Repository navigation
feat(android): Mask screenshots by default - #6437
Open
runningcode wants to merge 2 commits into
Open
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
Error and user feedback screenshots now mask all text and images by default, matching Session Replay. The manifest reader defaulted the screenshot masking keys to false, which would have undone the new default, so it now defaults them to true like the replay keys. Masking needs sentry-android-replay at runtime. Apps that depend on sentry-android-core alone and attach screenshots now get no screenshot until they add the replay module or turn masking off. Refs JAVA-502 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
📲 Install BuildsAndroid
|
runningcode
marked this pull request as ready for review
October 30, 2026 12:18
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
October 30, 2026 12:18
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Error screenshots and user feedback screenshots now mask all text and images by default, matching Session Replay.
SentryScreenshotOptionsturns onmaskAllTextandmaskAllImagesin its constructor.maskAllImagesalso masksWebView,VideoViewand the media player views.ManifestMetadataReaderused to set both options tofalsewhenio.sentry.screenshot.mask-all-textandio.sentry.screenshot.mask-all-imageswere missing, which would have undone the new default. It now defaults them totrue, like the session replay keys.Opt out with
options.screenshot.setMaskAllText(false)/setMaskAllImages(false), or the manifest keys above set tofalse.Note: masking needs
sentry-android-replayat runtime. If masking is configured and the replay module is missing,ScreenshotEventProcessorskips the screenshot instead of attaching an unmasked one.sentry-androidincludes replay, so this only affects apps that depend onsentry-android-coredirectly and useattachScreenshot. Those apps now get no screenshot until they addsentry-android-replayor turn masking off.💡 Motivation and Context
Screenshots can contain PII. Masking by default makes the safe choice the default, as on iOS.
💚 How did you test it?
SentryScreenshotOptionsandManifestMetadataReadersentry-android-corescreenshot, feedback and manifest unit tests📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps