From b65c392cb6e20d72c6665d07784bea323da7b181 Mon Sep 17 00:00:00 2001 From: Ghasem Shirdel Date: Wed, 21 May 2025 10:37:46 +0330 Subject: [PATCH 1/4] fix: sentry-androi-ndk proguard rule keeps all native class --- sentry-android-ndk/proguard-rules.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-android-ndk/proguard-rules.pro b/sentry-android-ndk/proguard-rules.pro index 09e6fb6c7c..db825e27b4 100644 --- a/sentry-android-ndk/proguard-rules.pro +++ b/sentry-android-ndk/proguard-rules.pro @@ -7,7 +7,7 @@ -keep class io.sentry.protocol.DebugImage { *; } # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native --keepclasseswithmembernames,includedescriptorclasses class * { +-keepclasseswithmembernames,includedescriptorclasses class io.sentry.** { native ; } From 448c46bf1da5b67b3c9aeb8e00557d9492e3bb86 Mon Sep 17 00:00:00 2001 From: Ghasem Shirdel Date: Wed, 21 May 2025 12:37:43 +0330 Subject: [PATCH 2/4] docs: update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 980d37262d..c868a64d51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - Use `Sentry.replay().enableDebugMaskingOverlay()` to overlay the screen with the Session Replay masks. - The masks will be invalidated at most once per `frameRate` (default 1 fps). +### Fixes + +- Overly broad Proguard rule in `sentry-android-ndk` keeping all native methods. + ## 8.12.0 ### Features From 93ad35bb27922c4d4caa89714790cf4b1a92c5d5 Mon Sep 17 00:00:00 2001 From: Ghasem Shirdel Date: Wed, 21 May 2025 12:38:19 +0330 Subject: [PATCH 3/4] fix: update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c868a64d51..3c7248baae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ### Fixes -- Overly broad Proguard rule in `sentry-android-ndk` keeping all native methods. +- Overly broad Proguard rule in `sentry-android-ndk` keeping all native methods. ([#4427](https://github.com/getsentry/sentry-java/pull/4427)) ## 8.12.0 From 4161556e742f3c6b68378d6c17869e757899f08d Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Thu, 12 Jun 2025 07:39:42 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f210a175c..2c97a048e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ - Session Replay: Do not capture current replay for cached events from the past ([#4474](https://github.com/getsentry/sentry-java/pull/4474)) - Session Replay: Correctly capture Dialogs and non full-sized windows ([#4354](https://github.com/getsentry/sentry-java/pull/4354)) - Session Replay: Fix inconsistent `segment_id` ([#4471](https://github.com/getsentry/sentry-java/pull/4471)) +- Limit ProGuard keep rules for native methods within `sentry-android-ndk` to the `io.sentry.**` namespace. ([#4427](https://github.com/getsentry/sentry-java/pull/4427)) + - If you relied on the Sentry SDK to keep native method names for JNI compatibility within your namespace, please review your ProGuard rules and ensure the configuration still works. Especially when you're not consuming any of the default Android proguard rules (`proguard-android.txt` or `proguard-android-optimize.txt`) the following config should be present: + ``` + -keepclasseswithmembernames class * { + native ; + } + ``` ## 8.13.2 @@ -62,10 +69,6 @@ - Bump Spring Boot to `3.5.0` ([#4111](https://github.com/getsentry/sentry-java/pull/4111)) -### Fixes - -- Overly broad Proguard rule in `sentry-android-ndk` keeping all native methods. ([#4427](https://github.com/getsentry/sentry-java/pull/4427)) - ## 8.12.0 ### Features