14

I want to check which classes and methods were removed. Any way to achieve this?

I know mapping.txt shows which symbols is obfuscated to what. But what is removed is not listed there as I know. Proguard web site does not describe about this.

ytRino
  • 1,450
  • 15
  • 28

3 Answers3

13

The option -printusage writes out the unused classes, fields, and methods.

Android Gradle builds by default write it to build/outputs/mapping/release/usage.txt.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • thanks! I didnt notice it caz searching about "remove" verb :( I also find d.android.com which mentions about usage.txt. https://developer.android.com/studio/build/shrink-code.html – ytRino Aug 03 '17 at 09:33
7

Add the following rules in proguard-rules.pro file in your Gradel Scripts directory

  • Generate a report of removed (or kept) code

    add -printusage usage.txt

  • To check report of the entry points that R8 determines from your project’s keep rules

    add -printseeds seeds.txt

after this, build signed apk. Then at the root of your projects these files will be generated.

Makarand
  • 983
  • 9
  • 27
0

usage.txt is your choice to find what were removed - list of what Proguard does not keep

[Read more here]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205