chore: share the return-hook loop, manifest cleanup, toggle texts and Hide surveys #123

Closed
midas wants to merge 0 commits from review/84-shared-patches into dev
Owner

Part of #105, fixes #84. Refactor, no behaviour change.

  • shared/util/Instructions.kt: hookReturns(opcode, ...) { reg -> smali } and hookReturnVoids(...) (every return, back to front, at the control-flow label, throws when none); all hand-written return-hook loops replaced (Edition review prompts, article block filter, onboarding, Kubus Midas Settings, Kubus Markdown, VideoProductionCache, Videoland picker and Force HD).
  • shared/util/Manifest.kt: removeManifestEntries(...), applicationElement, setApplicationMetaData, used by the Edition/Kubus tracking and Edition ads cleanups and midasSettingsPatch (#90's Firebase meta-data kept).
  • shared/settings/MidasToggles.kt: one catalogue of all 22 toggles (_EDITION/_KUBUS entries only where the texts really differ); the contract check resolves MidasToggles.X.key and still fails on unreadable keys.
  • Hide surveys is one patch (shared/surveys) for Edition + Kubus; no other pair is identical.

Verified: list-patches (packages, versions, descriptions, options) identical apart from the two Hide surveys blocks becoming one; Applied identical on six APKs; assets/midas_settings.json byte-identical in all six patched APKs. After rebasing onto dev: build + contract check green, Applied 13/13/15/15 on Volkskrant 7.53.1, Trouw 7.52.0, Tubantia 9.22.0, Gelderlander 9.21.1, and 2 on Videoland TV 1.116.3.

🤖 Generated with Claude Code

Part of #105, fixes #84. Refactor, no behaviour change. - `shared/util/Instructions.kt`: `hookReturns(opcode, ...) { reg -> smali }` and `hookReturnVoids(...)` (every return, back to front, at the control-flow label, throws when none); all hand-written return-hook loops replaced (Edition review prompts, article block filter, onboarding, Kubus Midas Settings, Kubus Markdown, VideoProductionCache, Videoland picker and Force HD). - `shared/util/Manifest.kt`: `removeManifestEntries(...)`, `applicationElement`, `setApplicationMetaData`, used by the Edition/Kubus tracking and Edition ads cleanups and `midasSettingsPatch` (#90's Firebase meta-data kept). - `shared/settings/MidasToggles.kt`: one catalogue of all 22 toggles (`_EDITION`/`_KUBUS` entries only where the texts really differ); the contract check resolves `MidasToggles.X.key` and still fails on unreadable keys. - Hide surveys is one patch (`shared/surveys`) for Edition + Kubus; no other pair is identical. Verified: `list-patches` (packages, versions, descriptions, options) identical apart from the two Hide surveys blocks becoming one; Applied identical on six APKs; `assets/midas_settings.json` byte-identical in all six patched APKs. After rebasing onto dev: build + contract check green, Applied 13/13/15/15 on Volkskrant 7.53.1, Trouw 7.52.0, Tubantia 9.22.0, Gelderlander 9.21.1, and 2 on Videoland TV 1.116.3. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore: share the return-hook loop, manifest cleanup, toggle texts and Hide surveys
All checks were successful
CI / Build (pull_request) Successful in 1m13s
c7ac68e562
- hookReturns / hookReturnVoids (shared/util/Instructions.kt) replace the hand-written
  "find every return, fail if none, insert back to front" loops in eight patches.
- removeManifestEntries / setApplicationMetaData (shared/util/Manifest.kt) replace the
  manifest DOM loops of the Edition and Kubus tracking cleanup and the Edition ads cleanup.
- MidasToggles (shared/settings) holds key, Dutch title, summary and category of every
  toggle once; patches register `MidasToggles.X` and refer to keys as `MidasToggles.X.key`.
  The extension contract check reads the catalogue literals and resolves those references.
- Hide surveys is one patch for Edition and Kubus (shared/surveys).

No behaviour change: same patch list (Hide surveys listed once with both platforms'
packages), same Applied set and same assets/midas_settings.json on the test APKs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Merged into dev as b999c00 (merged locally together with other review PRs, so Forgejo didn't mark it merged).

Merged into dev as b999c00 (merged locally together with other review PRs, so Forgejo didn't mark it merged).
midas closed this pull request 2026-10-17 21:03:40 +02:00
All checks were successful
CI / Build (pull_request) Successful in 1m13s
Required
Details

Pull request closed

Sign in to join this conversation.
No description provided.