proguard-rules.pro 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # GENERAL OPTIONS
  2. # turn on all optimizations except those that are known to cause problems on Android
  3. -optimizations !code/simplification/cast,!field/*,!class/merging/*
  4. -optimizationpasses 6
  5. -allowaccessmodification
  6. -dontpreverify
  7. -dontusemixedcaseclassnames
  8. -dontskipnonpubliclibraryclasses
  9. -keepattributes *Annotation*
  10. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
  11. -keepclasseswithmembernames class * {
  12. native <methods>;
  13. }
  14. # keep setters in Views so that animations can still work.
  15. # see http://proguard.sourceforge.net/manual/examples.html#beans
  16. -keepclassmembers public class * extends android.view.View {
  17. void set*(***);
  18. *** get*();
  19. }
  20. # We want to keep methods in Activity that could be used in the XML attribute onClick
  21. -keepclassmembers class * extends android.app.Activity {
  22. public void *(android.view.View);
  23. }
  24. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
  25. -keepclassmembers enum * {
  26. public static **[] values();
  27. public static ** valueOf(java.lang.String);
  28. }
  29. -keepclassmembers class * implements android.os.Parcelable {
  30. public static final android.os.Parcelable$Creator CREATOR;
  31. }
  32. -keepclassmembers class **.R$* {
  33. public static <fields>;
  34. }
  35. # The support library contains references to newer platform versions.
  36. # Don't warn about those in case this app is linking against an older
  37. # platform version. We know about them, and they are safe.
  38. -dontwarn android.support.**
  39. # TUSKY SPECIFIC OPTIONS
  40. ## for okhttp
  41. -dontwarn javax.annotation.**
  42. -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
  43. -dontwarn org.codehaus.mojo.animal_sniffer.*
  44. -dontwarn okhttp3.internal.platform.ConscryptPlatform
  45. ##for keep
  46. -dontwarn android.arch.util.paging.CountedDataSource
  47. -dontwarn android.arch.persistence.room.paging.LimitOffsetDataSource
  48. ## for retrofit
  49. -dontwarn retrofit2.**
  50. -keep class retrofit2.** { *; }
  51. -keepattributes Signature
  52. -keepattributes Exceptions
  53. -keepattributes *Annotation*
  54. -keepclasseswithmembers class * {
  55. @retrofit2.http.* <methods>;
  56. }
  57. -keep class com.keylesspalace.tusky.entity.** { *; }
  58. -keep public enum com.keylesspalace.tusky.entity.*$** {
  59. **[] $VALUES;
  60. public *;
  61. }
  62. # preserve line numbers for crash reporting
  63. -keepattributes SourceFile,LineNumberTable
  64. -renamesourcefileattribute SourceFile
  65. # remove all logging from production apk
  66. -assumenosideeffects class android.util.Log {
  67. public static *** getStackTraceString(...);
  68. public static *** d(...);
  69. public static *** w(...);
  70. public static *** v(...);
  71. public static *** i(...);
  72. }
  73. # remove some kotlin overhead
  74. -assumenosideeffects class kotlin.jvm.internal.Intrinsics {
  75. static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
  76. static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
  77. static void throwUninitializedPropertyAccessException(java.lang.String);
  78. }
  79. -dontwarn com.google.errorprone.annotations.*
  80. # without this emoji font downloading fails with AbstractMethodError
  81. -keep class * extends android.os.AsyncTask {
  82. public *;
  83. }
  84. # Glide
  85. -keep public class * implements com.bumptech.glide.module.GlideModule
  86. -keep public class * extends com.bumptech.glide.module.AppGlideModule
  87. -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  88. **[] $VALUES;
  89. public *;
  90. }