proguard-rules.pro 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # Add project specific ProGuard rules here.
  2. # By default, the flags in this file are appended to flags specified
  3. # in /Users/shanpin_lxw/Desktop/Leexw/DevelopmentTool/android-sdk/tools/proguard/proguard-android.txt
  4. # You can edit the include path and order by changing the proguardFiles
  5. # directive in build.gradle.
  6. #
  7. # For more details, see
  8. # http://developer.android.com/guide/developing/tools/proguard.html
  9. # Add any project specific keep options here:
  10. # If your project uses WebView with JS, uncomment the following
  11. # and specify the fully qualified class name to the JavaScript interface
  12. # class:
  13. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  14. # public *;
  15. #}
  16. # ------ 通用配置 ------
  17. -optimizationpasses 5
  18. -dontusemixedcaseclassnames
  19. -dontskipnonpubliclibraryclasses
  20. -dontpreverify
  21. -verbose
  22. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  23. # ------ 官方模板推荐不需要混淆的组件 ------
  24. -keep public class * extends android.app.Application
  25. -keep public class * extends android.app.Activity
  26. -keep public class * extends android.app.Service
  27. -keep public class * extends android.content.ContentProvider
  28. -keep public class * extends android.content.BroadcastReceiver
  29. -keep public class * extends android.app.backup.BackupAgentHelper
  30. -keep public class * extends android.preference.Preference
  31. -keep public class * extends android.widget.PopupWindow
  32. -keep class * extends android.webkit.WebChromeClient {*;}
  33. -keep class * extends android.webkit.WebViewClient {*;}
  34. -keep public class com.android.vending.licensing.ILicensingService
  35. # 忽略自定义控件
  36. -keep public class * extends android.view.View {
  37. public <init>(android.content.Context);
  38. public <init>(android.content.Context, android.util.AttributeSet);
  39. public <init>(android.content.Context, android.util.AttributeSet, int);
  40. public void set*(...);
  41. *** get*();
  42. }
  43. -keepclassmembers class * extends android.app.Activity{
  44. public void *(android.view.View);
  45. }
  46. # 忽略原生方法
  47. -keepclasseswithmembernames class * {
  48. native <methods>;
  49. }
  50. # 忽略枚举
  51. -keepclassmembers enum * {
  52. public static **[] values();
  53. public static ** valueOf(java.lang.String);
  54. }
  55. # 忽略序列化实体类
  56. -keep class * implements android.os.Parcelable {
  57. public static final android.os.Parcelable$Creator *;
  58. }
  59. -keepnames class * implements java.io.Serializable
  60. # 保留Annotation不混淆
  61. -keepattributes *Annotation*,InnerClasses
  62. # 避免混淆泛型
  63. -keepattributes Signature
  64. # 保持R文件不被混淆
  65. -keep class **.R$* {*;}
  66. # ------ 应用定制混淆方案 ------
  67. -keep class com.xsbanruo.common.activity.**{*;}
  68. -keep class com.xsbanruo.common.fragment.**{*;}
  69. -keep class com.xsbanruo.common.adapter.**{*;}
  70. -keep public class * extends com.shanp.base.pop.AbstractPop
  71. -keep class com.xsbanruo.data.model.**{*;}
  72. -keep class com.xsbanruo.**.vo.**{*;}
  73. -keep class **.*$JavaScriptInterface{*;}
  74. -keepclassmembers class * {
  75. public <init> (org.json.JSONObject);
  76. }
  77. # ------ 企业私有sdk混淆方案 ------
  78. -keep class com.shanp.sms.**{*;}
  79. -keep class com.shanp.base.util.GsonUtil{*;}
  80. -keep class com.shanp.widget.wheel.**{*;}
  81. -dontwarn com.shanp.widget.wheel.**
  82. # ------ 保护第三方jar包,不做混淆处理----------
  83. -keep class android.support.**{*;}
  84. -dontwarn android.support.**
  85. -keep public class * extends androidx.**
  86. -dontwarn androidx.**
  87. -keep public class * extends com.google.android.**
  88. -dontwarn com.google.android.**
  89. -keep public class * extends android.support.v4.**
  90. -keep public class * extends android.support.v7.**
  91. -keep public class * extends android.support.annotation.**
  92. # Gson
  93. -keep class com.google.gson.**{*;}
  94. -dontwarn com.google.gson.**
  95. # 分享
  96. -keep class cn.sharesdk.**{*;}
  97. -dontwarn cn.sharesdk.**
  98. -keep class com.mob.**{*;}
  99. -dontwarn com.mob.**
  100. # 腾讯相关
  101. -keep class com.tencent.**{*;}
  102. -dontwarn com.tencent.**
  103. -keep class com.qq.**{*;}
  104. -dontwarn com.qq.**
  105. -keep class src.com.qq.**{*;}
  106. -dontwarn src.com.qq.**
  107. # 新浪相关
  108. -keep class com.sina.**{*;}
  109. -dontwarn com.sina.**
  110. # 阿里巴巴 支付宝 阿里云
  111. -keep class com.taobao.** {*;}
  112. -dontwarn com.taobao.**
  113. -keep class com.alibaba.** {*;}
  114. -dontwarn com.alibaba.**
  115. -keep class org.json.alipay.** {*;}
  116. -dontwarn org.json.alipay.**
  117. -keep class com.alipay.**{*;}
  118. -dontwarn com.alipay.**
  119. -keep class com.ta.utdid2.**{*;}
  120. -dontwarn com.ta.utdid2.**
  121. -keep class com.ut.device.**{*;}
  122. -dontwarn com.ut.device.**
  123. -keep class com.acme.hellojni.nativeapklib.**{*;}
  124. -dontwarn com.acme.hellojni.nativeapklib.**
  125. -keep class com.alivc.player.**{*;}
  126. -keep class com.aliyun.clientinforeport.**{*;}
  127. -keep class com.aliyun.vodplayer.**{*;}
  128. -keep class com.alibaba.sdk.android.** { *; }
  129. -dontwarn com.alivc.player.**
  130. # 友盟
  131. -keep class org.android.** {*;}
  132. -dontwarn org.android.**
  133. -keep class anet.channel.** {*;}
  134. -dontwarn anetwork.channel.**
  135. -dontwarn anet.channel.**
  136. -keep class com.umeng.** {*;}
  137. -dontwarn com.umeng.**
  138. -keep class com.xiaomi.** {*;}
  139. -dontwarn com.xiaomi.**
  140. -keep class com.huawei.** {*;}
  141. -dontwarn com.huawei.**
  142. -keep class com.meizu.** {*;}
  143. -dontwarn com.meizu.**
  144. -keep class org.apache.thrift.** {*;}
  145. -dontwarn org.apache.thrift.**
  146. -keep class com.ut.**{*;}
  147. -keep class com.ta.**{*;}
  148. -keep class com.alimama.mobile.**{*;}
  149. -dontwarn com.alimama.mobile.**
  150. -keep class u.**{*;}
  151. -dontwarn u.**
  152. # 友盟离线推送
  153. -keep class org.android.agoo.xiaomi.MiPushBroadcastReceiver {*;}
  154. -keep class com.xsbanruo.common.util.MiPushRegistar {*;}
  155. -dontwarn com.xiaomi.push.**
  156. -keepattributes SourceFile,LineNumberTable
  157. -keep class com.hianalytics.android.**{*;}
  158. -keep class com.huawei.updatesdk.**{*;}
  159. -keep class com.huawei.hms.**{*;}
  160. -dontwarn com.vivo.push.**
  161. -keep class com.vivo.push.**{*; }
  162. -keep class com.vivo.vms.**{*; }
  163. -keep class org.android.agoo.vivo.PushMessageReceiverImpl{*;}
  164. # 图片加载库
  165. -keep public class * implements com.bumptech.glide.module.GlideModule
  166. -keep public class * extends com.bumptech.glide.module.AppGlideModule
  167. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  168. **[] $VALUES;
  169. public *;
  170. }
  171. # RxJava
  172. -keep class io.reactivex.**{*;}
  173. -dontwarn io.reactivex.**
  174. -keep class org.reactivestreams.**{*;}
  175. -dontwarn org.reactivestreams.**
  176. # retrofit2
  177. -dontnote retrofit2.Platform
  178. -dontwarn retrofit2.Platform$Java8
  179. -dontnote retrofit2.Platform$IOS$MainThreadExecutor
  180. -keepattributes Exceptions
  181. -keepclassmembers,allowshrinking,allowobfuscation interface * {
  182. @retrofit2.http.* <methods>;
  183. }
  184. -dontwarn javax.annotation.**
  185. # okhttp3
  186. -keep class okhttp3.**{*;}
  187. -dontwarn okhttp3.**
  188. -keep class okio.**{*;}
  189. -dontwarn okio.**
  190. # SwipeToLoadLayout
  191. -keep class com.aspsine.swipetoloadlayout.**{*;}
  192. -dontwarn com.aspsine.swipetoloadlayout.**
  193. #穿山甲
  194. -keep class com.bytedance.sdk.openadsdk.** { *; }
  195. -keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;}
  196. -keep class com.pgl.sys.ces.* {*;}
  197. #oaid
  198. -keep class com.bun.miitmdid.core.** {*;}
  199. #oss
  200. -keep class com.alibaba.sdk.android.oss.** { *; }
  201. -dontwarn org.apache.commons.codec.binary.**