fix: Kubus 9.24.1 (renamed network models) + declare 9.24.1 tested #189

Merged
midas merged 4 commits from fix/kubus-9.24.1 into dev 2026-11-17 14:14:51 +01:00
Owner

Closes #185, #184, #183, #182, #178, #177

Contains #154 and #158 (this branch is stacked on app-update/kubus-9.23.3, which declares 9.23.2/9.23.3, merged with current dev). Merge those first, or merge this one and close them.

Root cause

Kubus 9.24.1 moved its network models from Moshi to kotlinx.serialization. The package com.kubus.module.network.model is gone, and R8 now renames the models (SectionResponse -> jvf, AdvertisementPack -> sk, ArticleDetailResponse -> ov0, ArticleComponent -> du0, ... in Tubantia). Every fingerprint that named one of these classes stopped matching. Most of the 15 failures were dependents of the two content-filter hooks (SectionResponse.<init> and the article component mapper). The profile menu models kept their names but moved to com.kubusapp.feature.domain.data.settings.api.model.

Fix (works on 9.21.1 to 9.24.1)

  • Patches: a model class is found through a fingerprint on its data class toString() literal ("SectionResponse(_sectionContent=", "AdvertisementPack(_ads=", "ArticleDetailResponse(components=", "Properties(buttons="). That literal is identical in every version. The patch then hooks every constructor that builds the object (kubus/shared/KubusModels.kt). In 9.24.1 this is the serialization constructor (int seen, ...), so the hooks take the first List parameter. The article component mapper takes "L".
  • Extension: models are recognised by KubusModels.typeName (the simple class name of a com.kubus.module class, otherwise the text of toString() up to (, cached per class) instead of instanceof on the stubs. Properties and Metadata are found by the model type of their value. ProfileMenuPatch builds the Midas row by reflection, in the package of the sections it receives. The main code no longer references the Kubus stubs; the tests still use them.
  • Midas Settings: getSections is matched by class simple name. 9.24.1's url-row opener (v6g.b(String, String)) navigates with AppRoute.MijnOmgeving instead of WEBVIEW_URL. DeepLinkRouterActivity moved to com.kubusapp.deeplink and forwards in a coroutine, so the hook goes into onCreate/onNewIntent before the launch.
  • Copy as Markdown: the toolbar click handler is now a function reference bound to the view model (ry0.invoke). The hook reads the view model from its receiver field and returns the lambda's own Unit. The toolbar state is built in the view model again (ArticleToolbarStateFingerprint without a parameter list).
  • Disable tracking: TrackingStarterInitializer no longer casts to FirebaseAnalytics, so only the HashSet.add is matched.
  • docs/apps/kubus.md has a new 9.24.1 section.

Checks

bash scripts/check-patches.sh <xapk> with the final bundle (APKPure XAPKs, signatures verified, --validate + SDK verify):

APK exit Applied Failed
Tubantia 9.24.1 0 19 0
AD 9.24.1 0 19 0
PZC 9.24.1 0 19 0
BN DeStem 9.24.1 0 19 0
Brabants Dagblad 9.24.1 0 19 0
De Stentor 9.24.1 0 19 0
Eindhovens Dagblad 9.23.3 0 19 0
De Gelderlander 9.23.3 0 19 0
Tubantia 9.22.0 0 19 0
Tubantia 9.21.1 0 19 0

An earlier build of this branch (same model/content-filter changes, before the Markdown/Settings/deep-link fixes for 9.24.1) also gave 19/19 on AD 9.22.0, AD 9.21.1 and PZC 9.22.0.

buildAndroid (incl. contract check) and :extensions:extension:testDebugUnitTest pass, including new tests for renamed models. check-stubs.sh: Tubantia 9.22.0 OK. For 9.24.1 no stub module applies any more, as expected.

Open

  • APK store: 9.24.1 is not in the store yet (no write token here). CI's Patch check on this PR will warn about that or fail until Tubantia/AD 9.24.1 are uploaded with scripts/apk-store.sh upload.
  • Not device-tested. The runtime parts that only a phone can show: the Midas row and its click, the deep link, the Markdown button and its copy, and whether the feed and article filters recognise the renamed models.
  • Eindhovens Dagblad and De Gelderlander are still on 9.23.3 on APKPure: 9.24.1 is in their untestedVersions.

🤖 Generated with Claude Code

Closes #185, #184, #183, #182, #178, #177 **Contains #154 and #158** (this branch is stacked on `app-update/kubus-9.23.3`, which declares 9.23.2/9.23.3, merged with current `dev`). Merge those first, or merge this one and close them. ## Root cause Kubus 9.24.1 moved its network models from Moshi to kotlinx.serialization. The package `com.kubus.module.network.model` is gone, and R8 now renames the models (`SectionResponse` -> `jvf`, `AdvertisementPack` -> `sk`, `ArticleDetailResponse` -> `ov0`, `ArticleComponent` -> `du0`, ... in Tubantia). Every fingerprint that named one of these classes stopped matching. Most of the 15 failures were dependents of the two content-filter hooks (`SectionResponse.<init>` and the article component mapper). The profile menu models kept their names but moved to `com.kubusapp.feature.domain.data.settings.api.model`. ## Fix (works on 9.21.1 to 9.24.1) - **Patches**: a model class is found through a fingerprint on its data class `toString()` literal (`"SectionResponse(_sectionContent="`, `"AdvertisementPack(_ads="`, `"ArticleDetailResponse(components="`, `"Properties(buttons="`). That literal is identical in every version. The patch then hooks every constructor that builds the object (`kubus/shared/KubusModels.kt`). In 9.24.1 this is the serialization constructor `(int seen, ...)`, so the hooks take the first `List` parameter. The article component mapper takes `"L"`. - **Extension**: models are recognised by `KubusModels.typeName` (the simple class name of a `com.kubus.module` class, otherwise the text of `toString()` up to `(`, cached per class) instead of `instanceof` on the stubs. `Properties` and `Metadata` are found by the model type of their value. `ProfileMenuPatch` builds the Midas row by reflection, in the package of the sections it receives. The main code no longer references the Kubus stubs; the tests still use them. - **Midas Settings**: `getSections` is matched by class simple name. 9.24.1's url-row opener (`v6g.b(String, String)`) navigates with `AppRoute.MijnOmgeving` instead of `WEBVIEW_URL`. `DeepLinkRouterActivity` moved to `com.kubusapp.deeplink` and forwards in a coroutine, so the hook goes into `onCreate`/`onNewIntent` before the launch. - **Copy as Markdown**: the toolbar click handler is now a function reference bound to the view model (`ry0.invoke`). The hook reads the view model from its `receiver` field and returns the lambda's own `Unit`. The toolbar state is built in the view model again (`ArticleToolbarStateFingerprint` without a parameter list). - **Disable tracking**: `TrackingStarterInitializer` no longer casts to `FirebaseAnalytics`, so only the `HashSet.add` is matched. - `docs/apps/kubus.md` has a new 9.24.1 section. ## Checks `bash scripts/check-patches.sh <xapk>` with the final bundle (APKPure XAPKs, signatures verified, `--validate` + SDK verify): | APK | exit | Applied | Failed | | --- | --- | --- | --- | | Tubantia 9.24.1 | 0 | 19 | 0 | | AD 9.24.1 | 0 | 19 | 0 | | PZC 9.24.1 | 0 | 19 | 0 | | BN DeStem 9.24.1 | 0 | 19 | 0 | | Brabants Dagblad 9.24.1 | 0 | 19 | 0 | | De Stentor 9.24.1 | 0 | 19 | 0 | | Eindhovens Dagblad 9.23.3 | 0 | 19 | 0 | | De Gelderlander 9.23.3 | 0 | 19 | 0 | | Tubantia 9.22.0 | 0 | 19 | 0 | | Tubantia 9.21.1 | 0 | 19 | 0 | An earlier build of this branch (same model/content-filter changes, before the Markdown/Settings/deep-link fixes for 9.24.1) also gave 19/19 on AD 9.22.0, AD 9.21.1 and PZC 9.22.0. `buildAndroid` (incl. contract check) and `:extensions:extension:testDebugUnitTest` pass, including new tests for renamed models. `check-stubs.sh`: Tubantia 9.22.0 OK. For 9.24.1 no stub module applies any more, as expected. ## Open - **APK store**: 9.24.1 is not in the store yet (no write token here). CI's Patch check on this PR will warn about that or fail until Tubantia/AD 9.24.1 are uploaded with `scripts/apk-store.sh upload`. - **Not device-tested.** The runtime parts that only a phone can show: the Midas row and its click, the deep link, the Markdown button and its copy, and whether the feed and article filters recognise the renamed models. - Eindhovens Dagblad and De Gelderlander are still on 9.23.3 on APKPure: 9.24.1 is in their `untestedVersions`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bump: declare AD 9.23.2 as tested
All checks were successful
CI / Build (pull_request) Successful in 1m8s
CI / Patch check (pull_request) Successful in 2m8s
c7d82fdb55
bump: declare Tubantia 9.23.3 as tested
All checks were successful
CI / Build (pull_request) Successful in 3m42s
CI / Patch check (pull_request) Successful in 6m43s
1a71ae1a71
Keeps both Kubus platform versions: KUBUS_TARGETS lists 9.23.3 and 9.23.2, the titles not yet
checked on either carry both in untestedVersions, AD stays untested on 9.23.3 and Tubantia on
9.23.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bump: declare AD, De Stentor, Eindhovens Dagblad, Brabants Dagblad 9.23.3 and BN DeStem 9.23.2 as tested
All checks were successful
CI / Build (pull_request) Successful in 5m5s
CI / Patch check (pull_request) Successful in 7m12s
bad4493c31
scripts/check-patches.sh applies every patch to APKPure's current signed XAPKs: AD, De Stentor,
Eindhovens Dagblad and Brabants Dagblad 9.23.3, BN DeStem 9.23.2 (APKPure's newest of it). Each
drops that version from its untestedVersions. De Gelderlander and PZC (APKPure still has 9.22.0)
stay untested on both 9.23.2 and 9.23.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kubus 9.24.1 moved its network models from Moshi to kotlinx.serialization:
com.kubus.module.network.model is gone and R8 renames the models (SectionResponse,
AdvertisementPack, ArticleDetailResponse, ShareButtons.Properties, ArticleComponent).
Every patch that named one failed, and so did every patch depending on the two
content filter hooks.

- Patches find a model by its data class toString() literal, which is the same in
  9.21.1-9.24.1, and hook every constructor that builds the object (the first List
  parameter, as 9.24.1 adds a leading int "seen" mask).
- The extension recognises models by KubusModels.typeName (class name, else the
  start of toString()) instead of instanceof on the stubs; Properties and Metadata
  are found by the model type of their value.
- Midas Settings: the profile menu models moved to
  com.kubusapp.feature.domain.data.settings.api.model (reflection in the extension,
  getSections matched by class simple name); the url row opener navigates with
  AppRoute; DeepLinkRouterActivity moved and forwards from onCreate/onNewIntent.
- Copy as Markdown: the toolbar click handler is a function reference bound to
  the view model; the state is built in the view model again.
- Disable tracking: TrackingStarterInitializer no longer casts to FirebaseAnalytics.

Closes #185, #184, #183, #182, #178, #177

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
bump: declare Kubus 9.24.1 as tested
All checks were successful
CI / Build (pull_request) Successful in 1m55s
CI / Patch check (pull_request) Successful in 2m49s
715ad8a8bd
Checked with check-patches.sh on Tubantia, AD, PZC, BN DeStem, Brabants Dagblad and
De Stentor 9.24.1. Eindhovens Dagblad and De Gelderlander are still on 9.23.3 on
APKPure, so 9.24.1 is untested for them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Independent read-only review before merge: nothing blocking. The four model fingerprints and constructor hooks were checked against the 9.24.1 and 9.22.0 decompiles; all hooks catch Throwable; typeName is cached per class. Two low-severity notes for later: (1) KubusArticleExporter.flatten now looks up media/title with Object.class, so a nested value containing ', title=' could in theory be matched instead (no real collision found, cannot crash); (2) the new unit tests cover the filters on renamed models but not buildMarkdown/flatten on them, nor a throwing toString(). Not device-tested.

Independent read-only review before merge: nothing blocking. The four model fingerprints and constructor hooks were checked against the 9.24.1 and 9.22.0 decompiles; all hooks catch Throwable; typeName is cached per class. Two low-severity notes for later: (1) KubusArticleExporter.flatten now looks up media/title with Object.class, so a nested value containing ', title=' could in theory be matched instead (no real collision found, cannot crash); (2) the new unit tests cover the filters on renamed models but not buildMarkdown/flatten on them, nor a throwing toString(). Not device-tested.
Merge remote-tracking branch 'origin/dev' into HEAD
All checks were successful
CI / Build (pull_request) Successful in 3m46s
CI / Patch check (pull_request) Successful in 6m11s
b385110c78
Sign in to join this conversation.
No description provided.