Skip to content

Commit d3dc567

Browse files
authored
Merge pull request #41 from auth0/task/proguard-setup
Added the consumer file with the rules for client facing obfustication
2 parents fa9e811 + 59ce730 commit d3dc567

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# --- Auth0 SDK Gson models ---------------------------------------------------
2+
# The Auth0 Android SDK deserializes its API responses (Factor,
3+
# AuthenticationMethod and its sealed subclasses) with Gson via reflection.
4+
# R8 cannot see those reflective accesses, so without keep rules it strips the
5+
# fields/classes and Gson fails — surfacing as "a0.sdk.internal_error.unknown".
6+
# Gson also needs Signature (generic types like List<String>) and the
7+
# @SerializedName annotations to map JSON keys correctly.
8+
-keepattributes Signature
9+
-keep class com.auth0.android.result.** { *; }
10+
-keepclassmembers class com.auth0.android.result.** { *; }
11+
# Polymorphic deserializer referenced via @JsonAdapter must be kept by name.
12+
-keep class com.auth0.android.result.AuthenticationMethod$Deserializer { *; }
13+
-keepclassmembers class * {
14+
@com.google.gson.annotations.SerializedName <fields>;
15+
}
16+
17+
# --- Public enums passed across the API boundary -----------------------------
18+
# AuthenticatorType is used as a kotlinx.serialization-backed Compose Navigation
19+
# argument, which resolves the enum by its fully qualified name at runtime — so
20+
# the class name must not be obfuscated.
21+
-keep public enum com.auth0.universalcomponents.domain.model.AuthenticatorType {
22+
**[] $VALUES;
23+
public *;
24+
}

0 commit comments

Comments
 (0)