Skip to content

Commit 2121235

Browse files
committed
feat: update more proguard-rules.pro and consumer-rules.pro
Signed-off-by: Gaurav Goel <[email protected]>
1 parent 116b0df commit 2121235

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

core/consumer-rules.pro

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,29 @@
2121
# If using Gson or any reflection-based serialization:
2222
-keepclassmembers class * {
2323
@com.google.gson.annotations.SerializedName <fields>;
24-
}
24+
}
25+
26+
# Keep the Web3Auth class and prevent any obfuscation or stripping
27+
-keep class com.web3auth.core.Web3Auth {
28+
*;
29+
}
30+
31+
-keepclassmembers class com.web3auth.core.Web3Auth$Companion {
32+
public *;
33+
}
34+
-keep class com.web3auth.core.Web3Auth {
35+
public static final com.web3auth.core.Web3Auth$Companion Companion;
36+
}
37+
-keep interface com.web3auth.core.types.WebViewResultCallback {
38+
*;
39+
}
40+
41+
-keep class com.web3auth.core.types.Web3AuthError {
42+
*;
43+
}
44+
-keepclassmembers class com.web3auth.core.types.Web3AuthError {
45+
public static <methods>;
46+
}
47+
-keep enum com.web3auth.core.types.ErrorCode {
48+
*;
49+
}

core/proguard-rules.pro

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,29 @@
4141
# If using Gson or any reflection-based serialization:
4242
-keepclassmembers class * {
4343
@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+
*;
4469
}

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,15 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
748748
}
749749

750750
companion object {
751+
@JvmStatic
751752
private var isCustomTabsClosed: Boolean = false
752753

754+
@JvmStatic
753755
fun setCustomTabsClosed(_isCustomTabsClosed: Boolean) {
754756
isCustomTabsClosed = _isCustomTabsClosed
755757
}
756758

759+
@JvmStatic
757760
fun getCustomTabsClosed(): Boolean {
758761
return isCustomTabsClosed
759762
}

core/src/main/java/com/web3auth/core/types/Web3AuthError.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.annotation.Keep
44

55
object Web3AuthError {
66

7+
@JvmStatic
78
fun getError(errorCode: ErrorCode): String {
89
return when (errorCode) {
910
ErrorCode.NOUSERFOUND -> {
@@ -13,12 +14,15 @@ object Web3AuthError {
1314
ErrorCode.ENCODING_ERROR -> {
1415
"Encoding Error"
1516
}
17+
1618
ErrorCode.DECODING_ERROR -> {
1719
"Decoding Error"
1820
}
21+
1922
ErrorCode.SOMETHING_WENT_WRONG -> {
2023
"Something went wrong!"
2124
}
25+
2226
ErrorCode.RUNTIME_ERROR -> {
2327
"Runtime Error"
2428
}

0 commit comments

Comments
 (0)