From 9ec1c8bd687c3d1447d2cfec7ea432616f9bcb2a Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Tue, 1 Dec 2026 11:36:28 +0000 Subject: [PATCH 1/2] fix(android): Remove the WebView adapter keep rule The Sentry Android Gradle Plugin rewrites the WebView.loadUrl calls before R8 runs, so R8 renames the adapter and its call sites together and no keep rule is needed. Partially reverts 8ebf12fbe359baa680b57ac6557bbefb3792698a. Co-Authored-By: Markus Hintersteiner --- sentry-android-core/proguard-rules.pro | 6 ------ .../io/sentry/android/core/SentryWebViewTracingAdapter.java | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sentry-android-core/proguard-rules.pro b/sentry-android-core/proguard-rules.pro index 2ec39f82fe..f058197818 100644 --- a/sentry-android-core/proguard-rules.pro +++ b/sentry-android-core/proguard-rules.pro @@ -36,12 +36,6 @@ # keep the name of the class the presence check looks up, so it still finds it in minified apps -keepnames class androidx.webkit.ScriptHandler -# The Sentry Android Gradle Plugin's WebView instrumentation rewrites WebView.loadUrl calls to these -# methods by name, so keep their names --keepnames class io.sentry.android.core.SentryWebViewTracingAdapter { - public static void loadUrl(...); -} - # To ensure that stack traces is unambiguous # https://developer.android.com/studio/build/shrink-code#decode-stack-trace -keepattributes LineNumberTable,SourceFile diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java b/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java index d9c70df3c9..5971d571ae 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java @@ -17,7 +17,8 @@ * *

The plugin calls these methods by class name, method name and signature, so don't rename, move * or change them: apps built with an existing plugin version would fail to find them. Add new - * overloads instead. The consumer ProGuard rules keep their names. + * overloads instead. No keep rule is needed: the plugin rewrites the calls before R8 runs, so R8 + * renames them together with this class, like {@link SentryLogcatAdapter}. */ @ApiStatus.Internal public final class SentryWebViewTracingAdapter { From bac93bab4713747b48a11b80f172c833b25886d3 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 1 Dec 2026 12:45:03 +0100 Subject: [PATCH 2/2] Streamline comment --- .../io/sentry/android/core/SentryWebViewTracingAdapter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java b/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java index 5971d571ae..62674456ce 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/SentryWebViewTracingAdapter.java @@ -17,8 +17,7 @@ * *

The plugin calls these methods by class name, method name and signature, so don't rename, move * or change them: apps built with an existing plugin version would fail to find them. Add new - * overloads instead. No keep rule is needed: the plugin rewrites the calls before R8 runs, so R8 - * renames them together with this class, like {@link SentryLogcatAdapter}. + * overloads instead. */ @ApiStatus.Internal public final class SentryWebViewTracingAdapter {