Skip to content

Commit 32a6f2e

Browse files
sentry-junior[bot]romtsnmarkushi
authored
fix(android): Preserve custom Throwable identities (#5881)
* fix(android): Preserve custom Throwable identities Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> * changelog --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io> Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
1 parent c70653f commit 32a6f2e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Preserve custom `Throwable` identities when R8 optimizes Android apps ([#5881](https://github.com/getsentry/sentry-java/pull/5881))
8+
39
## 8.52.0
410

511
### Fixes

‎sentry-android-core/proguard-rules.pro‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
# https://developer.android.com/studio/build/shrink-code#decode-stack-trace
3030
-keepattributes LineNumberTable,SourceFile
3131

32+
# Preserve distinct runtime identities for custom Throwables. R8 horizontal class merging can
33+
# otherwise merge unrelated exception classes, causing the runtime type and retraced frames to
34+
# disagree. Unused Throwables may still be removed, and retained Throwables may still be obfuscated.
35+
-keep,allowshrinking,allowobfuscation class * extends java.lang.Throwable
36+
3237
# Keep Classnames for integrations
3338
-keepnames class * implements io.sentry.Integration
3439

0 commit comments

Comments
 (0)