Guy Guy - 3 months ago 23
Java Question

Setting ProGuard to obfuscate only my app's package

Trying to obfuscate using ProGuard but getting 3rd party libraries errors, so I'm excluding each package one by one:

-keepclassmembers class android.** {*;}
-keepclassmembers interface android.** {*;}

-keepclassmembers class** {*;}
-keepclassmembers interface** {*;}

Is there a way to whitelist only my package name?



According to your code you are just keeping class members not whole class. Use this to keep class as it is.

-keep class** {*;}

-keep interface** {*;}

You also can use this line to only obfuscate your own classes and accept everything else.

-keep class !com.yourpackage.**,!com.youranotherpackage.** { *; }