# Consumer ProGuard / R8 rules for Medallia Mobile Bridge SDK
# These rules are packaged with the AAR and automatically applied in apps that depend on it.
# Keep minimal surface necessary for runtime behavior and avoid over-keeping.

# Keep public API classes and their public members
-keep public class com.medallia.mobile.sdk.internal.eventbus.EventBus {
    public <methods>;
}

-keep public class com.medallia.mobile.sdk.internal.eventbus.Event {
    public <methods>;
    public <fields>;
}

-keep public class com.medallia.mobile.sdk.internal.eventbus.Subscriber {
    public <methods>;
}

-keep public class com.medallia.mobile.sdk.internal.eventbus.Subscription {
    public <methods>;
}

# Keep concrete event types and their public members
-keep public class com.medallia.mobile.sdk.internal.eventbus.events.** {
    public <methods>;
    public <fields>;
}

# Keep model classes - ALL fields (for serialization) but only public methods
-keepclassmembers public class com.medallia.mobile.sdk.internal.eventbus.events.model.** {
    <fields>;
    public <methods>;
}

# Allow full obfuscation of pure utility/helper classes that are not part of the API
-keep,allowobfuscation,allowshrinking class com.medallia.mobile.sdk.internal.concurrency.**
-keep,allowobfuscation,allowshrinking class com.medallia.mobile.sdk.internal.time.**

# Ensure proper enum functionality
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# Preserve generic type information for Event<T>
-keepattributes Signature

# Preserve inner class relationships for sealed classes
-keepattributes InnerClasses

# Preserve the original source file name and line number information for debugging stack traces
-keepattributes SourceFile, LineNumberTable