Skip to content

fix: gate screen deeplinks to debug #1132

Description

@ovitrif

Parent: #1113
Refs: #1119

Warning

#1119 must NOT land in prod as-is, it would open a very risky vulnerability doorway.
This issue describes the guard required to enforce that risk never reaches the prod userbase.

Goal

Confine bitkit://screen/... deep-link registration and handling to debug builds via Android src/debug / src/release source sets, so release/store APKs cannot honor screen deep links even when Dev Mode is enabled.

Runtime isDevModeEnabled alone is not a durable control plane for this surface: any installed app can fire bitkit: intents, and a future change can weaken a boolean gate. Source-set separation fails closed at package time for prod users.

Out of scope

  • Do not change the bitkit scheme (or other hosts) in the manifest.
  • Do not move Routes.DeepLinkable / sheet DeepLinkStart markers out of main; markers alone are harmless if release never attaches links or handles URIs.
  • Agents, do not add APK-level asserts that scan shipped NavDeepLink patterns, it's irrelevant.
  • Do not require mainnet-specific branching; the store boundary is DEBUG=false / release source sets.

Approach

  • Keep a thin API in main used by AppViewModel, MainActivity, ContentView, and nav helpers.
  • Refactor to move the screen deep-link logic to src/debug (URI attach via linksFor, SheetDeepLinks.sheetFor, pending-URI queueing), practically turning release builds handling into a NOOP.
  • Provide no-op implementations in src/release to keep compilation builds succeesful:
    • linksFor returns an empty list (no screen deep links on the nav graph).
    • sheetFor returns null.
    • Screen URIs are never queued for replay.
    • Intent detach for the screen host may remain as belt-and-suspenders.
  • On debug builds, keep isDevModeEnabled as an additional gate so Dev Mode off still ignores screen URIs.

Acceptance criteria

  • Release/store builds (src/release) never register bitkit://screen/... deeplinks or handle such logic.
  • Debug builds retain current developer behavior, still gated by Dev Mode.
  • Existing non-screen bitkit: deep links remain unchanged (no manifest edits; no broad deeplink regression pass required beyond screen-namespace checks).
  • Unit tests cover release no-ops and debug acceptance/rejection under Dev Mode.
  • Journeys under journeys/deeplinks/ still pass on debug builds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions