feat(gelderlander): open Midas Settings from the profile menu #51

Closed
opened 2026-10-10 12:43:23 +02:00 by midas · 1 comment
Owner

Part of #16. Depends on #49.

Feature description

Add a row Midas Settings to De Gelderlander's settings/profile menu ("Instellingen") that opens MidasSettingsActivity (#49).

Findings (9.21.1)

The menu is server-driven

  • Retrofit op9 calls @GET("v2/profile-menu") on https://mobileapi.gelderlander.nl/mobile. The repository qp9 (anchor "com.kubusapp.profilemenu.repository.ProfileMenuRepositoryImpl$profileMenuData$1") only caches in memory.
  • Unobfuscated models in com.kubus.module.network.model:
    • ProfileMenuResponse(List<ProfileMenuSection>), with getSections();
    • ProfileMenuSection(String title, List<ProfileMenuItem> items);
    • ProfileMenuItem(String title, String subtitle, String url, boolean isLoginRequired, String destination, MenuItemIcon icons, TrackingInfo trackingInfo). title, destination and trackingInfo must be non-null; new TrackingInfo() is public.
  • The only caller of getSections() is ProfileMenuViewModel (com.kubusapp.profilemenu.b).

Click path

  • com.kubusapp.profilemenu.ProfileMenuFragment.F0(mp9 destination, ProfileMenuItem item) is handleClick. The anchor is the function-reference string "handleClick(Lcom/kubusapp/profilemenu/ProfileMenuItemDestination;Lcom/kubus/module/network/model/ProfileMenuItem;)V". It is the only method in the class with signature (L, ProfileMenuItem)V.
  • Destination enum mp9 values: myAccount, myList, darkMode, pushNotifications, feedback, appInfo, privacy, termsAndConditions, colophon, url, unsupported.

Approach

  1. Inject the row. At the end of ProfileMenuResponse.getSections(), return a copy of the list with an extra section that holds one item:
    new ProfileMenuItem("Midas Settings", "Patch-instellingen", "midas-settings://open", false, "url", null, new TrackingInfo())
    
    Use destination "url". Whether the Compose renderer (vp9.O, which doesn't decompile) shows unsupported rows is unknown.
  2. Intercept the click. At index 0 of ProfileMenuFragment.F0, if p2.getUrl() equals the sentinel, start the Activity using requireContext() (name kept) and return-void. This also skips the app's tracking call.
  3. Second entry, because the menu is missing when offline: com.kubusapp.DeepLinkRouterActivity handles dg://gelderlander.nl/.... Intercept a path like dg://gelderlander.nl/midas-settings in its forwarding method Q(), and document it, for example as a home-screen shortcut.

Risks

  • Offline: if v2/profile-menu fails, the screen shows its error state and the row is missing. The deep link covers that.
  • The renderer may treat a null icon differently from server rows. Check on the device, and use an existing MenuItemIcon if needed.

Done when

  • Build passes; patch applied on 9.21.1.
  • Device check (after asking): the row appears and opens Midas Settings; the deep link works; the menu is otherwise unchanged.
  • Documented in docs/apps/gelderlander.md.
Part of #16. Depends on #49. ## Feature description Add a row **Midas Settings** to De Gelderlander's settings/profile menu ("Instellingen") that opens `MidasSettingsActivity` (#49). ## Findings (9.21.1) ### The menu is server-driven - Retrofit `op9` calls `@GET("v2/profile-menu")` on `https://mobileapi.gelderlander.nl/mobile`. The repository `qp9` (anchor `"com.kubusapp.profilemenu.repository.ProfileMenuRepositoryImpl$profileMenuData$1"`) only caches in memory. - Unobfuscated models in `com.kubus.module.network.model`: - `ProfileMenuResponse(List<ProfileMenuSection>)`, with `getSections()`; - `ProfileMenuSection(String title, List<ProfileMenuItem> items)`; - `ProfileMenuItem(String title, String subtitle, String url, boolean isLoginRequired, String destination, MenuItemIcon icons, TrackingInfo trackingInfo)`. `title`, `destination` and `trackingInfo` must be non-null; `new TrackingInfo()` is public. - The only caller of `getSections()` is ProfileMenuViewModel (`com.kubusapp.profilemenu.b`). ### Click path - `com.kubusapp.profilemenu.ProfileMenuFragment.F0(mp9 destination, ProfileMenuItem item)` is `handleClick`. The anchor is the function-reference string `"handleClick(Lcom/kubusapp/profilemenu/ProfileMenuItemDestination;Lcom/kubus/module/network/model/ProfileMenuItem;)V"`. It is the only method in the class with signature `(L, ProfileMenuItem)V`. - Destination enum `mp9` values: myAccount, myList, darkMode, pushNotifications, feedback, appInfo, privacy, termsAndConditions, colophon, url, unsupported. ## Approach 1. **Inject the row.** At the end of `ProfileMenuResponse.getSections()`, return a copy of the list with an extra section that holds one item: ```java new ProfileMenuItem("Midas Settings", "Patch-instellingen", "midas-settings://open", false, "url", null, new TrackingInfo()) ``` Use destination `"url"`. Whether the Compose renderer (`vp9.O`, which doesn't decompile) shows `unsupported` rows is unknown. 2. **Intercept the click.** At index 0 of `ProfileMenuFragment.F0`, if `p2.getUrl()` equals the sentinel, start the Activity using `requireContext()` (name kept) and `return-void`. This also skips the app's tracking call. 3. **Second entry, because the menu is missing when offline:** `com.kubusapp.DeepLinkRouterActivity` handles `dg://gelderlander.nl/...`. Intercept a path like `dg://gelderlander.nl/midas-settings` in its forwarding method `Q()`, and document it, for example as a home-screen shortcut. ## Risks - **Offline:** if `v2/profile-menu` fails, the screen shows its error state and the row is missing. The deep link covers that. - The renderer may treat a `null` icon differently from server rows. Check on the device, and use an existing `MenuItemIcon` if needed. ## Done when - [ ] Build passes; patch applied on 9.21.1. - [ ] Device check (after asking): the row appears and opens Midas Settings; the deep link works; the menu is otherwise unchanged. - [ ] Documented in `docs/apps/gelderlander.md`.
Author
Owner

Done in 440a1a4 (v1.6.0-dev.2, merged to main). Device-tested on De Gelderlander 9.21.1: the 'Midas' section with the Midas Settings row renders at the bottom of Instellingen (above Uitloggen), opens the screen, back returns; deep link dg://gelderlander.nl/midas-settings opens it too (fallback when the menu can't load offline).

Done in 440a1a4 (v1.6.0-dev.2, merged to main). Device-tested on De Gelderlander 9.21.1: the 'Midas' section with the Midas Settings row renders at the bottom of Instellingen (above Uitloggen), opens the screen, back returns; deep link dg://gelderlander.nl/midas-settings opens it too (fallback when the menu can't load offline).
midas closed this issue 2026-10-10 13:53:32 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/midas-patches#51
No description provided.