proguard-rules.pro 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. # 代码混淆压缩比,在0~7之间,默认为5,一般不做修改
  20. -optimizationpasses 5
  21. # 混合时不使用大小写混合,混合后的类名为小写
  22. -dontusemixedcaseclassnames
  23. # 指定不去忽略非公共库的类
  24. -dontskipnonpubliclibraryclasses
  25. -dontoptimize
  26. # 这句话能够使我们的项目混淆后产生映射文件
  27. # 包含有类名->混淆后类名的映射关系
  28. -verbose
  29. -ignorewarnings
  30. # 指定不去忽略非公共库的类成员
  31. -dontskipnonpubliclibraryclassmembers
  32. # 指定混淆是采用的算法,后面的参数是一个过滤器
  33. # 这个过滤器是谷歌推荐的算法,一般不做更改
  34. -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  35. # 保留java与js交互注解
  36. -keepattributes *Annotation*
  37. -keepattributes *JavascriptInterface*
  38. #保留JavascriptInterface中的方法
  39. -keepclassmembers class * {
  40. @android.webkit.JavascriptInterface <methods>;
  41. }
  42. # 保留内部类
  43. -keepattributes Exceptions,InnerClasses
  44. # 保留泛型
  45. -keepattributes Signature
  46. -keep class kotlin.** { *; }
  47. -keep class kotlin.Metadata { *; }
  48. -dontwarn kotlin.**
  49. -keepclassmembers class **$WhenMappings {
  50. <fields>;
  51. }
  52. -keepclassmembers class kotlin.Metadata {
  53. public <methods>;
  54. }
  55. -assumenosideeffects class kotlin.jvm.internal.Intrinsics {
  56. static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
  57. }
  58. -keepnames class * implements java.io.Serializable
  59. -keepclassmembers class * implements java.io.Serializable {
  60. static final long serialVersionUID;
  61. private static final java.io.ObjectStreamField[] serialPersistentFields;
  62. !static !transient <fields>;
  63. private void writeObject(java.io.ObjectOutputStream);
  64. private void readObject(java.io.ObjectInputStream);
  65. java.lang.Object writeReplace();
  66. java.lang.Object readResolve();
  67. }
  68. -keepclassmembers class **.R$* {
  69. public static <fields>;
  70. }
  71. -keep class **.R$* {
  72. *;
  73. }
  74. -keep public class * extends android.app.Activity{
  75. public <fields>;
  76. public <methods>;
  77. }
  78. -keep public class * extends android.app.Application{
  79. public <fields>;
  80. public <methods>;
  81. }
  82. -keep public class * extends android.app.Service
  83. -keep public class * extends android.content.BroadcastReceiver
  84. -keep public class * extends android.content.ContentProvider
  85. -keep public class * extends android.app.backup.BackupAgentHelper
  86. -keep public class * extends android.preference.Preference
  87. -keep public class * extends androidx.core.app.CoreComponentFactory
  88. -keepclassmembers enum * {
  89. public static **[] values();
  90. public static ** valueOf(java.lang.String);
  91. }
  92. -keepclasseswithmembers class * {
  93. public <init>(android.content.Context, android.util.AttributeSet);
  94. }
  95. -keepclasseswithmembers class * {
  96. public <init>(android.content.Context, android.util.AttributeSet, int);
  97. }
  98. -keepclasseswithmembernames class *{
  99. native <methods>;
  100. }
  101. -keep class * implements android.os.Parcelable {
  102. public static final android.os.Parcelable$Creator *;
  103. }
  104. -keepclasseswithmembers class * {
  105. ... *JNI*(...);
  106. }
  107. -keepclasseswithmembernames class * {
  108. ... *JRI*(...);
  109. }
  110. -keep class **JNI* {*;}
  111. -keep class cn.yyxx.commsdk.impl.merge.platform.SdkPlatformBridge{public <fields>; public<methods>;}
  112. -keep class cn.yyxx.commsdk.impl.merge.platform.hnqj.action.**{public <fields>; public<methods>;}
  113. -keep class cn.yyxx.commsdk.impl.merge.platform.msa.MsaDeviceHandler{public <fields>; public<methods>;}
  114. -dontshrink
  115. # support sdk
  116. -keep class cn.yyxx.support.**{*;}
  117. # base sdk
  118. -keep class cn.qingshi.gamesdk.base.**{*;}
  119. # msa sdk
  120. -keep class XI.**{*;}
  121. -keep class com.asus.**{*;}
  122. -keep class com.bun.**{*;}
  123. -keep class com.huawei.hms.ads.identifier.**{*;}
  124. -keep class com.samsung.android.deviceidservice.**{*;}
  125. -keep class com.netease.nis.sdkwrapper.** {*;}
  126. -keep class com.zui.**{*;}
  127. -keep class org.json.**{*;}
  128. # authsdk
  129. -keep class com.alibaba.**{*;}
  130. -keep class com.cmic.**{*;}
  131. -keep class com.mobile.**{*;}
  132. -keep class com.nirvana.**{*;}
  133. # mmkv
  134. -keep class com.tencent.mmkv.**{*;}
  135. # zap
  136. -keep class com.dolin.zap.**{*;}
  137. # v4-support
  138. -keep class android.support.**{*;}