proguard-rules.pro 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. # keep javascript注释的方法,使用到webview js回调方法的需要添加此配置
  39. -keepclassmembers class * {
  40. @android.webkit.JavascriptInterface <methods>;
  41. }
  42. # #保留内部接口或内部类、内部类、泛型签名类型
  43. -keepattributes Exceptions,InnerClasses,Signature
  44. # 将崩溃日志文件来源重命名为"SourceFile"
  45. -renamesourcefileattribute SourceFile
  46. # 产生有用的混淆堆栈跟踪
  47. -keepattributes SourceFile,LineNumberTable
  48. # 保留注释
  49. -keepattributes *Annotation*
  50. # 保留函数的参数名
  51. -keepparameternames
  52. -keepnames class * implements java.io.Serializable
  53. -keepclassmembers class * implements java.io.Serializable {
  54. static final long serialVersionUID;
  55. private static final java.io.ObjectStreamField[] serialPersistentFields;
  56. !static !transient <fields>;
  57. private void writeObject(java.io.ObjectOutputStream);
  58. private void readObject(java.io.ObjectInputStream);
  59. java.lang.Object writeReplace();
  60. java.lang.Object readResolve();
  61. }
  62. -keepclassmembers class **.R$* {
  63. public static <fields>;
  64. }
  65. -keep class **.R$* {
  66. *;
  67. }
  68. -keep public class * extends android.app.Activity{
  69. public <fields>;
  70. public <methods>;
  71. }
  72. -keep public class * extends android.app.Application{
  73. public <fields>;
  74. public <methods>;
  75. }
  76. -keep public class * extends android.app.Service
  77. -keep public class * extends android.content.BroadcastReceiver
  78. -keep public class * extends android.content.ContentProvider
  79. -keep public class * extends android.app.backup.BackupAgentHelper
  80. -keep public class * extends android.preference.Preference
  81. -keepclassmembers enum * {
  82. public static **[] values();
  83. public static ** valueOf(java.lang.String);
  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. -keepclasseswithmembernames class *{
  92. native <methods>;
  93. }
  94. -keep class * implements android.os.Parcelable {
  95. public static final android.os.Parcelable$Creator *;
  96. }
  97. -keepclasseswithmembers class * {
  98. ... *JNI*(...);
  99. }
  100. -keepclasseswithmembernames class * {
  101. ... *JRI*(...);
  102. }
  103. -keep class **JNI* {*;}
  104. # 保留native方法
  105. -keepclasseswithmembernames class * {
  106. native <methods>;
  107. }
  108. # keep R文件的静态字段
  109. -keepclassmembers class **.R$* {
  110. public static <fields>;
  111. }
  112. -keeppackagenames cn.yyxx.eyuancomm.core.**
  113. -keep class cn.yyxx.eyuancomm.core.EYuanGameSdk{public <fields>; public <methods>;}
  114. -keep class cn.yyxx.eyuancomm.core.EYuanGameSdk$Companion{public <fields>; public <methods>;}
  115. -keep class cn.yyxx.eyuancomm.core.impl.SdkJsImpl{*;}
  116. -keep class cn.yyxx.eyuancomm.core.impl.floatball.FloatCenterService{public<fields>;public<methods>;}