Commit c34670b
authored
feat: Android observability session replay masking support (#276)
## Summary
Adds masking, PrivacyOptions for customizing masking.
## How did you test this change?
Bench testing mostly, we have a future story for e2e tests.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds configurable session replay masking using
PrivacyProfile/MaskMatcher and applies masking during capture; updates
sample app to showcase sensitive inputs.
>
> - **SDK / Replay**:
> - **Privacy & Matchers**: Introduce `PrivacyProfile` (configurable
masking for text inputs, text, sensitive views) and `MaskMatcher`
interface; convert profile to matcher list via `asMatchersList()`.
> - **Capture Pipeline**: `CaptureSource` now accepts matcher list,
syncs with `Choreographer`, traverses Compose semantics via
`unmergedRootSemanticsNode`, computes sensitive rects, and masks them
(`Color.GRAY`) before encoding; removes enum-based privacy and ad-hoc
sensitivity check.
> - **Instrumentation**: `ReplayInstrumentation` passes
`options.privacyProfile.asMatchersList()` to `CaptureSource`.
> - **Options**: `ReplayOptions` defaults `privacyProfile` to
`PrivacyProfile()`.
> - **E2E App**:
> - Configure `ReplayInstrumentation` with `ReplayOptions(privacyProfile
= PrivacyProfile(maskText = false))` in `BaseApplication`.
> - Replace `SecondaryActivity` UI with a form containing password,
address, and credit card fields to exercise masking.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ea12d8c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 1927107 commit c34670b
File tree
7 files changed
+433
-125
lines changed- e2e/android/app/src/main/java/com/example/androidobservability
- sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay
7 files changed
+433
-125
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
Lines changed: 177 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
| 11 | + | |
8 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
12 | 28 | | |
| 29 | + | |
| 30 | + | |
13 | 31 | | |
| 32 | + | |
14 | 33 | | |
15 | 34 | | |
16 | 35 | | |
| |||
19 | 38 | | |
20 | 39 | | |
21 | 40 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
26 | 47 | | |
27 | 48 | | |
28 | 49 | | |
| |||
31 | 52 | | |
32 | 53 | | |
33 | 54 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
37 | 69 | | |
38 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
39 | 206 | | |
40 | 207 | | |
41 | 208 | | |
42 | 209 | | |
43 | | - | |
| 210 | + | |
44 | 211 | | |
45 | | - | |
| 212 | + | |
46 | 213 | | |
47 | 214 | | |
0 commit comments