proguard-rules.pro 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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. -optimizationpasses 5
  17. -dontusemixedcaseclassnames
  18. -dontskipnonpubliclibraryclasses
  19. -dontskipnonpubliclibraryclassmembers
  20. -dontpreverify
  21. -verbose
  22. -printmapping priguardMapping.txt
  23. -optimizations !code/simplification/artithmetic,!field/*,!class/merging/*
  24. ################自定义依赖库不被混淆###############
  25. -keep class com.zkjc.commnon.** { *; } #自定义控件不参与混淆
  26. ################common###############
  27. -keep public class * implements com.jess.arms.integration.ConfigModule
  28. #实体类不参与混淆
  29. -keep class com.jess.arms.widget.** { *; } #自定义控件不参与混淆
  30. -keep class * implements android.os.Parcelable {
  31. public static final android.os.Parcelable$Creator *;
  32. }
  33. -keepnames class * implements java.io.Serializable
  34. -keepattributes Signature
  35. -keep class **.R$* {*;}
  36. -ignorewarnings
  37. -keepclassmembers class **.R$* {
  38. public static <fields>;
  39. }
  40. -keepclasseswithmembernames class * { # 保持native方法不被混淆
  41. native <methods>;
  42. }
  43. -keepclassmembers enum * { # 使用enum类型时需要注意避免以下两个方法混淆,因为enum类的特殊性,以下两个方法会被反射调用,
  44. public static **[] values();
  45. public static ** valueOf(java.lang.String);
  46. }
  47. ################support###############
  48. -keep class android.support.** { *; }
  49. -keep interface android.support.** { *; }
  50. -dontwarn android.support.**
  51. ################alipay###############
  52. -keep class com.alipay.android.app.IAlixPay{*;}
  53. -keep class com.alipay.android.app.IAlixPay$Stub{*;}
  54. -keep class com.alipay.android.app.IRemoteServiceCallback{*;}
  55. -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
  56. -keep class com.alipay.sdk.app.PayTask{ public *;}
  57. -keep class com.alipay.sdk.app.AuthTask{ public *;}
  58. ################retrofit###############
  59. -dontwarn retrofit2.**
  60. -keep class retrofit2.** { *; }
  61. -keepattributes Signature
  62. -keepattributes Exceptions
  63. ################butterknife###############
  64. -keep class butterknife.** { *; }
  65. -dontwarn butterknife.internal.**
  66. -keep class **$$ViewBinder { *; }
  67. -keepclasseswithmembernames class * {
  68. @butterknife.* <fields>;
  69. }
  70. -keepclasseswithmembernames class * {
  71. @butterknife.* <methods>;
  72. }
  73. ################gson###############
  74. -keepattributes Signature
  75. -keepattributes *Annotation*
  76. -keep class sun.misc.Unsafe { *; }
  77. -keep class com.google.gson.stream.** { *; }
  78. # Application classes that will be serialized/deserialized over Gson
  79. -keep class com.sunloto.shandong.bean.** { *; }
  80. ################glide###############
  81. -keep public class * implements com.bumptech.glide.module.AppGlideModule
  82. -keep public class * implements com.bumptech.glide.module.LibraryGlideModule
  83. -keep class com.bumptech.glide.** { *; }
  84. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  85. **[] $VALUES;
  86. public *;
  87. }
  88. ################okhttp###############
  89. -keepattributes Signature
  90. -keepattributes *Annotation*
  91. -keep class com.squareup.okhttp.** { *; }
  92. -keep interface com.squareup.okhttp.** { *; }
  93. -keep class okhttp3.** { *; }
  94. -keep interface okhttp3.** { *; }
  95. -dontwarn com.squareup.okhttp.**
  96. ################androidEventBus###############
  97. -keep class org.simple.** { *; }
  98. -keep interface org.simple.** { *; }
  99. -keepclassmembers class * {
  100. @org.simple.eventbus.Subscriber <methods>;
  101. }
  102. -keepattributes *Annotation*
  103. ################EventBus###############
  104. -keepclassmembers class * {
  105. @org.greenrobot.eventbus.Subscribe <methods>;
  106. }
  107. -keep class org.greenrobot.eventbus.EventBus { *; }
  108. -keep enum org.greenrobot.eventbus.ThreadMode { *; }
  109. -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
  110. <init>(java.lang.Throwable);
  111. }
  112. ################autolayout###############
  113. -keep class com.zhy.autolayout.** { *; }
  114. -keep interface com.zhy.autolayout.** { *; }
  115. ################RxJava and RxAndroid###############
  116. -dontwarn org.mockito.**
  117. -dontwarn org.junit.**
  118. -dontwarn org.robolectric.**
  119. -keep class io.reactivex.** { *; }
  120. -keep interface io.reactivex.** { *; }
  121. -keepattributes Signature
  122. -keepattributes *Annotation*
  123. -keep class com.squareup.okhttp.** { *; }
  124. -dontwarn okio.**
  125. -keep interface com.squareup.okhttp.** { *; }
  126. -dontwarn com.squareup.okhttp.**
  127. -dontwarn io.reactivex.**
  128. -dontwarn retrofit.**
  129. -keep class retrofit.** { *; }
  130. -keepclasseswithmembers class * {
  131. @retrofit.http.* <methods>;
  132. }
  133. -keep class sun.misc.Unsafe { *; }
  134. -dontwarn java.lang.invoke.*
  135. -keep class io.reactivex.schedulers.Schedulers {
  136. public static <methods>;
  137. }
  138. -keep class io.reactivex.schedulers.ImmediateScheduler {
  139. public <methods>;
  140. }
  141. -keep class io.reactivex.schedulers.TestScheduler {
  142. public <methods>;
  143. }
  144. -keep class io.reactivex.schedulers.Schedulers {
  145. public static ** test();
  146. }
  147. -keepclassmembers class io.reactivex.internal.util.unsafe.*ArrayQueue*Field* {
  148. long producerIndex;
  149. long consumerIndex;
  150. }
  151. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  152. long producerNode;
  153. long consumerNode;
  154. }
  155. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  156. io.reactivex.internal.util.atomic.LinkedQueueNode producerNode;
  157. }
  158. -keepclassmembers class io.reactivex.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
  159. io.reactivex.internal.util.atomic.LinkedQueueNode consumerNode;
  160. }
  161. -dontwarn io.reactivex.internal.util.unsafe.**
  162. ################espresso###############
  163. -keep class android.support.test.espresso.** { *; }
  164. -keep interface android.support.test.espresso.** { *; }
  165. ################annotation###############
  166. -keep class android.support.annotation.** { *; }
  167. -keep interface android.support.annotation.** { *; }
  168. ################RxLifeCycle#################
  169. -keep class com.trello.rxlifecycle2.** { *; }
  170. -keep interface com.trello.rxlifecycle2.** { *; }
  171. ################RxPermissions#################
  172. -keep class com.tbruyelle.rxpermissions2.** { *; }
  173. -keep interface com.tbruyelle.rxpermissions2.** { *; }
  174. ################RxCache#################
  175. -dontwarn io.rx_cache2.internal.**
  176. -keep class io.rx_cache2.internal.Record { *; }
  177. -keep class io.rx_cache2.Source { *; }
  178. -keep class io.victoralbertos.jolyglot.** { *; }
  179. -keep interface io.victoralbertos.jolyglot.** { *; }
  180. ################RxErrorHandler#################
  181. -keep class me.jessyan.rxerrorhandler.** { *; }
  182. -keep interface me.jessyan.rxerrorhandler.** { *; }
  183. ################Timber#################
  184. -dontwarn org.jetbrains.annotations.**
  185. ################Canary#################
  186. -dontwarn com.squareup.haha.guava.**
  187. -dontwarn com.squareup.haha.perflib.**
  188. -dontwarn com.squareup.haha.trove.**
  189. -dontwarn com.squareup.leakcanary.**
  190. -keep class com.squareup.haha.** { *; }
  191. -keep class com.squareup.leakcanary.** { *; }
  192. # Marshmallow removed Notification.setLatestEventInfo()
  193. -dontwarn android.app.Notification
  194. # FastJson 混淆代码
  195. -dontwarn com.alibaba.fastjson.**
  196. -keep class com.alibaba.fastjson.** { *; }
  197. -keepattributes Signature
  198. -keepattributes *Annotation*