WP-085: Google TV app pipeline — library, import, test packages and updates

Status: 🚧 In progress — executed 2026-11-26/27 on the TCL 65Q77K (§Result). Milestones 1, 3 and 4 verified; fork PR barefootbetters/scummvm#13 merged into scooby-engine 2026-11-27 (0d5a69c769). Open: exit criterion 3, an import route that works without a computer (USB and the system picker don’t work on this TV; the cloud route is untested on a personal account). Pre-flight READY 2026-11-26; execution prompt session-WP-085-2026-11-26. Not blocked on any rights holder: it distributes no game, and tests only with legally obtained data. Built first: Jeff chose “Pipeline first (a)” on 2026-11-26, so this app ships to Google Play through WP-084 once it’s done (D0). Phase: 5 (polish & distribution). Depends on: WP-079 ✅ (the fork’s TV build path proven on the TCL 65Q77K, per the smart-TV guide). Unblocks: any Google Play release of the studio’s TV app (WP-084 or its successor), and the delivery path for licensed TerraGlyph game data. Companion EC: EC-008. Pre-flight required: Yes. It changes the fork outside engines/terraglyph/ (the Android backend and build configuration) and adds network download code. Targets generation(s): none directly. TerraGlyph is compiled in and tested with Gen 1 (Showdown) data; no engine code changes. Estimated effort: about 2 weeks across four milestones, each verified on the TV before the next starts.


Goal

Prove the studio can deliver and maintain a complete ScummVM-powered game experience on Google TV: an app with its own identity that contains the fork’s runtime, shows a library of installed games, imports legally obtained games, downloads and installs authorized game-data packages with integrity checks, removes them, and keeps games and saves through app and game-data updates. The milestone is the pipeline, not any particular game. It’s built and verified by sideloading; the Google Play release is a separate step.

Background

Scope

In scope

Milestone 1 — the app shell.

  1. Our own applicationId, app name, icon and TV banner (per D1), containing the fork’s runtime with sky and terraglyph engines (and any engine the test data needs).
  2. The library is ScummVM’s launcher (grid view), not a new UI, for v1.
  3. Input: Bluetooth keyboard and mouse work throughout; a gamepad works throughout (left stick moves the pointer); the TV remote reaches and launches games in the library. Each recorded as pass/gap on the TCL. The Play release declares a gamepad required (D2; WP-084 §6 sets the manifest); keyboard and mouse stay supported.

Milestone 2 — importing a legally obtained game.

  1. On the TCL, test each import route and record which work: the system file picker (“Add game”, including from USB storage); ScummVM’s cloud download dialog; adb push to the app’s folder (developer fallback).
  2. An imported game is detected, appears in the library, launches, saves, and restores after the app is closed and reopened.

Milestone 3 — authorized test packages (an advanced mode).

  1. A hidden advanced mode (off by default) that lists packages from a manifest fetched over HTTPS. Test builds only (D4): the Play build doesn’t include it.
  2. Each package is a zip of game data only. The manifest gives its id, version, size, SHA-256 and download URL. The downloader takes any HTTPS URL from the manifest and hard-codes no host, so packages can move between hosts without an app change (D3). The app downloads to a temporary folder, refuses any file whose SHA-256 doesn’t match, extracts into app-specific storage (not the bundled-assets path, which updateStartSettings prunes), runs ScummVM’s add/detection, and shows it in the library.
  3. Remove: deletes the game’s files and its library entry; its saves are kept unless the user deletes them too.
  4. Advanced mode also shows the engine version, the detection result for each installed game, and a shareable diagnostic log.
  5. Implementation preference: Android-side (Java) download, verify and extract, feeding ScummVM’s existing add path; keep C++ changes minimal. Porting backends/dlc/ to Android is the alternative if it proves smaller (it would still need the integrity check added).

Milestone 4 — updates.

  1. App updates: a newer build installed over an older one (sideload now; Play later) keeps installed games, library entries and saves.
  2. Game-data updates: a manifest with a newer package version offers an update; the new package is downloaded and verified before the old one is touched, then swapped in; a failed or interrupted update leaves the old version playable.
  3. Verified end to end on the TCL with the test data in §Dependencies.

Out of scope

Decisions for Jeff

# Decision Recommendation
D0 How this WP relates to WP-084 and the logged “free Google TV app first” decision. (a) WP-085 comes first and WP-084 becomes the store release of this app; (b) WP-084 ships first as planned and WP-085 follows; (c) WP-085 replaces WP-084 Answered 2026-11-26 — (a). Jeff: “Pipeline first (a)”. WP-084 is re-scoped as this app’s Google Play release
D1 App identity (tracked privately, not in this public WP) Answered 2026-11-26; tracked privately. The package id is treated as permanent: once published on Play it can’t change, and this app may become the shared runtime other apps detect by that id (see Notes)
D2 Input requirement for a Play release. Gamepad required (meets TV-GP), keyboard and mouse supported; D-pad required (Copilot’s proposal; the D-pad moves ScummVM’s pointer today but lacks the fine movement needed to click a button or object, per Jeff on the TCL, 2026-11-26); or mouse required (no TV-quality exemption; risks TV review) Answered 2026-11-26. Jeff: “Gamepad required (Rec)”. Gamepad required for Play; keyboard and mouse supported and tested now. The D-pad-only pointer stays out of scope
D3 Where test packages are hosted Answered 2026-11-26. Jeff: “Split, own repo (Rec)”. Freely redistributable packages (the BASS freeware, readme intact) go on GitHub Releases in a dedicated repo, which keeps game data out of the engine repos; anything licensed goes on Cloudflare behind Access. The downloader is host-independent (§Scope 7). WP-085 hosts only BASS, so the Access host isn’t built here: it’s set up when licensed data first needs it
D4 Whether advanced mode ships in the Play build or only in test builds Answered 2026-11-26. Jeff: “Test builds only (Rec)”. Test builds only for v1; revisit after the first Play release

Pre-flight answers (2026-11-26)

Put to Jeff at the pre-flight, recommendation first. The answers are the option labels he picked.

# Question Jeff’s answer
Q1 Keeping the package id private on the public fork “Inject at build time (Rec)”. The fork keeps org.scummvm.scummvm and ScummVM’s name and art as defaults. The real id, label and art come from Gradle properties (tvAppId, tvAppLabel, tvAppResDir) in the build environment’s user-level gradle.properties, outside every repo, with the values recorded privately. namespace is unchanged
Q2 The test-package repo’s name “tv-test-packages (Rec)”: barefootbetters/tv-test-packages. Created on Jeff’s go during Milestone 3
Q3 Icon and banner for sideloaded test builds “Placeholders OK (Rec)”. The real art is needed only for the Play release

Engineering calls (pre-flight, 2026-11-26)

Reasoning and code citations are in the pre-flight.

  1. Java download, verify and extract (§Scope 10’s preference), feeding ScummVM’s own --add --path=… --recursive --no-exit. Porting backends/dlc/ would also need a SHA-256 implementation, Android store wiring, a manifest adapter and update logic.
  2. D4 by build-type source sets: the advanced-mode classes are compiled into the debug (test) build only, with a stub in release, so the Play build holds no advanced-mode code. EC-008 Step 3 checks the release APK with apkanalyzer and a dex string search.
  3. Packages live in getFilesDir()/packages/<id>/<version>/, staged in packages/.staging/. App updates keep folders in the data dir, and only assets/ and doc/ are resynced.

Dependencies

Execution

  1. Pre-flight: pre-flight-WP-085-2026-11-26, READY.
  2. Milestone 1 → verify on the TCL (EC-008 step 1) → Milestone 2 → verify → Milestone 3 → verify → Milestone 4 → verify. Each milestone lands as its own commit on the fork branch; a failed verification is fixed before the next milestone starts.
  3. Write §Result with evidence; open the fork PR.

Exit criteria

  1. D0–D4 answered (2026-11-26; §Decisions).
  2. Milestone 1: the app installs on the TCL with its own identity, shows the library, and launches a game; keyboard, mouse, gamepad and remote results recorded. (The gamepad is recorded as not tested: none was paired.)
  3. Milestone 2: at least one import route works on the TCL without a computer; the imported game launches, saves and restores (logged). Routes that don’t work are recorded. Open: only adb push worked; launch, save and restore passed.
  4. Milestone 3: a test package is listed, downloaded, verified, installed, detected, launched and removed on the TCL (logged); a package with a wrong SHA-256 is refused (logged).
  5. Milestone 4: an app update keeps games and saves; a game-data update installs after verification; an interrupted update leaves the old version playable (logged).
  6. No executable code is downloaded by the app (code review note in §Result).
  7. Fork PR open with the milestone commits; §Result written. (Merged 2026-11-27.) Three commits: milestone 2 needed no code.

Deliverables

Result

Executed 2026-11-26/27 on the TCL 65Q77K (Google TV, Android 14, armeabi-v7a) from the execution prompt. Every result below comes from a capture made in the session (logcat, dumpsys, run-as file listings, screenshots) or is Jeff’s live confirmation, marked as his. Per-step evidence is in EC-008. Raw captures stay local, because they show the TV’s address and the app’s id.

Fork PR: barefootbetters/scummvm#13, merged 2026-11-27 with a merge commit (0d5a69c769) so the milestone SHAs below stay as cited; branch wp-085-tv-app-pipeline off ff490ad9449f. Three commits, all inside dists/android/ and backends/platform/android/:

Commit Milestone What
99d611a9d8 1 Identity injected from Gradle properties (tvAppId, tvAppLabel, tvAppResDir); grid launcher by default, when the build has PNG support
70a3ba0a5c 3 The hidden advanced mode, test builds only: manifest, download, verify, data-only extract, add, launch, remove, update, diagnostics
1c625e57c9 4 tvAppVersionCode / tvAppVersionName, so the app numbers its own releases

Milestone 2 needed no code. The manifest format is tv-package-manifest. The test packages are on barefootbetters/tv-test-packages release packages-2026-11-26, created on Jeff’s go (Q2).

Per milestone

Milestone Result
1, app shell ✅ Installs as the injected id beside the WP-079 app; its own icon and name in Google TV’s Your apps (the banner is in the APK; this Google TV row shows icons). The grid launcher opens. BASS was added and launched with the remote. Keyboard typing works; the combo keyboard’s F-row sends media keys, so F5 is Fn+F5. Touchpad pointer and click work. Gaps: right-click and two-finger scroll did nothing; no gamepad was available
2, import ⚠️ adb push into the app’s own folder, then Add Game… ✅. USB by path ❌ (Permission denied: Android 14 hides non-media files on removable storage). USB through the system picker ❌ (no picker on this TV: only com.android.tv.frameworkpackagestubs handles OPEN_DOCUMENT_TREE, which says “You don’t have an app that can do this”). Cloud ❌ with a company Box account (Box sign-in error 5253-5020); a personal account is untested. Save, close, reopen, restore ✅
3, test packages ✅ The gesture opens the mode. The manifest loads over HTTPS. BASS 1.2 is downloaded from GitHub Releases, verified, extracted, added ([sky] → packages/bass-cd/1.2/…), launched and removed with its saves kept. With only the manifest changed, it installs from downloads.scummvm.org (host independence). Wrong SHA-256, zip-slip, ELF and .so packages are refused with nothing left behind. Diagnostics show the engine version and each package’s detection result, and save the log for adb pull (this TV has no share target)
4, updates ✅ Test app 26041001 installed over 26041000: library, packages and saves identical byte for byte. BASS 1.2 → 1.2.1: downloaded and verified, extracted beside 1.2, then the target switched and 1.2 deleted; saves kept. An update killed mid-download (am force-stop with 21 of 69 MB staged) left 1.2 installed and playable; the partial file was cleaned up. Showdown (TerraGlyph), pushed to the app’s folder over adb, was added, played, saved and loaded

D4: the release build has no advanced mode

On the release APK (ScummVM-release-unsigned.apk, SHA-256 06dd2fe3…1adde, identical across three builds): apkanalyzer dex packages --defined-only lists no org.scummvm.scummvm.advanced package and no TestFeatures class, and the merged manifest has no PackagesActivity. unzip -p … 'classes*.dex' | strings | grep -c TVPKG_MANIFEST_URL (the advanced mode’s preference key) returns 0. On the debug APK the same checks find the package (23 classes) and return 1, so they do detect the code.

Code review note (exit criterion 6)

The app downloads only data. A package’s entries are written as files and nothing from them is loaded or run. The extractor refuses .so, .dex, .jar, .apk, .odex, .oat and .vdex entries, any file that starts with ELF or dex magic, and any path that leaves the package folder. git diff origin/scooby-engine..HEAD contains no DexClassLoader, PathClassLoader, InMemoryDexClassLoader, System.load, Runtime.exec or PackageInstaller (0 matches). Android 14 rejects a ../ zip entry itself, before the app’s own check. That check was exercised against the same zips on a desktop JVM, where nothing pre-empts it.

Fixed during the run

Open, and follow-ups

  1. Exit criterion 3, an import route without a computer. Next: test the cloud route with a personal Dropbox or Google Drive. If that fails, the options are a file-manager app that provides a document picker, or an import path inside the app (a Play-policy question).
  2. Gamepad (TV-GP, required for Play per D2): not tested. It must pass before WP-084.
  3. Touchpad right-click and two-finger scroll did nothing in the launcher.
  4. Entering the gesture by hand on the TCL remote hasn’t registered yet. The gesture is verified with the remote’s own key codes over adb.
  5. ScummVM’s on-screen keyboard opens by itself at launcher start on the TV.
  6. ✅ Done 2026-11-27: the smart-TV guide has the libpng build step and says to drive the TV from Windows adb (WSL in NAT mode can’t see the TV’s mDNS).

Notes