# Proguard rules that are applied to all library modules

##---------------Begin: proguard configuration for Gson  ----------
# For using GSON annotations
-keepattributes *Annotation*

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}
# common consumer proguard rules for third party libraries used by 3DS SDK
-dontwarn java.lang.instrument.ClassFileTransformer
-dontwarn sun.misc.SignalHandler
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
-dontwarn com.google.errorprone.annotations.Immutable
# Consumer ProGuard rules for the Checkout 3DS SDK.
# These rules are automatically applied to merchant apps that depend on this AAR.

# ===== SDK classes =====
# Keep all SDK classes so the merchant's R8 pass does not strip or rename them.
# The SDK's own R8 pass has already obfuscated internals into com.checkout.threedsobfuscation.
-keep class com.checkout.threeds.** { *; }
-keep class com.checkout.eventlogger.** { *; }

# Protect SDK-internal classes that were repackaged by the SDK's own R8 pass.
# The SDK's minification moves internals into com.checkout.threedsobfuscation.
# Without -keep, the merchant's R8 pass would rename these classes a second time.
# FragmentManager saves Fragment class names as strings for process-death restoration;
# if those names are renamed by the merchant's R8, Class.forName() throws
# ClassNotFoundException when Android restores the 3DS challenge screen.
-keepnames class com.checkout.threedsobfuscation.**
-dontwarn com.checkout.threedsobfuscation.**

# ===== Third-party runtime dependencies used by the SDK =====
# Bouncy Castle is an internal runtime dependency (not exposed as a compile-time API).
# These -keep rules prevent R8 from stripping BC algorithm implementation classes
# that are registered via string-based reflection inside BouncyCastleProvider.
-keep class org.bouncycastle.** { *; }
-keep interface org.bouncycastle.** { *; }
-keep class com.nimbusds.** { *; }
-keep interface com.nimbusds.** { *; }
-keep class com.google.gson.** { *; }
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }

# ===== Suppress warnings for optional / platform dependencies =====
-dontwarn com.google.crypto.tink.**