I try to wrap my head around this, but I just donβt understand why this happens: according to the proguard.cfg file, by default I define the following rule:
-keep public class * extends android.app.Activity
as I understand it, this means: save the Activity class as an entry point, but feel free to shorten / obfuscate / optimize anything inside it (otherwise I would have to use, for example, the <methods> template to save methods too, right? )
Now my test activity is as follows:
public class MyActivity extends Activity { public void onCreate(Bundle savedInstanceState) { ... } public void unusedMethod() { } }
If I now export a signed APK and call ProGuard, it will remove unusedMethod as expected, but it will save the onCreate method, rather than obfuscate its name. Why is this?
source share