proguard-rules.pro 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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.xsbanruo.data.model.**{*;}
  72. -keep class com.xsbanruo.**.vo.**{*;}
  73. -keep class com.shanp.base.util.GsonUtil{*;}
  74. -keep class **.*$JavaScriptInterface{*;}
  75. # ------ 保护第三方jar包,不做混淆处理----------
  76. -keep class android.support.**{*;}
  77. -dontwarn android.support.**
  78. -keep public class * extends android.support.v4.**
  79. -keep public class * extends android.support.v7.**
  80. -keep public class * extends android.support.annotation.**
  81. # Gson
  82. -keep class com.google.gson.**{*;}
  83. -dontwarn com.google.gson.**
  84. # 分享
  85. -keep class cn.sharesdk.**{*;}
  86. -dontwarn cn.sharesdk.**
  87. -keep class com.mob.**{*;}
  88. -dontwarn com.mob.**
  89. # 腾讯相关
  90. -keep class com.tencent.**{*;}
  91. -dontwarn com.tencent.**
  92. -keep class com.qq.**{*;}
  93. -dontwarn com.qq.**
  94. -keep class src.com.qq.**{*;}
  95. -dontwarn src.com.qq.**
  96. # 新浪相关
  97. -keep class com.sina.**{*;}
  98. -dontwarn com.sina.**
  99. # 阿里巴巴 支付宝 阿里云
  100. -keep class com.taobao.** {*;}
  101. -dontwarn com.taobao.**
  102. -keep class com.alibaba.** {*;}
  103. -dontwarn com.alibaba.**
  104. -keep class org.json.alipay.** {*;}
  105. -dontwarn org.json.alipay.**
  106. -keep class com.alipay.**{*;}
  107. -dontwarn com.alipay.**
  108. -keep class com.ta.utdid2.**{*;}
  109. -dontwarn com.ta.utdid2.**
  110. -keep class com.ut.device.**{*;}
  111. -dontwarn com.ut.device.**
  112. -keep class com.acme.hellojni.nativeapklib.**{*;}
  113. -dontwarn com.acme.hellojni.nativeapklib.**
  114. -keep class com.alivc.player.**{*;}
  115. -keep class com.aliyun.clientinforeport.**{*;}
  116. -keep class com.aliyun.vodplayer.**{*;}
  117. -keep class com.alibaba.sdk.android.** { *; }
  118. -dontwarn com.alivc.player.**
  119. # 友盟
  120. -keep class anet.channel.** {*;}
  121. -dontwarn anet.channel.**
  122. -keep class anetwork.channel.** {*;}
  123. -dontwarn anetwork.channel.**
  124. -keep class com.umeng.** {*;}
  125. -dontwarn com.umeng.**
  126. -keep class org.android.** {*;}
  127. -dontwarn org.android.**
  128. -keep class org.apache.thrift.** {*;}
  129. -dontwarn org.apache.thrift.**
  130. -keep class com.xiaomi.** {*;}
  131. -dontwarn com.xiaomi.**
  132. -keep class com.huawei.** {*;}
  133. -dontwarn com.huawei.**
  134. -keepclassmembers class * {
  135. public <init> (org.json.JSONObject);
  136. }
  137. # 图片加载库
  138. -keep public class * implements com.bumptech.glide.module.GlideModule
  139. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  140. **[] $VALUES;
  141. public *;
  142. }
  143. # RxJava
  144. -keep class io.reactivex.**{*;}
  145. -dontwarn io.reactivex.**
  146. -keep class org.reactivestreams.**{*;}
  147. -dontwarn org.reactivestreams.**
  148. # SwipeToLoadLayout
  149. -keep class com.aspsine.swipetoloadlayout.**{*;}
  150. -dontwarn com.aspsine.swipetoloadlayout.**
  151. -keep class com.shanp.widget.wheel.**{*;}
  152. -dontwarn com.shanp.widget.wheel.**
  153. # okhttp3
  154. -keep class okhttp3.**{*;}
  155. -dontwarn okhttp3.**
  156. -keep class okio.**{*;}
  157. -dontwarn okio.**