Files
chanora/crates/chanora_bridge/Cargo.toml
T
EdisonJwa 7966a7c8c6 feat(bridge,android): BridgeEvent::PermissionState + JNI publish hook + c++_shared link
Per SDD-106 §5 add BridgeEvent::PermissionState{permission, state}
with the PermissionStateKind enum (Granted, Denied, PermanentlyDenied,
Unknown). The Kotlin side publishes mid-session permission changes
through a new JNI entry point Java_app_chanora_chanora_1flutter
_MainActivity_publishPermissionState routed by the new
permission_jni.rs module; the Rust audio engine subscribes and
authoritatively clamps the transmit gate (see SDD-106 §6).

Adds crates/chanora_bridge/build.rs to emit
cargo:rustc-link-lib=dylib=c++_shared on Android so libchanora_bridge
.so carries DT_NEEDED libc++_shared.so; this is required by Android
API 24+ per-library linker namespaces to resolve __cxa_pure_virtual
and friends at System.loadLibrary time.

Includes the FRB-regenerated Dart counterparts so each commit is
independently buildable.

Trace: SDD-105, SDD-106 §5, SDD-118 item 6 (extended).
2026-05-18 12:32:01 +08:00

40 lines
1.5 KiB
TOML

[package]
name = "chanora_bridge"
description = "Chanora typed Flutter/Rust bridge — schema-controlled DTOs for commands, results, and events. Backed by flutter_rust_bridge 2.x per DEC-014."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
[lib]
# cdylib so the Flutter app can dlopen us via dart:ffi.
# staticlib so iOS / static-link configurations remain possible later.
# rlib so chanora_core and other Rust callers can use the public types.
crate-type = ["cdylib", "staticlib", "rlib"]
[dependencies]
chanora_core = { path = "../../core/chanora_core" }
chanora_protocol = { path = "../chanora_protocol" }
chanora_audio = { path = "../chanora_audio" }
flutter_rust_bridge = "=2.12.0"
thiserror.workspace = true
serde.workspace = true
tracing.workspace = true
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
# Android: route `tracing` output to logcat so a user can see protocol
# and audio diagnostics via `adb logcat -s chanora`. Also brings in the
# JNI bindings we need to initialise `ndk_context` for cpal-on-Oboe.
[target.'cfg(target_os = "android")'.dependencies]
tracing-android = "0.2"
log = "0.4"
jni = { version = "0.21", default-features = false }
ndk-context = "0.1"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }