proguard-rules.pro 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. -keep public class * extends android.app.Activity #所有activity的子类不要去混淆
  20. -keep public class * extends android.app.Application
  21. -keep public class * extends android.app.Service
  22. -keep public class * extends android.content.BroadcastReceiver
  23. -keep public class * extends android.content.ContentProvider
  24. -keep public class * extends android.app.backup.BackupAgentHelper
  25. -keep public class * extends android.preference.Preference
  26. -keepclasseswithmembernames class * {
  27. native <methods>; #保持 native 的方法不去混淆
  28. }
  29. -keepclasseswithmembers class * {
  30. public <init>(android.content.Context, android.util.AttributeSet); #保持自定义控件类不被混淆,指定格式的构造方法不去混淆
  31. }
  32. -keep public class * extends android.view.View { #保持自定义控件指定规则的方法不被混淆
  33. public <init>(android.content.Context);
  34. public <init>(android.content.Context, android.util.AttributeSet);
  35. public <init>(android.content.Context, android.util.AttributeSet, int);
  36. public void set*(...);
  37. }
  38. -keep class * implements android.os.Parcelable { #保持 Parcelable 不被混淆(aidl文件不能去混淆)
  39. public static final android.os.Parcelable$Creator *;
  40. }
  41. -keepnames class * implements java.io.Serializable #需要序列化和反序列化的类不能被混淆(注:Java反射用到的类也不能被混淆)
  42. -keepattributes *Annotation* #假如项目中有用到注解,应加入这行配置
  43. -keepattributes Signature #过滤泛型(不写可能会出现类型转换错误,一般情况把这个加上就是了)
  44. ##################################################################
  45. # 下面都是项目中引入的第三方 jar 包。第三方 jar 包中的代码不是我们的目标和关心的对象,故而对此我们全部忽略不进行混淆。
  46. ##################################################################
  47. # okhttpUtils 的混淆
  48. #okhttputils
  49. -dontwarn com.zhy.http.**
  50. -keep class com.zhy.http.**{*;}
  51. #okhttp
  52. -dontwarn okhttp3.**
  53. -keep class okhttp3.**{*;}
  54. #okio
  55. -dontwarn okio.**
  56. -keep class okio.**{*;}
  57. -dontwarn com.google.auto.**
  58. -keep class com.google.auto.**{*;}
  59. -dontwarn com.google.common.**
  60. -keep class com.google.common.**{*;}
  61. -keep class com.alipay.android.app.IAlixPay{*;}
  62. -keep class com.alipay.android.app.IAlixPay$Stub{*;}
  63. -keep class com.alipay.android.app.IRemoteServiceCallback{*;}
  64. -keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
  65. -keep class com.alipay.sdk.app.PayTask{ public *;}
  66. -keep class com.alipay.sdk.app.AuthTask{ public *;}
  67. -keep class com.alipay.sdk.app.H5PayCallback {
  68. <fields>;
  69. <methods>;
  70. }
  71. -keep class com.alipay.android.phone.mrpc.core.** { *; }
  72. -keep class com.alipay.apmobilesecuritysdk.** { *; }
  73. -keep class com.alipay.mobile.framework.service.annotation.** { *; }
  74. -keep class com.alipay.mobilesecuritysdk.face.** { *; }
  75. -keep class com.alipay.tscenter.biz.rpc.** { *; }
  76. -keep class org.json.alipay.** { *; }
  77. -keep class com.alipay.tscenter.** { *; }
  78. -keep class com.ta.utdid2.** { *;}
  79. -keep class com.ut.device.** { *;}
  80. -keep class com.just.agentweb.** {
  81. *;
  82. }
  83. -dontwarn com.just.agentweb.**
  84. -keepclassmembers class com.just.agentweb.sample.common.AndroidInterface{ *; }
  85. -dontwarn com.tencent.bugly.**
  86. -keep public class com.tencent.bugly.**{*;}
  87. -keep class com.github.mikephil.charting.** { *; }