feat(gelderlander): add a feature-flag override hook (Firebase Remote Config wrapper) #17

Closed
opened 2026-10-10 12:22:04 +02:00 by midas · 0 comments
Owner

Part of #16.

Feature description

De Gelderlander gates many features behind FEATURE_* flags that are read through one Firebase Remote Config wrapper. Overriding a handful of keys there turns off several nags at once. That makes this hook the shared building block for several roadmap issues:

  • review modal;
  • temptation views;
  • Firebase In-App Messaging;
  • comScore;
  • onboarding screens.

Add an internal (unnamed) patch that forces selected flag keys to a fixed value. The user-facing patches declare it with dependsOn and register the keys they need.

Findings (9.21.1)

  • Wrapper: defpackage/tha (implements interface rha).
    • tha.c(String key, String staticValue): boolean reads FirebaseRemoteConfig.getString(key); if empty it falls back to dw3.b(staticValue).
    • tha.a(String key, String defaultValue): String is the string variant.
  • Fingerprint anchors (the class names are obfuscated):
    • signature (Ljava/lang/String;Ljava/lang/String;)Z;
    • calls to FirebaseRemoteConfig.getInstance() / getString;
    • sibling method g() calls setMinimumFetchIntervalInSeconds(0) and setFetchTimeoutInSeconds(120).
  • Some callers go through the rha.b(...) default helper or an injected rha. All of them end up in tha.c.
  • Keys that matter for the roadmap:
    • FEATURE_RATING_MODAL
    • FEATURE_TEMPTATION_VIEWS
    • FEATURE_FIREBASE_IN_APP_MESSAGING
    • FEATURE_COMSCORE
    • FEATURE_MARKETING_POSITION_TOP
    • FEATURE_DISPLAY_PUSH_NOTIFICATIONS_IN_ONBOARDING
    • FEATURE_ONBOARDING_LOGIN_SEDUCTION_SCREEN
    • FEATURE_COMMENTING_VIAFOURA
    • FEATURE_GAMES_FEEDBACK

Approach

  • At index 0 of tha.c, look up p1 (the key) and return the forced boolean when it is overridden.
  • A small extension (Java) holding a Map<String, Boolean> is cleaner than a long smali if chain. Copy extensions/extension back from the template (see AGENTS.md).
  • Mind register aliasing: reuse a parameter register, or use findFreeRegister.
  • Decide how named patches contribute keys:
    • a shared set filled in each patch's execute; or
    • one extension method per flag.

Done when

  • Hook implemented as an unnamed patch under gelderlander/ (or a kubus/ package if #47 lands first).
  • Build passes; patch-install.ps1 -NoInstall applies on 9.21.1.
  • docs/apps/gelderlander.md documents the wrapper, the anchors and the key list.

Midas Settings

A flag is only forced when the Midas Settings toggle of the patch that registered it is on (#49). Example: FEATURE_RATING_MODAL is forced off only while "Verberg beoordelingsverzoeken" is on.

  • The override map therefore stores key -> toggle, not key -> fixed value.
  • The app reads some flags only at startup. Toggles backed by a flag are marked "requires restart" unless the flag is read on every use; check this per flag.
Part of #16. ## Feature description De Gelderlander gates many features behind `FEATURE_*` flags that are read through one Firebase Remote Config wrapper. Overriding a handful of keys there turns off several nags at once. That makes this hook the shared building block for several roadmap issues: - review modal; - temptation views; - Firebase In-App Messaging; - comScore; - onboarding screens. Add an internal (unnamed) patch that forces selected flag keys to a fixed value. The user-facing patches declare it with `dependsOn` and register the keys they need. ## Findings (9.21.1) - Wrapper: `defpackage/tha` (implements interface `rha`). - `tha.c(String key, String staticValue): boolean` reads `FirebaseRemoteConfig.getString(key)`; if empty it falls back to `dw3.b(staticValue)`. - `tha.a(String key, String defaultValue): String` is the string variant. - Fingerprint anchors (the class names are obfuscated): - signature `(Ljava/lang/String;Ljava/lang/String;)Z`; - calls to `FirebaseRemoteConfig.getInstance()` / `getString`; - sibling method `g()` calls `setMinimumFetchIntervalInSeconds(0)` and `setFetchTimeoutInSeconds(120)`. - Some callers go through the `rha.b(...)` default helper or an injected `rha`. All of them end up in `tha.c`. - Keys that matter for the roadmap: - `FEATURE_RATING_MODAL` - `FEATURE_TEMPTATION_VIEWS` - `FEATURE_FIREBASE_IN_APP_MESSAGING` - `FEATURE_COMSCORE` - `FEATURE_MARKETING_POSITION_TOP` - `FEATURE_DISPLAY_PUSH_NOTIFICATIONS_IN_ONBOARDING` - `FEATURE_ONBOARDING_LOGIN_SEDUCTION_SCREEN` - `FEATURE_COMMENTING_VIAFOURA` - `FEATURE_GAMES_FEEDBACK` ## Approach - At index 0 of `tha.c`, look up `p1` (the key) and return the forced boolean when it is overridden. - A small extension (Java) holding a `Map<String, Boolean>` is cleaner than a long smali `if` chain. Copy `extensions/extension` back from the template (see AGENTS.md). - Mind register aliasing: reuse a parameter register, or use `findFreeRegister`. - Decide how named patches contribute keys: - a shared set filled in each patch's `execute`; or - one extension method per flag. ## Done when - [ ] Hook implemented as an unnamed patch under `gelderlander/` (or a `kubus/` package if #47 lands first). - [ ] Build passes; `patch-install.ps1 -NoInstall` applies on 9.21.1. - [ ] `docs/apps/gelderlander.md` documents the wrapper, the anchors and the key list. ## Midas Settings A flag is only forced when the Midas Settings toggle of the patch that registered it is on (#49). Example: `FEATURE_RATING_MODAL` is forced off only while "Verberg beoordelingsverzoeken" is on. - The override map therefore stores `key -> toggle`, not `key -> fixed value`. - The app reads some flags only at startup. Toggles backed by a flag are marked "requires restart" unless the flag is read on every use; check this per flag.
midas closed this issue 2026-10-10 15:59:24 +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#17
No description provided.