2

I am using Proguard and in my app I use this code

            System.out.println("ACTIVITY NAME IS " + activity.getLocalClassName());

It prints out the Activity name out, Iin release mode. I thought it is suppose to obfuscate all class names?

Is this behavior normal?

JayVDiyk
  • 4,277
  • 22
  • 70
  • 135

1 Answers1

6

Yes this is a normal behaviour. Activity names are never obfuscated because these are referenced in manifest.xml. and android access these activities via reflection so their names cannot be changed. check this link https://stackoverflow.com/a/20620108/1320616

Community
  • 1
  • 1
Ankit Aggarwal
  • 5,317
  • 2
  • 30
  • 53
  • Oh Thanks, Is there a way to check if the code has been successfully obfuscated? – JayVDiyk Apr 12 '16 at 03:34
  • I use to check it using online decompilers like http://www.decompileandroid.com/ upload the apk there and get back the decompiled folder. There it can be checked whether the code is obfuscated or not. – Ankit Aggarwal Apr 12 '16 at 03:37
  • 1
    You can also use Analyse APK option in Android Studio to find whether you are able to se your code after generating apk. – Atmaram Oct 31 '17 at 05:28