Repository navigation
ref(android): Narrow consumer keep rules to what the SDK reads - #6779
Merged
Merged
Conversation
Contributor
PR risk: mediumFor commit Main concerns: reach, public contract, data sent to Sentry. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
3 of 9 tasks
runningcode
marked this pull request as ready for review
November 26, 2026 07:18
runningcode
requested review from
markushi and
romtsn
and removed request for
a team
November 26, 2026 07:18
0xadam-brown
left a comment
Member
There was a problem hiding this comment.
One quick comment; otherwise lgtm 👍
4 of 9 tasks
romtsn
approved these changes
Dec 1, 2026
Classes that are only checked by name now keep just their name, the NDK entry points keep only init() and close(), replay keeps the names of the three Painters isMaskable() leaves unmasked, LayoutNode keeps only the reflected members, and the Compose tag elements keep only their tag field. The app-wide Integration keepnames is dropped, since integration names are string literals now. Refs #6771 Refs JAVA-856 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isMaskable() left any Painter unmasked whose class name contained Vector, Color, or Brush. Once R8 renames an app's painter, that check gave different results in debug and release. Checking the three AndroidX types directly behaves the same in both, and drops their keep rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/narrow-android-keep-rules
branch
from
December 2, 2026 16:03
0299f5c to
9fb60b3
Compare
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
Narrows Android consumer keep rules to the names and members the SDK actually reads by reflection, and drops the app-wide
-keepnames class * implements io.sentry.Integration.💡 Motivation and Context
Google Play adds DEX optimization thresholds in Feb 2027, and library consumer rules count against the app. Part of #6771 (JAVA-856).
isMaskable()now leavesVectorPainter,ColorPainter, andBrushPainterunmasked by type instead of by class name, so no Painter needs to keep its name. Before, an app's own Painter withVector,Color, orBrushin its name stayed unmasked; it's now masked in debug and release alike.SentryOptionsrules (hybrid SDKs depend on them), theThrowablerule,-keeppackagenames, and the exception keepnames.💚 How did you test it?
Built the minified
sentry-samples-androidrelease with and without these changes (together with #6778) and ran the same journey on an API 36 emulator: exceptions with screenshot and view hierarchy, Timber, native capture, fragment and ComposetestTagclick breadcrumbs, Session Replay, and a Java crash on relaunch. Captured the envelopes locally. The events, attachments, view hierarchy tags, breadcrumbs,sdk.integrations, and the integration init logs were identical, and logcat showed no reflection failures.R8 Configuration Analyzer on the sample: Sentry's rules keep 1,556 items instead of 1,700, and the uncompressed DEX shrinks by 6.5 KB.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Conflicts with #6778 in
sentry-android-core/proguard-rules.proandCHANGELOG.md. Whichever lands second takes both sides.🤖 Generated with Claude Code