# ChottuLink SDK - Consumer ProGuard Rules (applied in app builds)
# These rules are packaged into the AAR via consumerProguardFiles and are applied
# when an app that depends on this SDK is minified.
#
# IMPORTANT:
# - DO NOT include -repackageclasses here. Doing so can repackage the app and other
#   dependencies into ChottuLink's namespace, making stack traces misleading and
#   potentially impacting unrelated libraries.

# Keep line number information where possible for stack traces.
-keepattributes SourceFile,LineNumberTable

# Keep SDK model classes (used with Gson) and all their members to ensure JSON deserialization works.
-keep class com.chottulink.lib.network.ChottuApiClient$* { *; }
-keep class com.chottulink.lib.network.ChottuApiClient$ResolveLinkResponse { *; }
-keep class com.chottulink.lib.network.ChottuApiClient$CreateLinkResponse { *; }
-keep class com.chottulink.lib.ChottuLink { *; }
-keep class com.chottulink.lib.ChottuLink$OnSuccessListener { *; }
-keep class com.chottulink.lib.ChottuLink$OnFailureListener { *; }
-keep class com.chottulink.lib.ChottuLink$AppLinkData { *; }
-keep class com.chottulink.lib.ChottuLink$ChottuLinkTask { *; }
-keep class com.chottulink.lib.DynamicLink { *; }
-keep class com.chottulink.lib.DynamicLink$Builder { *; }
-keep class com.chottulink.lib.config.ChottuConfig { *; }

# --- Rules for OkHttp3 ---
-keepattributes Signature
-keepattributes InnerClasses
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-dontwarn okio.** # OkHttp depends on Okio

# --- Rules for Gson ---
-keepclassmembers,allowobfuscation class * {
    @com.google.gson.annotations.SerializedName <fields>;
}
-keep public class java.util.List { *; }
-keep public class java.util.Map { *; }
-keep class com.google.gson.TypeAdapter { *; }
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.TypeAdapter
-keep class * extends com.google.gson.reflect.TypeToken

