Skip to content

Conversation

@abelonogov-ld
Copy link
Contributor

@abelonogov-ld abelonogov-ld commented Nov 21, 2025

Summary

Support maskText, maskTextInput, maskSensitive for Android Native XML Views

How did you test this change?

Are there any deployment considerations?


Note

Adds auto-masking for Android XML views and refactors masking to a new MaskTarget/MaskMatcher API, updating capture/instrumentation and e2e demo package paths.

  • SDK • Session Replay/Masking:
    • New masking module replay/masking: introduce MaskTarget/MaskMatcher, ComposeMaskTarget, NativeMaskTarget (handles EditText/TextView, passwords, hints, contentDescription), and SensitiveAreasCollector (now uses LDLogger).
    • Privacy: PrivacyProfile matchers rewritten to operate on MaskTarget (textInput, text, sensitive).
    • Capture/Instrumentation: CaptureSource now accepts LDLogger and uses new masking.SensitiveAreasCollector; ReplayInstrumentation creates logger and passes it to CaptureSource.
    • Remove old replay/MaskMatcher.kt and old SensitiveAreasCollector.
  • E2E App:
    • Move Smoothie demo to com.example.androidobservability.smoothie; update AndroidManifest.xml, MainActivity, and adapter imports.
    • SmoothieAdapter: call ldMask() on image view to mark as sensitive.

Written by Cursor Bugbot for commit 60a4713. This will update automatically on new commits. Configure here.

@abelonogov-ld abelonogov-ld requested a review from a team as a code owner November 21, 2025 23:36
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: ldMask modifier ignored when matchers list empty

The condition checks maskMatchers.isNotEmpty() instead of sensitiveComposeRects.isNotEmpty() before applying masking. This causes views marked with the ldMask() modifier to not be masked when the matchers list is empty, even though the sensitive areas were collected. The ldMask() modifier should work independently of configured matchers.

sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/CaptureSource.kt#L156-L161

maskSensitiveRects(bitmap, sensitiveComposeRects)
} else {
bitmap
}
// TODO: O11Y-625 - optimize memory allocations here, re-use byte arrays and such

Fix in Cursor Fix in Web


@abelonogov-ld abelonogov-ld changed the title WIP: XML Views Automasking options feat: XML Views Automasking options Nov 22, 2025
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) November 22, 2025 00:19
@abelonogov-ld abelonogov-ld merged commit c61a7be into main Nov 22, 2025
22 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/mask-native-input-text branch November 22, 2025 00:34
abelonogov-ld pushed a commit that referenced this pull request Nov 22, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-observability-android: 0.16.0</summary>

##
[0.16.0](launchdarkly-observability-android-0.15.0...launchdarkly-observability-android-0.16.0)
(2025-11-22)


### Features

* XML Views Automasking options
([#299](#299))
([c61a7be](c61a7be))


### Bug Fixes

* missed imports
([#298](#298))
([6e6c388](6e6c388))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release `observability-android` 0.16.0 with XML Views automasking and
an import fix; update manifest and gradle version.
> 
> - **SDK `observability-android`**:
> - Bump version to `0.16.0` in
`sdk/@launchdarkly/observability-android/gradle.properties` and
`.release-please-manifest.json`.
>   - Update `CHANGELOG.md`:
>     - Features: XML Views automasking options.
>     - Bug Fixes: missed imports.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d827ba6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
abelonogov-ld added a commit that referenced this pull request Dec 4, 2025
* main: (85 commits)
  doc: Add using ldMask in readme. (#311)
  chore: release main (#312)
  feat: take transformed coordinates, which are more precise in animation  (#309)
  chore: release main (#307)
  fix(SEC-7530): update react-server-dom-webpack to 19.0.1 (#310)
  feat: recursive mask collection (#308)
  feat: support non-standard windows added by WindowManager (#306)
  feat: Android SR Do not send duplicate screens (#304)
  test: Add UI and logic to evaluate boolean flags (#305)
  chore: release main (#303)
  feat: Android Dialog Capture (#302)
  chore: Update Android Test main screen (#301)
  chore: release main (#300)
  feat: XML Views Automasking options (#299)
  fix: missed imports (#298)
  chore: release main (#297)
  feat: Support ldMask() for Native and Compose views. (#295)
  chore: release main (#296)
  fix: tweaks Android InteractionDetector to delegate additional defaul… (#294)
  chore: release main (#293)
  ...

# Conflicts:
#	e2e/react-router/src/ldclientLazy.tsx
#	e2e/react-router/src/routes/root.tsx
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.

3 participants