1. Start the obfuscation switch
In the project directory under the Project.Properties file, known as the proguard.config tag, the default is the off state, open. 2. Confusing configuration
In the project directory under the Proguard-project.txt file for specific confusion configuration, after configuration right click on the project, select Export exported apk package, the APK package is a confusing package.
Example: Package named Com.test
-dontwarn org.*
-keepattributes Enclosingmethod, innerclasses
-keepattributes *annotation
-keepattributes Signature
-keepattributes sourcefile,linenumbertable
#配置不进行混淆的类
-keep class Android.support. * { *; }
-keep class Com.test.model. * { *; }
#配置不进行混淆的枚举类型
-keepclassmembers enum * {*;}
#配置不进行混淆的成员变量
-keepclassmembernames class Com.test.db.Table {
public long *;
}
For more information, refer to: http://developer.android.com/guide/developing/tools/proguard.html
Linghaihua
Code obfuscation for Android development