proguard-rules.pro 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. -keepnames class * implements java.io.Serializable
  43. -keepclassmembers class * implements java.io.Serializable {
  44. static final long serialVersionUID;
  45. private static final java.io.ObjectStreamField[] serialPersistentFields;
  46. !static !transient <fields>;
  47. private void writeObject(java.io.ObjectOutputStream);
  48. private void readObject(java.io.ObjectInputStream);
  49. java.lang.Object writeReplace();
  50. java.lang.Object readResolve();
  51. }
  52. -keepclassmembers class **.R$* {
  53. public static <fields>;
  54. }
  55. -keep class **.R$* {
  56. *;
  57. }
  58. -keep public class * extends android.app.Activity{
  59. public <fields>;
  60. public <methods>;
  61. }
  62. -keep public class * extends android.app.Application{
  63. public <fields>;
  64. public <methods>;
  65. }
  66. -keep public class * extends android.app.Service
  67. -keep public class * extends android.content.BroadcastReceiver
  68. -keep public class * extends android.content.ContentProvider
  69. -keep public class * extends android.app.backup.BackupAgentHelper
  70. -keep public class * extends android.preference.Preference
  71. -keepclassmembers enum * {
  72. public static **[] values();
  73. public static ** valueOf(java.lang.String);
  74. }
  75. -keepclasseswithmembers class * {
  76. public <init>(android.content.Context, android.util.AttributeSet);
  77. }
  78. -keepclasseswithmembers class * {
  79. public <init>(android.content.Context, android.util.AttributeSet, int);
  80. }
  81. -keepclasseswithmembernames class *{
  82. native <methods>;
  83. }
  84. -keep class * implements android.os.Parcelable {
  85. public static final android.os.Parcelable$Creator *;
  86. }
  87. -keepclasseswithmembers class * {
  88. ... *JNI*(...);
  89. }
  90. -keepclasseswithmembernames class * {
  91. ... *JRI*(...);
  92. }
  93. -keep class **JNI* {*;}
  94. -keep class com.dolin.zap.Version{public <fields>;public <methods>;}
  95. -keep class com.dolin.zap.Zap{public <fields>;public <methods>;}
  96. -keep class com.dolin.zap.impl.Record2MMap{*;}
  97. -keep class com.dolin.zap.entity.Level{*;}
  98. -keep class com.dolin.zap.entity.Config{public <fields>;public <methods>;}
  99. -keep class com.dolin.zap.entity.Config$Builder{public <fields>;public <methods>;}