Skip to main content
Version: 1.1.x

Privacy Masking - Compose

Use Modifier.corynHideFromUiCapture() to mask sensitive Composables in UI captures and exclude their text from automatic Screen Text collection. Apply it before showing sensitive content.

Masking a Composable​

import ai.coryn.replay.api.recordercompose.corynHideFromUiCapture
import ai.coryn.replay.shared.uicapture.CorynPadding

Text(
text = creditCardNumber,
modifier = Modifier.corynHideFromUiCapture(
padding = CorynPadding.horizontal(12f)
)
)

Use hide = false to reveal the content in captures. The flag can follow app state:

@Composable
fun PasswordField(password: String, isMasked: Boolean) {
Text(
text = if (isMasked) "****" else password,
modifier = Modifier.corynHideFromUiCapture(
hide = !isMasked,
padding = CorynPadding.vertical(12f)
)
)
}

Here the real password appears only when isMasked is false, so that is when capture masking is enabled.

Use the modifier on an AndroidView Composable as well, instead of marking its hosted View through the View API.

Overscroll tracking​

Wrap the tree containing hidden Composables with CorynOverscrollFactoryWrapper, inside your Theme and any provider of LocalOverscrollFactory that affects that content:

import ai.coryn.replay.api.recordercompose.CorynOverscrollFactoryWrapper

@Composable
fun App() {
AppTheme {
CorynOverscrollFactoryWrapper {
AppContent()
}
}
}

The wrapper preserves the supplied effect and tracks it for masking. If a nested subtree overrides LocalOverscrollFactory, wrap that subtree again after its provider. This also applies to hidden content in dialogs and popups when they supply their own factory. A null factory disables overscroll and does not need wrapping.

Track the effective overscroll factory

A hidden Composable using a non-null factory that Coryn is not tracking triggers a critical integration error and cancels recording. Keep the wrapper inside the provider that supplies the effective factory; placing it outside that provider does not track the overridden effect.

For shared guidance on padding, moving hidden content, overscroll strategies and secure windows, see Privacy Masking.

For temporary moves in custom drawing code or changes to Popup/Overlay elevation or surface insets, see manual position changes. Normal scrolling and layout movement do not require notifications.

Compose version

Minimum Compose 1.8.0; recommended 1.9.3 or newer, especially for moving layouts. See Introduction.