# Preserve all classes and methods in the SDK package (this prevents name obfuscation)
-keepnames class com.moneyhash.sdk.android.** {
    *;
}

# Allow methods to be obfuscated but preserve signatures (method names, arguments, and return types)
-keepnames class com.moneyhash.sdk.android.** {
    public *;  # Keep all public methods and fields intact
    protected *;  # Keep all protected methods and fields intact
}


# Keep all classes that implement Parcelable, including their fields and methods
-keep class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
}

# Strip line number information (makes reverse engineering more difficult)
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

# Keep `Companion` object fields of serializable classes.
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1> {
    static <1>$Companion Companion;
}

-keepclassmembers class kotlinx.** {
    volatile <fields>;
}

-keepclassmembers class io.ktor.** { volatile <fields>; }

# Keep `serializer()` on companion objects (both default and named) of serializable classes.
-if @kotlinx.serialization.Serializable class ** {
    static **$* *;
}
-keepclassmembers class <1>$<3> {
    kotlinx.serialization.KSerializer serializer(...);
}

# Keep `INSTANCE.serializer()` of serializable objects.
-if @kotlinx.serialization.Serializable class ** {
    public static ** INSTANCE;
}
-keepclassmembers class <1> {
    public static <1> INSTANCE;
    kotlinx.serialization.KSerializer serializer(...);
}

# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

-keepclassmembers class kotlinx.** {
    volatile <fields>;
}

-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.slf4j.impl.StaticMDCBinder
-dontwarn org.slf4j.impl.StaticMarkerBinder
-dontwarn java.lang.invoke.StringConcatFactory
