简体   繁体   中英

How to make Proguard obfuscate using Android Studio

ProGuard is not doing a very complete job of obfuscating my Android project. When I decompile my apk at decompileandroid.com I see that it is only changing the name of local temporary variables and nothing else. It is not changing class names, variable names, method names, or anything else.

After reading the manual all of the optional commands seem to be telling it NOT to do something so I am left to think it should obfuscate everything by default.

my build.gradle has the following...

 buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } 

Neither of those two files exist is the project. The project is as it was converted from Eclipse by Android Studio.

What am I missing. Do I need to create those two files and put some proguard parameters in them - if so what. I want maximum obfuscation. Thanks, Dean

Set minifyEnabled true in order to turn on code shrinking, and then shrinkResources true to turn on resource shrinking.

Reference for the quote

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM