proguard.cfg file missing

If you’re using ADT 17 or newer, the documentation is slightly inaccurate. The generated file is proguard-project.txt and will be in the root directory of your project. To enable Proguard, you will need to ignore the “do not modify” warning in project.properties and uncomment the following line: proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt The Android toolchain will sometimes make changes … Read more

Android/java: Transition / Migration from ProGuard to R8?

Proguard is developed and maintained by GuardSquare while R8 is developed and maintained by Android team which means they are two different products although R8 is compatible with Proguard. As seen from here https://www.guardsquare.com/en/blog/proguard-and-r8 Compatibility of ProGuard and R8 The good news for developers is that R8 is backward compatible with ProGuard. If you have … Read more

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 <init>(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) … Read more

Android Proguard Javascript Interface Fail

If MyJavaScriptInterface is an inner class of MyClass, ProGuard expects a fully qualified name com.mypackage.MyClass$MyJavaScriptInterface. The naming convention with $ is used in the compiled class files on which ProGuard operates. Note that ProGuard mentions class names in the configuration that it can’t find in the input jar, suggesting that these names may have been … Read more