# Keep rules for the BLE stack. # # Every class below is reached only from Rust, over JNI, by name. R8 sees no # reference to any of it and would strip or rename the lot — and the failure is # invisible until the first scan on a *release* build, where btleplug's # `platform::init` throws ClassNotFound and the app finds no trainer. Debug # builds are unminified, so this cannot be caught by testing locally. # btleplug's Android backend. `register_native_methods` binds by exact method # name and signature, and the exception classes are looked up so the Rust side # can map them onto btleplug::Error. -keep class com.nonpolynomial.btleplug.** { *; } # jni-utils: the Future/Stream/Waker plumbing btleplug's Java calls back into. -keep class io.github.gedgygedgy.rust.** { *; } # The Rust side calls these on the Android framework classes it is handed. -keepclassmembers class * extends android.bluetooth.BluetoothGattCallback { *; } -keepclassmembers class * extends android.bluetooth.le.ScanCallback { *; } # Our own JNI entry point, called from MainActivity as an `external fun`. -keepclasseswithmembernames class paris.tourolle.bikecontrol.MainActivity { native ; }