|
| 1 | +# Keep Kotlin metadata |
| 2 | +-keepclassmembers class ** { |
| 3 | + @kotlin.Metadata *; |
| 4 | +} |
| 5 | + |
| 6 | +# Keep public classes and members of your SDK |
| 7 | +-keep class com.web3auth.** { *; } |
| 8 | + |
| 9 | +# If using Gson (for JSON parsing) |
| 10 | +-keep class com.google.gson.** { *; } |
| 11 | +-keepattributes *Annotation* |
| 12 | +-keepclassmembers class * { |
| 13 | + @com.google.gson.annotations.SerializedName <fields>; |
| 14 | +} |
| 15 | + |
| 16 | +# Keep method names and constructor params |
| 17 | +-keepattributes Signature, InnerClasses, EnclosingMethod, *Annotation*, SourceFile, LineNumberTable |
| 18 | + |
| 19 | +# If you use coroutines or lambdas |
| 20 | +-keep class kotlinx.coroutines.** { *; } |
| 21 | +-dontwarn kotlinx.coroutines.** |
| 22 | + |
| 23 | +# To avoid stripping methods like getError(), setCustomTabsClosed(), etc. |
| 24 | +-keepclassmembers class ** { |
| 25 | + *** getError(...); |
| 26 | + void setCustomTabsClosed(...); |
| 27 | +} |
| 28 | + |
| 29 | +# Preserve Kotlin metadata and parameter names |
| 30 | +-keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod |
| 31 | +-keep class kotlin.Metadata { *; } |
| 32 | +-keepclassmembers class ** { |
| 33 | + @kotlin.Metadata *; |
| 34 | +} |
| 35 | + |
| 36 | +# Optional: Keep your SDK class and its methods fully |
| 37 | +-keep class com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin { |
| 38 | + *; |
| 39 | +} |
| 40 | + |
| 41 | +-keepclassmembers class com.web3auth.core.Web3Auth { |
| 42 | + public static <methods>; |
| 43 | +} |
| 44 | + |
| 45 | +# Preserve the entire Kotlin object class (prevents it from being removed/renamed) |
| 46 | +-keep class com.web3auth.core.types.Web3AuthError { |
| 47 | + *; |
| 48 | +} |
0 commit comments