Skip to content

Commit 818c1c4

Browse files
committed
feat: consumer_rules.pro added
1 parent 1a0f302 commit 818c1c4

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

android/consumer_rules.pro

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
}

android/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
}
4444

4545
# Preserve the entire Kotlin object class (prevents it from being removed/renamed)
46-
-keep class com.web3auth.core.Web3AuthError {
46+
-keep class com.web3auth.core.types.Web3AuthError {
4747
*;
4848
}

0 commit comments

Comments
 (0)