Files
proton-stream/crates/pstr-android/Cargo.toml
T
nvrl 0b2813cd42 feat(core,stream,meta,app,android,cli): sign in to Proton and sync watch history
A Proton account is now optional alongside public links. Signing in (password,
then a second-factor code and a mailbox password where the account has them;
a CAPTCHA gate is solved in the Android app) stores one session blob in the OS
credential store under `proton-account`, writing back every refreshed token
since refresh tokens are single-use. With an account, folders of the viewer's
own Drive — My Files, other devices, shared with me — can be added as shares
through the same `ShareClient` surface as a public link.

Watch history syncs through a `proton-stream` device in that Drive: one
`watch-history/<installation>.json` per installation, so no two devices ever
write the same file. Each sync reads the others and merges per episode, newer
`updated_at` wins, with a deterministic tie-break. It runs at launch, after
sign-in, whenever the player closes and every five minutes. A session that can
no longer refresh signs the app out instead of failing on every launch.

The CLI gains `login`, `logout`, `account`, `browse` and `sync`.

Also in this change:
- Android offline downloads no longer look stuck (B64): two transfer at once,
  through a copy stream with no read-ahead, with a smoothed transfer rate.
- Choosing a metadata match by hand now enriches the title too, instead of
  keeping the old match's episodes and artwork.

The catalog schema is unchanged.
2026-10-06 13:06:54 +02:00

41 lines
991 B
TOML

[package]
name = "pstr-android"
description = "Android language bridge for proton-stream."
version.workspace = true
edition.workspace = true
license-file = "LICENSE"
repository.workspace = true
rust-version.workspace = true
authors.workspace = true
[lib]
crate-type = ["cdylib", "rlib"]
[features]
bindgen = ["uniffi/cli"]
[[bin]]
name = "uniffi-bindgen"
path = "src/bin/uniffi-bindgen.rs"
required-features = ["bindgen"]
[dependencies]
pstr-core.workspace = true
pstr-meta.workspace = true
pstr-stream.workspace = true
tokio.workspace = true
futures.workspace = true
parking_lot.workspace = true
thiserror.workspace = true
uniffi.workspace = true
serde.workspace = true
serde_json.workspace = true
log = "0.4"
[target.'cfg(target_os = "android")'.dependencies]
# Match rustls-platform-verifier's JNI types: Java objects from different
# major `jni` releases cannot be passed across the verifier's API boundary.
jni = "0.21.1"
rustls-platform-verifier = "0.6.2"
android_logger = "0.14"