1 # Onde Inference — ProGuard consumer rules
2 #
3 # These rules are applied to any app that depends on the Onde Inference AAR.
4 # They preserve the UniFFI JNI bridge symbols that the Rust native library
5 # resolves at runtime via System.loadLibrary("onde").
6
7 # Keep all UniFFI-generated classes and their native method declarations
8 -keep class uniffi.onde.** { *; }
9
10 # Keep the OndeInference public API and companion objects
11 -keep class com.ondeinference.onde.** { *; }
12
13 # Keep the StreamChunkListener callback interface (called from Rust)
14 -keep interface uniffi.onde.StreamChunkListener { *; }
15
16 # Prevent stripping of native method registrations
17 -keepclasseswithmembernames class * {
18 native <methods>;
19 }
20
21 # Keep Kotlin coroutine internal classes referenced by the Flow streaming API
22 -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
23 -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
24
25 # Prevent R8 from removing the load-library static initializer in the
26 # UniFFI-generated onde.kt (it calls System.loadLibrary in a companion object)
27 -keepclassmembers class uniffi.onde.* {
28 static <clinit>();
29 }