# Jaak Visage SDK - Consumer ProGuard Rules
# These rules are automatically applied to apps that use this SDK when they have minifyEnabled = true

# Keep attributes needed for Gson/Retrofit reflection
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes *Annotation*

# Keep all SDK data model classes (used by Gson for JSON deserialization)
-keep class com.jaak.visagesdk.data.model.** { *; }

# Keep Retrofit API service interfaces
-keep interface com.jaak.visagesdk.data.network.** { *; }
-keepclassmembers interface com.jaak.visagesdk.data.network.** {
    *;
}
-keep,allowobfuscation,allowshrinking interface com.jaak.visagesdk.data.network.VisageApiService

# Keep classes with Gson annotations
-keepclassmembers class * {
    @com.google.gson.annotations.SerializedName <fields>;
}

# Keep Retrofit service method signatures and generic types
-keepclassmembers,allowobfuscation interface * {
    @retrofit2.http.* <methods>;
}

# Keep Retrofit, Kotlin reflection, and coroutine classes
-keep class retrofit2.** { *; }
-keep class retrofit2.Response { *; }
-keep class retrofit2.Call { *; }
-keep interface retrofit2.Call { *; }
-keep class kotlin.reflect.** { *; }
-keep class kotlin.Metadata { *; }
-keep class kotlin.coroutines.Continuation

# Keep Gson TypeToken and related classes (prevents generic type issues)
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type

# Keep OkHttp classes (used by Retrofit)
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
-dontwarn okio.**

# Keep ML Kit classes (used for face detection)
-keep class com.google.mlkit.** { *; }
-keep class com.google.android.gms.internal.mlkit_** { *; }

# Keep Play Services classes used by the SDK
-keep class com.google.android.gms.common.** { *; }

# Keep CameraX classes (used for camera functionality)
-keep class androidx.camera.** { *; }

# Keep LightCompressor classes (video compression)
-keep class com.abedelazizshe.lightcompressorlibrary.** { *; }

# Dontwarn for OpenTelemetry optional dependencies
-dontwarn com.fasterxml.jackson.**
-dontwarn io.grpc.**
-dontwarn org.osgi.**

# Keep OpenTelemetry classes for telemetry functionality
-keep class io.opentelemetry.** { *; }
-dontwarn io.opentelemetry.**

# Keep Hilt generated classes
-keep class dagger.hilt.** { *; }
-keep class * extends dagger.hilt.** { *; }

-keep,allowobfuscation,allowshrinking class com.jaak.visagesdk.ui.viewmodel.LicenseViewModel
-keep,allowobfuscation,allowshrinking class com.jaak.visagesdk.ui.viewmodel.LicenseViewModel