diff --git a/cmd/gomobile/bind.go b/cmd/gomobile/bind.go index 8804e38..0a2a9a4 100644 --- a/cmd/gomobile/bind.go +++ b/cmd/gomobile/bind.go @@ -311,7 +311,7 @@ func main() { // R.txt (mandatory) // res/ (mandatory) // libs/*.jar (optional, not relevant) -// proguard.txt (optional, not relevant) +// proguard.txt (optional) // lint.jar (optional, not relevant) // aidl (optional, not relevant) // @@ -345,6 +345,12 @@ func buildAAR(androidDir string, pkg *build.Package) (err error) { const manifestFmt = `` fmt.Fprintf(w, manifestFmt, "go."+pkg.Name+".gojni") + w, err = aarwcreate("proguard.txt") + if err != nil { + return err + } + fmt.Fprintln(w, `-keep class go.** { *; }`) + w, err = aarwcreate("classes.jar") if err != nil { return err