This is the big one — the Tauri Android app now has a real audio stack
capable of full-duplex VoIP, reusing the proven C++ Oboe bridge from the
legacy wzp-android crate.
Architecture:
- desktop/src-tauri/cpp/ — copies of oboe_bridge.{h,cpp}, oboe_stub.cpp,
and getauxval_fix.c from crates/wzp-android/cpp/. build.rs clones
google/oboe@1.8.1 into OUT_DIR and compiles the bridge + all Oboe
sources as "oboe_bridge" static lib, linking against shared libc++
(static would pull broken libc stubs that SIGSEGV in .so libraries).
- src/oboe_audio.rs — Rust side: an SPSC ring buffer matching the C++
bridge's AtomicI32 layout, plus OboeHandle::start() which returns
(capture_ring, playout_ring, owning_handle). The ring exposes the same
(available / read / write) methods as wzp_client::audio_ring::AudioRing
so CallEngine treats both backends interchangeably.
- src/engine.rs — compiled on every platform now. A cfg-switched type
alias picks wzp_client::audio_ring::AudioRing on desktop and
crate::oboe_audio::AudioRing on Android. The audio setup block has
three branches: VPIO/CPAL on macOS, CPAL on Linux/Windows, Oboe on
Android. Send/recv tasks are identical across platforms.
- src/lib.rs — removes all the "step 3 not done" Android stubs. The
engine module is no longer cfg-gated; connect / disconnect / toggle_mic
/ toggle_speaker / get_status are single implementations used by both
desktop and Android. Identity path resolves via app.path().app_data_dir()
from the Tauri setup() callback (already wired in step 1).
Runtime mic permission:
- scripts/build-tauri-android.sh now injects RECORD_AUDIO + MODIFY_AUDIO_
SETTINGS into gen/android/app/src/main/AndroidManifest.xml after init,
and overwrites MainActivity.kt with a version that calls
ActivityCompat.requestPermissions in onCreate. This is idempotent:
every build re-applies the patches so tauri re-init can't regress them.
Cargo.toml:
- cc is now an unconditional build-dep (build.rs runs on the host, so
target-gating build-deps doesn't work).
- wzp-client is now a dep on every platform. On Android it gets default
features only (no "audio"/"vpio") so CPAL isn't dragged in — oboe_audio
provides the capture/playout rings instead.
- tracing-android is added on Android so tracing events flow into logcat.
build.rs also gained embedded git hash (WZP_GIT_HASH) capture, which is
shown under the fingerprint on the home screen — already committed in
7639aaf, reinstated here alongside the Oboe build logic.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
61 lines
2.0 KiB
TOML
61 lines
2.0 KiB
TOML
[package]
|
|
name = "wzp-desktop"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
description = "WarzonePhone Desktop — encrypted VoIP client"
|
|
default-run = "wzp-desktop"
|
|
|
|
# Library target — required for Tauri mobile (Android/iOS link the app as a cdylib)
|
|
# and also used by the desktop binary below.
|
|
[lib]
|
|
name = "wzp_desktop_lib"
|
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
|
|
[[bin]]
|
|
name = "wzp-desktop"
|
|
path = "src/main.rs"
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [] }
|
|
# cc is always available because build.rs runs on the HOST, not the TARGET.
|
|
# We gate the actual cc::Build::new() calls on `target.contains("android")` at
|
|
# build-script runtime.
|
|
cc = "1"
|
|
|
|
[dependencies]
|
|
tauri = { version = "2", features = [] }
|
|
tauri-plugin-shell = "2"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
tokio = { version = "1", features = ["full"] }
|
|
tracing = "0.1"
|
|
tracing-subscriber = "0.3"
|
|
anyhow = "1"
|
|
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
|
|
|
|
# WarzonePhone crates — protocol layer is platform-independent
|
|
wzp-proto = { path = "../../crates/wzp-proto" }
|
|
wzp-codec = { path = "../../crates/wzp-codec" }
|
|
wzp-fec = { path = "../../crates/wzp-fec" }
|
|
wzp-crypto = { path = "../../crates/wzp-crypto" }
|
|
wzp-transport = { path = "../../crates/wzp-transport" }
|
|
|
|
# wzp-client on desktop: full audio stack (CPAL + macOS VoiceProcessingIO)
|
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
|
wzp-client = { path = "../../crates/wzp-client", features = ["audio", "vpio"] }
|
|
|
|
# wzp-client on Android: only the codec/handshake/call modules. Audio I/O is
|
|
# handled by our own oboe_audio module (C++ Oboe bridge).
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
wzp-client = { path = "../../crates/wzp-client", default-features = false }
|
|
# On-device logcat bridge for the tracing crate — useful for native debugging.
|
|
tracing-android = "0.2"
|
|
|
|
# Platform-specific
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
coreaudio-rs = "0.11"
|
|
|
|
[features]
|
|
default = ["custom-protocol"]
|
|
custom-protocol = ["tauri/custom-protocol"]
|