straw/rust/Cargo.toml
Cobb e4a8751942 reliability + security fix sprint (vc=91)
Straw full-audit fix batch (2026-07-04). Confirmed HIGH/MED findings:

- Updater self-brick: drop the fdroid.sulkta.com leaf+E7 SPKI pins (LE
  rotates the leaf every ~90d + intermediates from a pool → a routine
  renewal was guaranteed to miss both pins and silently kill the only
  in-app update path). System-CA validation + the install-time APK
  signature gate remain. Also distinguish "index unreachable" from "up to
  date", add a 30s callTimeout + bounded index read, guard the API-26
  NotificationChannel, and setOnlyAlertOnce.
- Request POST_NOTIFICATIONS at runtime so A13+ update/media notifications
  actually post (was declared but never requested → silent no-op).
- isDebuggable=false on the shipped debug variant (closes ADB run-as dump
  of watch/search history + subs; no package-id cutover).
- Crash fixes: distinctBy(url) on moreFromChannel + related (duplicate
  LazyColumn key); back-handling driven by live nav depth so it survives
  moveTaskToBack on A12+; PlaylistsStore per-store caps + off-main
  hydration (hostile import ANR); SponsorBlock staleness fence via
  NowPlaying.refreshIfCurrent.
- CacheCap.nearest() snaps up to the nearest finite cap (defaults no longer
  resolve to Unlimited/100k on fresh installs).
- RYD/SB FFI shims wrap the uniffi call (swallow a core panic per contract).
- Rust wrapper: release panic="unwind" (was "abort", which defeated UniFFI
  catch_unwind → any core panic = whole-app SIGABRT) + a 60s wall-clock
  timeout on every blocking extractor call (unblocks the caller, bounds
  thread pileup). Pairs with the strawcore-core reliability fix.
2026-07-04 07:09:54 -07:00

41 lines
1.4 KiB
TOML

# Straw Rust core — workspace.
# Hosts the JNI/UniFFI-exported library that replaces NewPipeExtractor.
#
# Builds via cargo-ndk for the four Android ABIs (arm64-v8a, armeabi-v7a,
# x86, x86_64). The Mozilla rust-android-gradle plugin wires this into the
# strawApp Gradle build so `./gradlew assembleDebug` produces a single APK
# with the .so files packed inside.
[workspace]
resolver = "2"
members = ["strawcore"]
[workspace.package]
edition = "2021"
license = "GPL-3.0-or-later"
authors = ["Sulkta"]
repository = "https://git.sulkta.com/Sulkta-OSS/straw"
[profile.release]
# Strip debug info, run thin LTO. APK size matters more than build time here.
strip = true
lto = "thin"
codegen-units = 1
# unwind (NOT abort): panic=abort defeats UniFFI's catch_unwind AND tokio's
# spawn_blocking JoinError capture, turning ANY panic in the extractor core
# (which chews weekly-rotating, attacker-influenced YouTube payloads) into an
# instant whole-app SIGABRT. unwind restores both safety nets so a core panic
# surfaces as a caught StrawcoreException instead of crashing the app. The
# unwind-table size cost is a rounding error against the 4-ABI jniLibs payload.
# (straw + FFI-wrapper audits, 2026-07-04.)
panic = "unwind"
opt-level = "z"
# `url` crate for video-id extraction in stream.rs.
[workspace.dependencies]
url = "2"
[profile.dev]
# Keep debug builds fast — we rebuild often during NDK cross-compile.
opt-level = 0
debug = 1