PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/app/proguard-rules.pro

https://gitlab.com/zhangxiaang/CloudPrint4AndroidManager
Prolog | 126 lines | 98 code | 28 blank | 0 comment | 1 complexity | 1a36c4debf49ab42bcb96e3d77f1ca5d MD5 | raw file
  1. # Add project specific ProGuard rules here.
  2. # By default, the flags in this file are appended to flags specified
  3. # in /Users/zhangxiaang/Library/Android/sdk/tools/proguard/proguard-android.txt
  4. # You can edit the include path and order by changing the proguardFiles
  5. # directive in build.gradle.
  6. #
  7. # For more details, see
  8. # http://developer.android.com/guide/developing/tools/proguard.html
  9. # Add any project specific keep options here:
  10. # If your project uses WebView with JS, uncomment the following
  11. # and specify the fully qualified class name to the JavaScript interface
  12. # class:
  13. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  14. # public *;
  15. #}
  16. -ignorewarnings
  17. -optimizationpasses 5
  18. -dontusemixedcaseclassnames
  19. -dontskipnonpubliclibraryclasses
  20. -assumenosideeffects class android.util.Log {
  21. public static *** e(...); #forbidden all Log.e()method
  22. }
  23. # 不要去混淆 dataType里面的model fastJson是反射来获取到的吗?
  24. -keep class com.uprint.android_pack.cloudprint4androidmanager.CPBaseActivity {* ;}
  25. -keep class com.uprint.android_pack.cloudprint4androidmanager.dataType.** {* ;}
  26. -keep class com.uprint.android_pack.cloudprint4androidmanager.dataType.** {*;}
  27. -dontwarn com.uprint.android_pack.cloudprint4androidmanager.dataType.**
  28. # for butter knife 这个如果被混淆了直接导致crash因为视图无法被找到
  29. # 参考butter knife官网给出来的建议即可
  30. -keep class butterknife.** { *; }
  31. -dontwarn butterknife.internal.**
  32. -keep class **$$ViewBinder { *; }
  33. # 但是还是有部分的视图被过渡混淆了导致程序crash 继续优化
  34. -keepclasseswithmembernames class * {
  35. @butterknife.* <fields>;
  36. }
  37. -keepclasseswithmembernames class * {
  38. @butterknife.* <methods>;
  39. }
  40. # 保护第三方的jar包里面的类不要被混淆了
  41. -keep class com.hedgehog.ratingbar.** {* ;}
  42. -keep class com.github.dmytrodanylyk.android-process-button.** {* ;}
  43. -keep class com.rengwuxian.materialedittext.** {* ;}
  44. -keep class com.mcxiaoke.volley.** {* ;}
  45. -keep class de.greenrobot.** {* ;}
  46. -keep class com.android.support.** {* ;}
  47. #-keep class cn.leancloud.** {* ;}
  48. #-keep class com.avos.avoscloud.** {* ;}
  49. #-dontwarn com.avos.avoscloud.**
  50. # 保护两个fragment不要被混淆
  51. -keep class com.uprint.android_pack.cloudprint4androidmanager.fragment.** {* ;}
  52. -keep class com.uprint.android_pack.cloudprint4androidmanager.widgets.** {* ;}
  53. -keep class * implements android.os.Parcelable {
  54. public static final android.os.Parcelable$Creator *;
  55. }
  56. -keepclassmembers class * implements java.io.Serializable {
  57. static final long serialVersionUID;
  58. private static final java.io.ObjectStreamField[] serialPersistentFields;
  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. # 参考leancloud官网的混淆文件,不要乱改下面的玩意儿
  65. -keepattributes Signature
  66. -dontwarn com.jcraft.jzlib.**
  67. -keep class com.jcraft.jzlib.** { *;}
  68. -dontwarn sun.misc.**
  69. -keep class sun.misc.** { *;}
  70. -dontwarn com.alibaba.fastjson.**
  71. -keep class com.alibaba.fastjson.** { *;}
  72. -dontwarn sun.security.**
  73. -keep class sun.security.** { *; }
  74. -dontwarn com.google.**
  75. -keep class com.google.** { *;}
  76. -dontwarn com.avos.**
  77. -keep class com.avos.** { *;}
  78. -dontwarn com.avos.avoscloud.**
  79. -keep class com.avos.avoscloud.** {* ;}
  80. -keep public class android.net.http.SslError
  81. -keep public class android.webkit.WebViewClient
  82. -dontwarn android.webkit.WebView
  83. -dontwarn android.net.http.SslError
  84. -dontwarn android.webkit.WebViewClient
  85. -dontwarn android.support.**
  86. -dontwarn org.apache.**
  87. -keep class org.apache.** { *;}
  88. -dontwarn org.jivesoftware.smack.**
  89. -keep class org.jivesoftware.smack.** { *;}
  90. -dontwarn com.loopj.**
  91. -keep class com.loopj.** { *;}
  92. -dontwarn com.squareup.okhttp.**
  93. -keep class com.squareup.okhttp.** { *;}
  94. -keep interface com.squareup.okhttp.** { *; }
  95. -dontwarn okio.**
  96. -dontwarn org.xbill.**
  97. -keep class org.xbill.** { *;}
  98. -keepattributes *Annotation*