# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
-keep class com.arthenica.mobileffmpeg.Config {
    native <methods>;
    void log(long, int, byte[]);
    void statistics(long, int, float, float, long , int, double, double);
}
-keepclassmembers class com.android.installreferrer.api.** {
  *;
}
-keep class com.google.android.gms.common.** {*;}
-keep public class com.horcrux.svg.** {*;}
-keep class com.arthenica.mobileffmpeg.AbiDetect {
    native <methods>;
}
-keep class com.humand.demo.BuildConfig { *; }
-keepattributes *Annotation*
-keepclassmembers class ** {
  @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
-keep class com.android.installreferrer.api.** {
  *;
}
-keep class com.google.android.gms.common.** {*;}
-keep class org.webrtc.** { *; }
-dontwarn com.stripe.**
-dontwarn com.google.common.util.concurrent.ListenableFuture
-dontwarn com.facebook.fresco.ui.common.LoggingListener
-dontwarn com.facebook.drawee.controller.AbstractDraweeController.mLoggingListener
-dontwarn com.facebook.memory.config.MemorySpikeConfig

# Keep AudioManager APIs for communication device handling
-keep class android.media.AudioManager$OnCommunicationDeviceChangedListener { *; }
-keep class android.media.AudioManager {
    public void addOnCommunicationDeviceChangedListener(...);
    public void removeOnCommunicationDeviceChangedListener(...);
    public void setCommunicationDevice(...);
    public void clearCommunicationDevice();
    public android.media.AudioDeviceInfo[] getAvailableCommunicationDevices();
}
-keep class android.media.AudioDeviceInfo { *; }

# Kotlin Coroutines - Fix for pdfiumandroid
-keep class kotlin.coroutines.** { *; }
-keep class kotlinx.coroutines.** { *; }
-dontwarn kotlin.coroutines.jvm.internal.**
-keep class kotlin.coroutines.jvm.internal.** { *; }

# Expo Modules
-keep class expo.modules.** { *; }
-dontwarn expo.modules.**

# Google Common (Guava)
-keep class com.google.common.** { *; }
-dontwarn com.google.common.**

# PDF library dependencies
-keep class io.legere.pdfiumandroid.** { *; }
-dontwarn io.legere.pdfiumandroid.**

# Additional rules for coroutines suspend functions
-keepclassmembernames class kotlinx.** {
    volatile <fields>;
}
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

# Keep generic signature of Continuation
-keepattributes Signature, InnerClasses, EnclosingMethod

# Kotlinx-coroutines-core
-keep class kotlinx.coroutines.android.AndroidExceptionPreHandler { *; }
-keep class kotlinx.coroutines.android.AndroidDispatcherFactory { *; }

# Keep Continuation interface
-keep class kotlin.coroutines.Continuation { *; }

# Keep all methods with Continuation parameters (suspend functions)
-keepclassmembers class ** {
    *** *(***, kotlin.coroutines.Continuation);
}

# Stream Video SDK
-keep class io.getstream.video.** { *; }
-dontwarn io.getstream.video.android.mock.StreamPreviewDataUtils
-dontwarn io.getstream.video.android.mock.StreamPreviewDataUtilsKt