proguard-rules.pro 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. # Add project specific ProGuard rules here.
  2. # You can control the set of applied configuration files using the
  3. # proguardFiles setting in build.gradle.
  4. #
  5. # For more details, see
  6. #
  7. # If your project uses WebView with JS, uncomment the following
  8. # and specify the fully qualified class name to the JavaScript interface
  9. # class:
  10. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  11. # public *;
  12. #}
  13. # Uncomment this to preserve the line number information for
  14. # debugging stack traces.
  15. #-keepattributes SourceFile,LineNumberTable
  16. # If you keep the line number information, uncomment this to
  17. # hide the original source file name.
  18. #-renamesourcefileattribute SourceFile
  19. #指定压缩级别
  20. -optimizationpasses 5
  21. -dontusemixedcaseclassnames
  22. #不跳过非公共的库的类成员
  23. -dontskipnonpubliclibraryclassmembers
  24. #混淆时采用的算法
  25. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  26. #方法同名混淆后亦同名,方法不同名混淆后亦不同名
  27. -useuniqueclassmembernames
  28. #优化时允许访问并修改有修饰符的类和类的成员
  29. #-allowaccessmodification
  30. #将文件来源重命名为“SourceFile”字符串
  31. #-renamesourcefileattribute SourceFile
  32. #保留行号
  33. #-keepattributes SourceFile,LineNumberTable
  34. # ------ 官方模板推荐不需要混淆的组件 ------
  35. -keep public class * extends android.app.Application
  36. -keep public class * extends android.app.Activity
  37. -keep public class * extends android.app.Service
  38. -keep public class * extends android.content.ContentProvider
  39. -keep public class * extends android.content.BroadcastReceiver
  40. -keep public class * extends android.app.backup.BackupAgentHelper
  41. -keep public class * extends android.preference.Preference
  42. -keep public class com.android.vending.licensing.ILicensingService
  43. -keep public class * extends android.app.Dialog
  44. -keep public class * extends androidx.fragment.app.Fragment
  45. # 忽略自定义控件
  46. -keep public class * extends android.view.View {
  47. public <init>(android.content.Context);
  48. public <init>(android.content.Context, android.util.AttributeSet);
  49. public <init>(android.content.Context, android.util.AttributeSet, int);
  50. public void set*(...);
  51. *** get*();
  52. }
  53. -keepclassmembers class * extends android.app.Activity{
  54. public void *(android.view.View);
  55. }
  56. # 忽略原生方法
  57. -keepclasseswithmembernames class * {
  58. native <methods>;
  59. }
  60. # 忽略枚举
  61. -keepclassmembers enum * {
  62. public static **[] values();
  63. public static ** valueOf(java.lang.String);
  64. }
  65. # 忽略序列化实体类
  66. -keep class * implements android.os.Parcelable {
  67. public static final android.os.Parcelable$Creator *;
  68. <fields>;
  69. <methods>;
  70. }
  71. #保持 Serializable 不被混淆
  72. -keepnames class * implements java.io.Serializable
  73. #保持 Serializable 不被混淆并且enum 类也不被混淆
  74. -keepclassmembers class * implements java.io.Serializable {
  75. static final long serialVersionUID;
  76. private static final java.io.ObjectStreamField[] serialPersistentFields;
  77. !static !transient <fields>;
  78. !private <fields>;
  79. !private <methods>;
  80. private void writeObject(java.io.ObjectOutputStream);
  81. private void readObject(java.io.ObjectInputStream);
  82. java.lang.Object writeReplace();
  83. java.lang.Object readResolve();
  84. }
  85. # 保留Annotation不混淆
  86. -keepattributes *Annotation*,InnerClasses
  87. -keep class * extends java.lang.annotation.Annotation { *; }
  88. # 避免混淆泛型
  89. -keepattributes Signature
  90. # 保持R文件不被混淆
  91. -keep class **.R$* {*;}
  92. -keep class **.R2$* {*;}
  93. # ------ 应用定制混淆方案 ------
  94. -keep class com.shanp.youqi.**.model.**{*;}
  95. -keep class com.shanp.youqi.core.event.**{*;}
  96. -keep class com.shanp.youqi.**.vo.**{*;}
  97. -keep class com.shanp.youqi.common.**{*;}
  98. #JSON
  99. -keep class **.*$JavaScriptInterface{*;}
  100. -keepclassmembers class * {
  101. public <init> (org.json.JSONObject);
  102. }
  103. -keep class * implements com.google.gson.TypeAdapterFactory
  104. -keep class * implements com.google.gson.JsonSerializer
  105. -keep class * implements com.google.gson.JsonDeserializer
  106. # ------ 保护第三方jar包,不做混淆处理----------
  107. -keep class android.support.**{*;}
  108. -dontwarn android.support.**
  109. -keep class androidx.*{*;}
  110. -dontwarn androidx.**
  111. -keep class com.google.android.**
  112. -dontwarn com.google.android.**
  113. # Gson
  114. -keep class com.google.gson.examples.android.model.** { *; }
  115. #-keep class com.google.gson.**{*;}
  116. -dontwarn com.google.gson.**
  117. -dontwarn sun.misc.**
  118. #语音房间相关的混淆配置
  119. #-------------云信相关的混淆配置------------
  120. -dontwarn com.netease.**
  121. -keep class com.netease.** {*;}
  122. #如果你使用全文检索插件,需要加入
  123. -dontwarn org.apache.lucene.**
  124. -keep class org.apache.lucene.** {*;}
  125. #-keep class com.tongdaxing.erban.ui.im.chat.** {*;}
  126. -keep class com.hncx.xxm.im.holder.** {*;}
  127. # 内部WebView混淆过滤
  128. -keepclassmembers class * {
  129. @android.webkit.JavascriptInterface <methods>;
  130. }
  131. -keep class org.json.** {*;}
  132. -dontwarn com.hncx.xxm.base.bindadapter.**
  133. -keep class com.hncx.xxm.base.bindadapter.** {*;}
  134. -keepclassmembers class * {
  135. @com.tongdaxing.xchat_framework.coremanager.CoreEvent <methods>;
  136. }
  137. -keep class com.baidu.bottom.** { *; }
  138. -keep class com.baidu.kirin.** { *; }
  139. -keep class com.baidu.mobstat.** { *; }
  140. -keep class io.agora.** { *; }
  141. # 即构混淆代码
  142. -keep class com.zego.**{*;}
  143. # 七牛
  144. -keep class com.qiniu.**{*;}
  145. -keep class com.qiniu.**{public <init>();}
  146. -ignorewarnings
  147. # 安全检测库的bean不混淆
  148. -dontwarn com.hncxco.safetychecker.bean.**
  149. -keep class com.hncxco.safetychecker.bean.**{*;}
  150. -dontwarn com.tongdaxing.xchat_framework.im.**
  151. -keep class com.tongdaxing.xchat_framework.im.**{*;}
  152. -dontwarn com.tongdaxing.**.bean.**
  153. -keep class com.tongdaxing.**.bean.**{*;}
  154. #-------------TakePhoto的混淆配置------------
  155. -keep class com.jph.takephoto.** { *; }
  156. -dontwarn com.jph.takephoto.**
  157. -keep class com.darsh.multipleimageselect.** { *; }
  158. -dontwarn com.darsh.multipleimageselect.**
  159. -keep class com.soundcloud.android.crop.** { *; }
  160. -dontwarn com.soundcloud.android.crop.**
  161. # BaseAdapter
  162. -keep class com.chad.library.adapter.** {
  163. *;
  164. }
  165. -keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
  166. -keep public class * extends com.chad.library.adapter.base.BaseViewHolder
  167. -keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
  168. <init>(...);
  169. }
  170. #阿里相关
  171. -keep class com.alipay.** {*;}
  172. -dontwarn com.alipay.**
  173. -keep class com.taobao.** {*;}
  174. -dontwarn com.taobao.**
  175. -keep class com.alibaba.** {*;}
  176. -dontwarn com.alibaba.**
  177. -keep class org.json.alipay.** {*;}
  178. -dontwarn org.json.alipay.**
  179. -keep class com.ta.utdid2.**{*;}
  180. -dontwarn com.ta.utdid2.**
  181. -keep class com.ut.device.**{*;}
  182. -dontwarn com.ut.device.**
  183. -dontwarn org.apache.commons.codec.binary.**
  184. # 腾讯相关
  185. -keep class com.tencent.**{*;}
  186. -dontwarn com.tencent.**
  187. -keep class com.qq.**{*;}
  188. -dontwarn com.qq.**
  189. -keep class src.com.qq.**{*;}
  190. -dontwarn src.com.qq.**
  191. #闪验
  192. -dontwarn com.cmic.sso.sdk.**
  193. -dontwarn com.sdk.**
  194. -keep class com.cmic.sso.sdk.**{*;}
  195. -keep class com.sdk.**{*;}
  196. -keep class cn.com.chinatelecom.account.api.**{*;}
  197. #融云
  198. -keep class io.rong.** {*;}
  199. -keep class cn.rongcloud.** {*;}
  200. -keep class * implements io.rong.imlib.model.MessageContent {*;}
  201. -dontwarn io.rong.push.**
  202. -dontnote com.xiaomi.**
  203. -dontnote com.google.android.gms.gcm.**
  204. -dontnote io.rong.**
  205. -keep class com.amap.api.**{*;}
  206. -keep class com.amap.api.services.**{*;}
  207. -keep class com.uuhelper.Application.** {*;}
  208. -keep class net.sourceforge.zbar.** { *; }
  209. -keep class com.jrmf360.rylib.** {*;}
  210. -keep class com.blink.** { *; }
  211. -keep class com.bailingcloud.bailingvideo.engine.binstack.json.** { *; }
  212. -keep class bailingquic.**{*;}
  213. -keep class go.**{*;}
  214. -keep class com.shanp.youqi.im.receiver.SealNotificationReceiver {*;}
  215. # 友盟
  216. -keep class org.android.** {*;}
  217. -dontwarn org.android.**
  218. -keep class anet.channel.** {*;}
  219. -dontwarn anetwork.channel.**
  220. -dontwarn anet.channel.**
  221. -keep class com.uc.** {*;}
  222. -keep class com.umeng.** {*;}
  223. -dontwarn com.umeng.**
  224. -keep class com.xiaomi.** {*;}
  225. -dontwarn com.xiaomi.**
  226. -keep class com.huawei.** {*;}
  227. -dontwarn com.huawei.**
  228. -keep class com.meizu.** {*;}
  229. -dontwarn com.meizu.**
  230. -keep class org.apache.thrift.** {*;}
  231. -dontwarn org.apache.thrift.**
  232. -keep class com.ut.**{*;}
  233. -keep class com.ta.**{*;}
  234. -keep class com.alimama.mobile.**{*;}
  235. -dontwarn com.alimama.mobile.**
  236. -keep class u.**{*;}
  237. -dontwarn u.**
  238. -dontwarn com.taobao.**
  239. -keep class com.taobao.**{*;}
  240. -dontwarn com.vivo.push.**
  241. -keep class com.vivo.push.**{*; }
  242. -keep class com.vivo.vms.**{*; }
  243. -keep class org.android.agoo.vivo.PushMessageReceiverImpl{*;}
  244. -keepattributes SourceFile,LineNumberTable
  245. -keep class com.hianalytics.android.**{*;}
  246. -keep class com.huawei.updatesdk.**{*;}
  247. -keep class com.huawei.hms.**{*;}
  248. -keep class org.android.agoo.xiaomi.MiPushBroadcastReceiver {*;}
  249. -dontwarn com.xiaomi.push.**
  250. # 图片加载库
  251. -keep class * implements com.bumptech.glide.module.GlideModule
  252. -keep class * extends com.bumptech.glide.module.AppGlideModule
  253. -keep enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  254. **[] $VALUES;
  255. public *;
  256. }
  257. # RxJava
  258. -keep class io.reactivex.**{*;}
  259. -dontwarn io.reactivex.**
  260. -keep class org.reactivestreams.**{*;}
  261. -dontwarn org.reactivestreams.**
  262. # retrofit2
  263. -dontnote retrofit2.Platform
  264. -dontwarn retrofit2.Platform$Java8
  265. -dontnote retrofit2.Platform$IOS$MainThreadExecutor
  266. -keepattributes Exceptions
  267. -keepclassmembers,allowshrinking,allowobfuscation interface * {
  268. @retrofit2.http.* <methods>;
  269. }
  270. -dontwarn javax.annotation.**
  271. # okhttp3
  272. -keep class okhttp3.**{*;}
  273. -dontwarn okhttp3.**
  274. -keep class okio.**{*;}
  275. -dontwarn okio.**
  276. #Butterknife
  277. -keep class butterknife.** { *; }
  278. -dontwarn butterknife.internal.**
  279. -keep class **$$ViewBinder { *; }
  280. -keepclasseswithmembernames class * {
  281. @butterknife.* <fields>;
  282. }
  283. -keepclasseswithmembernames class * {
  284. @butterknife.* <methods>;
  285. }
  286. #MaterialDialog
  287. -keep class com.afollestad.materialdialogs.**{ *; }
  288. -dontwarn com.afollestad.materialdialogs.**
  289. #lottie
  290. -keep class com.airbnb.lottie.**{ *; }
  291. -dontwarn com.airbnb.lottie.**
  292. #Arouter
  293. -keep public class com.alibaba.android.arouter.routes.**{*;}
  294. -keep public class com.alibaba.android.arouter.facade.**{*;}
  295. -keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
  296. # 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
  297. #-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
  298. # 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
  299. # -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
  300. #高德定位
  301. -keep class com.amap.api.location.**{*;}
  302. -keep class com.amap.api.fence.**{*;}
  303. -keep class com.loc.**{*;}
  304. -keep class com.autonavi.aps.amapapi.model.**{*;}
  305. #blankj 的 工具类
  306. -keep class com.blankj.utilcode.**{ *; }
  307. -dontwarn com.blankj.utilcode.**
  308. #pickerview 多级联动选择库?
  309. -keep class com.bigkoo.pickerview.**{*;}
  310. -dontwarn com.bigkoo.pickerview.**
  311. -keep class com.contrarywind.**{*;}
  312. -dontwarn com.contrarywind.**
  313. #multipleimageselect 图像选择库
  314. -keep class com.darsh.multipleimageselect.**{*;}
  315. -dontwarn com.darsh.multipleimageselect.**
  316. #relinker 本地加载库
  317. -keep class com.getkeepsafe.relinker.**{*;}
  318. -dontwarn com.getkeepsafe.relinker.**
  319. #com.github.chrisbanes.photoview 带有手势操作的图片查看库
  320. -keep class com.github.chrisbanes.photoview.**{*;}
  321. -dontwarn com.github.chrisbanes.photoview.**
  322. #master.flame.danmaku B站弹幕
  323. -keep class master.flame.danmaku.**{*;}
  324. -dontwarn master.flame.danmaku.**
  325. -keep class tv.cjump.jni.**{*;}
  326. -dontwarn tv.cjump.jni.**
  327. #百度识别
  328. #-keep class com.baidu.idl.facesdk.** { *; }
  329. #-dontwarn com.baidu.idl.facesdk.**
  330. #-keep class com.baidu.idl.face.** { *; }
  331. #-dontwarn com.baidu.idl.face.**
  332. # baidu_ocr_ui
  333. -keep class com.baidu.idl.**{*;}
  334. -dontwarn com.baidu.idl.**
  335. -keep class com.baidu.ocr.sdk.**{*;}
  336. -dontwarn com.baidu.ocr.sdk.**
  337. -keep class com.baidu.idcardquality.**{*;}
  338. -dontwarn com.baidu.idcardquality.**
  339. -keep class com.baidu.ocr.ui.**{*;}
  340. -dontwarn com.baidu.ocr.ui.**
  341. #baidu_faceplatform
  342. -keep class com.baidu.aip.face.stat.**{*;}
  343. -dontwarn com.baidu.aip.face.stat.**
  344. #gsyvideoplayer
  345. -keep class com.shuyu.gsyvideoplayer.video.** { *; }
  346. -dontwarn com.shuyu.gsyvideoplayer.video.**
  347. -keep class com.shuyu.gsyvideoplayer.video.base.** { *; }
  348. -dontwarn com.shuyu.gsyvideoplayer.video.base.**
  349. -keep class com.shuyu.gsyvideoplayer.utils.** { *; }
  350. -dontwarn com.shuyu.gsyvideoplayer.utils.**
  351. -keep class tv.danmaku.ijk.** { *; }
  352. -dontwarn tv.danmaku.ijk.**
  353. -keep public class * extends android.view.View{
  354. *** get*();
  355. void set*(***);
  356. public <init>(android.content.Context);
  357. public <init>(android.content.Context, android.util.AttributeSet);
  358. public <init>(android.content.Context, android.util.AttributeSet, int);
  359. }