17

a question on android proguard obfuscation. For some reason, when generating apk using ant, I want proguard to shrink size (remove unused classes) but no name obfuscation. In proguard.cfg, I added:

-dontobfuscate

all others in proguard.cfg are either -dontwarn or -keep class. But after decompile the generated apk (dex2jar), I found many names are still obfuscated. Why this happens?

Thanks

flx
  • 14,146
  • 11
  • 55
  • 70
brewphone
  • 1,316
  • 4
  • 24
  • 32
  • 1
    Just found this post solves my issue: http://stackoverflow.com/questions/9651703/using-proguard-with-android-without-obfuscation Thanks – brewphone Feb 24 '13 at 07:09

1 Answers1

19

Since nobody was actually answering this, here is the link to the post that solves the issue: Using Proguard with Android without obfuscation

Basically, what you need to add below your -dontobfuscate instruction is:

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/allocation/variable

Important thing here is: !code/allocation/variable

Community
  • 1
  • 1
milosmns
  • 3,595
  • 4
  • 36
  • 48