TV package manifest format
The test build of the studio’s Google TV app (WP-085) installs authorized game-data packages from a manifest: a JSON file fetched over HTTPS that lists each package’s id, version, size, SHA-256 and download URL. This page is that format, and the rules the app enforces when it installs a package.
The manifest and its packages are data only. The app never loads or runs anything from a package. That’s what Google Play’s Device and Network Abuse policy allows: game data interpreted by ScummVM’s engines, never downloaded native code or bytecode.
Where it’s used
Only in test builds (the debug build type), through a hidden advanced mode. The release build, which is the one that goes to Google Play, compiles a stub instead and contains none of this code (WP-085 D4).
The advanced mode opens from ScummVM’s library with a D-pad sequence: up, down, up, down, left, right, left, right within ten seconds. A gamepad’s D-pad and a keyboard’s arrow keys send it, and so does a TV remote. No key follows itself in the sequence and a repeated key is ignored, because the TCL 65Q77K’s remote reports each press twice. Other keys, such as a stray OK from the remote’s ring, don’t break it. Entering it by hand on the TCL’s remote hasn’t worked yet (WP-085 §Result). The mode asks for the manifest’s URL; there’s no built-in one.
The format
{
"format": 1,
"packages": [
{
"id": "bass-cd",
"title": "Beneath a Steel Sky (CD, freeware)",
"version": "1.2",
"size": 69377781,
"sha256": "53209b9400eab6fd7fa71518b2f357c8de75cfeaa5ba57024575ab79cc974593",
"url": "https://github.com/barefootbetters/tv-test-packages/releases/download/packages-2026-11-26/bass-cd-1.2.zip"
}
]
}
| Field | Required | Rule |
|---|---|---|
format |
yes | 1. Any other value refuses the whole manifest |
packages |
yes | An array of package entries |
id |
yes | [a-z0-9][a-z0-9._-]{0,63}. Stable across versions: it’s the package’s folder name, and how an update finds the installed version |
title |
no | Shown in the list. Defaults to the id |
version |
yes | [A-Za-z0-9][A-Za-z0-9._-]{0,31}. Compared part by part, numerically where both parts are numbers (1.2.1 is newer than 1.2) |
size |
yes | The zip’s exact size in bytes. A download larger than this is stopped; a different final size is refused |
sha256 |
yes | The zip’s SHA-256, 64 hex digits. A mismatch is refused |
url |
yes | Any HTTPS URL. The app holds no host: moving a package to another host is a manifest change, not an app change. A redirect may change host but not leave HTTPS |
installedSize |
no | The sum of the zip’s uncompressed file sizes, in bytes (directories don’t count). It lets the app check before downloading that the package will fit once extracted (§Space check). Must be 0 or more |
engineid |
no | The ScummVM engine id of the game inside, as its library entry will have it (terraglyph, sky). With gameid, it places a package that isn’t installed in the test build’s library (§Get and Update tiles) |
gameid |
no | The game’s id within that engine (showdown, phantomknight, sky). An entry without both fields gets no tile; it stays in the advanced mode only |
An entry that breaks a rule is skipped and listed as skipped; the rest of the manifest still loads. The manifest itself must be HTTPS and at most 1 MB.
installedSize was added by WP-096
and is still format 1: the parser ignores fields it doesn’t know, so older test
builds read a manifest that has it, and newer ones read one that doesn’t.
engineid and gameid were added by WP-145,
also within format 1. The runtime file lists (tools/packages/<id>.json) carry
them, so New-GamePackage.ps1 and the private Publish-BetaGame.ps1 write
them; a package not built from a list (BASS) gets them by hand.
The package
A package is a zip of game data, laid out as the game’s folder (or a folder holding it). ScummVM detects the game anywhere inside it.
The app refuses the whole package, and keeps nothing from it, if any entry:
- ends in
.so,.dex,.jar,.apk,.odex,.oator.vdex(any case); - is a file that starts with the ELF (
7F 45 4C 46) or dex (dex\n) magic number, whatever its name; - resolves, after
..and the like, to a path outside the package’s folder (zip-slip); - would take the extracted total past 8 GB.
An empty zip is refused too.
What the app does with it
- Check the space (§Space check). If the package won’t fit, refuse before writing anything.
- Download to
files/packages/.staging/<id>-<version>.zip.partin the app’s private storage, resuming an earlier partial download of the same id and version (§Resume). - Verify the size and SHA-256 against the manifest. Refuse on any mismatch.
Without
installedSize, check the space again now, from the zip’s own central directory. - Extract to a staging folder under the rules above, syncing each file to
disk, then move it to
files/packages/<id>/<version>/. That folder survives app updates (onlyassets/anddoc/are re-synced on an update) and is deleted on uninstall. Beside it,files/packages/<id>/<version>.files.jsonrecords each file’s path, size and CRC-32 (§Verify). - Add it through ScummVM’s own detection: the app restarts the ScummVM
thread with
--add --path=<folder> --recursive --no-exit, which adds what it detects and stays in the library. - Update: a newer
versionof an installedidis downloaded, verified and extracted beside the old one. Only then does the app point the game’s library entry at the new folder and delete the old one. A failed or interrupted update leaves the old version in place and playable. - Remove deletes the package’s folder and its library entries. Saves are kept: they belong to the library entry’s name, so re-adding the game finds them.
ScummVM’s --add skips a game whose usual target name (for example sky) is
already in the library. Remove an earlier entry for the same game before
installing it as a package.
Get and Update tiles
Test builds read the manifest at every start, in the background, from the URL the advanced mode stored (WP-145). The start never waits for it.
- Success: the app writes
files/packages/available.json(temp file, sync, rename). It holds each entry that hasengineidandgameid: itsid,title,version,size,engineid,gameid, and akindworked out againstinstalled.json:get(not installed),update(an older version is installed) orinstalled. It holds no URLs, so no key. - HTTP 404 (the tester’s key is revoked or expired): the file is deleted, and the Get tiles go. Installed games stay.
- Any other failure (offline, a timeout): the last good file is kept.
The library reads the file. Each get entry becomes a tile with the game’s
cover and a Get band, in the same series, publisher and year groups as
an installed copy. An installed game whose target lives under
files/packages/<id>/ for an update entry shows Update, and its tray
gets an Update button. The library checks the file’s time once a second,
so a fetch that finishes after the library is drawn still shows.
Choosing a Get tile, or the tray’s Update, opens a one-package install screen: the title, a progress bar (“MB of MB”, then “Extracting”) and Cancel. It fetches the manifest again for the URL, then installs as below, and the library comes back with the game playable. Cancel keeps the partial download, so choosing the tile again resumes it. Release builds have none of this; a desktop build never looks for the file.
The advanced mode’s LOAD MANIFEST writes the same file, and so does every
add, update and remove (which re-marks each entry against the new
installed.json). They go through one writer.
Space check
An install needs room for the zip and the extracted files at the same time, so a 400 MiB download that extracts to 531 MiB needs about 931 MiB free. An update needs the same again: the old version stays on disk until the new one is in place, and isn’t counted as free.
The app needs the bytes still to download + installedSize + 64 MiB. It
compares that with what it can allocate on the volume that holds its files:
StorageManager.getAllocatableBytes on Android 8 (API 26) and later, which
counts cache Android can clear on demand, and File.getUsableSpace before
that. The 64 MiB headroom covers filesystem overhead; on the TCL 65Q77K the
real overshoot was under 30 KB (WP-096 §Result).
- With
installedSize: one check, before anything is written. - Without it: the first check counts the download only. After the zip is verified, the app reads the zip’s central directory for the exact extracted size and checks again before extracting.
A package that doesn’t fit is refused. The message gives the bytes
needed, the bytes free and the shortfall, and the store log has the same
line. If the disk fills anyway mid-download or mid-extract (ENOSPC), the app
deletes that package’s staging files and the installed version stays as it
was.
Test builds can pretend to have a given amount of free space: put a number of
bytes in files/packages/debug-free-bytes (through run-as). The
diagnostics show it as an override while it’s there.
For a power-cut test, test builds can also slow the extract down: put a
number of milliseconds in files/packages/debug-extract-delay-ms. The extract
then pauses that long after each file is written and synced, up to 60 s per
file. The store log, the “Extracting…” status and the diagnostics say so.
Delete the file to go back to normal.
Resume
A download that stops for any reason but a refusal or a full disk (a dropped
connection, a force-stopped app, a reboot) keeps its bytes as
<id>-<version>.zip.part, with a sidecar <id>-<version>.zip.part.json that
records the URL, the size, the SHA-256 and the server’s validator (a strong
ETag, else Last-Modified).
Installing the same id and version again re-hashes the bytes already there,
then asks the manifest’s URL (never a stored redirect: release-asset URLs are
signed and expire) for Range: bytes=<n>- with If-Range:
| Answer | What the app does |
|---|---|
206 starting at <n>, same total size and validator |
Appends the rest |
206 from elsewhere, another total or another validator |
Starts again with a new request |
200 |
Starts again, using that answer’s body |
416 |
Starts again with a new request |
| Anything else | Fails, and keeps the partial download for the next try |
The size and SHA-256 checks still run on the whole file, so a bad resume can’t install. A finished download is synced to disk before it’s verified, so a power cut can’t shorten it afterwards. A complete download that wasn’t extracted (an interrupted extract) is reused without fetching it again.
A partial download is kept only while a retry could still use it:
- Opening the advanced mode deletes everything in
.staging/except.partfiles and their sidecars. Then it deletes a.partthat has no sidecar, a sidecar that has no.part, and any.partthat hasn’t changed for 7 days. - Loading a manifest also deletes any
.partthe manifest doesn’t list, or whose entry changed (URL, size or SHA-256), since it can’t be resumed. Switching to another manifest therefore drops partial downloads that only the other manifest lists.
Each deletion takes the sidecar with it and is logged with the reason
(Stale download: deleting …).
GitHub Releases ignores If-Range: given a validator that doesn’t match, it
still answers 206 with its real ETag. The app compares the answer’s
validator with the stored one, so it starts again anyway.
Verify
Each installed package has a Verify button in the advanced mode. It
re-reads every file in the package’s folder and compares its size and CRC-32
with <version>.files.json, then reports a pass, or names each changed or
missing file. Files that aren’t in the list (a game may write its own) are
listed but don’t fail it. A package installed before Verify existed has no file
list; Verify says so, and reinstalling it writes one.
Interrupted installation
A power cut, a reboot or a killed app during the extract never leaves a half-installed package:
- Extraction happens in
.staging/. Each file is synced to disk (fsync) before the folder is renamed into place, and the parent folder is synced after the rename. installed.jsonandpending.jsonare written to a temp file, synced, renamed over the old file, and the folder synced, so after a power cut each is either the old or the new one.- A package is recorded as installed only after its folder is complete, synced and renamed.
- Every start of the advanced mode deletes incomplete extraction folders in
.staging/, version folders thatinstalled.jsonandpending.jsondon’t name, and temp files left by an interrupted write. Each deletion is logged.
So the previous version stays installed and playable, and installing again reuses the download and extracts afresh.
Hosting
Per WP-085 D3: freely redistributable packages go on GitHub Releases in a dedicated repo, barefootbetters/tv-test-packages, which keeps game data out of the engine repos. Anything licensed is hosted behind access control, not on a public release.