Proguard and reflection in Android?

SOLVED For others that are having this problem you need to add the following to proguard. Cnf keep public class * extends com.yoursite.android.yourappname. YourClassName -keepclassmembers class * extends com.yoursite.android.yourappname.

YourClassName{ public (android.content. Context); } The first keep tells proguard to not obfuscate class names that extend YourClassName The second one says to keep the constructor name ( init means constructor) un-obfuscated that has a single argument of Context and extends YourClassName In addition, for android developers that are using the onClick attribute in you XML layouts file you will also need to add the name of the function in your proguard. Cnf file keepclassmembers class * { public void myClickHandler(android.view.

View); } This says keep all methods named myClickHandler with a single argument View in all classes. You could further constrain this by using the extends keyword like above hope this helps.

SOLVED For others that are having this problem you need to add the following to proguard. Cnf -keep public class * extends com.yoursite.android.yourappname. YourClassName -keepclassmembers class * extends com.yoursite.android.yourappname.

YourClassName{ public (android.content. Context); } The first keep tells proguard to not obfuscate class names that extend YourClassName The second one says to keep the constructor name ( means constructor) un-obfuscated that has a single argument of Context and extends YourClassName In addition, for android developers that are using the onClick attribute in you XML layouts file you will also need to add the name of the function in your proguard. Cnf file.

-keepclassmembers class * { public void myClickHandler(android.view. View); } This says keep all methods named myClickHandler with a single argument View in all classes. You could further constrain this by using the extends keyword like above.

Hope this helps.

For the on click fix you don't have to list each method name. You can do: -keepclassmembers class * { public void *(android.view. View); } which find all methods that have a View as parameter.

Keep public class * extends android.app. -keep public class * extends android.app. -keep public class * extends android.app.

-keep public class * extends android.content. -keep public class * extends android.content. -keep public class com.android.vending.licensing.

Public static ** valueOf(java.lang. -keep class * implements android.os. Public static final android.os.

-assumenosideeffects class android.util.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions