1
0

proguard-rules.pro 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. # Add project specific ProGuard rules here.
  2. # By default, the flags in this file are appended to flags specified
  3. # in /Users/jess/Library/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. # 混淆规则在 arms moudule下的proguard-rules.pro中,混淆前先参阅https://github.com/JessYanCoding/MVPArms/wiki#1.5
  17. -optimizationpasses 5
  18. -dontusemixedcaseclassnames
  19. -dontskipnonpubliclibraryclasses
  20. -dontskipnonpubliclibraryclassmembers
  21. -dontpreverify
  22. -verbose
  23. -printmapping priguardMapping.txt
  24. -optimizations !code/simplification/artithmetic,!field/*,!class/merging/*
  25. ################common###############
  26. -keep public class * implements com.jess.arms.integration.ConfigModule
  27. #实体类不参与混淆
  28. -keep class com.jess.arms.widget.** { *; } #自定义控件不参与混淆
  29. -keep class * implements android.os.Parcelable {
  30. public static final android.os.Parcelable$Creator *;
  31. }
  32. -keepnames class * implements java.io.Serializable
  33. -keepattributes Signature
  34. -keep class **.R$* {*;}
  35. -ignorewarnings
  36. -keepclassmembers class **.R$* {
  37. public static <fields>;
  38. }
  39. -keepclasseswithmembernames class * { # 保持native方法不被混淆
  40. native <methods>;
  41. }
  42. -keepclassmembers enum * { # 使用enum类型时需要注意避免以下两个方法混淆,因为enum类的特殊性,以下两个方法会被反射调用,
  43. public static **[] values();
  44. public static ** valueOf(java.lang.String);
  45. }
  46. ################support###############
  47. -keep class android.support.** { *; }
  48. -keep interface android.support.** { *; }
  49. -dontwarn android.support.**
  50. -keep class com.google.android.material.** {*;}
  51. -keep class androidx.** {*;}
  52. -keep public class * extends androidx.**
  53. -keep interface androidx.** {*;}
  54. -dontwarn com.google.android.material.**
  55. -dontnote com.google.android.material.**
  56. -dontwarn androidx.**
  57. ################alipay###############
  58. -keep class com.alipay.android.app.IAlixPay{*;}
  59. -keep class com.alipay.android.app.IAlixPay$Stub{*;}
  60. -keep class com.alipay.android.app.IRemoteServiceCallback{*;}
  61. -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
  62. -keep class com.alipay.sdk.app.PayTask{ public *;}
  63. -keep class com.alipay.sdk.app.AuthTask{ public *;}
  64. ################retrofit###############
  65. -dontwarn retrofit2.**
  66. -keep class retrofit2.** { *; }
  67. -keepattributes Signature
  68. -keepattributes Exceptions
  69. ################butterknife###############
  70. -keep class butterknife.** { *; }
  71. -dontwarn butterknife.internal.**
  72. -keep class **$$ViewBinder { *; }
  73. -keepclasseswithmembernames class * {
  74. @butterknife.* <fields>;
  75. }
  76. -keepclasseswithmembernames class * {
  77. @butterknife.* <methods>;
  78. }
  79. ################gson###############
  80. -keepattributes Signature
  81. -keepattributes *Annotation*
  82. -keep class sun.misc.Unsafe { *; }
  83. -keep class com.google.gson.stream.** { *; }
  84. # Application classes that will be serialized/deserialized over Gson
  85. -keep class com.sunloto.shandong.bean.** { *; }
  86. ################glide###############
  87. -keep public class * implements com.bumptech.glide.module.AppGlideModule
  88. -keep public class * implements com.bumptech.glide.module.LibraryGlideModule
  89. -keep class com.bumptech.glide.** { *; }
  90. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  91. **[] $VALUES;
  92. public *;
  93. }
  94. ################okhttp###############
  95. -keepattributes Signature
  96. -keepattributes *Annotation*
  97. -keep class com.squareup.okhttp.** { *; }
  98. -keep interface com.squareup.okhttp.** { *; }
  99. -keep class okhttp3.** { *; }
  100. -keep interface okhttp3.** { *; }
  101. -dontwarn com.squareup.okhttp.**
  102. ################androidEventBus###############
  103. -keep class org.simple.** { *; }
  104. -keep interface org.simple.** { *; }
  105. -keepclassmembers class * {
  106. @org.simple.eventbus.Subscriber <methods>;
  107. }
  108. -keepattributes *Annotation*
  109. ################EventBus###############
  110. -keepclassmembers class * {
  111. @org.greenrobot.eventbus.Subscribe <methods>;
  112. }
  113. -keep class org.greenrobot.eventbus.EventBus { *; }
  114. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  115. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  116. <init>(java.lang.Throwable);
  117. }
  118. ################autolayout###############
  119. -keep class com.zhy.autolayout.** { *; }
  120. -keep interface com.zhy.autolayout.** { *; }
  121. ################RxJava and RxAndroid###############
  122. -dontwarn org.mockito.**
  123. -dontwarn org.junit.**
  124. -dontwarn org.robolectric.**
  125. -keep class io.reactivex.** { *; }
  126. -keep interface io.reactivex.** { *; }
  127. -keepattributes Signature
  128. -keepattributes *Annotation*
  129. -keep class com.squareup.okhttp.** { *; }
  130. -dontwarn okio.**
  131. -keep interface com.squareup.okhttp.** { *; }
  132. -dontwarn com.squareup.okhttp.**
  133. -dontwarn io.reactivex.**
  134. -dontwarn retrofit.**
  135. -keep class retrofit.** { *; }
  136. -keepclasseswithmembers class * {
  137. @retrofit.http.* <methods>;
  138. }
  139. -keep class sun.misc.Unsafe { *; }
  140. -dontwarn java.lang.invoke.*
  141. -keep class io.reactivex.schedulers.Schedulers {
  142. public static <methods>;
  143. }
  144. -keep class io.reactivex.schedulers.ImmediateScheduler {
  145. public <methods>;
  146. }
  147. -keep class io.reactivex.schedulers.TestScheduler {
  148. public <methods>;
  149. }
  150. -keep class io.reactivex.schedulers.Schedulers {
  151. public static ** test();
  152. }
  153. -keepclassmembers class io.reactivex.internal.util.unsafe.*ArrayQueue*Field* {
  154. long producerIndex;
  155. long consumerIndex;
  156. }
  157. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  158. long producerNode;
  159. long consumerNode;
  160. }
  161. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  162. io.reactivex.internal.util.atomic.LinkedQueueNode producerNode;
  163. }
  164. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
  165. io.reactivex.internal.util.atomic.LinkedQueueNode consumerNode;
  166. }
  167. -dontwarn io.reactivex.internal.util.unsafe.**
  168. ################espresso###############
  169. -keep class android.support.test.espresso.** { *; }
  170. -keep interface android.support.test.espresso.** { *; }
  171. ################annotation###############
  172. -keep class android.support.annotation.** { *; }
  173. -keep interface android.support.annotation.** { *; }
  174. ################RxLifeCycle#################
  175. -keep class com.trello.rxlifecycle2.** { *; }
  176. -keep interface com.trello.rxlifecycle2.** { *; }
  177. ################RxPermissions#################
  178. -keep class com.tbruyelle.rxpermissions2.** { *; }
  179. -keep interface com.tbruyelle.rxpermissions2.** { *; }
  180. ################RxCache#################
  181. -dontwarn io.rx_cache2.internal.**
  182. -keep class io.rx_cache2.internal.Record { *; }
  183. -keep class io.rx_cache2.Source { *; }
  184. -keep class io.victoralbertos.jolyglot.** { *; }
  185. -keep interface io.victoralbertos.jolyglot.** { *; }
  186. ################RxErrorHandler#################
  187. -keep class me.jessyan.rxerrorhandler.** { *; }
  188. -keep interface me.jessyan.rxerrorhandler.** { *; }
  189. ################Timber#################
  190. -dontwarn org.jetbrains.annotations.**
  191. ################Canary#################
  192. -dontwarn com.squareup.haha.guava.**
  193. -dontwarn com.squareup.haha.perflib.**
  194. -dontwarn com.squareup.haha.trove.**
  195. -dontwarn com.squareup.leakcanary.**
  196. -keep class com.squareup.haha.** { *; }
  197. -keep class com.squareup.leakcanary.** { *; }
  198. # Marshmallow removed Notification.setLatestEventInfo()
  199. -dontwarn android.app.Notification
  200. ####################上面是MvpArms的混淆规则 下面是自己加的###################
  201. -keep class me.hegj.wandroid.mvp.model.entity.**{ *; }
  202. -keep class me.hegj.wandroid.app.weight.**{ *; }
  203. -keep class me.hegj.wandroid.app.event.**{ *; }
  204. # 保留自定义控件(继承自View)不能被混淆
  205. -keep public class * extends android.view.View {
  206. public <init>(android.content.Context);
  207. public <init>(android.content.Context, android.util.AttributeSet);
  208. public <init>(android.content.Context, android.util.AttributeSet, int);
  209. public void set*(***);
  210. *** get* ();
  211. }
  212. -dontwarn com.kingja.loadsir.**
  213. -keep class com.kingja.loadsir.** {*;}
  214. -keep class com.just.agentweb.** {
  215. *;
  216. }
  217. -dontwarn com.just.agentweb.**
  218. -keepattributes *Annotation*
  219. -keep class **.*_SnakeProxy
  220. -keep @com.youngfeng.snake.annotations.EnableDragToClose public class *
  221. -dontwarn com.tencent.bugly.**
  222. -keep public class com.tencent.bugly.**{*;}
  223. # SearchView
  224. -keep class androidx.appcompat.widget.SearchView {
  225. ImageView mGoButton;
  226. }