
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# NOTE: following is NOT required since methods with @JavascriptInterface are kept explicitly below
# -----
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
-renamesourcefileattribute SourceFile

# Kotlin serialization lib. See more https://github.com/Kotlin/kotlinx.serialization
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations

# kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer
-keepclassmembers class kotlinx.serialization.json.** {
    *** Companion;
}
-keepclasseswithmembers class kotlinx.serialization.json.** {
    kotlinx.serialization.KSerializer serializer(...);
}

# NOTE: here ai.smartwall.android.sdk must be changed if sdk package is changed
-keep,includedescriptorclasses class ai.smartwall.android.sdk.**$$serializer { *; } # <-- change package name to your app's
-keepclassmembers class ai.smartwall.android.sdk.** { # <-- change package name to your app's
    *** Companion;
}
-keepclasseswithmembers class ai.smartwall.android.sdk.** { # <-- change package name to your app's
    kotlinx.serialization.KSerializer serializer(...);
}

# Bridge Kotlin and JS in WebView via @JavascriptInterface
-keepclassmembers class * {
    @android.webkit.JavascriptInterface <methods>;
}

-keepattributes JavascriptInterface

# Avoid shrinking and obfuscation of public SDK api
-keep class ai.smartwall.android.sdk.api.** { *; }

# Avoid shrinking and class name obfuscation (used in xml).
# XXX: consider class content obfuscation, but keep class name as is
-keep class ai.smartwall.android.sdk.fragment.WebViewFragment
