# These rules are added to the customer app obfuscation
# If you do something with reflection, chance your rule should be here

# keep protobuf generated message lite
-keepnames class com.contentsquare.protobuf.GeneratedMessageLite { *;}
-keepclassmembers class * extends com.contentsquare.protobuf.GeneratedMessageLite {
    <fields>;
}

# Keep classes implementing StartableModule interface, see ModuleStarter.kt
-keep class * implements com.contentsquare.android.common.communication.StartableModule {
    public <init>(...);
}

# Keep Jetpack Compose classes used in the tree view path
-keep class androidx.compose.ui.platform.AndroidComposeView
-keep class androidx.compose.ui.platform.AndroidViewsHandler
-keep class androidx.compose.ui.platform.ComposeView
-keep class androidx.compose.ui.viewinterop.ViewFactoryHolder

# Keep API classes used by cross-platform
-keep class com.contentsquare.android.api.bridge.telemetry.TelemetryInterface { *; }
-keep class com.contentsquare.android.api.bridge.flutter.FlutterInterface { *; }
-keep class com.contentsquare.android.api.bridge.xpf.XpfInterface { *; }
-keep interface com.contentsquare.android.api.bridge.xpf.ExternalBridgeInterface { *; }
-keep class com.contentsquare.android.api.bridge.xpf.ExternalBridgeType { *; }

-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt
-keepclassmembers @kotlinx.serialization.Serializable class ** {
    *** Companion;
}
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1>$Companion {
    kotlinx.serialization.KSerializer serializer(...);
}
-keepclasseswithmembers class **$$serializer {
    *** INSTANCE;
}

#This rule is added to prevent deleting SessionReplayStartStopController ref as it's not used but needed
-keep class **.ContentsquareModule {
    private static <fields>;
}
