Three ways to mark, one result. Compose:
import com.traceitx.sensitive.txSensitive
Text(cardNumber, modifier = Modifier.txSensitive())
XML — wrap the subtree in TXSensitiveView, a FrameLayout:
<com.traceitx.sensitive.TXSensitiveView ...>
<TextView android:id="@+id/card_number" ... />
</com.traceitx.sensitive.TXSensitiveView>
Programmatic, for a View you already hold:
TraceItX.markSensitive(cardNumberView)
markSensitive sets a tag on the view — nothing is retained, so there is
nothing to un-mark on teardown. It is a no-op before start(), so mark views
after the SDK is running.
The masking happens in the producer, before capture — masked content never enters the screenshot or the replay buffer, let alone the upload. It is not a flag a viewer is trusted to honour.
What it covers
| Screenshot | The region is painted black. |
| Session replay | One node with masked: true, no text, and the subtree beneath it dropped. |
| Logs & network | Not covered — those are text streams. Use Redaction. |
That last row is the one to remember: this is about pixels and rendered text. A card number that also appears in a response body needs a redaction rule as well.
Masking follows the view’s bounds at capture time rather than pinning a
rectangle that goes stale when the keyboard opens or the device rotates.
Compose regions are found by reading the semantics tree, so the Modifier
masks whatever is laid out under it.
Password fields
An EditText with a password inputType is detected and masked by the SDK
already, so you do not need to mark it. Anything else that happens to hold a
secret does.
FLAG_SECURE is not a substitute
FLAG_SECURE blanks the whole window, which means your report loses every
screenshot rather than one region. Mark the view instead — you keep a useful
report and still never ship the secret.
Choosing what to mark
Mark the smallest view that contains the secret. Masking a whole screen makes the report useless without making it meaningfully safer, and a blanked screenshot is a common reason a report gets closed as unreproducible.