2222# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
2323-keep class * implements com.google.gson.TypeAdapterFactory
2424-keep class * implements com.google.gson.JsonSerializer
25- -keep class * implements com.google.gson.JsonDeserializer
25+ -keep class * implements com.google.gson.JsonDeserializer
26+
27+ -keepattributes *Annotation*
28+ -keep class com.google.gson.annotations.SerializedName
29+ -keepclassmembers class * {
30+ @com.google.gson.annotations.SerializedName <fields>;
31+ }
32+
33+ # Keep all JsonElement types from Gson
34+ -keep class com.google.gson.JsonArray { *; }
35+ -keep class com.google.gson.JsonObject { *; }
36+ -keep class com.google.gson.JsonElement { *; }
37+
38+ # Preserve annotations and parameter names
39+ -keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod
40+
41+ # If using Gson or any reflection-based serialization:
42+ -keepclassmembers class * {
43+ @com.google.gson.annotations.SerializedName <fields>;
44+ }
45+
46+ # Keep the Web3Auth class and prevent any obfuscation or stripping
47+ -keep class com.web3auth.core.Web3Auth {
48+ *;
49+ }
50+
51+ -keepclassmembers class com.web3auth.core.Web3Auth$Companion {
52+ public *;
53+ }
54+ -keep class com.web3auth.core.Web3Auth {
55+ public static final com.web3auth.core.Web3Auth$Companion Companion;
56+ }
57+ -keep interface com.web3auth.core.types.WebViewResultCallback {
58+ *;
59+ }
60+
61+ -keep class com.web3auth.core.types.Web3AuthError {
62+ *;
63+ }
64+ -keepclassmembers class com.web3auth.core.types.Web3AuthError {
65+ public static <methods>;
66+ }
67+ -keep enum com.web3auth.core.types.ErrorCode {
68+ *;
69+ }
0 commit comments