-
-
Notifications
You must be signed in to change notification settings - Fork 475
fix(android): Preserve custom Throwable identities #5881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,11 @@ | |
| # https://developer.android.com/studio/build/shrink-code#decode-stack-trace | ||
| -keepattributes LineNumberTable,SourceFile | ||
|
|
||
| # Preserve distinct runtime identities for custom Throwables. R8 horizontal class merging can | ||
| # otherwise merge unrelated exception classes, causing the runtime type and retraced frames to | ||
| # disagree. Unused Throwables may still be removed, and retained Throwables may still be obfuscated. | ||
| -keep,allowshrinking,allowobfuscation class * extends java.lang.Throwable | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We definitely need to check that R8 doesn't flag us here
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it likely does, but there's no other way to work this around, so 🤷 every crash reporter is prone to this issue. But I will check with the R8 config analyzer |
||
|
|
||
| # Keep Classnames for integrations | ||
| -keepnames class * implements io.sentry.Integration | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be just
-keepnames(which should be short for Short for-keep,allowshrinking)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea here is to allow obfuscating the class as well, and keepnames would disable that