#---------------------------------基本指令区---------------------------------- -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers -dontpreverify -verbose -printmapping proguardMapping.txt -optimizations !code/simplification/cast,!field/*,!class/merging/* -keepattributes *Annotation*,InnerClasses -keepattributes Signature -keepattributes SourceFile,LineNumberTable #---------------------------------默认保留区--------------------------------- -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 * extends android.view.View -keep class android.support.** {*;} -keepclasseswithmembernames class * { native ; } -keepclassmembers class * extends android.app.Activity{ public void *(android.view.View); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep public class * extends android.view.View{ *** get*(); void set*(***); public (android.content.Context); public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } # ActionBarSherlock -keep class android.support.** { *; } -keep interface android.support.** { *; } -keep class com.actionbarsherlock.** { *; } -keep interface com.actionbarsherlock.** { *; } # Keep line numbers to alleviate debugging stack traces -renamesourcefileattribute SourceFile -keep class **.R$* { *; } -ignorewarnings -keep class * { public private *; } -keepclassmembers class * { void *(**On*Event); } -keep class * implements com.guadou.lib_baselib.base.mvi.BaseViewState #---------------------------------------------------------------------------- #---------------------------------1.实体类--------------------------------- -keep class com.guadou.kt_zoom.bean.** { *; } -keep class com.guadou.lib_baselib.bean.** { *; } #--------------------------------第三方混淆-------------------------------------------- # OkHttp3 -dontwarn okhttp3.logging.** -keep class okhttp3.internal.**{*;} -dontwarn okio.** #glide -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } # Gson -keepattributes *Annotation* -keepattributes Signature -dontwarn sun.misc.** -keep class com.google.gson.stream.** { *; } -keep class com.google.gson.examples.android.model.** { *; } -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer # Retrofit -dontwarn retrofit2.** -keep class retrofit2.** { *; } -keepattributes Signature -keepattributes Exceptions # converters and adapters. 是否要注释 -keepclassmembernames,allowobfuscation interface * { @retrofit2.http.* ; } -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement #Retrofit+rxjava+rxandroid+gson+okhttp -dontwarn javax.annotation.** -dontwarn javax.inject.** #AndPermission -dontwarn com.yanzhenjie.permission.** #极光推送 -dontoptimize -dontpreverify -dontwarn cn.jpush.** -keep class cn.jpush.** { *; } #okhttp -dontwarn okhttp3.** -keep class okhttp3.**{*;} #okio -dontwarn okio.** -keep class okio.**{*;} #brvah -keep class com.chad.library.adapter.** { *; } -keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter -keep public class * extends com.chad.library.adapter.base.viewholder.BaseViewHolder -keepclassmembers class **$** extends com.chad.library.adapter.base.viewholder.BaseViewHolder { (...); } #==================其他========================== -dontwarn com.google.** -keep class com.google.gson.** {*;} -keep class com.google.protobuf.** {*;} -keep class com.google.gson.examples.android.model.** { *; } -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer #Gson容错处理 -keep class com.ke.gson.** { *; } ##腾讯系列 #-keep class com.tencent.** { *; } #LiveBus -dontwarn com.jeremyliao.liveeventbus.** -keep class com.jeremyliao.liveeventbus.** { *; } -keep class androidx.lifecycle.** { *; } -keep class androidx.arch.core.** { *; } # Rules for Kotlin Coroutines -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} -keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {} -keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {} -keepclassmembernames class kotlinx.** { volatile ; } #PictureSelector 2.0 -keep class com.luck.picture.lib.** { *; } #Ucrop -dontwarn com.yalantis.ucrop** -keep class com.yalantis.ucrop** { *; } -keep interface com.yalantis.ucrop** { *; } #Okio -dontwarn org.codehaus.mojo.animal_sniffer.* #ARouter -keep public class com.alibaba.android.arouter.routes.**{*;} -keep public class com.alibaba.android.arouter.facade.**{*;} -keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;} # 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口 -keep interface * implements com.alibaba.android.arouter.facade.template.IProvider # 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现 # -keep class * implements com.alibaba.android.arouter.facade.template.IProvider