proguard-rules.pro 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. -obfuscationdictionary bt-proguard.txt
  20. -classobfuscationdictionary bt-proguard.txt
  21. -packageobfuscationdictionary bt-proguard.txt
  22. -dontusemixedcaseclassnames
  23. -dontskipnonpubliclibraryclasses
  24. -verbose
  25. -optimizationpasses 5
  26. -dontskipnonpubliclibraryclassmembers
  27. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  28. -ignorewarnings
  29. -keepattributes Exceptions
  30. -keepattributes InnerClasses
  31. -keepattributes *Annotation*
  32. -keepattributes JavascriptInterface
  33. -keepattributes Signature
  34. -keepattributes RuntimeVisibleAnnotations
  35. -keepattributes SourceFile
  36. -keepattributes LineNumberTable
  37. #native
  38. -keepclasseswithmembers class * {
  39. native <methods>;
  40. }
  41. #context
  42. -keepclassmembers class * extends android.content.Context {
  43. public void *(android.view.View);
  44. public void *(android.view.MenuItem);
  45. }
  46. #Parcelable
  47. -keep class * implements android.os.Parcelable {
  48. public static final android.os.Parcelable$Creator *;
  49. }
  50. -keepclassmembers class * implements android.os.Parcelable {
  51. public static final android.os.Parcelable$Creator CREATOR;
  52. }
  53. -keepclassmembers class * implements android.os.Parcelable {
  54. static ** CREATOR;
  55. <fields>;
  56. <methods>;
  57. }
  58. #Serializable
  59. -keep class * implements java.io.Serializable {
  60. *;
  61. }
  62. -keepclassmembers class * implements java.io.Serializable {
  63. static final long serialVersionUID;
  64. private static final java.io.ObjectStreamField[] serialPersistentFields;
  65. !static !transient <fields>;
  66. private void writeObject(java.io.ObjectOutputStream);
  67. private void readObject(java.io.ObjectInputStream);
  68. java.lang.Object writeReplace();
  69. java.lang.Object readResolve();
  70. }
  71. -keepclassmembers class * {
  72. public <init>(org.json.JSONObject);
  73. }
  74. #View相关
  75. -keepclassmembers public class * extends android.view.View {
  76. void set*(***);
  77. *** get*();
  78. }
  79. -keep public class * extends android.view.View {
  80. public <init>(android.content.Context, android.util.AttributeSet);
  81. public <init>(android.content.Context, android.util.AttributeSet, int);
  82. public <init>(android.content.Context, android.util.AttributeSet, int, int);
  83. public void set*(...);
  84. }
  85. -keepclasseswithmembers class * {
  86. public <init>(android.content.Context, android.util.AttributeSet);
  87. }
  88. -keepclasseswithmembers class * {
  89. public <init>(android.content.Context, android.util.AttributeSet, int);
  90. }
  91. -keepclassmembers class * extends android.app.Activity {
  92. public void *(android.view.View);
  93. }
  94. #Enum
  95. -keepclassmembers enum * {
  96. public static **[] values();
  97. public static ** valueOf(java.lang.String);
  98. public static ** valueOf(int);
  99. }
  100. #Resource
  101. -keepclassmembers class **.R$* {
  102. public static <fields>;
  103. }
  104. -keep class **.R$* {*;}
  105. -keep class **.R{*;}
  106. -dontwarn **.R$*
  107. #keep
  108. -keep class androidx.annotation.Keep
  109. -keep @androidx.annotation.Keep class * {*;}
  110. -keepclasseswithmembers class * {
  111. @androidx.annotation.Keep <methods>;
  112. }
  113. -keepclasseswithmembers class * {
  114. @androidx.annotation.Keep <fields>;
  115. }
  116. -keepclasseswithmembers class * {
  117. @androidx.annotation.Keep <init>(...);
  118. }
  119. #android component
  120. -keep public class * extends android.app.Activity
  121. -keep public class * extends android.app.Application
  122. -keep public class * extends android.app.Service
  123. -keep public class * extends android.content.BroadcastReceiver
  124. -keep public class * extends android.content.ContentProvider
  125. -keep public class * extends android.preference.Preference
  126. -keep public class * extends android.app.backup.BackupAgentHelper
  127. #LOG
  128. #xlog
  129. -keep class com.tencent.mars.xlog.** {*;}
  130. -assumenosideeffects class android.util.Log {
  131. public static *** println(...);
  132. public static *** wtf(...);
  133. }
  134. -assumenosideeffects class * extends java.lang.Throwable {
  135. public void printStackTrace();
  136. }
  137. #Rxjava@1.1.9
  138. -dontwarn sun.misc.**
  139. -dontwarn rx.**
  140. -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
  141. long producerIndex;
  142. long consumerIndex;
  143. }
  144. -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
  145. rx.internal.util.atomic.LinkedQueueNode producerNode;
  146. }
  147. -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
  148. rx.internal.util.atomic.LinkedQueueNode consumerNode;
  149. }
  150. #supportV4
  151. -keep public class android.support.v4.content.LocalBroadcastManager{*;}
  152. -dontwarn android.support.v4.**
  153. -keep public class * extends android.support.v4.app.** { *; }
  154. -keep public class * extends android.app.Fragment{ *; }
  155. -keep public class * extends androidx.fragment.app.Fragment { *; }
  156. -keep public class android.support.v4.app.**{ *; }
  157. -keep public class android.support.v4.media.**{ *; }
  158. -keep class androidx.annotation.** { *; }
  159. -dontwarn androidx.annotation.**
  160. #okhttp
  161. -dontwarn okhttp3.**
  162. -dontwarn okio.**
  163. -dontnote retrofit2.Platform
  164. # Gson specific classes
  165. -keep class sun.misc.Unsafe { *; }
  166. -keep class com.google.gson.stream.** { *; }
  167. -keep class com.google.gson.examples.android.model.** { *; }
  168. -keep class * implements com.google.gson.TypeAdapterFactory
  169. -keep class * implements com.google.gson.JsonSerializer
  170. -keep class * implements com.google.gson.JsonDeserializer
  171. -keepclassmembers,allowobfuscation class * {
  172. @com.google.gson.annotations.SerializedName <fields>;
  173. }
  174. #gms
  175. -keep class * extends java.util.ListResourceBundle {
  176. protected Object[][] getContents();
  177. }
  178. -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
  179. public static final *** NULL;
  180. }
  181. -keepnames @com.google.android.gms.common.annotation.KeepName class *
  182. -keepclassmembernames class * {
  183. @com.google.android.gms.common.annotation.KeepName *;
  184. }
  185. -keepnames class * implements android.os.Parcelable {
  186. public static final ** CREATOR;
  187. }
  188. #webkit
  189. -keepclassmembers class * extends android.webkit.WebChromeClient {
  190. public void openFileChooser(...);
  191. public void onShowFileChooser(...);
  192. }
  193. -keepclassmembers class * {
  194. @android.webkit.JavascriptInterface <methods>;
  195. }
  196. #来电浮窗代码
  197. -keep interface com.android.internal.telephony.ITelephony {* ;}
  198. #google installreferrer
  199. -dontwarn com.appsflyer.**
  200. -dontwarn com.android.installreferrer
  201. -keep class com.appsflyer.** { *;}
  202. # thinR
  203. -keepclassmembers class **.R$* {
  204. public static <fields>;
  205. }
  206. -keep class **.R {*;}
  207. -keep class **.R$* {*;}
  208. -keep class **.R$*
  209. -keep class **.R
  210. -keepclassmembers class **.R2$* {
  211. public static <fields>;
  212. }
  213. -keep class **.R2 {*;}
  214. -keep class **.R2$* {*;}
  215. -keep class **.R2$*
  216. -keep class **.R2
  217. -dontpreverify
  218. -keepclassmembers class * {
  219. void *(**On*Event);
  220. }
  221. -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
  222. #router
  223. -keep public class * implements com.adealink.frame.router.IBinder
  224. -keep public class * implements com.adealink.frame.router.IInterceptor
  225. -keep interface com.adealink.frame.router.IRouterInit
  226. -keep class * implements com.adealink.frame.router.IRouterInit
  227. #spi
  228. -keep class * implements com.adealink.frame.aab.IService
  229. # com.opensource.svgaplayer
  230. -keep class com.squareup.wire.** {*;}
  231. -keep class com.opensource.svgaplayer.proto.* {*;}
  232. #fresco
  233. -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
  234. -keep,allowobfuscation @interface com.facebook.soloader.DoNotOptimize
  235. -keep @com.facebook.common.internal.DoNotStrip class *
  236. -keepclassmembers class * {
  237. @com.facebook.common.internal.DoNotStrip *;
  238. }
  239. -keep @com.facebook.soloader.DoNotOptimize class *
  240. -keepclassmembers class * {
  241. @com.facebook.soloader.DoNotOptimize *;
  242. }
  243. -keepclassmembers class com.facebook.** {
  244. native <methods>;
  245. }
  246. -keep public class com.facebook.soloader.SoLoader {
  247. public static void init(android.content.Context, int);
  248. }
  249. -dontwarn okio.**
  250. -dontwarn com.squareup.okhttp.**
  251. -dontwarn okhttp3.**
  252. -dontwarn javax.annotation.**
  253. -dontwarn com.android.volley.toolbox.**
  254. -dontwarn com.facebook.infer.**
  255. #aliyun oss
  256. -keep class com.alibaba.sdk.android.oss.** { *; }
  257. -dontwarn okio.**
  258. -dontwarn org.apache.commons.codec.binary.**
  259. #refrofit
  260. -keepattributes Signature, InnerClasses, EnclosingMethod
  261. -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
  262. -keepclassmembers,allowshrinking,allowobfuscation interface * {
  263. @retrofit2.http.* <methods>;
  264. }
  265. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  266. -dontwarn kotlin.Unit
  267. -dontwarn retrofit2.KotlinExtensions
  268. -dontwarn retrofit2.KotlinExtensions$*
  269. -if interface * { @retrofit2.http.* <methods>; }
  270. -keep,allowobfuscation interface <1>
  271. #websocket
  272. -if interface * {
  273. @com.adealink.frame.network.socket.annotation.* <methods>;
  274. }
  275. -keep,allowobfuscation interface <1>
  276. -keepclassmembers,allowshrinking,allowobfuscation interface * {
  277. @com.adealink.frame.network.socket.annotation.* <methods>;
  278. }
  279. -keep class com.adealink.frame.network.socket.annotation.* { *; }
  280. #agora
  281. -keep class io.agora.**{*;}
  282. #error
  283. -keep public class * extends com.adealink.frame.base.IError { *; }
  284. #java mail
  285. -keep class javamail.** {*;}
  286. -keep class javax.mail.** {*;}
  287. -keep class javax.activation.** {*;}
  288. -keep class com.sun.mail.dsn.** {*;}
  289. -keep class com.sun.mail.handlers.** {*;}
  290. -keep class com.sun.mail.smtp.** {*;}
  291. -keep class com.sun.mail.util.** {*;}
  292. -keep class mailcap.** {*;}
  293. -keep class mimetypes.** {*;}
  294. -keep class myjava.awt.datatransfer.** {*;}
  295. -keep class org.apache.harmony.awt.** {*;}
  296. -keep class org.apache.harmony.misc.** {*;}
  297. #qttaudio
  298. -keep class com.qttaudio.**{*;}
  299. #trtc
  300. -keep class com.tencent.** { *; }
  301. #apm
  302. -keepclassmembers public class * extends com.adealink.frame.apm.core.base.MonitorEvent {
  303. <fields>;
  304. }
  305. #fcm
  306. -keep public class com.google.firebase.messaging.FirebaseMessagingService {
  307. public *;
  308. }
  309. #cocos
  310. # Proguard Cocos2d-x-lite for release
  311. -keep public class com.cocos.** { *; }
  312. -dontwarn com.cocos.**
  313. -keep public class com.google.** { *; }
  314. -keep class com.adealink.frame.game.GameNativeBridge { *; }
  315. # Banner
  316. -dontwarn androidx.viewpager2.**
  317. -keep class androidx.viewpager2.** {*;}
  318. -dontwarn androidx.recyclerview.widget.RecyclerView
  319. -keep class androidx.recyclerview.widget.RecyclerView{*;}
  320. -dontwarn com.youth.banner.**
  321. -keep class com.youth.banner.** {*;}