Skip to content

feat(session-replay-privacy): record Android FLAG_SECURE windows fully masked - #160

Open
turnipdabeets wants to merge 2 commits into
mainfrom
spec/replay-flag-secure
Open

turnipdabeets wants to merge 2 commits into
mainfrom
spec/replay-flag-secure

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Hold until posthog-android#910/#912 are approved; they must ship in the same release.

Summary

Android apps set FLAG_SECURE on screens that must never be screenshotted (login, payment, PIN). session-replay-privacy didn't cover it, and Android session replay recorded those windows anyway: screenshot mode copied their pixels, wireframe mode serialized their view tree and text, and taps were recorded. Other parts of posthog-android already skip secure windows.

Changes

New requirement Android secure windows are recorded fully masked in session-replay-privacy:

  • While the captured window has FLAG_SECURE, replay records it fully masked rather than skipping it, in every replay mode, so recordings show something private was there instead of freezing on the previous screen.
    • Screenshot mode: an opaque masked frame the size of the window; none of its pixels are recorded or uploaded.
    • Wireframe mode: one masked node covering the window, with no child views, text or images.
  • The secure state is checked when capture starts and again before the frame is recorded; the frame is masked if the window was secure at either point.
  • Taps on a secure window aren't recorded; the app still receives them.
  • Each window follows its own flag, so a dialog without the flag over a secure activity is captured normally, as Android's own screenshots do.
  • Not applicable on iOS, which has no window-level secure flag and keeps masking sensitive inputs per field.

openspec validate --specs --strict passes (68/68). No Gherkin added to acceptance/private/session-replay-privacy.feature, matching the neighbouring browser network requirement, which added none either.

Impact

🤖 Generated with Claude Code

@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 29, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant