proguard-android-optimize.txt-8.0.0 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 AnnotationDefault,
  22. EnclosingMethod,
  23. InnerClasses,
  24. RuntimeVisibleAnnotations,
  25. RuntimeVisibleParameterAnnotations,
  26. RuntimeVisibleTypeAnnotations,
  27. Signature
  28. -keep public class com.google.vending.licensing.ILicensingService
  29. -keep public class com.android.vending.licensing.ILicensingService
  30. -keep public class com.google.android.vending.licensing.ILicensingService
  31. -dontnote com.android.vending.licensing.ILicensingService
  32. -dontnote com.google.vending.licensing.ILicensingService
  33. -dontnote com.google.android.vending.licensing.ILicensingService
  34. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
  35. -keepclasseswithmembernames,includedescriptorclasses class * {
  36. native <methods>;
  37. }
  38. # Keep setters in Views so that animations can still work.
  39. -keepclassmembers public class * extends android.view.View {
  40. void set*(***);
  41. *** get*();
  42. }
  43. # We want to keep methods in Activity that could be used in the XML attribute onClick.
  44. -keepclassmembers class * extends android.app.Activity {
  45. public void *(android.view.View);
  46. }
  47. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
  48. -keepclassmembers enum * {
  49. public static **[] values();
  50. public static ** valueOf(java.lang.String);
  51. }
  52. -keepclassmembers class * implements android.os.Parcelable {
  53. public static final ** CREATOR;
  54. }
  55. # Preserve annotated Javascript interface methods.
  56. -keepclassmembers class * {
  57. @android.webkit.JavascriptInterface <methods>;
  58. }
  59. # The support libraries contains references to newer platform versions.
  60. # Don't warn about those in case this app is linking against an older
  61. # platform version. We know about them, and they are safe.
  62. -dontnote android.support.**
  63. -dontnote androidx.**
  64. -dontwarn android.support.**
  65. -dontwarn androidx.**
  66. # This class is deprecated, but remains for backward compatibility.
  67. -dontwarn android.util.FloatMath
  68. # Understand the @Keep support annotation.
  69. -keep class android.support.annotation.Keep
  70. -keep class androidx.annotation.Keep
  71. -keep @android.support.annotation.Keep class * {*;}
  72. -keep @androidx.annotation.Keep class * {*;}
  73. -keepclasseswithmembers class * {
  74. @android.support.annotation.Keep <methods>;
  75. }
  76. -keepclasseswithmembers class * {
  77. @androidx.annotation.Keep <methods>;
  78. }
  79. -keepclasseswithmembers class * {
  80. @android.support.annotation.Keep <fields>;
  81. }
  82. -keepclasseswithmembers class * {
  83. @androidx.annotation.Keep <fields>;
  84. }
  85. -keepclasseswithmembers class * {
  86. @android.support.annotation.Keep <init>(...);
  87. }
  88. -keepclasseswithmembers class * {
  89. @androidx.annotation.Keep <init>(...);
  90. }
  91. # These classes are duplicated between android.jar and org.apache.http.legacy.jar.
  92. -dontnote org.apache.http.**
  93. -dontnote android.net.http.**
  94. # These classes are duplicated between android.jar and core-lambda-stubs.jar.
  95. -dontnote java.lang.invoke.**