Skip to content

ref(android): Remove consumer keep rules that have no effect - #6778

Merged
runningcode merged 3 commits into
mainfrom
no/remove-dead-android-keep-rules
Nov 26, 2026
Merged

runningcode merged 3 commits into
mainfrom
no/remove-dead-android-keep-rules

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

Removes Android consumer keep rules that have no effect: nothing looks up these classes or members by name.

💡 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).

Deliberately kept: the native <methods> rule in sentry-android-ndk. It also matches hybrid SDK and app classes under io.sentry.**, and sentry-dart's ProGuard file says it relies on it. Apps that use AGP's default ProGuard files already keep all native methods anyway.

💚 How did you test it?

Built the minified sentry-samples-android release with and without these changes (together with the narrowing PR) and ran the same journey on an API 36 emulator: exceptions with screenshot and view hierarchy, Timber, native capture, fragment and Compose click breadcrumbs, Session Replay, and a Java crash on relaunch. Captured the envelopes locally. The events, attachments, view hierarchy tags, breadcrumbs, and sdk.integrations were identical, and logcat showed no reflection failures.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The enum and SentryOptions rules are 90% of the remaining impact, and they wait on the hybrid SDKs to ship their own keeps.

🤖 Generated with Claude Code

runningcode and others added 2 commits November 25, 2026 16:18
Nothing looks up these classes or members by name: the interceptor and
listener keepnames predate hardcoded integration names, the
SentryOkHttpInterceptor module is gone, sentry-native's JNI uses its own
io.sentry.ndk.DebugImage, and neither LayoutNode.layoutDelegate nor
FillElement is referenced anymore.

Refs #6771
Refs JAVA-856

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 39cd323.

Main concerns: public contract, reach.

Rules that block low also fired:

  • R6: build or release configuration changed: sentry-android-core/proguard-rules.pro, sentry-android-ndk/proguard-rules.pro, sentry-android-replay/proguard-rules.pro, sentry-compose/proguard-rules.pro

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.66.0 (1) release

⚙️ sentry-android Build Distribution Settings

Comment thread sentry-android-core/proguard-rules.pro Resolved
Comment thread sentry-android-core/proguard-rules.pro Resolved
Comment thread sentry-android-ndk/proguard-rules.pro Resolved
Comment thread sentry-compose/proguard-rules.pro Resolved
@runningcode
runningcode marked this pull request as ready for review November 25, 2026 15:28
@runningcode
runningcode requested review from a team and adinauer as code owners November 25, 2026 15:28
@runningcode
runningcode requested review from 0xadam-brown and markushi and removed request for a team November 25, 2026 15:28
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡

Comment thread CHANGELOG.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 26, 2026
@runningcode
runningcode enabled auto-merge (squash) November 26, 2026 15:09
@runningcode
runningcode merged commit a8ff282 into main Nov 26, 2026
56 of 58 checks passed
@runningcode
runningcode deleted the no/remove-dead-android-keep-rules branch November 26, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants