# ============================================================================
#  JOIN Stories SDK — consumer ProGuard / R8 rules
#
#  Applied AUTOMATICALLY in any host app that depends on this SDK (declared via
#  `consumerProguardFiles("consumer-rules.pro")` in the library build.gradle.kts).
#
#  Goal: keep the SDK's PUBLIC API intact when the host app obfuscates its
#  release build (`isMinifyEnabled = true`), so that:
#    - direct calls keep working,
#    - reflection / name-based access keeps working (e.g. RN / Flutter native bridges),
#    - crash stack traces coming from the SDK stay readable.
#
#  Scope: only the public surface is kept —
#    - root package      com.joinstoriessdk.androidsdk.*    (entry points, config, data, listeners)
#    - public UI package com.joinstoriessdk.androidsdk.ui.** (trigger views + vertical player view)
#  The implementation (com.joinstoriessdk.androidsdk.internal.**) is intentionally
#  NOT kept, so R8 can still shrink/obfuscate it.
#
#  Note: a single "*" matches the package itself (one level), NOT sub-packages,
#  which is why `androidsdk.*` keeps the public root without touching `.internal`.
#
#  JSON models use kotlinx.serialization, which ships its OWN consumer rules
#  (keeps @Serializable types' generated serializers), so they are not listed here.
# ============================================================================

# --- Public entry points, configuration, data classes & listeners (root package) ---
-keep public class com.joinstoriessdk.androidsdk.* {
    public protected *;
}
-keep public interface com.joinstoriessdk.androidsdk.* {
    *;
}

# --- Public UI components (BubbleTriggerView, CardTriggerView, JOINVerticalPlayerView) ---
-keep public class com.joinstoriessdk.androidsdk.ui.** {
    public protected *;
}
-keep public interface com.joinstoriessdk.androidsdk.ui.** {
    *;
}

# --- Enums exposed by the public API (PlayerType, VerticalPlayerVideoSizing,
#     CardOrientation, AnimationType, animation origins, …) ---
-keepclassmembers enum com.joinstoriessdk.androidsdk.* {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
