proguard-rules.pro 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.Activity
  25. -keep public class * extends android.app.Application
  26. -keep public class * extends android.app.Service
  27. -keep public class * extends android.content.BroadcastReceiver
  28. -keep public class * extends android.content.ContentProvider
  29. -keep public class * extends android.app.backup.BackupAgentHelper
  30. -keep public class * extends android.preference.Preference
  31. -keep public class com.android.vending.licensing.ILicensingService
  32. -keep public class * extends android.widget.PopupWindow
  33. -keep class * extends android.webkit.WebChromeClient {*;}
  34. -keep class * extends android.webkit.WebViewClient {*;}
  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 public class * extends com.xsbanruo.common.activity.**{*;}
  68. -keep public class * extends com.xsbanruo.common.fragment.**{*;}
  69. -keep public class * extends com.xsbanruo.common.adapter.**{*;}
  70. -keep public class * extends com.shanp.base.pop.AbstractPop
  71. -keep class com.shanp.sms.**{*;}
  72. -keep class com.xsbanruo.data.model.**{*;}
  73. -keep class com.xsbanruo.**.vo.**{*;}
  74. -keep class com.shanp.base.util.GsonUtil{*;}
  75. -keep class **.*$JavaScriptInterface{*;}
  76. -keepclassmembers class * {
  77. public <init> (org.json.JSONObject);
  78. }
  79. # ------ 保护第三方jar包,不做混淆处理----------
  80. -keep class android.support.**{*;}
  81. -dontwarn android.support.**
  82. -keep public class * extends androidx.**
  83. -dontwarn androidx.**
  84. -keep public class * extends com.google.android.**
  85. -dontwarn com.google.android.**
  86. -keep public class * extends android.support.v4.**
  87. -keep public class * extends android.support.v7.**
  88. -keep public class * extends android.support.annotation.**
  89. # Gson
  90. -keep class com.google.gson.**{*;}
  91. -dontwarn com.google.gson.**
  92. # 分享
  93. -keep class cn.sharesdk.**{*;}
  94. -dontwarn cn.sharesdk.**
  95. -keep class com.mob.**{*;}
  96. -dontwarn com.mob.**
  97. # 腾讯相关
  98. -keep class com.tencent.**{*;}
  99. -dontwarn com.tencent.**
  100. -keep class com.qq.**{*;}
  101. -dontwarn com.qq.**
  102. -keep class src.com.qq.**{*;}
  103. -dontwarn src.com.qq.**
  104. # 新浪相关
  105. -keep class com.sina.**{*;}
  106. -dontwarn com.sina.**
  107. # 阿里巴巴 支付宝 阿里云
  108. -keep class com.taobao.** {*;}
  109. -dontwarn com.taobao.**
  110. -keep class com.alibaba.** {*;}
  111. -dontwarn com.alibaba.**
  112. -keep class org.json.alipay.** {*;}
  113. -dontwarn org.json.alipay.**
  114. -keep class com.alipay.**{*;}
  115. -dontwarn com.alipay.**
  116. -keep class com.ta.utdid2.**{*;}
  117. -dontwarn com.ta.utdid2.**
  118. -keep class com.ut.device.**{*;}
  119. -dontwarn com.ut.device.**
  120. -keep class com.acme.hellojni.nativeapklib.**{*;}
  121. -dontwarn com.acme.hellojni.nativeapklib.**
  122. -keep class com.alivc.player.**{*;}
  123. -keep class com.aliyun.clientinforeport.**{*;}
  124. -keep class com.aliyun.vodplayer.**{*;}
  125. -keep class com.alibaba.sdk.android.** { *; }
  126. -dontwarn com.alivc.player.**
  127. # 友盟
  128. -keep class org.android.** {*;}
  129. -dontwarn org.android.**
  130. -keep class anet.channel.** {*;}
  131. -dontwarn anetwork.channel.**
  132. -dontwarn anet.channel.**
  133. -keep class com.umeng.** {*;}
  134. -dontwarn com.umeng.**
  135. -keep class com.xiaomi.** {*;}
  136. -dontwarn com.xiaomi.**
  137. -keep class com.huawei.** {*;}
  138. -dontwarn com.huawei.**
  139. -keep class com.meizu.** {*;}
  140. -dontwarn com.meizu.**
  141. -keep class org.apache.thrift.** {*;}
  142. -dontwarn org.apache.thrift.**
  143. -keep class com.ut.**{*;}
  144. -keep class com.ta.**{*;}
  145. -keep class com.alimama.mobile.**{*;}
  146. -dontwarn com.alimama.mobile.**
  147. -keep class u.**{*;}
  148. -dontwarn u.**
  149. # 图片加载库
  150. -keep public class * implements com.bumptech.glide.module.GlideModule
  151. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  152. **[] $VALUES;
  153. public *;
  154. }
  155. # RxJava
  156. -keep class io.reactivex.**{*;}
  157. -dontwarn io.reactivex.**
  158. -keep class org.reactivestreams.**{*;}
  159. -dontwarn org.reactivestreams.**
  160. # SwipeToLoadLayout
  161. -keep class com.aspsine.swipetoloadlayout.**{*;}
  162. -dontwarn com.aspsine.swipetoloadlayout.**
  163. -keep class com.shanp.widget.wheel.**{*;}
  164. -dontwarn com.shanp.widget.wheel.**
  165. # okhttp3
  166. -keep class okhttp3.**{*;}
  167. -dontwarn okhttp3.**
  168. -keep class okio.**{*;}
  169. -dontwarn okio.**