Android - How to check Proguard obfuscation has worked? Android - How to check Proguard obfuscation has worked? android android

Android - How to check Proguard obfuscation has worked?


Here is probably a more visual way to check.In the newer release of Android Studio, it comes with the APK Analyser that let user explore what is in the APK file and it is handy to check if your class has been obfuscated.

Below image shows that both package and method name have been obfuscated

You can see the package name and method name is obfuscated


In your project directory you will find a Proguard folder, in which you will see four text files:

dump.txt

Describes the internal structure of all the class files in the .apk file

mapping.txt

Lists the mapping between the original and obfuscated class, method, and field names. This file is important when you receive a bug report from a release build, because it translates the obfuscated stack trace back to the original class, method, and member names. See Decoding Obfuscated Stack Traces for more information.

seeds.txt

Lists the classes and members that are not obfuscated

usage.txt

Lists the code that was stripped from the .apk

Source: Proguard

Hope this helps!


Proguard workflow:

enter image description here

  • seeds.txt - list of what Proguard keeps. These are entry points and they nodes. For example for bare java it is a main function and others dependencies
  • usage.txt - list of what Proguard does not keep
  • mapping.txt - info about old and new naming in old_name -> new_name format. It can be used for decoding stacktrace by retrace or proguardui
  • dump.txt - describe everything that Proguard put into the result archive

You can find output

<module_name>/build/outputs/mapping/<buildType>/

You can use Analyze APK tool. Where you can look thought .class files, add a Proguard mapping file, show removed nodes, show deobfuscated names

enter image description here