Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions FlagsmithClient/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,47 @@
-keep class com.flagsmith.entities.** {
<fields>;
}

# Retrofit Proguard rules to prevent crashes when using Proguard/R8
# Keep Retrofit interfaces and their methods from being obfuscated
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

# Keep Retrofit Call and Response classes
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# Keep Retrofit annotations
-keep class retrofit2.** { *; }

# Keep Retrofit converter classes
-keep class * extends retrofit2.Converter$Factory

# Keep Retrofit call adapter classes
-keep class * extends retrofit2.CallAdapter$Factory

# Keep Retrofit service interfaces
-keep interface * extends retrofit2.Call

# Keep Retrofit HTTP annotations
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}

# Keep Retrofit service method parameters and return types
-keepclassmembers,allowshrinking,allowobfuscation interface * {
<methods>;
}

# Keep Retrofit service interfaces used by Flagsmith
-keep interface com.flagsmith.internal.FlagsmithRetrofitService { *; }

# Keep OkHttp classes used by Retrofit
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }

# Keep Gson classes used by Retrofit converter
-keep class com.google.gson.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
Loading