proguard-android-optimize.txt-3.6.1 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # This is a configuration file for ProGuard.
  2. # http://proguard.sourceforge.net/index.html#manual/usage.html
  3. #
  4. # Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
  5. # the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
  6. # will be ignored by new version of the Android plugin for Gradle.
  7. # Optimizations: If you don't want to optimize, use the proguard-android.txt configuration file
  8. # instead of this one, which turns off the optimization flags.
  9. # Adding optimization introduces certain risks, since for example not all optimizations performed by
  10. # ProGuard works on all versions of Dalvik. The following flags turn off various optimizations
  11. # known to have issues, but the list may not be complete or up to date. (The "arithmetic"
  12. # optimization can be used if you are only targeting Android 2.0 or later.) Make sure you test
  13. # thoroughly if you go this route.
  14. -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
  15. -optimizationpasses 5
  16. -allowaccessmodification
  17. -dontusemixedcaseclassnames
  18. -dontskipnonpubliclibraryclasses
  19. -verbose
  20. # Preserve some attributes that may be required for reflection.
  21. -keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
  22. -keep public class com.google.vending.licensing.ILicensingService
  23. -keep public class com.android.vending.licensing.ILicensingService
  24. -keep public class com.google.android.vending.licensing.ILicensingService
  25. -dontnote com.android.vending.licensing.ILicensingService
  26. -dontnote com.google.vending.licensing.ILicensingService
  27. -dontnote com.google.android.vending.licensing.ILicensingService
  28. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
  29. -keepclasseswithmembernames class * {
  30. native <methods>;
  31. }
  32. # Keep setters in Views so that animations can still work.
  33. -keepclassmembers public class * extends android.view.View {
  34. void set*(***);
  35. *** get*();
  36. }
  37. # We want to keep methods in Activity that could be used in the XML attribute onClick.
  38. -keepclassmembers class * extends android.app.Activity {
  39. public void *(android.view.View);
  40. }
  41. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
  42. -keepclassmembers enum * {
  43. public static **[] values();
  44. public static ** valueOf(java.lang.String);
  45. }
  46. -keepclassmembers class * implements android.os.Parcelable {
  47. public static final ** CREATOR;
  48. }
  49. -keepclassmembers class **.R$* {
  50. public static <fields>;
  51. }
  52. # Preserve annotated Javascript interface methods.
  53. -keepclassmembers class * {
  54. @android.webkit.JavascriptInterface <methods>;
  55. }
  56. # The support libraries contains references to newer platform versions.
  57. # Don't warn about those in case this app is linking against an older
  58. # platform version. We know about them, and they are safe.
  59. -dontnote android.support.**
  60. -dontnote androidx.**
  61. -dontwarn android.support.**
  62. -dontwarn androidx.**
  63. # This class is deprecated, but remains for backward compatibility.
  64. -dontwarn android.util.FloatMath
  65. # Understand the @Keep support annotation.
  66. -keep class android.support.annotation.Keep
  67. -keep class androidx.annotation.Keep
  68. -keep @android.support.annotation.Keep class * {*;}
  69. -keep @androidx.annotation.Keep class * {*;}
  70. -keepclasseswithmembers class * {
  71. @android.support.annotation.Keep <methods>;
  72. }
  73. -keepclasseswithmembers class * {
  74. @androidx.annotation.Keep <methods>;
  75. }
  76. -keepclasseswithmembers class * {
  77. @android.support.annotation.Keep <fields>;
  78. }
  79. -keepclasseswithmembers class * {
  80. @androidx.annotation.Keep <fields>;
  81. }
  82. -keepclasseswithmembers class * {
  83. @android.support.annotation.Keep <init>(...);
  84. }
  85. -keepclasseswithmembers class * {
  86. @androidx.annotation.Keep <init>(...);
  87. }
  88. # These classes are duplicated between android.jar and org.apache.http.legacy.jar.
  89. -dontnote org.apache.http.**
  90. -dontnote android.net.http.**
  91. # These classes are duplicated between android.jar and core-lambda-stubs.jar.
  92. -dontnote java.lang.invoke.**