Repository navigation
feat(android): Add masked screenshot capture for Hybrid SDKs - #6281
Merged
Merged
Conversation
Hybrid SDKs capture screenshots for their own errors through ScreenshotUtils.takeScreenshot, which ignores the screenshot masking options. Add ScreenshotUtils.takeMaskedScreenshot, backed by a shared captureMaskedScreenshot that ScreenshotEventProcessor now uses as well, so native and hybrid screenshots follow the same masking rules. Refs getsentry/sentry-react-native#6900 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
antonis
commented
Oct 19, 2026
Catch only InterruptedException around the main-thread wait and RuntimeException around bitmap masking. Keep the broad catch for view hierarchy traversal, which runs custom View code, but let fatal errors through with ExceptionUtils.rethrowIfFatal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e821ddc. Configure here.
📲 Install BuildsAndroid
|
antonis
marked this pull request as ready for review
October 19, 2026 09:21
antonis
requested review from
0xadam-brown,
adinauer,
markushi,
romtsn and
runningcode
as code owners
October 19, 2026 09:21
romtsn
reviewed
Oct 20, 2026
Add ScreenshotMasking.isAvailable() so the replay integration class name no longer needs to be public on SentryAndroid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reenshot # Conflicts: # CHANGELOG.md
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
Adds
ScreenshotUtils.takeMaskedScreenshot(activity, options, buildInfoProvider)for Hybrid SDKs. It takes a screenshot and masks it according toSentryAndroidOptions.getScreenshot(), the same way native error screenshots are masked. The implementation moves the existing native masking code into a shared place unchanged and adds a thin entry point for hybrid SDKs💡 Motivation and Context
Resolves (Android side): getsentry/sentry-react-native#6900
💚 How did you test it?
CI, Manually on RN
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
RNSentryModuleImpltotakeMaskedScreenshotand default screenshot masking to on, once a sentry-java release with this change is available.