Skip to content

Instantly share code, notes, and snippets.

@kyze8439690
Last active January 2, 2016 19:08
Show Gist options
  • Save kyze8439690/8347890 to your computer and use it in GitHub Desktop.
Save kyze8439690/8347890 to your computer and use it in GitHub Desktop.
-optimizationpasses 5
# 混淆时不会产生形形色色的类名
-dontusemixedcaseclassnames
# 指定不去忽略非公共的类库
-dontskipnonpubliclibraryclasses
# 不预校验
-dontpreverify
-verbose
# 优化
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
# Parcel
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# 不进行混淆保持原样
-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
# ndk
-keepclasseswithmembernames class * {
native <methods>;
}
# custom View/ViewGroup
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
# implement OnClick and so on
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment