# 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
# Runtime metadata required by Retrofit, Kotlin suspend APIs, and kotlinx.serialization.
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations, AnnotationDefault
-keepattributes *Annotation*

# Retrofit reads endpoint annotations and generic suspend return types at runtime.
-keepclassmembers,allowshrinking,allowoptimization interface * {
    @retrofit2.http.* <methods>;
}

# kotlinx.serialization generated serializers must remain available, but SDK DTO names may still
# be obfuscated in the consuming app.
-keep,allowobfuscation @kotlinx.serialization.Serializable class blueid.access.sdk.network.dto.** { *; }
-keep,allowobfuscation class blueid.access.sdk.network.dto.**$$serializer { *; }
-keepclassmembers,allowobfuscation class blueid.access.sdk.network.dto.** {
    public static ** Companion;
    public static kotlinx.serialization.KSerializer serializer(...);
}

# Full protobuf Java uses generated method names through its field-accessor table.
# These classes are part of the public SDK API, so keep their runtime shape stable.
-keep class blueid.access.sdk.pb.** { *; }
-keep class com.google.protobuf.** { *; }

# JNI entry points are resolved by their Java package/class/method names.
-keepclasseswithmembernames class blueid.access.sdk.core.SetupKt {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.utils.BlueNativeUtilsKt {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.core.sp.BlueSpKt {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.core.sp.BlueOss {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.core.sp.BlueOssId {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.core.sp.BlueSpConnection {
    native <methods>;
}
-keepclasseswithmembernames class blueid.access.sdk.services.BlueSpTransponder {
    native <methods>;
}

# Methods/classes looked up explicitly from native code.
-keepnames class blueid.access.sdk.data.BlueServiceData
-keepclassmembers class blueid.access.sdk.data.BlueServiceData {
    public <init>(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
}
-keepclassmembers class blueid.access.sdk.core.sp.BlueOssNfc {
    java.nio.ByteBuffer transceiver(java.nio.ByteBuffer);
}
-keepclassmembers interface blueid.access.sdk.core.sp.BlueSpConnectionDelegate {
    int getMaxSize();
    byte[] receive();
    void transmit(java.nio.ByteBuffer);
}
-keepclassmembers class blueid.access.sdk.services.BlueSpTransponder {
    byte[] publicKey(java.lang.String);
}
-keepnames class blueid.access.sdk.utils.TimeoutException

# JJWT loads implementation classes indirectly.
-keep class io.jsonwebtoken.** { *; }
-dontwarn io.jsonwebtoken.**
