diff --git a/CHANGELOG.md b/CHANGELOG.md index 735831f2f98..6e081168e1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## Unreleased +### Improvements + +- Android: Remove consumer keep rules that had no effect, so R8 can optimize more of your app ([#6778](https://github.com/getsentry/sentry-java/pull/6778)) + ### Fixes - Session Replay: Mask Compose images loaded with Coil 3.1+ `AsyncImage` when `maskAllImages` is enabled ([#6759](https://github.com/getsentry/sentry-java/pull/6759)) diff --git a/sentry-android-core/proguard-rules.pro b/sentry-android-core/proguard-rules.pro index 34fc51f709a..f058197818b 100644 --- a/sentry-android-core/proguard-rules.pro +++ b/sentry-android-core/proguard-rules.pro @@ -48,18 +48,7 @@ # Keep Classnames for integrations -keepnames class * implements io.sentry.Integration --dontwarn io.sentry.apollo.SentryApolloInterceptor --keepnames class io.sentry.apollo.SentryApolloInterceptor - --dontwarn io.sentry.apollo3.SentryApollo3HttpInterceptor --keepnames class io.sentry.apollo3.SentryApollo3HttpInterceptor - --dontwarn io.sentry.android.okhttp.SentryOkHttpInterceptor --keepnames class io.sentry.android.okhttp.SentryOkHttpInterceptor - --dontwarn io.sentry.android.navigation.SentryNavigationListener --keepnames class io.sentry.android.navigation.SentryNavigationListener - +# SentryClient logs the processor's class name when it throws -keepnames class io.sentry.android.core.ScreenshotEventProcessor -keepnames class io.sentry.android.core.ViewHierarchyEventProcessor diff --git a/sentry-android-ndk/proguard-rules.pro b/sentry-android-ndk/proguard-rules.pro index db825e27b4d..5d20c64a20b 100644 --- a/sentry-android-ndk/proguard-rules.pro +++ b/sentry-android-ndk/proguard-rules.pro @@ -3,9 +3,6 @@ # The Android SDK checks at runtime if this class is available via Class.forName -keep class io.sentry.android.ndk.SentryNdk { *; } -# The JNI layer uses this class through reflection --keep class io.sentry.protocol.DebugImage { *; } - # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames,includedescriptorclasses class io.sentry.** { native ; diff --git a/sentry-android-replay/proguard-rules.pro b/sentry-android-replay/proguard-rules.pro index 90a78965e89..1e7b08908d3 100644 --- a/sentry-android-replay/proguard-rules.pro +++ b/sentry-android-replay/proguard-rules.pro @@ -10,10 +10,8 @@ } # Elements without a painter member, e.g. Coil 3.1+ ContentPainterElement, are masked by name only -keepnames class **PainterElement -# Rules to detect Text colors and if they have Modifier.fillMaxWidth to later mask them +# Rules to detect Text colors to later mask them -dontwarn androidx.compose.ui.graphics.ColorProducer --dontwarn androidx.compose.foundation.layout.FillElement --keepnames class androidx.compose.foundation.layout.FillElement -keepclasseswithmembernames class * { androidx.compose.ui.graphics.ColorProducer color; } diff --git a/sentry-compose/proguard-rules.pro b/sentry-compose/proguard-rules.pro index 30473497a5f..4c847b6a053 100644 --- a/sentry-compose/proguard-rules.pro +++ b/sentry-compose/proguard-rules.pro @@ -5,9 +5,6 @@ -keep class io.sentry.compose.viewhierarchy.ComposeViewHierarchyExporter { (...); } -keepnames interface androidx.compose.ui.node.Owner --keepclassmembers class androidx.compose.ui.node.LayoutNode { - private androidx.compose.ui.node.LayoutNodeLayoutDelegate layoutDelegate; -} -keepnames class androidx.compose.foundation.ClickableElement -keepnames class androidx.compose.foundation.CombinedClickableElement