-keepclassmembers enum ir.metrix.** { *; }

-keep class * extends ir.metrix.internal.init.MetrixComponentInitializer

-keep class * extends ir.metrix.utils.common.di.Provider { *; }

# Keep Exception names
-keepnames class ir.metrix.** extends java.lang.Exception

# -- Moshi --
-dontwarn okio.**
-dontwarn javax.annotation.**
-keepclasseswithmembers class * {
    @com.squareup.moshi.* <methods>;
}
-keep @com.squareup.moshi.JsonQualifier interface *

-keep class **JsonAdapter {
    <init>(...);
    <fields>;
}
-keepnames @com.squareup.moshi.JsonClass class *

# Moshi's generated adapters invoke the Kotlin synthetic "defaults" constructor
# (..., int, int, DefaultConstructorMarker) reflectively for data classes that
# declare default parameter values. Without keeping these constructors R8 strips
# or rewrites them, causing NoSuchMethodException at runtime during deserialization.
-keepclassmembers,allowobfuscation @com.squareup.moshi.JsonClass class * {
    synthetic <init>(...);
}
# Keep the primary constructors of Moshi model classes as well, so the generated
# adapter can construct instances when all values are present.
-keepclassmembers,allowobfuscation @com.squareup.moshi.JsonClass class * {
    <init>(...);
}

-dontwarn org.codehaus.mojo.animal_sniffer.*

# Fix application release build problem with R8
-keep class io.reactivex.rxjava3.disposables.RunnableDisposable { <init>(...); }

### for gradle 8 and after

# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

-dontwarn com.squareup.okhttp.**
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-keepattributes Signature
-keepattributes Annotation
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions

-keeppackagenames ir.metrix.session
-if class ir.metrix.session.SessionActivity
-keepnames class ir.metrix.session.SessionActivity
-if class ir.metrix.session.SessionActivity
-keep class ir.metrix.session.SessionActivityJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

