The workspace pinned `ring` everywhere because aws-lc-sys 0.41.0 failed to C-compile on the Windows CI runner. Re-tested on that runner (.133) with aws-lc-sys 0.44.0: the `params.c` cl.exe failure does not reproduce under MSVC 14.44, and rustls's `aws_lc_rs` feature turns on `aws-lc-rs/prebuilt-nasm`, so no NASM is needed on the box either. That unblocks post-quantum TLS: `prefer-post-quantum` offers X25519MLKEM768 first on every TLS 1.3 handshake (mgmt API, native control plane, QUIC), which ring cannot do — it has no ML-KEM. Classical curves stay in the list, so older clients still connect. rustls, quinn, rcgen and tokio-rustls each select a backend independently, so all four had to move together; a single dissenter pulls a second crypto stack in via feature unification. The direct `ring` users (ed25519 in pf-update-check, SHA-256 in the Windows updater) moved to aws-lc-rs, whose API is ring-compatible. `ring` does NOT leave the tree: ureq 2 names `features = ["ring"]` in its own rustls dependency line and cargo features are additive, so no dependent can switch it off. Two backends compiled in means rustls refuses to infer one, and anything built via `ClientConfig::builder()` panics instead of picking — which is what ureq's default agent does on its first HTTPS request. `tls::install_default_provider()` makes the choice explicit; it runs at each binary's entry point and defensively in pf-client-core, which several binaries link. Dropping ring entirely needs the ureq 2 -> 3 upgrade (36 call sites), deliberately left out of this change. Verified on macOS: pf-update-check 32, punktfunk-core 385, c_abi 1 (the last with LIBRARY_PATH=/opt/homebrew/opt/opus/lib) — aws-lc-sys links into the C ABI harness, so the Swift/Kotlin embedders keep working. cargo fmt --all --check clean.
79 lines
5.2 KiB
TOML
79 lines
5.2 KiB
TOML
[package]
|
|
name = "punktfunk-client-android"
|
|
description = "punktfunk Android client — JNI bridge ('nativecore') over punktfunk-core (Rust-heavy client model)"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
|
|
[lib]
|
|
# `libpunktfunk_android.so` — loaded by Kotlin via `System.loadLibrary("punktfunk_android")`.
|
|
name = "punktfunk_android"
|
|
crate-type = ["cdylib"]
|
|
|
|
[dependencies]
|
|
# The whole protocol/transport/FEC/crypto + the embeddable NativeClient connector. `quic` pulls
|
|
# the punktfunk/1 control plane, whose TLS runs on aws-lc-rs (see punktfunk-core/Cargo.toml) —
|
|
# aws-lc-sys cross-compiles for all three ABIs with the NDK clang cargo-ndk already exports.
|
|
punktfunk-core = { path = "../../../crates/punktfunk-core", features = ["quic"] }
|
|
jni = "0.21"
|
|
log = "0.4"
|
|
# LAN host discovery: browse the host's `_punktfunk._udp` mDNS advert — the SAME crate + service the
|
|
# Linux/Windows clients use (`crates/pf-client-core/src/discovery.rs`), replacing Android's per-OEM
|
|
# `NsdManager` system daemon with one tested browse path. Pure Rust (socket2/if-addrs/mio), so it
|
|
# cross-compiles to the Android targets AND builds on the host (the JNI seam links into
|
|
# `cargo build --workspace`). Kotlin keeps only the Wi-Fi `MulticastLock` + permission UX.
|
|
mdns-sd = "0.20"
|
|
|
|
# Android-only deps. Gated so `cargo build --workspace` on the Linux/macOS dev boxes + CI still
|
|
# compiles this crate (as a host cdylib) — the Android-framework glue (logging, AMediaCodec + AAudio
|
|
# via `ndk`, the Opus codec) is only pulled in for the real `*-linux-android` targets.
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
android_logger = "0.14"
|
|
# Feature bridge, no code here: punktfunk-core logs through `tracing`, but this client only
|
|
# installs `android_logger` (a `log` backend). Core transport warnings (e.g. "UDP socket buffer
|
|
# capped well below target") reach logcat only via tracing's "log" feature, which forwards events
|
|
# as `log` records when no tracing subscriber is set (always, here). Today that feature happens to
|
|
# be enabled transitively — quinn's default `log` feature unifies `tracing/log` onto the whole
|
|
# graph — but nothing about this client's logging should hinge on a QUIC crate's default feature
|
|
# set, so declare it explicitly.
|
|
tracing = { version = "0.1", default-features = false, features = ["std", "log"] }
|
|
# NDK bindings. "media" = AMediaCodec/ANativeWindow (video); "audio" = AAudio (audio playback).
|
|
# Pure-Rust FFI to libmediandk/libnativewindow/libaaudio — no C++/libc++_shared to bundle. Decode +
|
|
# audio run entirely in Rust on native threads (the "no async on the hot path" invariant).
|
|
# api-level-28 matches the app's minSdk floor (Android 9). AAudio (26), AMediaCodec (21) and
|
|
# ANativeWindow_setBuffersDataSpace (28) are all ≤28; every call above the floor —
|
|
# ANativeWindow_setFrameRate (30), …WithChangeStrategy (31), AMediaCodec_setOnFrameRenderedCallback
|
|
# (33), the ADPF hints — is dlsym-resolved at runtime (decode::try_set_frame_rate,
|
|
# decode::install_render_callback, adpf), never linked, so the .so still loads on API 28+.
|
|
ndk = { version = "0.9", features = ["media", "audio", "nativewindow", "api-level-28"] }
|
|
# Raw FFI *types* for the one AMediaCodec entry point the `ndk` wrapper lacks:
|
|
# `AMediaCodec_setOnFrameRenderedCallback` — the per-frame render-timestamp callback behind the
|
|
# HUD's `display` stage (see decode::DisplayTracker). The symbol is API 33 ("Available since
|
|
# Android T"), ABOVE the minSdk-28 floor, so it is dlsym-resolved at runtime
|
|
# (decode::install_render_callback), NEVER hard-linked: 0.9.0 hard-linked it and
|
|
# `System.loadLibrary` failed on every pre-Android-13 device. Only ndk-sys's pointer/typedef
|
|
# types are referenced, which creates no import. Reaching it needs the codec's raw pointer, which
|
|
# is why the workspace pins `ndk` to the vendored copy whose only patch makes `MediaCodec::as_ptr`
|
|
# public (vendor/ndk, wired in the root Cargo.toml).
|
|
ndk-sys = { version = "0.6", features = ["media"] }
|
|
# setpriority/gettid to raise the decode thread toward URGENT_DISPLAY (see decode::boost_thread_priority).
|
|
libc = "0.2"
|
|
# Opus decode for the host→client audio plane (0xC9: 48 kHz stereo, 5 ms frames). Same crate the
|
|
# host + Linux client use. audiopus_sys vendors libopus (pure C) and builds it static via cmake —
|
|
# the cargo-ndk build sets LIBOPUS_STATIC=1/LIBOPUS_NO_PKG=1 so it links the bundled lib, not the host's.
|
|
opus = "0.3"
|
|
# Tier-A pad audio (WP9). Android's audio framework denylists the DualSense's output by VID/PID,
|
|
# so the pad's isochronous endpoint is driven directly on the fd `UsbDeviceConnection` hands over.
|
|
# Our own crates, developed openly because the hole they fill — isochronous USB in Rust — is an
|
|
# ecosystem-wide one: https://github.com/unom-io/usbfs-iso
|
|
# Pinned by revision rather than floating: this is a transport under a real-time deadline and it
|
|
# should move when we choose to. Becomes a plain version dependency once the crates are published.
|
|
uac-host = { git = "https://github.com/unom-io/usbfs-iso", rev = "f3de1fd62cec271d07f45664dc464f23e423e721" }
|
|
usbfs-iso = { git = "https://github.com/unom-io/usbfs-iso", rev = "f3de1fd62cec271d07f45664dc464f23e423e721" }
|
|
|
|
[lints]
|
|
workspace = true
|