Android obfuscation related

The obfuscation changed after the Android Studio upgrade, the original runProguard was abandoned, and minifyEnabled was used for obfuscation

The main project build.gradle:

buildTypes {

        debug {
            minifyEnabled true
            shrinkResources true
        }

        release {
            minifyEnabled true
            shrinkResources true
        }

    }
minifyEnabled: true means confusion, false means no confusion;
shrinkResources

Confusion can compress APK size,

The function of minifyEnabled is to open and delete useless code, such as code that is not referenced;

The function of shrinkResources is to open and delete resources that have not been used, or files that have not been used,

 

Both need to be set to true at the same time in order to completely delete useless code and useless resource files; and play the effect of reducing the size of APK;

 

 

Published 57 original articles · liked 0 · 10,000+ views

Guess you like

Origin blog.csdn.net/java9832/article/details/105671218