-optimizationpasses 5 -dontusemixedcaseclassnames//混淆時不會產生形形色色的類名 -dontskipnonpubliclibraryclasses//指定不去忽略非公用的類庫 -dontpreverify//不預校正 -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*//最佳化 //不進行混淆保持原樣 -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class com.android.vending.licensing.ILicensingService //保護指定的類和類的成員的名稱,如果所有指定的類成員出席 -keepclasseswithmembernames class * { native <methods>; } //保護指定的類和類的成員,但條件是所有指定的類和類成員是要存在 -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet, int); } //保護指定類的成員,如果此類受到保護他們會保護的更好 -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } //保護指定的類檔案和類成員 -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; }