# JNI native methods (and the descriptor classes referenced by their
# signatures) are resolved by FQN at runtime — keep them under R8.
-keepclasseswithmembernames,includedescriptorclasses class * {
    native <methods>;
}

# Generated cinterop bindings (com.ditto.dittoffi.*) are called from Rust by FQN.
-keep class com.ditto.dittoffi.** { *; }

# Vendored Kotlin/Native cinterop runtime, shaded under com.ditto.*.
#   - NativeMemoryAllocator's clinit reflects on its own field "rawOffset".
#   - JvmCallbacksKt resolves kotlin.jvm.functions.FunctionN by FQN to bridge
#     Kotlin lambdas to C function pointers.
-keep class com.ditto.kotlinx.cinterop.** { *; }
-keep class com.ditto.org.jetbrains.** { *; }
-keep class kotlin.jvm.functions.Function* { *; }
