# 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 #不跳过非公共的库的类成员 -dontskipnonpubliclibraryclassmembers #混淆时采用的算法 -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* #把混淆类中的方法名也混淆了 -useuniqueclassmembernames # 屏蔽警告 -ignorewarnings #优化时允许访问并修改有修饰符的类和类的成员 -allowaccessmodification #将文件来源重命名为“SourceFile”字符串 -renamesourcefileattribute SourceFile #保留行号 -keepattributes SourceFile,LineNumberTable #保持所有实现 Serializable 接口的类成员 -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(); } -keep public class * implements android.os.Parcelable{*;} -keepclasseswithmembers class * implements android.os.Parcelable {*;} #避免混淆Annotation、内部类、泛型、匿名类 -keepattributes InnerClasses,Signature,EnclosingMethod #处理support包 -dontnote android.support.** -dontwarn android.support.** #保留四大组件,自定义的Application等这些类不被混淆 -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.preference.Preference -keep public class com.android.vending.licensing.ILicensingService #保留枚举类不被混淆 -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } #Fragment不需要在AndroidManifest.xml中注册,需要额外保护下 -keep public class * extends android.support.v4.app.Fragment -keep public class * extends android.app.Fragment -keep public class * extends androidx.fragment.app.Fragment -keepclasseswithmembernames class * { native ; } -printmapping mapping.txt #混淆后文件映射 -keepclasseswithmembers class * { public (android.content.Context); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet, int); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } #webView需要进行特殊处理 -keepclassmembers class fqcn.of.javascript.interface.for.Webview { public *; } -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); } -keepclassmembers class * extends android.webkit.WebViewClient { public void *(android.webkit.WebView, jav.lang.String); } #表示不混淆任何一个View中的setXxx()和getXxx()方法, #因为属性动画需要有相应的setter和getter的方法实现,混淆了就无法工作了。 -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 * extends java.lang.annotation.Annotation {*;} ##Gson -dontwarn com.google.** -keep class com.google.gson.** {*;} #otto -keepattributes *Annotation* -keepclassmembers class ** { @com.squareup.Subscribe public *; @com.squareup.otto.Produce public *; } #xlib -dontwarn x.lib.** -keep class x.lib.**{*;} #entity -keep class com.starbuds.app.entity.**{*;} #-keep class com.starbuds.app.entity.db.**{*;} -dontwarn com.starbuds.app.widget.** -keep class com.starbuds.app.widget.**{*;} #友盟 -keep class com.umeng.** {*;} -keep class com.uc.** {*;} -keepclassmembers class * { public (org.json.JSONObject); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class com.zui.** {*;} -keep class com.miui.** {*;} -keep class com.heytap.** {*;} -keep class a.** {*;} -keep class com.vivo.** {*;} -keep public class com.starbuds.app.R$*{ public static final int *; } #字节美颜 -keep class com.bytedance.labcv.effectsdk.**{*;} #okhttp -dontwarn com.squareup.okhttp.** -keep class com.squareup.okhttp.** {*;} -keep interface com.squareup.okhttp.** {*;} -dontwarn okio.** #Glide -dontwarn com.bumptech.glide.** -keep class com.bumptech.glide.**{*;} -keep public class * implements com.bumptech.glide.module.GlideModule -keep public class * extends com.bumptech.glide.AppGlideModule -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { **[] $VALUES; public *; } -keep public class * implements com.bumptech.glide.module.GlideModule -keep class * extends com.bumptech.glide.module.AppGlideModule { (...); } -keep public enum com.bumptech.glide.load.ImageHeaderParser$** { **[] $VALUES; public *; } -keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder { *** rewind(); } #SVGA -keep class com.squareup.wire.** { *; } -keep class com.opensource.svgaplayer.proto.** { *; } #声网 -keep class io.agora.**{*;} #闪验 -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 com.pili.pldroid.player.** { *; } -keep class com.qiniu.qplayer.mediaEngine.MediaPlayer{*;} -keep class com.qiniu.pili.droid.**{*;} -keep class com.qiniu.pili.droid.streaming.** { *; } # 七牛RTC混淆 -keep class com.youme.** {*;} -keep class org.webrtc.** {*;} -keep class com.qiniu.android.dns.** {*;} -keep class com.qiniu.pili.droid.streaming.** {*;} -keep class com.sensetime.**{*;} # 七牛RTC混淆 -keep class org.webrtc.** {*;} -dontwarn org.webrtc.** -keep class com.qiniu.droid.rtc.**{*;} -keep interface com.qiniu.droid.rtc.**{*;} # 阿里云推送混淆 -keepclasseswithmembernames class ** { native ; } -keep class sun.misc.Unsafe { *; } -keep class com.taobao.** {*;} -keep class com.alibaba.** {*;} -keep class com.alipay.** {*;} -keep class com.ut.** {*;} -keep class com.ta.** {*;} -keep class anet.**{*;} -keep class anetwork.**{*;} -keep class org.android.spdy.**{*;} -keep class org.android.agoo.**{*;} -keep class android.os.**{*;} -dontwarn com.taobao.** -dontwarn com.alibaba.** -dontwarn com.alipay.** -dontwarn anet.** -dontwarn org.android.spdy.** -dontwarn org.android.agoo.** -dontwarn anetwork.** -dontwarn com.ut.** -dontwarn com.ta.** -dontwarn com.aliyuncs.** -keep class com.aliyuncs.**{*;} # 阿里云RTC -keep class com.serenegiant.**{*;} -keep class org.webrtc.**{*;} -keep class com.alivc.**{*;} # UCrop -dontwarn com.yalantis.ucrop** -keep class com.yalantis.ucrop** { *; } -keep interface com.yalantis.ucrop** { *; } # 华为 -ignorewarning -keepattributes *Annotation* -keepattributes Exceptions -keepattributes InnerClasses -keepattributes Signature -keepattributes SourceFile,LineNumberTable -keep class com.hianalytics.android.**{*;} -keep class com.huawei.updatesdk.**{*;} -keep class com.huawei.hms.**{*;} -keep class com.huawei.android.hms.agent.**{*;} -keep class com.huawei.gamebox.plugin.gameservice.**{*;} # 定位 -keep class com.amap.api.location.**{*;} -keep class com.amap.api.fence.**{*;} -keep class com.loc.**{*;} -keep class com.autonavi.aps.amapapi.model.**{*;} # jzvd -keep public class cn.jzvd.JZMediaSystem {*; } -keep public class cn.jzvd.demo.CustomMedia.CustomMedia {*; } -keep public class cn.jzvd.demo.CustomMedia.JZMediaIjk {*; } -keep public class cn.jzvd.demo.CustomMedia.JZMediaSystemAssertFolder {*; } -keep class tv.danmaku.ijk.media.player.** {*; } -dontwarn tv.danmaku.ijk.media.player.* -keep interface tv.danmaku.ijk.media.player.** { *; } # 腾讯IM -keep class com.tencent.** { *; } # 微信 -keep class com.tencent.mm.opensdk.** {*;} -keep class com.tencent.wxop.** {*;} -keep class com.tencent.mm.sdk.** {*;} # QQ -keep class com.tencent.imsdk.** {*;} # 微博 -keep class com.sina.weibo.sdk.** { *; } # Bugly -dontwarn com.tencent.bugly.** -keep public class com.tencent.bugly.**{*;} -keep class org.greenrobot.greendao.**{*;} -keepclassmembers class * extends org.greenrobot.greendao.AbstractDao { public static java.lang.String TABLENAME; } -keep class **$Properties -keep class net.sqlcipher.database.**{*;} -keep public interface net.sqlcipher.database.** -dontwarn net.sqlcipher.database.** -dontwarn org.greenrobot.greendao.** -keepclassmembers class ** { @org.greenrobot.eventbus.Subscribe ; } -keep enum org.greenrobot.eventbus.ThreadMode { *; } # Only required if you use AsyncExecutor -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { (java.lang.Throwable); } # ali -keepclasseswithmembernames class ** { native ; } -keepattributes Signature -keep class sun.misc.Unsafe { *; } -keep class com.taobao.** {*;} -keep class com.alibaba.** {*;} -keep class com.alipay.** {*;} -keep class com.ut.** {*;} -keep class com.ta.** {*;} -keep class anet.**{*;} -keep class anetwork.**{*;} -keep class org.android.spdy.**{*;} -keep class org.android.agoo.**{*;} -keep class android.os.**{*;} -keep class org.json.**{*;} -dontwarn com.taobao.** -dontwarn com.alibaba.** -dontwarn com.alipay.** -dontwarn anet.** -dontwarn org.android.spdy.** -dontwarn org.android.agoo.** -dontwarn anetwork.** -dontwarn com.ut.** -dontwarn com.ta.** # 小米通道 -keep class com.xiaomi.** {*;} -dontwarn com.xiaomi.** # 华为通道 -keep class com.huawei.** {*;} -dontwarn com.huawei.** # GCM/FCM通道 -keep class com.google.firebase.**{*;} -dontwarn com.google.firebase.** # OPPO通道 -keep public class * extends android.app.Service # VIVO通道 -keep class com.vivo.** {*;} -dontwarn com.vivo.** # 魅族通道 -keep class com.meizu.cloud.** {*;} -dontwarn com.meizu.cloud.** #Rxjava RxAndroid -dontwarn rx.* -dontwarn sun.misc.** -keep class rx.internal.**{*;} -keepattributes Exceptions,InnerClasses -keepattributes Signature -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.** -ignorewarnings #ImmersionBar -keep class com.gyf.immersionbar.* {*;} -dontwarn com.gyf.immersionbar.** #security -keep class com.laylib.security.lib.* {*;} -dontwarn com.laylib.security.lib.** # 保持调用jni的类不被混淆 -keep class android_serialport_api.*{*;} # 设置所有 native 方法不被混淆 -keepclasseswithmembernames class * { native ; }