cmd/gomobile: add generated package names to proguard.txt
No test as I couldn't figure out how to persuade gradle test to
strip classes.
Fixes golang/go#30251
Change-Id: I7dca9169a4a8eb31b981ad49047a6bdfa6f6efd7
Reviewed-on: https://go-review.googlesource.com/c/164798
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/gomobile/bind_androidapp.go b/cmd/gomobile/bind_androidapp.go
index 149fab4..3b01adc 100644
--- a/cmd/gomobile/bind_androidapp.go
+++ b/cmd/gomobile/bind_androidapp.go
@@ -155,6 +155,13 @@
return err
}
fmt.Fprintln(w, `-keep class go.** { *; }`)
+ if bindJavaPkg != "" {
+ fmt.Fprintln(w, `-keep class `+bindJavaPkg+`.** { *; }`)
+ } else {
+ for _, p := range pkgs {
+ fmt.Fprintln(w, `-keep class `+p.Name+`.** { *; }`)
+ }
+ }
w, err = aarwcreate("classes.jar")
if err != nil {