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

# 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
-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations

-keep class **.R$* {
    *;
}

# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum  * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
    native <methods>;
}

# Keep names - _class method names. Keep all .class method names. This may be
# useful for libraries that will be obfuscated again with different obfuscators.
-keepclassmembers,allowshrinking class * {
    java.lang.Class class$(java.lang.String);
    java.lang.Class class$(java.lang.String,boolean);
}

-keep class kotlin.Metadata { *; }

-keepattributes RuntimeVisibleAnnotations

-keep class com.microblink.surveys.internal.SurveysCollection {
    public *;
    protected *;
    private *;
}

-keep class com.microblink.surveys.SurveyLoader {
    public *;
    protected *;
}

-keep class com.microblink.surveys.SurveyFragment {
    public *;
    protected *;
}

-keep class com.microblink.surveys.SurveyViewModel {
    public *;
    protected *;
}

-keep class com.microblink.surveys.SurveyClient {
    public *;
    protected *;
}

-keepclassmembers class * extends androidx.work.Worker {
    public <init>(android.content.Context,androidx.work.WorkerParameters);
}

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}

# Room's generated *_Impl classes under R8 full mode.
#
# This module puts androidx.work on your runtime classpath, and androidx.work brings androidx.room
# with it. Room's consumer rule named no members before 2.7.0:
#
#   -keep class * extends androidx.room.RoomDatabase
#
# R8 full mode - the AGP default for an app - does not implicitly keep a kept class's default
# constructor, so the generated androidx.work.impl.WorkDatabase_Impl survives by name but loses
# the <init>() Room instantiates it with, and WorkManager's initializer takes the app down on
# first launch with `NoSuchMethodException: androidx.work.impl.WorkDatabase_Impl.<init> []`.
#
# We resolve work-runtime 2.11.2, which brings Room 2.7.0 and the corrected rule, so this line is
# normally redundant. It is kept because pinning or substituting Room below 2.7.0 silently removes
# the rule Room ships, and the resulting break is invisible at build time and fatal at launch.
-keep class * extends androidx.room.RoomDatabase { void <init>(); }
