chore: app update check handles Videoland TV builds #211

Open
midas wants to merge 6 commits from chore/app-update-check-tv-builds into dev
Owner

The daily check did not know Videoland ships a phone and an Android TV build under one package. For TV 1.119.2 that gave issue #201 (the opt-in Auto skip intro was tried on an undeclared TV build and threw) and PR #199 (version added to the targets, but not to TV_ONLY_VERSIONS). This makes both cases work without a human.

Design

  1. Detection in scripts/check-patches.sh (step 4c): for a platform with a shared/<Platform>Build.kt (Videoland) it reads TV_MARKER / PHONE_MARKER from that Kotlin file, so the check cannot drift from the patches (the constants are now one-line literals; an unreadable marker is exit 2). It then searches the base APK's classes*.dex for the class descriptor: a descriptor is a string in the dex string table, so unzip + grep is enough, no decompile. The phone marker wins, as in videolandBuild(). It prints Build: phone|tv|unknown and writes <out dir>/build.
  2. app-update-check.sh: the check step copies a whitelisted build= into the meta file; the report step re-validates it and passes it to open_pull and declare_version. For tv the bump: PR also adds the version to TV_ONLY_VERSIONS (new insert_tv_only: one-line setOf(...) only, newest first, anything else fails the package like the other edits). Phone, unknown and all other platforms behave exactly as before. No new token exposure: the build word is produced in the token-less check job and only used as a whitelisted word in the report job.
  3. Auto skip intro (fix:): on a TV build it now logs and returns instead of throwing, the same pattern as Midas Settings on a phone build.

Why the patch skips itself and check-patches.sh has no special case

check-patches.sh enables every opt-in patch, and its "Skipped:" is derived from the declared versions, which an undeclared version by definition lacks. A special case would need a hard-coded list of mobile-player patches in the script (or inferring TV versions from the compat lists), and every future TV-incompatible patch would need an entry. Letting the patch decide matches the existing convention (a patch that cannot work on a build handles that itself) and keeps check-patches.sh free of per-patch knowledge; it only reports the build. Trade-off: someone who force-enables Auto skip intro on an undeclared TV build gets a log line instead of a failed patch (it hooks nothing there anyway; for declared TV versions Manager does not list it). A phone build whose marker was renamed still fails loudly (videolandBuild() throws when neither marker exists, or a fingerprint fails).

Note: the fix: commit means merging this into dev creates a pre-release. The branch also contains #199's fix commit (04cd884) because it is not in dev yet; it drops out of the diff once that is merged.

Tested locally (Git Bash, bundle built from this branch)

  • check-patches.sh on 1.115.2 phone splits: Build: phone, exit 0. On 1.116.3 TV xapk, 1.118.0 TV splits and 1.119.2 TV apk: Build: tv, exit 0 (Auto skip intro Skipped: as declared).
  • With 1.119.2 temporarily removed from Constants.kt (undeclared TV, the #201 case): Build: tv, log line Auto skip intro hooks the mobile player, ... skipping, Applied: Auto skip intro, exit 0.
  • :patches:test (extension contract check) ran as part of buildAndroid.
  • declare_version on a scratch copy of Constants.kt without 1.119.2: tv adds the AppTarget and puts "1.119.2" first in TV_ONLY_VERSIONS (diff checked); phone only the AppTarget; a multi-line setOf( is rejected with an error; an empty setOf() works. Git Bash's gawk drops the CRs of CRLF files (the existing insert_target too); CI checks out LF.

Not tested locally (needs a CI dispatch)

The jq/curl parts of the report step, the real APKPure download and the end-to-end path meta -> PR body. Dispatch app-update-check on branch chore/app-update-check-tv-builds with dry_run=true, packages=nl.rtl.videoland.v2 and tested_override=nl.rtl.videoland.v2=1.115.2 (pretends 1.115.2 is the newest tested version, so APKPure's newer TV build is checked). Expected in the log: Build: tv, and the dry-run PR body lists "adds <version> to the targets" plus "adds it to TV_ONLY_VERSIONS", with a diff showing both lines in Constants.kt. The run must also stay green when the check step meets Auto skip intro (no ::warning about a patch that no longer applies). Run it only on a base that lacks the version (it says "already declared" otherwise). A phone build would show only the AppTarget line.

🤖 Generated with Claude Code

The daily check did not know Videoland ships a phone and an Android TV build under one package. For TV 1.119.2 that gave issue #201 (the opt-in Auto skip intro was tried on an undeclared TV build and threw) and PR #199 (version added to the targets, but not to `TV_ONLY_VERSIONS`). This makes both cases work without a human. ## Design 1. **Detection in `scripts/check-patches.sh` (step 4c)**: for a platform with a `shared/<Platform>Build.kt` (Videoland) it reads `TV_MARKER` / `PHONE_MARKER` from that Kotlin file, so the check cannot drift from the patches (the constants are now one-line literals; an unreadable marker is exit 2). It then searches the base APK's `classes*.dex` for the class descriptor: a descriptor is a string in the dex string table, so unzip + grep is enough, no decompile. The phone marker wins, as in `videolandBuild()`. It prints `Build: phone|tv|unknown` and writes `<out dir>/build`. 2. **`app-update-check.sh`**: the check step copies a whitelisted `build=` into the `meta` file; the report step re-validates it and passes it to `open_pull` and `declare_version`. For `tv` the `bump:` PR also adds the version to `TV_ONLY_VERSIONS` (new `insert_tv_only`: one-line `setOf(...)` only, newest first, anything else fails the package like the other edits). Phone, `unknown` and all other platforms behave exactly as before. No new token exposure: the build word is produced in the token-less check job and only used as a whitelisted word in the report job. 3. **Auto skip intro (`fix:`)**: on a TV build it now logs and returns instead of throwing, the same pattern as Midas Settings on a phone build. ### Why the patch skips itself and check-patches.sh has no special case check-patches.sh enables every opt-in patch, and its "Skipped:" is derived from the declared versions, which an undeclared version by definition lacks. A special case would need a hard-coded list of mobile-player patches in the script (or inferring TV versions from the compat lists), and every future TV-incompatible patch would need an entry. Letting the patch decide matches the existing convention (a patch that cannot work on a build handles that itself) and keeps check-patches.sh free of per-patch knowledge; it only reports the build. Trade-off: someone who force-enables Auto skip intro on an undeclared TV build gets a log line instead of a failed patch (it hooks nothing there anyway; for declared TV versions Manager does not list it). A phone build whose marker was renamed still fails loudly (`videolandBuild()` throws when neither marker exists, or a fingerprint fails). Note: the `fix:` commit means merging this into dev creates a pre-release. The branch also contains #199's fix commit (04cd884) because it is not in dev yet; it drops out of the diff once that is merged. ## Tested locally (Git Bash, bundle built from this branch) - check-patches.sh on 1.115.2 phone splits: `Build: phone`, exit 0. On 1.116.3 TV xapk, 1.118.0 TV splits and 1.119.2 TV apk: `Build: tv`, exit 0 (Auto skip intro `Skipped:` as declared). - With 1.119.2 temporarily removed from `Constants.kt` (undeclared TV, the #201 case): `Build: tv`, log line `Auto skip intro hooks the mobile player, ... skipping`, `Applied: Auto skip intro`, exit 0. - `:patches:test` (extension contract check) ran as part of `buildAndroid`. - `declare_version` on a scratch copy of `Constants.kt` without 1.119.2: `tv` adds the `AppTarget` and puts `"1.119.2"` first in `TV_ONLY_VERSIONS` (diff checked); `phone` only the `AppTarget`; a multi-line `setOf(` is rejected with an error; an empty `setOf()` works. Git Bash's gawk drops the CRs of CRLF files (the existing `insert_target` too); CI checks out LF. ## Not tested locally (needs a CI dispatch) The jq/curl parts of the report step, the real APKPure download and the end-to-end path meta -> PR body. Dispatch `app-update-check` on branch `chore/app-update-check-tv-builds` with `dry_run=true`, `packages=nl.rtl.videoland.v2` and `tested_override=nl.rtl.videoland.v2=1.115.2` (pretends 1.115.2 is the newest tested version, so APKPure's newer TV build is checked). Expected in the log: `Build: tv`, and the dry-run PR body lists "adds `<version>` to the targets" plus "adds it to `TV_ONLY_VERSIONS`", with a diff showing both lines in `Constants.kt`. The run must also stay green when the check step meets Auto skip intro (no `::warning` about a patch that no longer applies). Run it only on a base that lacks the version (it says "already declared" otherwise). A phone build would show only the `AppTarget` line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bump: declare Videoland 1.119.2 as tested
All checks were successful
CI / Build (pull_request) Successful in 4m57s
CI / Patch check (pull_request) Successful in 8m16s
90ca8bcf3c
fix: declare Videoland 1.119.2 as an Android TV build so Auto skip intro is skipped
All checks were successful
CI / Build (pull_request) Successful in 5m16s
CI / Patch check (pull_request) Successful in 3m49s
04cd8842eb
APKPure's 1.119.2 is the TV build (no MobileReplayControl); Auto skip intro
hooks the mobile player and failed on it (#201).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An undeclared Videoland TV build (the experimental target selects every patch) made the
patch throw, so the daily app update check reported "patches no longer apply" (#201).
It now logs and returns, like Midas Settings does on a phone build.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
chore: app update check declares Videoland TV builds in TV_ONLY_VERSIONS
All checks were successful
CI / Build (pull_request) Successful in 1m27s
CI / Patch check (pull_request) Successful in 3m45s
52191ca4e8
check-patches.sh finds the build (phone, tv) by the marker classes of VideolandBuild.kt, read
from that file, and writes it to <out dir>/build; app-update-check.sh passes it through meta
to the bump PR, which then also adds a TV build to TV_ONLY_VERSIONS.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
All checks were successful
CI / Build (pull_request) Successful in 1m27s
Required
Details
CI / Patch check (pull_request) Successful in 3m45s
This pull request has changes conflicting with the target branch.
  • CHANGELOG.md
  • README.md
  • gradle.properties
  • patches-bundle.json
  • patches-list.json
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin chore/app-update-check-tv-builds:chore/app-update-check-tv-builds
git switch chore/app-update-check-tv-builds
Sign in to join this conversation.
No description provided.