proguard-rules.pro 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 7
  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. # 保留内部类
  39. -keepattributes Exceptions,InnerClasses
  40. # 保留泛型
  41. -keepattributes Signature
  42. -keep class kotlin.** { *; }
  43. -keep class kotlin.Metadata { *; }
  44. -dontwarn kotlin.**
  45. -keepclassmembers class **$WhenMappings {
  46. <fields>;
  47. }
  48. -keepclassmembers class kotlin.Metadata {
  49. public <methods>;
  50. }
  51. -assumenosideeffects class kotlin.jvm.internal.Intrinsics {
  52. static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
  53. }
  54. -keepnames class * implements java.io.Serializable
  55. -keepclassmembers class * implements java.io.Serializable {
  56. static final long serialVersionUID;
  57. private static final java.io.ObjectStreamField[] serialPersistentFields;
  58. !static !transient <fields>;
  59. private void writeObject(java.io.ObjectOutputStream);
  60. private void readObject(java.io.ObjectInputStream);
  61. java.lang.Object writeReplace();
  62. java.lang.Object readResolve();
  63. }
  64. -keepclassmembers class **.R$* {
  65. public static <fields>;
  66. }
  67. -keep class **.R$* {
  68. *;
  69. }
  70. -keep public class * extends android.app.Activity{
  71. public <fields>;
  72. public <methods>;
  73. }
  74. -keep public class * extends android.app.Application{
  75. public <fields>;
  76. public <methods>;
  77. }
  78. -keep public class * extends android.app.Service
  79. -keep public class * extends android.content.BroadcastReceiver
  80. -keep public class * extends android.content.ContentProvider
  81. -keep public class * extends android.app.backup.BackupAgentHelper
  82. -keep public class * extends android.preference.Preference
  83. -keep public class * extends androidx.core.app.CoreComponentFactory
  84. -keepclassmembers enum * {
  85. public static **[] values();
  86. public static ** valueOf(java.lang.String);
  87. }
  88. -keepclasseswithmembers class * {
  89. public <init>(android.content.Context, android.util.AttributeSet);
  90. }
  91. -keepclasseswithmembers class * {
  92. public <init>(android.content.Context, android.util.AttributeSet, int);
  93. }
  94. -keepclasseswithmembernames class *{
  95. native <methods>;
  96. }
  97. -keep class * implements android.os.Parcelable {
  98. public static final android.os.Parcelable$Creator *;
  99. }
  100. -keepclasseswithmembers class * {
  101. ... *JNI*(...);
  102. }
  103. -keepclasseswithmembernames class * {
  104. ... *JRI*(...);
  105. }
  106. -keep class **JNI* {*;}
  107. -keep class com.tencent.mmkv.**{*;}
  108. -keep class cn.yyxx.support.**{*;}
  109. -keep class com.dolin.zap.**{*;}
  110. -keep class cn.yyxx.eyuangame.base.**{*;}
  111. -keep class cn.yyxx.eyuangame.Version{public <fields>; public <methods>;}
  112. -keep class cn.yyxx.eyuangame.core.internal.IJsCallback{public <fields>; public <methods>;}
  113. -keep class cn.yyxx.eyuangame.core.SdkBridge{public <fields>; public <methods>;}
  114. -keep class cn.yyxx.eyuangame.core.impl.SdkDrive{public <fields>; public <methods>;}
  115. # firebase
  116. -keepattributes SourceFile,LineNumberTable # Keep file names and line numbers.
  117. -keep public class * extends java.lang.Exception # Optional: Keep custom exceptions.