straw/rust/strawcore/Cargo.toml
Kayos 54458f3d40 Path C-1/C-2: rustypipe fork dep + Gradle Rust pipeline
C-1: rust/strawcore/Cargo.toml now points at Sulkta-Coop/rustypipe
     v0.11.5-sulkta.2 (kayos/m1-sig-port) instead of upstream 0.11.4.
     Upstream's sig-regex hard-fails on current YT player c2f7551f;
     the fork soft-fails, defaults to iOS-first, makes Deobfuscation
     errors switchable through the client-fallback chain, and adds
     observability via Reporter Level::WRN.

C-2: strawApp/build.gradle.kts restores the U-1 era Gradle Rust glue:
     - cargoBuild     → cross-compile strawcore for 4 Android ABIs
     - cargoBuildHost → host-arch debug build for uniffi-bindgen
                        to read metadata from
     - uniffiBindgen  → generate Kotlin bindings from libstrawcore.so
     Wired into the Android build via mergeXxxJniLibFolders +
     compileXxxKotlin task dependencies.

Bumps + gitignores:
     - .gitignore now excludes rust/target, strawApp/src/main/jniLibs,
       and strawApp/src/main/java/uniffi (generated)
     - jna 5.14.0 added as the JNI bridge runtime

Next: cargoBuildHost + uniffiBindgen verification in crafting-table,
then C-3 swaps SearchViewModel back to uniffi.strawcore.search().
2026-05-24 12:44:17 -07:00

65 lines
3 KiB
TOML

[package]
name = "strawcore"
version = "0.1.0"
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
[lib]
# cdylib — the .so that Android loads via System.loadLibrary("strawcore").
# staticlib — kept in case we ever want to link statically for a benchmark.
crate-type = ["cdylib", "staticlib"]
[dependencies]
# UniFFI generates the Kotlin bindings + the JNI glue. proc-macro mode
# (no .udl file) — annotate Rust fns directly with #[uniffi::export].
# `tokio` feature wires `#[uniffi::export(async_runtime = "tokio")]` so async
# fns surface as suspend fun on the Kotlin side.
uniffi = { version = "0.28", features = ["cli", "tokio"] }
# Tokio multi-thread runtime — rustypipe is async-first.
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync"] }
# rustypipe — the actual YouTube Innertube client. Phase U-2 wires search,
# U-3 wires streamInfo, U-4 wires channels.
#
# Points at the Sulkta-Coop fork (kayos/m1-sig-port branch, tag v0.11.5-sulkta.2)
# because upstream 0.11.4 hard-failed at init when YT rotated the
# player.js to a shape its sig-regex doesn't recognise (player c2f7551f, May 2026).
# The fork:
# - skips player.js deobf entirely for the iOS/Android client paths
# (pre-signed URLs, no &s= cipher, no &n= throttle param)
# - soft-fails sig_fn/nsig_fn extraction with a switchable error class
# so the player_from_clients chain falls through to iOS instead of
# killing the call
# - defaults to iOS-first client order
# - emits Level::WRN reporter event on partial extraction
#
# Force rustls + webpki-roots so we don't pull openssl-sys (cross-compiling
# system OpenSSL to four Android ABIs is a tarpit; rustls is pure-Rust).
#
# When YT rotates back to a sig shape both upstream and our fork recognise,
# we can flip back to crates.io. Until then, the fork is the only working dep.
rustypipe = { git = "http://192.168.0.5:3001/Sulkta-Coop/rustypipe.git", tag = "v0.11.5-sulkta.2", default-features = false, features = ["rustls-tls-webpki-roots"] }
# rquickjs-sys (transitive dep of rustypipe for YT signature decryption JS)
# doesn't ship prebuilt Android bindings. Direct-depend with `bindgen` feature
# so it generates them at build time. Crafting-table has libclang preinstalled.
rquickjs-sys = { version = "0.9", default-features = false, features = ["bindgen"] }
# Error glue.
thiserror = "1"
# Single-threaded init for the runtime + extractor singletons.
once_cell = "1"
# URL parsing for the video-id extractor in stream.rs.
url = { workspace = true }
# Android log integration — `log::info!()` ends up in `adb logcat -s strawcore`.
log = "0.4"
android_logger = { version = "0.14", default-features = false }
[build-dependencies]
uniffi = { version = "0.28", features = ["build"] }
[[bin]]
# Generates Kotlin bindings from the compiled .so:
# cargo run --bin uniffi-bindgen generate --library target/.../libstrawcore.so \
# --language kotlin --out-dir ../../strawApp/src/main/kotlin
name = "uniffi-bindgen"
path = "src/uniffi-bindgen.rs"