proguard-rules.pro 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. # Add project specific ProGuard rules here.
  2. # You can control the set of applied configuration files using the
  3. # proguardFiles setting in build.gradle.
  4. #
  5. # For more details, see
  6. # http://developer.android.com/guide/developing/tools/proguard.html
  7. # If your project uses WebView with JS, uncomment the following
  8. # and specify the fully qualified class name to the JavaScript interface
  9. # class:
  10. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  11. # public *;
  12. #}
  13. # Uncomment this to preserve the line number information for
  14. # debugging stack traces.
  15. #-keepattributes SourceFile,LineNumberTable
  16. # If you keep the line number information, uncomment this to
  17. # hide the original source file name.
  18. #-renamesourcefileattribute SourceFile
  19. -ignorewarnings
  20. ## GSON 2.2.4 specific rules ##
  21. # Gson uses generic type information stored in a class file when working with fields. Proguard
  22. # removes such information by default, so configure it to keep all of it.
  23. -keepattributes Signature
  24. # For using GSON @Expose annotation
  25. -keepattributes *Annotation*
  26. -keepattributes EnclosingMethod
  27. # Gson specific classes
  28. -keep class sun.misc.Unsafe { *; }
  29. -keep class com.google.gson.stream.** { *; }
  30. -keep public class * implements com.bumptech.glide.module.GlideModule
  31. -keep public class * extends com.bumptech.glide.module.AppGlideModule
  32. -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  33. **[] $VALUES;
  34. public *;
  35. }
  36. # Keep the support library
  37. -keep class android.support.** { *; }
  38. -keep interface android.support.** { *; }
  39. # Okio
  40. -keep class sun.misc.Unsafe { *; }
  41. -dontwarn java.nio.file.*
  42. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  43. -dontwarn okio.**
  44. -dontwarn okio.** -dontnote retrofit2.Platform -dontwarn retrofit2.Platform$Java8 -keepattributes Signature -keepattributes Exceptions -keep class com.myownpackage.models.** { *; }
  45. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  46. ########--------Retrofit + RxJava--------#########
  47. -dontwarn retrofit.**
  48. -keep class retrofit.** { *; }
  49. -dontwarn sun.misc.Unsafe
  50. -dontwarn com.octo.android.robospice.retrofit.RetrofitJackson**
  51. -dontwarn retrofit.appengine.UrlFetchClient
  52. -keepattributes Signature
  53. -keepattributes Exceptions
  54. -keepclasseswithmembers class * {
  55. @retrofit.http.* <methods>;
  56. }
  57. -keep class com.google.gson.** { *; }
  58. -keep class com.google.inject.** { *; }
  59. -keep class org.apache.http.** { *; }
  60. -keep class org.apache.james.mime4j.** { *; }
  61. -keep class javax.inject.** { *; }
  62. -keep class retrofit.** { *; }
  63. -dontwarn org.apache.http.**
  64. -dontwarn android.net.http.AndroidHttpClient
  65. -dontwarn retrofit.**
  66. -dontwarn sun.misc.**
  67. -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
  68. long producerIndex;
  69. long consumerIndex;
  70. }
  71. -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  72. long producerNode;
  73. long consumerNode;
  74. }
  75. # ALSO REMEMBER KEEPING YOUR MODEL CLASSES
  76. -keep class * extends com.billy.cc.core.component.IComponent{*;}
  77. -keep interface * implements com.ysnows.base.ccretrofit.IRoute{*;}
  78. -keep class * implements com.ysnows.base.net.IResp{*;}
  79. -keep class * implements com.ysnows.base.inter.IModel{*;}
  80. #Retrofit
  81. -dontwarn retrofit2.**
  82. -keep class retrofit2.** { *; }
  83. -keepattributes Signature
  84. -keepattributes Exceptions
  85. -keepclasseswithmembers class * {
  86. @retrofit2.http.* <methods>;
  87. }
  88. #RxJava RxAndroid
  89. -dontwarn sun.misc.**
  90. -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
  91. long producerIndex;
  92. long consumerIndex;
  93. }
  94. -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  95. rx.internal.util.atomic.LinkedQueueNode producerNode;
  96. }
  97. -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
  98. rx.internal.util.atomic.LinkedQueueNode consumerNode;
  99. }
  100. -dontwarn java.lang.invoke.*
  101. -keep class sun.misc.Unsafe { *; }
  102. # OkHttp
  103. -keepattributes Signature
  104. -keepattributes *Annotation*
  105. -keep class okhttp3.** { *; }
  106. -keep interface okhttp3.** { *; }
  107. -dontwarn okhttp3.**
  108. #glide
  109. -keep public class * implements com.bumptech.glide.module.GlideModule
  110. -keep public class * extends com.bumptech.glide.AppGlideModule
  111. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  112. **[] $VALUES;
  113. public *;
  114. }
  115. -dontwarn retrofit2.**
  116. -keep class retrofit2.** { *; }
  117. -keepattributes Signature
  118. -keepattributes Exceptions
  119. -keepclassmembers class * {
  120. public <init> (org.json.JSONObject);
  121. }
  122. -keepclassmembers enum * {
  123. public static **[] values();
  124. public static ** valueOf(java.lang.String);
  125. }
  126. -keepclassmembers class * {
  127. @android.webkit.JavascriptInterface <methods>;
  128. }
  129. #okhttp
  130. -dontwarn com.squareup.okhttp.**
  131. -keep class com.chad.library.adapter.** {
  132. *;
  133. }
  134. -keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
  135. -keep public class * extends com.chad.library.adapter.base.BaseViewHolder
  136. -keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
  137. <init>(...);
  138. }
  139. -dontwarn com.kingja.loadsir.**
  140. -keep class com.kingja.loadsir.** {*;}
  141. -dontwarn com.litesuits.orm.**
  142. -keep class com.litesuits.orm.** {*;}
  143. -dontwarn org.mozilla.javascript.**
  144. -keep class org.mozilla.javascript.** {*;}
  145. -dontwarn com.yanzhenjie.permission.**
  146. #alipay_begin
  147. -keep class com.alipay.android.app.IAlixPay{*;}
  148. -keep class com.alipay.android.app.IAlixPay$Stub{*;}
  149. -keep class com.alipay.android.app.IRemoteServiceCallback{*;}
  150. -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
  151. -keep class com.alipay.sdk.app.PayTask{ public *;}
  152. -keep class com.alipay.sdk.app.AuthTask{ public *;}
  153. -keep class com.alipay.sdk.app.H5PayCallback {
  154. <fields>;
  155. <methods>;
  156. }
  157. -keep class com.alipay.android.phone.mrpc.core.** { *; }
  158. -keep class com.alipay.apmobilesecuritysdk.** { *; }
  159. -keep class com.alipay.mobile.framework.service.annotation.** { *; }
  160. -keep class com.alipay.mobilesecuritysdk.face.** { *; }
  161. -keep class com.alipay.tscenter.biz.rpc.** { *; }
  162. -keep class org.json.alipay.** { *; }
  163. -keep class com.alipay.tscenter.** { *; }
  164. -keep class com.ta.utdid2.** { *;}
  165. -keep class com.ut.device.** { *;}
  166. #alipay_end
  167. -keep class com.hwangjr.rxbus.thread.** {*;}
  168. -keepattributes *Annotation*
  169. -keepclassmembers class ** {
  170. @com.hwangjr.rxbus.annotation.Subscribe public *;
  171. @com.hwangjr.rxbus.annotation.Produce public *;
  172. }
  173. -dontwarn com.yanzhenjie.permission.**
  174. -keep class com.chad.library.adapter.** {
  175. *;
  176. }
  177. -keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
  178. -keep public class * extends com.chad.library.adapter.base.BaseViewHolder
  179. -keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
  180. <init>(...);
  181. }
  182. -keep class com.umeng.** {*;}
  183. -keepclassmembers class * {
  184. public <init> (org.json.JSONObject);
  185. }
  186. -keepclassmembers enum * {
  187. public static **[] values();
  188. public static ** valueOf(java.lang.String);
  189. }
  190. # 穿山甲
  191. -keep class com.bytedance.sdk.openadsdk.** { *; }
  192. -keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;}
  193. -keep class com.pgl.sys.ces.* {*;}
  194. # YCWebView
  195. -keep class com.ycbjie.webviewlib.** {
  196. *;
  197. }
  198. -dontwarn com.ycbjie.webviewlib.**
  199. -renamesourcefileattribute SourceFile
  200. -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod
  201. # Preserve all annotations.
  202. -keepattributes *Annotation*
  203. # Preserve all public classes, and their public and protected fields and
  204. # methods.
  205. #-keep public class * {
  206. # public protected *;
  207. #}
  208. # Preserve all .class method names.
  209. #-keepclassmembernames class * {
  210. # java.lang.Class class$(java.lang.String);
  211. # java.lang.Class class$(java.lang.String, boolean);
  212. #}
  213. # Preserve all native method names and the names of their classes.
  214. #-keepclasseswithmembernames class * {
  215. # native <methods>;
  216. #}
  217. # Preserve the special static methods that are required in all enumeration
  218. # classes.
  219. #}
  220. #-keepclassmembers class * extends java.lang.Enum {
  221. # public static **[] values();
  222. # public static ** valueOf(java.lang.String);
  223. #
  224. ## Explicitly preserve all serialization members. The Serializable interface
  225. ## is only a marker interface, so it wouldn't save them.
  226. ## You can comment this out if your library doesn't use serialization.
  227. ## If your code contains serializable classes that have to be backward
  228. ## compatible, please refer to the manual.
  229. #
  230. #-keepclassmembers class * implements java.io.Serializable {
  231. # static final long serialVersionUID;
  232. # static final java.io.ObjectStreamField[] serialPersistentFields;
  233. # private void writeObject(java.io.ObjectOutputStream);
  234. # private void readObject(java.io.ObjectInputStream);
  235. # java.lang.Object writeReplace();
  236. # java.lang.Object readResolve();
  237. #}
  238. -keep class com.uc.* {*;}
  239. -dontwarn com.tencent.bugly.**
  240. -keep public class com.tencent.bugly.**{*;}
  241. #wx
  242. -keep class com.tencent.mm.opensdk.** {
  243. *;
  244. }
  245. -keep class com.tencent.wxop.** {
  246. *;
  247. }
  248. -keep class com.tencent.mm.sdk.** {
  249. *;
  250. }
  251. #3D 地图 V5.0.0之前:
  252. -keep class com.amap.api.maps.**{*;}
  253. -keep class com.autonavi.amap.mapcore.*{*;}
  254. -keep class com.amap.api.trace.**{*;}
  255. # 3D 地图 V5.0.0之后:
  256. -keep class com.amap.api.maps.**{*;}
  257. -keep class com.autonavi.**{*;}
  258. -keep class com.amap.api.trace.**{*;}
  259. # 定位
  260. -keep class com.amap.api.location.**{*;}
  261. -keep class com.amap.api.fence.**{*;}
  262. -keep class com.loc.**{*;}
  263. -keep class com.autonavi.aps.amapapi.model.**{*;}
  264. # 搜索
  265. -keep class com.amap.api.services.**{*;}
  266. # 2D地图
  267. -keep class com.amap.api.maps2d.**{*;}
  268. -keep class com.amap.api.mapcore2d.**{*;}
  269. #导航 V7.3.0以前:
  270. -keep class com.amap.api.navi.**{*;}
  271. -keep class com.alibaba.idst.nls.** {*;}
  272. -keep class com.nlspeech.nlscodec.** {*;}
  273. -keep class com.google.**{*;}
  274. #PictureSelector 2.0
  275. -keep class com.luck.picture.lib.** { *; }
  276. #导航 V7.3.0及以后:
  277. -keep class com.amap.api.navi.**{*;}
  278. -keep class com.alibaba.mit.alitts.*{*;}
  279. -keep class com.google.**{*;}
  280. #Ucrop
  281. -dontwarn com.yalantis.ucrop**
  282. -keep class com.yalantis.ucrop** { *; }
  283. -keep interface com.yalantis.ucrop** { *; }
  284. #Okio
  285. -dontwarn org.codehaus.mojo.animal_sniffer.*
  286. ##---------------Begin: proguard configuration for Gson ----------
  287. -keep public class com.google.gson.**
  288. -keep public class com.google.gson.** {public private protected *;}
  289. -keep public class com.project.mocha_patient.login.SignResponseData { private *; }
  290. # Application classes that will be serialized/deserialized over Gson
  291. -keep class com.hdl.xl.model.** { *; }
  292. -keep class com.ysnows.base.model.** { *; }
  293. -keep class com.ysnows.base.route.** { *; }
  294. #保持 Parcelable 不被混淆
  295. -keep class * implements android.os.Parcelable {
  296. public static final android.os.Parcelable$Creator *;
  297. }
  298. #保持 Serializable 不被混淆并且enum 类也不被混淆
  299. -keepclassmembers class * implements java.io.Serializable {
  300. static final long serialVersionUID;
  301. private static final java.io.ObjectStreamField[] serialPersistentFields;
  302. !static !transient <fields>;
  303. !private <fields>;
  304. !private <methods>;
  305. private void writeObject(java.io.ObjectOutputStream);
  306. private void readObject(java.io.ObjectInputStream);
  307. java.lang.Object writeReplace();
  308. java.lang.Object readResolve();
  309. }
  310. #保持枚举 enum 类不被混淆
  311. -keepclassmembers enum * {
  312. public static **[] values();
  313. public static ** valueOf(java.lang.String);
  314. }