Guest User

ProGuard Android

a guest
Oct 29th, 2025
9
0
3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.45 KB | Source Code | 0 0
  1. -keepattributes Signature
  2. -keepattributes *Annotation*
  3. -keepattributes EnclosingMethod,InnerClasses,Exceptions,MethodParameters
  4. -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, AnnotationDefault
  5. -keepattributes LineNumberTable, SourceFile
  6.  
  7. ########################
  8. ## 2) Retrofit / OkHttp / Gson
  9. ########################
  10. -keep class retrofit2.** { *; }
  11. -keep interface retrofit2.** { *; }
  12. -keep class okhttp3.** { *; }
  13. -dontwarn okhttp3.**
  14. -dontwarn okio.**
  15. -keep class com.google.gson.** { *; }
  16.  
  17. -keepclasseswithmembers class * {
  18. @retrofit2.http.* <methods>;
  19. }
  20.  
  21. -keep interface retrofit2.Call
  22. -keep class retrofit2.Response
  23. -keep class kotlin.coroutines.Continuation
  24.  
  25. -dontwarn javax.annotation.**
  26. -adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
  27. -dontwarn org.codehaus.mojo.animal_sniffer.*
  28. -dontwarn retrofit2.KotlinExtensions
  29. -dontwarn retrofit2.KotlinExtensions$*
  30. -dontnote retrofit2.Platform
  31. -dontwarn retrofit2.Platform$Android$MainThreadExecutor
  32.  
  33. ########################
  34. ## 3) Gson
  35. ########################
  36. -keep class * extends com.google.gson.TypeAdapter { *; }
  37. -keep class * implements com.google.gson.TypeAdapterFactory { *; }
  38. -keep class * implements com.google.gson.JsonDeserializer { *; }
  39. -keep class * implements com.google.gson.JsonSerializer { *; }
  40.  
  41. -keep class * {
  42. @com.google.gson.annotations.SerializedName <fields>;
  43. }
  44.  
  45. -keep interface com.companyname.data.remote.** { *; }
  46.  
  47. ########################
  48. ## 5) Glide
  49. ########################
  50. -keep public class * implements com.bumptech.glide.module.GlideModule
  51. -keep public class * extends com.bumptech.glide.module.AppGlideModule
  52. -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  53. **[] $VALUES;
  54. public *;
  55. }
  56.  
  57. ########################
  58. ## 6) Firebase (DataSnapshot.getValue)
  59. ########################
  60. -keepclassmembers,allowoptimization class com.companyname.domain.model.chat.TicketModel {
  61. public <init>(); !static <fields>; public !static *** get*();
  62. }
  63. -keepclassmembers,allowoptimization class com.companyname.features.dispute.presentation.view.DisputeMessage {
  64. public <init>(); !static <fields>; public !static *** get*();
  65. }
  66. -keepclassmembers,allowoptimization class com.companyname.domain.model.orderInfo.OrderResult {
  67. public <init>(); !static <fields>; public !static *** get*();
  68. }
  69.  
  70. ########################
  71. ## 7) DI / Koin / Initializers
  72. ########################
  73. -keep class com.companyname.features.core.initializers.KoinInitializer { *; }
  74. -keep class com.companyname.features.core.initializers.LokaliseInitializer { *; }
  75.  
  76. -keep interface com.companyname.domain.repository.local.DeliveryDataRepository { *; }
  77. -keep interface com.companyname.domain.datasource.SettingsDataSource { *; }
  78. -keep interface com.companyname.domain.datasource.UserDataSource { *; }
  79. -keep interface com.companyname.domain.datasource.RuntimeFlags { *; }
  80. -keep interface com.companyname.domain.intercators.CheckRuntimeAutoCanceledOrderUseCase { *; }
  81. -keep interface com.companyname.domain.repository.SettingsRepository { *; }
  82. -keep class com.companyname.domain.datasource.** { *; }
  83.  
  84. ########################
  85. ## 8) Domain
  86. ########################
  87. -keep class com.companyname.domain.model.** { *; }
  88. -keep enum com.companyname.features.address.OpenMapSource { *; }
  89.  
  90. ########################
  91. ## 9)
  92. ########################
  93. # PubNub
  94. -dontwarn com.pubnub.**
  95.  
  96. # Stripe Card Scan
  97. -dontwarn com.stripe.android.stripecardscan.**
  98.  
  99. # Install Referrer
  100. -dontwarn com.android.installreferrer.*
  101.  
  102. # Google Places
  103. -dontwarn com.google.android.libraries.places.api.*
  104.  
  105. # Google translate client
  106. -keepclassmembers class * { @com.google.api.client.util.Key <fields>; }
  107. -dontwarn com.google.**
  108. -dontwarn com.google.auto.**
  109. -dontwarn autovalue.shaded.com.**
  110.  
  111. # Adjust
  112. -keep class com.adjust.sdk.** { *; }
  113. -keep class com.google.android.gms.common.ConnectionResult { int SUCCESS; }
  114. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
  115. com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
  116. }
  117. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
  118. java.lang.String getId();
  119. boolean isLimitAdTrackingEnabled();
  120. }
  121. -keep public class com.android.installreferrer.** { *; }
  122.  
  123. # HMS / Huawei
  124. -ignorewarnings
  125. -keep class com.huawei.hms.** { *; }
  126. -keep class * extends com.huawei.hms.core.aidl.IMessageEntity { *; }
  127. -keep public class com.huawei.location.nlp.network.** { *; }
  128. -keep class com.huawei.wisesecurity.ucs.** { *; }
  129. -keep class com.huawei.hianalytics.** { *; }
  130. -keep class com.huawei.updatesdk.** { *; }
  131.  
  132. # Lokalise
  133. -keep class com.lokalise.** { *; }
  134. -dontwarn com.lokalise.*
  135.  
  136. # Realm annotations
  137. -keep @interface io.realm.annotations.RealmModule { *; }
  138. -keep class io.realm.annotations.RealmModule { *; }
  139.  
  140. # Sentry
  141. -keep class io.sentry.** { *; }
  142. -dontwarn io.sentry.**
  143.  
  144. # NewRelic
  145. -keep class com.newrelic.agent.android.distributedtracing.TraceConfiguration { *; }
  146. -keep class com.newrelic.** { *; }
  147. -dontwarn com.newrelic.**
  148.  
  149. -keep class com.newrelic.com.google.gson.reflect.TypeToken { *; }
  150. -keep class * extends com.newrelic.com.google.gson.reflect.TypeToken
  151.  
  152. ########################
  153. ## 10)
  154. ########################
  155. -keep class spay.sdk.** { *; }
  156. -keep class com.companyname.ui.** { *; }
  157. -keep class com.companyname.data.cache.** { *; } # если там есть runtime-reflection
  158. -keep class kotlin.Metadata
  159. -keep class * implements java.io.Serializable { *; }
  160.  
  161. -keepclassmembers class com.google.android.material.tabs.TabItem {
  162. public *;
  163. <fields>;
  164. <methods>;
  165. }
  166. -keep class com.google.android.material.tabs.TabItem { *; }
  167. -keep class com.google.android.material.tabs.TabLayout { *; }
  168.  
  169. ########################
  170. ## 11) Kotlin Coroutines
  171. ########################
  172. -keep class kotlinx.coroutines.** { *; }
  173. -keep class kotlin.coroutines.** { *; }
  174. -keep class kotlinx.coroutines.internal.** { *; }
  175. -keep class kotlinx.coroutines.android.** { *; }
  176. -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
  177. -keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {}
  178. -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
  179. -keepnames interface kotlinx.coroutines.Job
  180. -keepnames interface kotlinx.coroutines.CompletableJob
  181. -keepnames class kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher {}
  182.  
  183. -dontwarn kotlinx.coroutines.**
Advertisement
Add Comment
Please, Sign In to add comment