Narrow and clean up Android consumer keep rules
Maintainer thường phản hồi trong vòng 1 ngày
@runningcode đang làm issue này rồi.
Từ ngày 25/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Google Play is adding DEX shrinking, optimization, and obfuscation thresholds for apps in Feb 2027, and consumer keep rules shipped by libraries count against the app (Android guidance). An audit of the consumer rules on main found rules that are dead, broader than the code needs, or app-wide. Nothing below was verified with a minified build yet.
No effect / redundant
sentry-android-core/proguard-rules.pro:57-61:-keepnamesforio.sentry.android.okhttp.SentryOkHttpInterceptor(module no longer exists),SentryApolloInterceptor,SentryApollo3HttpInterceptor,SentryNavigationListener. Nothing looks these up by name; they register hardcoded integration names.sentry-android-core/proguard-rules.pro:63-64:-keepnamesforScreenshotEventProcessor/ViewHierarchyEventProcessor. No name lookup in this repo; React Native references them directly.sentry-android-ndk/proguard-rules.pro:7:-keep class io.sentry.protocol.DebugImage { *; }. sentry-native's JNI usesio/sentry/ndk/DebugImage.sentry-android-ndk/proguard-rules.pro:10:native <methods>rule. The module has no native methods, andsentry-native-ndkships the same rule forio.sentry.ndk.**.sentry-compose/proguard-rules.pro:8-10:LayoutNode.layoutDelegatekeep; the field isn't referenced.sentry-android-replay/proguard-rules.pro:13-14:FillElementkeepnames/dontwarn; the class isn't referenced.-keepattributes LineNumberTable,SourceFileis repeated in fragment, navigation, navigation3, ndk, replay, sqlite, timber, compose, launchdarkly-android, andsentry-okhttp'sMETA-INF;sentry-android-corealready sets it. The navigation, navigation3, launchdarkly-android, and okhttp files contain nothing else.sentry-android/proguard-rules.prois empty.sentry-spotlight/proguard-rules.prois never packaged (JVM jar, noconsumerProguardFiles).
Broader than needed
sentry-android-core/proguard-rules.pro:15:-keepclassmembers enum io.sentry.** { *; }was a workaround for an R8 bug in AGP 7.3/7.4 pre-releases (getsentry/sentry-java#2094). It pins every member of everyio.sentryenum, including hybrid SDK packages, and blocks enum unboxing.:68:-keep class * extends io.sentry.SentryOptions { *; }was added for reflective instantiation (getsentry/sentry-java#2696). Android now usesSentryAndroidOptionsContainer, and the NDK JNI usesNdkOptions. Only the class name is still read (Sentry.java:311).:49:-keepnames class * implements io.sentry.Integrationapplies app-wide, including app-defined integrations. It was added when integration names came from class names (getsentry/sentry-java#2592); they are now string literals. The Replay, Distribution, and Spotlight keepnames are still needed for presence checks.sentry-android-core:4-10,sentry-android-fragment:4,sentry-android-timber:4,sentry-compose:4-5:-keep class X { <init>(...); }/{ *; }on classes that are only checked by name and then instantiated directly.DefaultLifecycleObserverisn't looked up by name at all.sentry-android-ndk:4,sentry-android-ndk-outproc:4:SentryNdk { *; }/SentryNdkOutproc { *; }. Reflection only callsinit(...)andclose().sentry-android-replay:7:-keepnames class * extends Painteris app-wide, butisMaskable()only checks for Vector/Color/Brush painters and masks anything else.:33uses-keeponLayoutNodewhere only the listed members are needed.sentry-compose:17-18:TestTagElement { *; }andSentryTagModifierNodeElement { *; }; only thetagfield is read.
App-wide rules worth measuring
sentry-android-core:46:-keep,allowshrinking,allowobfuscation class * extends java.lang.Throwable(getsentry/sentry-java#5881) disables optimization for every Throwable in the app.:18:-keeppackagenames io.sentry.**blocks repackaging for all SDK and hybrid SDK classes. It exists for thestartsWith("io.sentry.")frame filter inSentryStackTraceFactory.- keepnames on
SentryHttpClientException,ApplicationNotResponding, andSentryApollo3ClientExceptionexist for readable issue titles, which mapping-based retrace already provides.
Hybrid SDK coupling
Unity reaches SentryAndroidOptions members by name, and .NET reaches enum constants through bindings, and both currently rely on the enum and SentryOptions rules above. Narrowing those needs the hybrid SDKs to ship their own keeps first. Hybrid SDK tickets: getsentry/sentry-unreal#1732, getsentry/sentry-unity#2964, getsentry/sentry-dotnet#6017, getsentry/sentry-dart#4225, getsentry/sentry-godot#1130.
via no.
--
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 483
- Merge trung bình
- 2 ngày 54 phút
- Pull request đã merge (30 ngày)
- 207
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Test the `sentry wizard` Android portCó thể đã có người làm @antonis đã nhận 1 ngày trước. Đang mởPlatform: Java
getsentry/sentry-java#6797 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Waiting for: Product Owner
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
getsentry/sentry-java#6758 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Replays
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
getsentry/sentry-java#6741 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Replays
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
getsentry/sentry-java#6740 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Feature Platform: Java Waiting for: Product Owner
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
getsentry/sentry-java#6731 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
[BUG] Issue reported from ReFraĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
IacobIonut01/ReFra#1515 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwatersio/slackwater-android#162 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
developmentwithyash/yaan#184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
analytics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 bình luận ·