-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

-keepclassmembers enum ir.metrix.notification.** { *; }
-keepclassmembers enum androidx.work.** { *; }

-keep class ir.metrix.notification.NotificationInitializer { *; }
-keep class ir.metrix.notification.receivers.BootCompletedIntentReceiver { *; }
-keep class ir.metrix.notification.receivers.FCMBroadcastReceiver { *; }
-keep class ir.metrix.notification.receivers.MetrixFirebaseMessagingService { *; }
-keep class ir.metrix.notification.prompt.MetrixPermissionsActivity { *; }

-keep class ir.metrix.notification.unity.* { *; }

-optimizations !class/unboxing/enum

# -- 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 (e.g. NotificationMessage). Without keeping
# these constructors R8 strips/rewrites them, causing NoSuchMethodException at
# runtime during downstream message parsing.
-keepclassmembers,allowobfuscation @com.squareup.moshi.JsonClass class * {
    synthetic <init>(...);
}
-keepclassmembers,allowobfuscation @com.squareup.moshi.JsonClass class * {
    <init>(...);
}

-dontwarn org.codehaus.mojo.animal_sniffer.*

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

-keep class com.google.firebase.iid.** { *; }
# Needed in order to be able to get the FirebaseMessaging constructor with reflection (in `FirebaseServiceManager`)
-keep class com.google.firebase.messaging.FirebaseMessaging { *; }

-keep public class kotlin.reflect.jvm.internal.impl.** { public *; }

-keep class me.leolin.shortcutbadger.impl.AdwHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.ApexHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.AsusHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.DefaultBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.EverythingMeHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.HuaweiHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.LGHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.NewHtcHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.NovaHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.OPPOHomeBader { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.SamsungHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.SonyHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.VivoHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.XiaomiHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.ZukHomeBadger { <init>(...); }
-if class ir.metrix.notification.actions.IntentAction
-keepnames class ir.metrix.notification.actions.IntentAction
-if class ir.metrix.notification.actions.IntentAction
-keep class ir.metrix.notification.actions.IntentActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.actions.IntentAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.actions.IntentAction
-keepclassmembers class ir.metrix.notification.actions.IntentAction {
    public synthetic <init>(java.lang.String,java.lang.String,java.util.List,java.lang.String,java.util.List,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.UserActivityAction
-keepnames class ir.metrix.notification.actions.UserActivityAction
-if class ir.metrix.notification.actions.UserActivityAction
-keep class ir.metrix.notification.actions.UserActivityActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.messaging.TrackNotification
-keepnames class ir.metrix.notification.messaging.TrackNotification
-if class ir.metrix.notification.messaging.TrackNotification
-keep class ir.metrix.notification.messaging.TrackNotificationJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.messaging.TrackNotification
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messaging.TrackNotification
-keepclassmembers class ir.metrix.notification.messaging.TrackNotification {
    public synthetic <init>(java.lang.String,java.lang.String,java.util.Map,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.messages.downstream.UpdateConfigMessage
-keepnames class ir.metrix.notification.messages.downstream.UpdateConfigMessage
-if class ir.metrix.notification.messages.downstream.UpdateConfigMessage
-keep class ir.metrix.notification.messages.downstream.UpdateConfigMessageJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.messages.downstream.UpdateConfigMessage
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messages.downstream.UpdateConfigMessage
-keepclassmembers class ir.metrix.notification.messages.downstream.UpdateConfigMessage {
    public synthetic <init>(java.util.Map,java.util.List,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.messages.downstream.InAppMessage
-keepnames class ir.metrix.notification.messages.downstream.InAppMessage
-if class ir.metrix.notification.messages.downstream.InAppMessage
-keep class ir.metrix.notification.messages.downstream.InAppMessageJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
    private com.squareup.moshi.JsonAdapter nullableTimeAtMillisAdapter;
}
-if class ir.metrix.notification.messages.downstream.InAppMessage
-keep @interface ir.metrix.utils.common.Millis
-if class ir.metrix.notification.messages.downstream.InAppMessage
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messages.downstream.InAppMessage
-keepclassmembers class ir.metrix.notification.messages.downstream.InAppMessage {
    public synthetic <init>(java.lang.String,java.lang.String,ir.metrix.notification.inapp.InAppMessageContent,java.lang.String,ir.metrix.utils.common.Time,java.lang.String,boolean,boolean,ir.metrix.notification.inapp.InAppMessageRedisplayStats,boolean,boolean,boolean,java.util.ArrayList,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.messaging.TrackInApp
-keepnames class ir.metrix.notification.messaging.TrackInApp
-if class ir.metrix.notification.messaging.TrackInApp
-keep class ir.metrix.notification.messaging.TrackInAppJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.messaging.TrackInApp
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messaging.TrackInApp
-keepclassmembers class ir.metrix.notification.messaging.TrackInApp {
    public synthetic <init>(java.lang.String,java.lang.String,java.util.Map,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.messages.downstream.CancelNotificationMessage
-keepnames class ir.metrix.notification.messages.downstream.CancelNotificationMessage
-if class ir.metrix.notification.messages.downstream.CancelNotificationMessage
-keep class ir.metrix.notification.messages.downstream.CancelNotificationMessageJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.actions.DownloadAppAction
-keepnames class ir.metrix.notification.actions.DownloadAppAction
-if class ir.metrix.notification.actions.DownloadAppAction
-keep class ir.metrix.notification.actions.DownloadAppActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.actions.DownloadAppAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.actions.DownloadAppAction
-keepclassmembers class ir.metrix.notification.actions.DownloadAppAction {
    public synthetic <init>(java.lang.String,java.lang.String,boolean,java.lang.String,ir.metrix.utils.common.Time,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.FallbackAction
-keepnames class ir.metrix.notification.actions.FallbackAction
-if class ir.metrix.notification.actions.FallbackAction
-keep class ir.metrix.notification.actions.FallbackActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.inapp.InAppMessageStyle
-keepnames class ir.metrix.notification.inapp.InAppMessageStyle
-if class ir.metrix.notification.inapp.InAppMessageStyle
-keep class ir.metrix.notification.inapp.InAppMessageStyleJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.inapp.InAppMessageStyle
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.inapp.InAppMessageStyle
-keepclassmembers class ir.metrix.notification.inapp.InAppMessageStyle {
    public synthetic <init>(java.lang.Boolean,java.lang.Boolean,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.WebViewAction
-keepnames class ir.metrix.notification.actions.WebViewAction
-if class ir.metrix.notification.actions.WebViewAction
-keep class ir.metrix.notification.actions.WebViewActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.actions.WebViewAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.actions.WebViewAction
-keepclassmembers class ir.metrix.notification.actions.WebViewAction {
    public synthetic <init>(java.lang.String,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.DialogAction
-keepnames class ir.metrix.notification.actions.DialogAction
-if class ir.metrix.notification.actions.DialogAction
-keep class ir.metrix.notification.actions.DialogActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.actions.DialogAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.actions.DialogAction
-keepclassmembers class ir.metrix.notification.actions.DialogAction {
    public synthetic <init>(java.lang.String,java.lang.String,java.lang.String,java.util.List,java.util.List,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.inapp.InAppMessageAction
-keepnames class ir.metrix.notification.inapp.InAppMessageAction
-if class ir.metrix.notification.inapp.InAppMessageAction
-keep class ir.metrix.notification.inapp.InAppMessageActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.inapp.InAppMessageAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.inapp.InAppMessageAction
-keepclassmembers class ir.metrix.notification.inapp.InAppMessageAction {
    public synthetic <init>(java.lang.String,boolean,ir.metrix.notification.actions.Action,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.inapp.InAppMessageContent
-keepnames class ir.metrix.notification.inapp.InAppMessageContent
-if class ir.metrix.notification.inapp.InAppMessageContent
-keep class ir.metrix.notification.inapp.InAppMessageContentJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.inapp.InAppMessageContent
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.inapp.InAppMessageContent
-keepclassmembers class ir.metrix.notification.inapp.InAppMessageContent {
    public synthetic <init>(java.lang.String,ir.metrix.notification.inapp.InAppMessageStyle,java.lang.Long,boolean,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.DismissAction
-keepnames class ir.metrix.notification.actions.DismissAction
-if class ir.metrix.notification.actions.DismissAction
-keep class ir.metrix.notification.actions.DismissActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.actions.AppAction
-keepnames class ir.metrix.notification.actions.AppAction
-if class ir.metrix.notification.actions.AppAction
-keep class ir.metrix.notification.actions.AppActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.actions.CafeBazaarRateAction
-keepnames class ir.metrix.notification.actions.CafeBazaarRateAction
-if class ir.metrix.notification.actions.CafeBazaarRateAction
-keep class ir.metrix.notification.actions.CafeBazaarRateActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}

-if class ir.metrix.notification.messages.downstream.NotificationMessage
-keepnames class ir.metrix.notification.messages.downstream.NotificationMessage
-if class ir.metrix.notification.messages.downstream.NotificationMessage
-keep class ir.metrix.notification.messages.downstream.NotificationMessageJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
    private com.squareup.moshi.JsonAdapter nullableTimeAtMillisAdapter;
}
-if class ir.metrix.notification.messages.downstream.NotificationMessage
-keep @interface ir.metrix.utils.common.Millis
-if class ir.metrix.notification.messages.downstream.NotificationMessage
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messages.downstream.NotificationMessage
-keepclassmembers class ir.metrix.notification.messages.downstream.NotificationMessage {
    public synthetic <init>(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.List,ir.metrix.notification.actions.Action,int,boolean,java.lang.String,int,int,boolean,java.lang.String,java.lang.String,boolean,java.lang.String,boolean,boolean,java.lang.String,java.lang.String,java.lang.String,ir.metrix.utils.common.Time,java.lang.String,java.lang.String,java.util.Date,java.lang.Long,java.lang.Integer,java.util.Map,boolean,int,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.messages.downstream.NotificationButton
-keepnames class ir.metrix.notification.messages.downstream.NotificationButton
-if class ir.metrix.notification.messages.downstream.NotificationButton
-keep class ir.metrix.notification.messages.downstream.NotificationButtonJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.messages.downstream.NotificationButton
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.messages.downstream.NotificationButton
-keepclassmembers class ir.metrix.notification.messages.downstream.NotificationButton {
    public synthetic <init>(java.lang.String,ir.metrix.notification.actions.Action,java.lang.String,java.lang.String,int,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.DownloadAndWebViewAction
-keepnames class ir.metrix.notification.actions.DownloadAndWebViewAction
-if class ir.metrix.notification.actions.DownloadAndWebViewAction
-keep class ir.metrix.notification.actions.DownloadAndWebViewActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}
-if class ir.metrix.notification.actions.DownloadAndWebViewAction
-keepnames class kotlin.jvm.internal.DefaultConstructorMarker
-if class ir.metrix.notification.actions.DownloadAndWebViewAction
-keepclassmembers class ir.metrix.notification.actions.DownloadAndWebViewAction {
    public synthetic <init>(java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,ir.metrix.utils.common.Time,int,kotlin.jvm.internal.DefaultConstructorMarker);
}

-if class ir.metrix.notification.actions.UrlAction
-keepnames class ir.metrix.notification.actions.UrlAction
-if class ir.metrix.notification.actions.UrlAction
-keep class ir.metrix.notification.actions.UrlActionJsonAdapter {
    public <init>(com.squareup.moshi.Moshi);
}


