Summary
Android SDK 8.34.0 (changelog) added screenshot masking support using the view hierarchy (getsentry/sentry-java#5077). This masks sensitive content (text, images) in error screenshots.
The React Native SDK already exposes attachScreenshot but doesn't provide masking options, meaning screenshots on Android could contain sensitive data.
New Android APIs to bridge
options.screenshot.setMaskAllText(true)
options.screenshot.setMaskAllImages(true)
options.screenshot.addMaskViewClass("com.example.MyCustomView")
Also configurable via AndroidManifest.xml:
<meta-data android:name="io.sentry.screenshot.mask-all-text" android:value="true" />
<meta-data android:name="io.sentry.screenshot.mask-all-images" android:value="true" />
Proposal
Expose screenshot masking options in the RN SDK options (e.g. screenshotMaskAllText, screenshotMaskAllImages) and forward them to the native Android SDK during init. Consider parity with iOS if Cocoa SDK adds similar support.
Note: requires sentry-android-replay module at runtime for masking to work.
References
Summary
Android SDK 8.34.0 (changelog) added screenshot masking support using the view hierarchy (getsentry/sentry-java#5077). This masks sensitive content (text, images) in error screenshots.
The React Native SDK already exposes
attachScreenshotbut doesn't provide masking options, meaning screenshots on Android could contain sensitive data.New Android APIs to bridge
Also configurable via
AndroidManifest.xml:Proposal
Expose screenshot masking options in the RN SDK options (e.g.
screenshotMaskAllText,screenshotMaskAllImages) and forward them to the native Android SDK during init. Consider parity with iOS if Cocoa SDK adds similar support.Note: requires
sentry-android-replaymodule at runtime for masking to work.References