proguard-rules.pro 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Add project specific ProGuard rules here.
  2. # You can control the set of applied configuration files using the
  3. # proguardFiles setting in build.gradle.
  4. #
  5. # For more details, see
  6. # http://developer.android.com/guide/developing/tools/proguard.html
  7. # If your project uses WebView with JS, uncomment the following
  8. # and specify the fully qualified class name to the JavaScript interface
  9. # class:
  10. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  11. # public *;
  12. #}
  13. # Uncomment this to preserve the line number information for
  14. # debugging stack traces.
  15. #-keepattributes SourceFile,LineNumberTable
  16. # If you keep the line number information, uncomment this to
  17. # hide the original source file name.
  18. #-renamesourcefileattribute SourceFile
  19. -keep class * implements java.io.Serializable { *; }
  20. -keepattributes *Annotation*
  21. #### OkHttp, Retrofit and Moshi
  22. -dontwarn okhttp3.**
  23. -dontwarn retrofit2.Platform$Java8
  24. -dontwarn okio.**
  25. -dontwarn javax.annotation.**
  26. -dontwarn org.jetbrains.annotations.**
  27. #-keep class kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoaderImpl
  28. -keep class kotlin.Metadata { *; }
  29. -keepclassmembers class kotlin.Metadata {
  30. public <methods>;
  31. }
  32. #-keepnames @kotlin.Metadata class gdt.com.e_payments.data.model.**
  33. #-keep class gdt.com.e_payments.data.model.** { *; }
  34. #-keepclassmembers class gdt.com.e_payments.data.model.** { *; }
  35. -keepclasseswithmembers class * {
  36. @retrofit2.http.* <methods>;
  37. }
  38. -keepclasseswithmembers class * {
  39. @com.squareup.moshi.* <methods>;
  40. }
  41. -keepclassmembers class * {
  42. @com.squareup.moshi.FromJson <methods>;
  43. @com.squareup.moshi.ToJson <methods>;
  44. }
  45. -keepclassmembers @com.squareup.moshi.JsonClass class * extends java.lang.Enum {
  46. <fields>;
  47. **[] values();
  48. }
  49. -keep @com.squareup.moshi.JsonQualifier interface *
  50. -keepnames @com.squareup.moshi.JsonClass class *
  51. # Retain generated target class's synthetic defaults constructor and keep DefaultConstructorMarker's
  52. # name. We will look this up reflectively to invoke the type's constructor.
  53. #
  54. # We can't _just_ keep the defaults constructor because Proguard/R8's spec doesn't allow wildcard
  55. # matching preceding parameters.
  56. -keepnames class kotlin.jvm.internal.DefaultConstructorMarker
  57. -keepclassmembers @com.squareup.moshi.JsonClass @kotlin.Metadata class * {
  58. synthetic <init>(...);
  59. }
  60. # Retain generated JsonAdapters if annotated type is retained.
  61. -if @com.squareup.moshi.JsonClass class *
  62. -keep class <1>JsonAdapter {
  63. <init>(...);
  64. <fields>;
  65. }
  66. -if @com.squareup.moshi.JsonClass class **$*
  67. -keep class <1>_<2>JsonAdapter {
  68. <init>(...);
  69. <fields>;
  70. }
  71. -if @com.squareup.moshi.JsonClass class **$*$*
  72. -keep class <1>_<2>_<3>JsonAdapter {
  73. <init>(...);
  74. <fields>;
  75. }
  76. -if @com.squareup.moshi.JsonClass class **$*$*$*
  77. -keep class <1>_<2>_<3>_<4>JsonAdapter {
  78. <init>(...);
  79. <fields>;
  80. }
  81. -if @com.squareup.moshi.JsonClass class **$*$*$*$*
  82. -keep class <1>_<2>_<3>_<4>_<5>JsonAdapter {
  83. <init>(...);
  84. <fields>;
  85. }
  86. -if @com.squareup.moshi.JsonClass class **$*$*$*$*$*
  87. -keep class <1>_<2>_<3>_<4>_<5>_<6>JsonAdapter {
  88. <init>(...);
  89. <fields>;
  90. }
  91. # RxJava
  92. -dontwarn org.reactivestreams.FlowAdapters
  93. -dontwarn org.reactivestreams.**
  94. -dontwarn java.util.concurrent.Flow.**
  95. -dontwarn java.util.concurrent.**
  96. # Firebase Crashlytics
  97. #-keepattributes SourceFile,LineNumberTable # Keep file names and line numbers.
  98. #-keep public class * extends java.lang.Exception # Optional: Keep custom exceptions.
  99. #-keep class com.google.firebase.crashlytics. { *; }
  100. #-dontwarn com.google.firebase.crashlytics.
  101. #-keepnames @kotlin.Metadata class com.sambath.cflive.remote.**
  102. #-keep class com.sambath.cflive.remote.model.** { *; }
  103. #-keepclassmembers class com.sambath.cflive.remote.model.** { *; }
  104. ##---------------Begin: proguard configuration for Gson ----------
  105. # Gson uses generic type information stored in a class file when working with fields. Proguard
  106. # removes such information by default, so configure it to keep all of it.
  107. -keepattributes Signature
  108. # For using GSON @Expose annotation
  109. -keepattributes *Annotation*
  110. # Gson specific classes
  111. -dontwarn sun.misc.**
  112. #-keep class com.google.gson.stream.** { *; }
  113. # Application classes that will be serialized/deserialized over Gson
  114. #-keep class com.google.gson.examples.android.model.** { <fields>; }
  115. -keep class com.sambath.kunkhmer.remote.** { <fields>; }
  116. # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
  117. # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
  118. -keep class * implements com.google.gson.TypeAdapter
  119. -keep class * implements com.google.gson.TypeAdapterFactory
  120. -keep class * implements com.google.gson.JsonSerializer
  121. -keep class * implements com.google.gson.JsonDeserializer
  122. # Prevent R8 from leaving Data object members always null
  123. -keepclassmembers,allowobfuscation class * {
  124. @com.google.gson.annotations.SerializedName <fields>;
  125. }
  126. ##---------------End: proguard configuration for Gson ----------