proguard-project.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. # To enable ProGuard in your project, edit project.properties
  2. # to define the proguard.config property as described in that file.
  3. #
  4. # Add project specific ProGuard rules here.
  5. # By default, the flags in this file are appended to flags specified
  6. # in ${sdk.dir}/tools/proguard/proguard-android.txt
  7. # You can edit the include path and order by changing the ProGuard
  8. # include property in project.properties.
  9. #
  10. # For more details, see
  11. # http://developer.android.com/guide/developing/tools/proguard.html
  12. # Add any project specific keep options here:
  13. # If your project uses WebView with JS, uncomment the following
  14. # and specify the fully qualified class name to the JavaScript interface
  15. # class:
  16. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  17. # public *;
  18. #}
  19. #-libraryjars /libs/android-support-v4.jar
  20. #-libraryjars /libs/httpmime-4.1.1.jar
  21. -dontwarn android.support.v4.**
  22. -dontwarn com.google.android.gms.**
  23. -dontwarn javax.naming.**
  24. #-keep class com.usai.redant.camera.CameraManager
  25. #-keep class javax.naming.*
  26. #-keep class com.usai.apex.apexcrm.RAJSInterface {*;}
  27. # 保持哪些类不被混淆
  28. #继承activity,application,service,broadcastReceiver,contentprovider....不进行混淆
  29. -keep public class * extends android.app.Activity
  30. -keep public class * extends android.app.Application
  31. -keep public class * extends android.support.multidex.MultiDexApplication
  32. -keep public class * extends android.app.Service
  33. -keep public class * extends android.content.BroadcastReceiver
  34. -keep public class * extends android.content.ContentProvider
  35. -keep public class * extends android.app.backup.BackupAgentHelper
  36. -keep public class * extends android.preference.Preference
  37. -keep public class * extends android.view.View
  38. -keep class android.support.** {*;}## 保留support下的所有类及其内部类
  39. -keep public class com.google.vending.licensing.ILicensingService
  40. -keep public class com.android.vending.licensing.ILicensingService
  41. -keep class * extends com.usai.redant.rautils.base.NoProguard {*;}
  42. -keep class javax.naming.*
  43. #表示不混淆上面声明的类,最后这两个类我们基本也用不上,是接入Google原生的一些服务时使用的。
  44. #----------------------------------------------------
  45. # 保留继承的
  46. -keep public class * extends android.support.v4.**
  47. -keep public class * extends android.support.v7.**
  48. -keep public class * extends android.support.annotation.**
  49. # Remove all Verbose/Debug logging
  50. -optimizations code/removal/simple,code/removal/advanced
  51. -dontobfuscate
  52. -assumenosideeffects class android.util.Log {
  53. public static *** d(...);
  54. public static *** v(...);
  55. public static *** i(...);
  56. }
  57. #-keep class com.baidu.** {*;}
  58. #-keep class com.baidu.mapapi.** {*;}
  59. -keep class vi.com.gdi.bgl.** {*;}
  60. #-------------------------------
  61. # This is a configuration file for ProGuard.
  62. # http://proguard.sourceforge.net/index.html#manual/usage.html
  63. #
  64. # Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
  65. # the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
  66. # will be ignored by new version of the Android plugin for Gradle.
  67. # Optimizations: If you don't want to optimize, use the proguard-android.txt configuration file
  68. # instead of this one, which turns off the optimization flags.
  69. # Adding optimization introduces certain risks, since for example not all optimizations performed by
  70. # ProGuard works on all versions of Dalvik. The following flags turn off various optimizations
  71. # known to have issues, but the list may not be complete or up to date. (The "arithmetic"
  72. # optimization can be used if you are only targeting Android 2.0 or later.) Make sure you test
  73. # thoroughly if you go this route.
  74. -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
  75. -optimizationpasses 5
  76. #-allowaccessmodification
  77. -dontusemixedcaseclassnames
  78. -dontskipnonpubliclibraryclasses
  79. -verbose
  80. # Preserve some attributes that may be required for reflection.
  81. -keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
  82. -keep public class com.google.vending.licensing.ILicensingService
  83. -keep public class com.android.vending.licensing.ILicensingService
  84. -keep public class com.google.android.vending.licensing.ILicensingService
  85. -dontnote com.android.vending.licensing.ILicensingService
  86. -dontnote com.google.vending.licensing.ILicensingService
  87. -dontnote com.google.android.vending.licensing.ILicensingService
  88. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
  89. -keepclasseswithmembernames class * {
  90. native <methods>;
  91. }
  92. # Keep setters in Views so that animations can still work.
  93. -keepclassmembers public class * extends android.view.View {
  94. void set*(***);
  95. *** get*();
  96. }
  97. # We want to keep methods in Activity that could be used in the XML attribute onClick.
  98. -keepclassmembers class * extends android.app.Activity {
  99. public void *(android.view.View);
  100. }
  101. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
  102. -keepclassmembers enum * {
  103. public static **[] values();
  104. public static ** valueOf(java.lang.String);
  105. }
  106. -keepclassmembers class * implements android.os.Parcelable {
  107. public static final ** CREATOR;
  108. }
  109. -keepclassmembers class **.R$* {
  110. public static <fields>;
  111. }
  112. # Preserve annotated Javascript interface methods.
  113. -keepclassmembers class * {
  114. @android.webkit.JavascriptInterface <methods>;
  115. }
  116. # The support libraries contains references to newer platform versions.
  117. # Don't warn about those in case this app is linking against an older
  118. # platform version. We know about them, and they are safe.
  119. -dontnote android.support.**
  120. -dontnote androidx.**
  121. -dontwarn android.support.**
  122. -dontwarn androidx.**
  123. # This class is deprecated, but remains for backward compatibility.
  124. -dontwarn android.util.FloatMath
  125. # Understand the @Keep support annotation.
  126. -keep class android.support.annotation.Keep
  127. -keep class androidx.annotation.Keep
  128. -keep @android.support.annotation.Keep class * {*;}
  129. -keep @androidx.annotation.Keep class * {*;}
  130. -keepclasseswithmembers class * {
  131. @android.support.annotation.Keep <methods>;
  132. }
  133. -keepclasseswithmembers class * {
  134. @androidx.annotation.Keep <methods>;
  135. }
  136. -keepclasseswithmembers class * {
  137. @android.support.annotation.Keep <fields>;
  138. }
  139. -keepclasseswithmembers class * {
  140. @androidx.annotation.Keep <fields>;
  141. }
  142. -keepclasseswithmembers class * {
  143. @android.support.annotation.Keep <init>(...);
  144. }
  145. -keepclasseswithmembers class * {
  146. @androidx.annotation.Keep <init>(...);
  147. }
  148. # These classes are duplicated between android.jar and org.apache.http.legacy.jar.
  149. -dontnote org.apache.http.**
  150. -dontnote android.net.http.**
  151. # These classes are duplicated between android.jar and core-lambda-stubs.jar.
  152. -dontnote java.lang.invoke.**