117 lines
3.8 KiB
Prolog
117 lines
3.8 KiB
Prolog
# Add project specific ProGuard rules here.
|
||
# You can control the set of applied configuration files using the
|
||
# proguardFiles setting in build.gradle.
|
||
#
|
||
# For more details, see
|
||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||
|
||
# If your project uses WebView with JS, uncomment the following
|
||
# and specify the fully qualified class name to the JavaScript interface
|
||
# class:
|
||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||
# public *;
|
||
#}
|
||
|
||
# Uncomment this to preserve the line number information for
|
||
# debugging stack traces.
|
||
#-keepattributes SourceFile,LineNumberTable
|
||
|
||
# If you keep the line number information, uncomment this to
|
||
# hide the original source file name.
|
||
#-renamesourcefileattribute SourceFile
|
||
-optimizationpasses 5
|
||
-dontusemixedcaseclassnames
|
||
# 不混淆Annotation(保留注解)
|
||
-keepattributes *Annotation*,InnerClasses
|
||
|
||
# 避免混淆泛型
|
||
-keepattributes Signature
|
||
# 保留support下的所有类及其内部类
|
||
-keep class android.support.** {*;}
|
||
# 保留继承的support类
|
||
-keep public class * extends android.support.v4.**
|
||
-keep public class * extends android.support.v7.**
|
||
-keep public class * extends android.support.annotation.**
|
||
# 保留枚举类不被混淆
|
||
-keepclassmembers enum * {
|
||
public static **[] values();
|
||
public static ** valueOf(java.lang.String);
|
||
}
|
||
# 保留Serializable序列化的类不被混淆
|
||
-keepclassmembers class * implements java.io.Serializable {
|
||
static final long serialVersionUID;
|
||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||
!static !transient <fields>;
|
||
!private <fields>;
|
||
!private <methods>;
|
||
private void writeObject(java.io.ObjectOutputStream);
|
||
private void readObject(java.io.ObjectInputStream);
|
||
java.lang.Object writeReplace();
|
||
java.lang.Object readResolve();
|
||
}
|
||
|
||
# 保留我们自定义控件(继承自View)不被混淆
|
||
-keep public class * extends android.view.View{
|
||
*** get*();
|
||
void set*(***);
|
||
public <init>(android.content.Context);
|
||
public <init>(android.content.Context, android.util.AttributeSet);
|
||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||
}
|
||
# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
|
||
-keepclassmembers class * {
|
||
void *(**On*Event);
|
||
void *(**On*Listener);
|
||
}
|
||
|
||
# webView的混淆处理
|
||
|
||
-keepclassmembers class * extends android.webkit.WebViewClient {
|
||
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
|
||
public boolean *(android.webkit.WebView, java.lang.String);
|
||
public void *(android.webkit.WebView, java.lang.String);
|
||
}
|
||
|
||
|
||
-keep class org.greenrobot.** { *; }
|
||
-keep interface org.greenrobot.** { *; }
|
||
-keepclassmembers class * {
|
||
@org.greenrobot.eventbus.Subscribe <methods>;
|
||
}
|
||
-keep public class * implements com.bumptech.glide.module.GlideModule
|
||
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
|
||
**[] $VALUES;
|
||
public *;
|
||
}
|
||
|
||
# Gson
|
||
-keepattributes Signature
|
||
-keepattributes *Annotation*
|
||
-keep class sun.misc.** { *; }
|
||
-keep class com.google.gson.stream.** { *; }
|
||
|
||
-keep class com.dev.model.** { *; }
|
||
-keep class org.ebookdroid.** {*;}
|
||
-keep class org.emdev.** {*;}
|
||
-keep class org.tool.** {*;}
|
||
|
||
-assumenosideeffects class com.dev.android.utils.LOG {
|
||
public static *** d(...);
|
||
public static *** w(...);
|
||
public static *** e(...);
|
||
}
|
||
# Keep GreenDAO encrypted database classes
|
||
-keep class org.greenrobot.greendao.database.** { *; }
|
||
-keep class net.sqlcipher.** { *; }
|
||
-keep class android.database.Cursor { *; }
|
||
|
||
# Keep methods referenced by GreenDAO encrypted database
|
||
-keepclassmembers class * {
|
||
@org.greenrobot.greendao.annotation.* *;
|
||
}
|
||
|
||
# Keep database related classes
|
||
-keep class * extends org.greenrobot.greendao.database.DatabaseOpenHelper { *; }
|
||
-dontwarn net.sqlcipher.**
|
||
-dontwarn net.sqlcipher.database.**
|
||
-keep class com.dev.dao2.**{ *; } |