# Consumer ProGuard Rules for Appnomix SDK
# These rules are automatically applied when apps embed this SDK AAR

# ====================================
# Prevent Re-obfuscation of SDK Code
# ====================================
# The SDK is already obfuscated. Prevent the app's R8 from re-obfuscating it,
# which would invalidate our saved mapping.txt files.

# Keep SDK class names and method names as-is (already obfuscated in SDK build)
-keepnames class app.appnomix.sdk.** { *; }

# Prevent optimization that could change line numbers or method signatures
-keepattributes SourceFile,LineNumberTable

# Keep SDK's crash handler constant for crash detection
-keepclassmembers class app.appnomix.sdk.internal.crashreporter.AppnomixCrashHandler {
    public static final java.lang.String SDK_PACKAGE_PREFIX;
}

# ====================================
# SDK Dependencies
# ====================================
# Ensure SDK dependencies are not stripped or re-obfuscated

# Kotlinx Serialization (used by SDK)
-keepnames class ** {
    @kotlinx.serialization.Serializable *;
}

-keepclassmembers class ** {
    kotlinx.serialization.KSerializer serializer(...);
}

-keepattributes Signature, InnerClasses, EnclosingMethod, Kotlin
-keepattributes *Annotation*

# Keep exception names for crash reporting
-keepnames class * extends java.lang.Throwable
