A staged file that replaces an existing one sits beside its old copy
until its swap, so many large replaced files open at once could run a
nearly full device out of space mid-update. The stream engine now admits
files in order and admits a replaced file only while the planned sizes of
open replaced files fit a budget (always at least one); the fetch core
dispatches a chunk only once its first file is admitted. Fresh files are
never held back. The manager sizes the budget from the game volume's free
space after the net growth and the cache, floored at the largest replaced
file, and hands over to the lookahead engine when that does not fit.
A successful install also removes the empty owned staging namespace.
The stream engine (mode=adaptive) stays the default; the lookahead engine
from this PR is selectable as mode=lookahead and takes over when the
stream engine's space plan does not fit. Once the library is loaded an
engine failure fails the install instead of switching to Java downloads.
nativeStream stages files in the owned .droiddeck-epic-staging namespace,
and its handle carries the worker thread that release joins. Each mode
logs its own summary line; docs describe all four writers.
EpicDownloadManager runs EpicNative.stream when the library loads and its
per-volume space plan fits (cache on internal scratch for card installs,
beside the game when internal storage is full), and falls back to the
bounded Java writer otherwise. A hidden storesEpicMode preference selects
adaptive, batch (whole-cache fetch then native assembly, with its 2x
space check) or java for A/B runs; each mode logs a summary line.
The stores' sign-ins (files/stores/<store>/credentials.json: access and refresh
tokens, account id and name) were plain JSON. Other apps could not read them, but
every program in the Linux session runs as the app and could. They are now sealed
with AES-256-GCM under a non-exportable AndroidKeyStore key (StrongBox when the
device has one), so the session only ever sees ciphertext.
- Format: a versioned envelope {v, alg, iv, ct}, written atomically and readable
only by the app. No new dependencies (javax.crypto and KeyStore).
- Migration: an existing plaintext file is sealed at the next start, checked by
decrypting it, then the plaintext is removed; users stay signed in.
- No Keystore on the device: the file stays plain and the log says so once per
start.
- A sealed file that can never be opened (tampered, key gone or invalidated,
broken envelope) is removed and that store asks for sign-in again. A transient
Keystore error keeps the file and retries.
A Stores section (rail, under Games; Setup › Stores gate) with each store's sign-in,
library, storefront shelves and a download queue. Each store has two tabs, Store and
Library, and Library filters to All or Installed; libraries open from a saved copy
and refresh in the background, with install sizes on every card. Games install to internal storage,
or a card chosen at Install time, and are registered in the Steam client as non-Steam
games, so they launch through Steam and droiddeck-proton from either the front end or
the client.
- Downloads: GOG, Epic and Amazon engines in Rust (app/src/main/rust/stores, built by
cargo-ndk, nothing compiled in the tree). One adaptive fetch core with a latency
brake, stalled-host handoff and every CDN a store offers. Per-stage progress,
pause/resume, two-step cancel that deletes, failed downloads kept for retry, a
foreground service with Wi-Fi and wake locks and notification controls.
- Games tab: store source chips (Steam, GOG, Epic, Amazon, Custom) and store art.
- Epic: per-launch exchange code from the app and from Steam's Play button,
"Epic sign-in (EOS)", "Launch offline", and a game's web links opened in Android's
browser for EOS consent. The EOS overlay crashed games and is left out.
- Cloud saves (GOG, Epic): pulled before launch, pushed after the game or the session
ends, no upload before a first download, conflicts never overwritten, backups both
ways.
- Logs: every store line redacted; the engine log goes to daily files.