android - Proguard doesn't work when export with Eclipse ADT plugin R19 -
when export application through export > export android application
or through android tools > export signed application package
, cannot proguard work.
all know how enable proguard uncomment line
proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt
in project.properties
.
and tried putting configuration file there, too. won't work either.
the classes.dex
file in exported package contains name of class private methods such onconfirmbuttonclicked
. there's more 99% chance proguard didn't work.
after put random characters in proguard-project.txt
file, didn't error. verbose output of build didn't refer proguard @ all.
i wonder what's wrong there.
proguard work when export project .apk file, , should put configuration need in file (.cfg) , point file in project.properties
proguard.config=${dir}\yourconfigfile.cfg
and in config file should tell proguard keep crucial elements in project. exemple :
-injars bin/classes -injars libs -outjars bin/classes-processed.jar -libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar -dontpreverify -repackageclasses '' -allowaccessmodification -optimizations !code/simplification/arithmetic -keepattributes *annotation* -keep public class * extends android.app.activity -keep public class * extends android.app.application -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class * extends android.view.view { public <init>(android.content.context); public <init>(android.content.context, android.util.attributeset); public <init>(android.content.context, android.util.attributeset, int); public void set*(...); } -keepclasseswithmembers class * { public <init>(android.content.context, android.util.attributeset); } -keepclasseswithmembers class * { public <init>(android.content.context, android.util.attributeset, int); } -keepclassmembers class * extends android.content.context { public void *(android.view.view); public void *(android.view.menuitem); } -keepclassmembers class * implements android.os.parcelable { static ** creator; } -keepclassmembers class **.r$* { public static <fields>; } -keepclassmembers class * { @android.webkit.javascriptinterface <methods>; }
hope helps!
Comments
Post a Comment