Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Proguard - dontobfuscate doesn't disable obfuscation

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

like image 241
brewphone Avatar asked Feb 24 '13 06:02

brewphone


1 Answers

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

like image 158
milosmns Avatar answered Nov 15 '22 18:11

milosmns