# Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in D:\Android\sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles # directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: # 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 *; } #ָ�������ѹ������ -optimizationpasses 5 #��������ϴ�Сд -dontusemixedcaseclassnames #��ȥ���Էǹ����Ŀ��� -dontskipnonpubliclibraryclasses #�Ż� ���Ż���������ļ� # -dontoptimize #ԤУ�� -dontpreverify #����ʱ�Ƿ��¼��־ -verbose # ����ʱ�����õ��㷨 -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* #����ע�� -keepattributes *Annotation* # ������Щ�಻������ -keep public class * extends android.app.Fragment -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 #���������v4����������������� -keep public class * extends android.support.v4.app.Fragment #���Ծ��� -ignorewarning ##��¼���ɵ���־����,gradle buildʱ�ڱ���Ŀ��Ŀ¼���## #apk �������� class ���ڲ��ṹ -dump proguard/class_files.txt #δ��������ͳ�Ա -printseeds proguard/seeds.txt #�г��� apk ��ɾ���Ĵ��� -printusage proguard/unused.txt #����ǰ���ӳ�� -printmapping proguard/mapping.txt ########��¼���ɵ���־���ݣ�gradle buildʱ �ڱ���Ŀ��Ŀ¼���-end###### #���������v4����v7�� -dontwarn android.support.** -keep class com.google.** { *; } -keep class android.support.v4.** -dontwarn android.support.v4.** -keep class android.support.v7.** -dontwarn android.support.v7.** ####���������Լ���Ŀ�IJ��ִ����Լ����õĵ�����jar��library-end#### -keep class com.blankj.** { *;} -keep class utilcode.** { *;} -keep class com.caysn.** { *;} #���� native ������������ -keepclasseswithmembernames class * { native ; } #�����Զ���ؼ��಻������ -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } #�����Զ���ؼ��಻������ -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } -keep public class * extends android.view.View { public (android.content.Context); public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); public void set*(...); } #���� Parcelable �������� -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } #���� Serializable �������� -keepnames class * implements java.io.Serializable #���� Serializable ������������enum ��Ҳ�������� -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; !static !transient ; !private ; !private ; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } #����ö�� enum �಻������ -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keepclassmembers class * { public void *ButtonClicked(android.view.View); } #��������Դ�� -keepclassmembers class **.R$* { public static ; } #����������� �������������ص� #-keepattributes Signature #�Ƴ�Log���ӡ�����ȼ���־�Ĵ��룬����ʽ����ʱ�������Ϊ��logʹ�ã����������Ϊ��ֹlog��ӡ�Ĺ���ʹ�ã������һ��ʵ�ַ�����ͨ��BuildConfig.DEBUG�ı��������� #-assumenosideeffects class android.util.Log { # public static *** v(...); # public static *** i(...); # public static *** d(...); # public static *** w(...); # public static *** e(...); #} ############################################################################################# ######################## ����ͨ�� ################################## ############################################################################################# ####################### ���õ�����ģ��Ļ���ѡ�� ################################### #gson #������õ�Gson�������ģ�ֱ����������⼸�о��ܳɹ���������Ȼ�ᱨ�� -keepattributes Signature # Gson specific classes -keep class sun.misc.Unsafe { *; } # Application classes that will be serialized/deserialized over Gson -keep class com.google.gson.** { *; } -keep class com.google.gson.stream.** { *; } -keep class com.google.**{*;} #butterknife -keep class butterknife.** { *; } -dontwarn butterknife.internal.** -keep class **$$ViewBinder { *; } -keepclasseswithmembernames class * { @butterknife.* ; } -keepclasseswithmembernames class * { @butterknife.* ; } ######���õ�����Module����ֱ����app����������ļ������� # ���ʹ����Gson֮��Ĺ���Ҫʹ����������JavaBean�༴ʵ���಻�������� -keep class com.novelbook.android.bean.** { *; } -keep class com.novelbook.android.db.** { *; } #####���������Լ���Ŀ�IJ��ִ����Լ����õĵ�����jar��library####### #����ڵ�ǰ��application module����������library module��ʹ���˵������Ŀ⣬������Ҫ��ʽ��ӹ��� #-libraryjars xxx #����˷����п����ڴ����ʱ������ͬһ��jar��α�ָ���Ĵ���һ��ֻ��Ҫ��Ӻ��Ծ���ͱ���ijЩclass���������������� #��libaray����ʽ�����˿�Դ��Ŀ,���������� keep �����������module��build.gradle������minifyEnabled=false # banner -keep class com.youth.banner** { *; } -keep interface com.youth.banner.** { *; } -dontwarn com.youth.banner.** #LitePal -keep class org.litepal.** { *; } -keep class * extends org.litepal.crud.DataSupport { *; } #pagerslidingtabstrip -keep class com.astuetz.** { *; } -keep class com.blankj.** { *; } -keep class com.sun.** { *; } #UMENG -keep class com.umeng.** {*;} -keepclassmembers class * { public (org.json.JSONObject); } #okhttp3 -dontwarn okio.** -keepattributes Signature -keepattributes *Annotation* -keep class okhttp3.** { *; } -keep interface okhttp3.** { *; } -dontwarn okhttp3.** -dontwarn com.squareup.okhttp3.** -keep class com.squareup.okhttp3.** { *;} -dontwarn okhttp3.logging.** -keep class okhttp3.internal.**{*;} # -keep class com.novelbook.android.netapi.**{*;} # Retrofit -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes Signature -keepattributes Exceptions -keepclasseswithmembers class * { @retrofit2.http.* ; } # RxJava RxAndroid -dontwarn sun.misc.** -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { long producerIndex; long consumerIndex; } -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { rx.internal.util.atomic.LinkedQueueNode producerNode; } -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef { rx.internal.util.atomic.LinkedQueueNode consumerNode; } #glide -keep public class * implements com.bumptech.glide.module.GlideModule -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } # ���ڴ��лص�������onXXEvent��**On*Listener�ģ����ܱ����� -keepclassmembers class * { void *(**On*Event); void *(**On*Listener); } -assumenosideeffects class android.util.Log { public static boolean isLoggable(java.lang.String,int); public static int v(...); public static int i(...); public static int w(...); public static int d(...); public static int e(...); } # 嵌入广点通sdk时必须添加 -keep class com.qq.e.** { public protected *; } #穿山甲广告 -keep class com.bytedance.sdk.openadsdk.** { *; } -keep class com.androidquery.callback.** {*;} -keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;} -keep class com.ss.sys.ces.* {*;} #GOOGLE MOBAD #-keep com.google.android.gms.ads.** { *; }