proguard-android-optimize.txt-4.1.3 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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,includedescriptorclasses 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. # Preserve annotated Javascript interface methods.
  50. -keepclassmembers class * {
  51. @android.webkit.JavascriptInterface <methods>;
  52. }
  53. # The support libraries contains references to newer platform versions.
  54. # Don't warn about those in case this app is linking against an older
  55. # platform version. We know about them, and they are safe.
  56. -dontnote android.support.**
  57. -dontnote androidx.**
  58. -dontwarn android.support.**
  59. -dontwarn androidx.**
  60. # This class is deprecated, but remains for backward compatibility.
  61. -dontwarn android.util.FloatMath
  62. # Understand the @Keep support annotation.
  63. -keep class android.support.annotation.Keep
  64. -keep class androidx.annotation.Keep
  65. -keep @android.support.annotation.Keep class * {*;}
  66. -keep @androidx.annotation.Keep class * {*;}
  67. -keepclasseswithmembers class * {
  68. @android.support.annotation.Keep <methods>;
  69. }
  70. -keepclasseswithmembers class * {
  71. @androidx.annotation.Keep <methods>;
  72. }
  73. -keepclasseswithmembers class * {
  74. @android.support.annotation.Keep <fields>;
  75. }
  76. -keepclasseswithmembers class * {
  77. @androidx.annotation.Keep <fields>;
  78. }
  79. -keepclasseswithmembers class * {
  80. @android.support.annotation.Keep <init>(...);
  81. }
  82. -keepclasseswithmembers class * {
  83. @androidx.annotation.Keep <init>(...);
  84. }
  85. # These classes are duplicated between android.jar and org.apache.http.legacy.jar.
  86. -dontnote org.apache.http.**
  87. -dontnote android.net.http.**
  88. # These classes are duplicated between android.jar and core-lambda-stubs.jar.
  89. -dontnote java.lang.invoke.**