# 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 # # 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 #不跳过非公共的库的类成员 -dontskipnonpubliclibraryclassmembers #混淆时采用的算法 -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* #方法同名混淆后亦同名,方法不同名混淆后亦不同名 -useuniqueclassmembernames #优化时允许访问并修改有修饰符的类和类的成员 #-allowaccessmodification #将文件来源重命名为“SourceFile”字符串 #-renamesourcefileattribute SourceFile #保留行号 #-keepattributes SourceFile,LineNumberTable # ------ 官方模板推荐不需要混淆的组件 ------ -keep public class * extends android.app.Application -keep public class * extends android.app.Activity -keep public class * extends android.app.Service -keep public class * extends android.content.ContentProvider -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.preference.Preference -keep public class com.android.vending.licensing.ILicensingService -keep public class * extends android.app.Dialog -keep public class * extends androidx.fragment.app.Fragment # 忽略自定义控件 -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*(...); *** get*(); } -keepclassmembers class * extends android.app.Activity{ public void *(android.view.View); } # 忽略原生方法 -keepclasseswithmembernames class * { native ; } # 忽略枚举 -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } # 忽略序列化实体类 -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(); } # 保留Annotation不混淆 -keepattributes *Annotation*,InnerClasses -keep class * extends java.lang.annotation.Annotation { *; } # 避免混淆泛型 -keepattributes Signature # 保持R文件不被混淆 -keep class **.R$* {*;} -keep class **.R2$* {*;} # ------ 应用定制混淆方案 ------ -keep class com.shanp.youqi.**.model.**{*;} -keep class com.shanp.youqi.core.event.**{*;} -keep class com.shanp.youqi.**.vo.**{*;} -keep class com.shanp.youqi.common.**{*;} #JSON -keep class **.*$JavaScriptInterface{*;} -keepclassmembers class * { public (org.json.JSONObject); } -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer # ------ 保护第三方jar包,不做混淆处理---------- -keep class android.support.**{*;} -dontwarn android.support.** -keep class androidx.*{*;} -dontwarn androidx.** -keep class com.google.android.** -dontwarn com.google.android.** # Gson -keep class com.google.gson.examples.android.model.** { *; } #-keep class com.google.gson.**{*;} -dontwarn com.google.gson.** -dontwarn sun.misc.** #语音房间相关的混淆配置 #-------------云信相关的混淆配置------------ -dontwarn com.netease.** -keep class com.netease.** {*;} #如果你使用全文检索插件,需要加入 -dontwarn org.apache.lucene.** -keep class org.apache.lucene.** {*;} #-keep class com.tongdaxing.erban.ui.im.chat.** {*;} -keep class com.hncx.xxm.im.holder.** {*;} # 内部WebView混淆过滤 -keepclassmembers class * { @android.webkit.JavascriptInterface ; } -keep class org.json.** {*;} -dontwarn com.hncx.xxm.base.bindadapter.** -keep class com.hncx.xxm.base.bindadapter.** {*;} -keepclassmembers class * { @com.tongdaxing.xchat_framework.coremanager.CoreEvent ; } -keep class com.baidu.bottom.** { *; } -keep class com.baidu.kirin.** { *; } -keep class com.baidu.mobstat.** { *; } -keep class io.agora.** { *; } # 即构混淆代码 -keep class com.zego.**{*;} # 七牛 -keep class com.qiniu.**{*;} -keep class com.qiniu.**{public ();} -ignorewarnings # 安全检测库的bean不混淆 -dontwarn com.hncxco.safetychecker.bean.** -keep class com.hncxco.safetychecker.bean.**{*;} -dontwarn com.tongdaxing.xchat_framework.im.** -keep class com.tongdaxing.xchat_framework.im.**{*;} -dontwarn com.tongdaxing.**.bean.** -keep class com.tongdaxing.**.bean.**{*;} #-------------TakePhoto的混淆配置------------ -keep class com.jph.takephoto.** { *; } -dontwarn com.jph.takephoto.** -keep class com.darsh.multipleimageselect.** { *; } -dontwarn com.darsh.multipleimageselect.** -keep class com.soundcloud.android.crop.** { *; } -dontwarn com.soundcloud.android.crop.** # BaseAdapter -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.BaseViewHolder -keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder { (...); } #阿里相关 -keep class com.alipay.** {*;} -dontwarn com.alipay.** -keep class com.taobao.** {*;} -dontwarn com.taobao.** -keep class com.alibaba.** {*;} -dontwarn com.alibaba.** -keep class org.json.alipay.** {*;} -dontwarn org.json.alipay.** -keep class com.ta.utdid2.**{*;} -dontwarn com.ta.utdid2.** -keep class com.ut.device.**{*;} -dontwarn com.ut.device.** -dontwarn org.apache.commons.codec.binary.** # 腾讯相关 -keep class com.tencent.**{*;} -dontwarn com.tencent.** -keep class com.qq.**{*;} -dontwarn com.qq.** -keep class src.com.qq.**{*;} -dontwarn src.com.qq.** #闪验 -dontwarn com.cmic.sso.sdk.** -dontwarn com.sdk.** -keep class com.cmic.sso.sdk.**{*;} -keep class com.sdk.**{*;} -keep class cn.com.chinatelecom.account.api.**{*;} #融云 -keep class io.rong.** {*;} -keep class cn.rongcloud.** {*;} -keep class * implements io.rong.imlib.model.MessageContent {*;} -dontwarn io.rong.push.** -dontnote com.xiaomi.** -dontnote com.google.android.gms.gcm.** -dontnote io.rong.** -keep class com.amap.api.**{*;} -keep class com.amap.api.services.**{*;} -keep class com.uuhelper.Application.** {*;} -keep class net.sourceforge.zbar.** { *; } -keep class com.jrmf360.rylib.** {*;} -keep class com.blink.** { *; } -keep class com.bailingcloud.bailingvideo.engine.binstack.json.** { *; } -keep class bailingquic.**{*;} -keep class go.**{*;} -keep class com.shanp.youqi.im.receiver.SealNotificationReceiver {*;} # 友盟 -keep class org.android.** {*;} -dontwarn org.android.** -keep class anet.channel.** {*;} -dontwarn anetwork.channel.** -dontwarn anet.channel.** -keep class com.uc.** {*;} -keep class com.umeng.** {*;} -dontwarn com.umeng.** -keep class com.xiaomi.** {*;} -dontwarn com.xiaomi.** -keep class com.huawei.** {*;} -dontwarn com.huawei.** -keep class com.meizu.** {*;} -dontwarn com.meizu.** -keep class org.apache.thrift.** {*;} -dontwarn org.apache.thrift.** -keep class com.ut.**{*;} -keep class com.ta.**{*;} -keep class com.alimama.mobile.**{*;} -dontwarn com.alimama.mobile.** -keep class u.**{*;} -dontwarn u.** -dontwarn com.taobao.** -keep class com.taobao.**{*;} -dontwarn com.vivo.push.** -keep class com.vivo.push.**{*; } -keep class com.vivo.vms.**{*; } -keep class org.android.agoo.vivo.PushMessageReceiverImpl{*;} -keepattributes SourceFile,LineNumberTable -keep class com.hianalytics.android.**{*;} -keep class com.huawei.updatesdk.**{*;} -keep class com.huawei.hms.**{*;} -keep class org.android.agoo.xiaomi.MiPushBroadcastReceiver {*;} -dontwarn com.xiaomi.push.** # 图片加载库 -keep class * implements com.bumptech.glide.module.GlideModule -keep class * extends com.bumptech.glide.module.AppGlideModule -keep enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } # RxJava -keep class io.reactivex.**{*;} -dontwarn io.reactivex.** -keep class org.reactivestreams.**{*;} -dontwarn org.reactivestreams.** # retrofit2 -dontnote retrofit2.Platform -dontwarn retrofit2.Platform$Java8 -dontnote retrofit2.Platform$IOS$MainThreadExecutor -keepattributes Exceptions -keepclassmembers,allowshrinking,allowobfuscation interface * { @retrofit2.http.* ; } -dontwarn javax.annotation.** # okhttp3 -keep class okhttp3.**{*;} -dontwarn okhttp3.** -keep class okio.**{*;} -dontwarn okio.** #Butterknife -keep class butterknife.** { *; } -dontwarn butterknife.internal.** -keep class **$$ViewBinder { *; } -keepclasseswithmembernames class * { @butterknife.* ; } -keepclasseswithmembernames class * { @butterknife.* ; } #MaterialDialog -keep class com.afollestad.materialdialogs.**{ *; } -dontwarn com.afollestad.materialdialogs.** #lottie -keep class com.airbnb.lottie.**{ *; } -dontwarn com.airbnb.lottie.** #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 #高德定位 -keep class com.amap.api.location.**{*;} -keep class com.amap.api.fence.**{*;} -keep class com.loc.**{*;} -keep class com.autonavi.aps.amapapi.model.**{*;} #blankj 的 工具类 -keep class com.blankj.utilcode.**{ *; } -dontwarn com.blankj.utilcode.** #pickerview 多级联动选择库? -keep class com.bigkoo.pickerview.**{*;} -dontwarn com.bigkoo.pickerview.** -keep class com.contrarywind.**{*;} -dontwarn com.contrarywind.** #multipleimageselect 图像选择库 -keep class com.darsh.multipleimageselect.**{*;} -dontwarn com.darsh.multipleimageselect.** #relinker 本地加载库 -keep class com.getkeepsafe.relinker.**{*;} -dontwarn com.getkeepsafe.relinker.** #com.github.chrisbanes.photoview 带有手势操作的图片查看库 -keep class com.github.chrisbanes.photoview.**{*;} -dontwarn com.github.chrisbanes.photoview.** #master.flame.danmaku B站弹幕 -keep class master.flame.danmaku.**{*;} -dontwarn master.flame.danmaku.** -keep class tv.cjump.jni.**{*;} -dontwarn tv.cjump.jni.** #百度识别 #-keep class com.baidu.idl.facesdk.** { *; } #-dontwarn com.baidu.idl.facesdk.** #-keep class com.baidu.idl.face.** { *; } #-dontwarn com.baidu.idl.face.** # baidu_ocr_ui -keep class com.baidu.idl.**{*;} -dontwarn com.baidu.idl.** -keep class com.baidu.ocr.sdk.**{*;} -dontwarn com.baidu.ocr.sdk.** -keep class com.baidu.idcardquality.**{*;} -dontwarn com.baidu.idcardquality.** -keep class com.baidu.ocr.ui.**{*;} -dontwarn com.baidu.ocr.ui.** #baidu_faceplatform -keep class com.baidu.aip.face.stat.**{*;} -dontwarn com.baidu.aip.face.stat.**