Skip to content
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

Support for renamesourcefileattribute in R8 config #1384

Closed
ILikeYourHat opened this issue Apr 8, 2021 · 9 comments
Closed

Support for renamesourcefileattribute in R8 config #1384

ILikeYourHat opened this issue Apr 8, 2021 · 9 comments

Comments

@ILikeYourHat
Copy link
Contributor

Hi 🙂 I'm currently working on improving obfuscation in one of our Android apps. Right now I want to remove any reference to the original file from obfuscated code, and to do so I've added this line to my R8/ProGuard config:

-renamesourcefileattribute SourceFile

Unfortunately, when I've added this, Sentry crash reporting stopped working as expected, giving me obfuscated stack traces. The mapping file is uploaded correctly, so this is not the issue. In the same time, Firebase Crashlytics is working fine in this configuration, so imo it is possible to get the original stack trace somehow.

Is this a bug, or a lack of feature? If the second thing, would it be possible to implement it into the Android SDK?

@marandaneto
Copy link
Contributor

@ILikeYourHat thanks for raising this.

I have to test this, if it's a symbolication problem or something else, what's the version of your AGP? I believe it's not an issue with the Android SDK itself but rather our symbolication crate https://github.com/getsentry/rust-proguard

proguard reference: https://www.guardsquare.com/en/products/proguard/manual/examples#stacktrace

maybe @Swatinem knows about this?

@ILikeYourHat
Copy link
Contributor Author

what's the version of your AGP?

It's 4.1.3

@marandaneto
Copy link
Contributor

@ILikeYourHat could you share a link of a Sentry's issue so we could have a look at it first? or even the raw JSON, you could erase PII data :)

@ILikeYourHat
Copy link
Contributor Author

@marandaneto one raw json for you :)

SENTRY_JSON.txt

@marandaneto
Copy link
Contributor

marandaneto commented Apr 9, 2021

@ILikeYourHat I don't see the debug_meta field in your JSON file.
wondering if you're experiencing this issue getsentry/sentry-android-gradle-plugin#37

how are you uploading the proguard mapping file? via Sentry Gradle plugin?

@marandaneto
Copy link
Contributor

@ILikeYourHat any news here? thanks

@ILikeYourHat
Copy link
Contributor Author

@marandaneto sorry for long delay. Here is the json with _meta field, I assume this is the debug_meta property you are talking about: SENTRY_JSON.txt

About getsentry/sentry-android-gradle-plugin#37, this issue was tested on app created by our release process. We have no issues with this process, for normal releases everything works fine. And I've created app with this flag twice, same issue in both.

I'm using Sentry Gradle Plugin. The mapping is uploading fine, I can see the uploaded file in project settings.

@marandaneto
Copy link
Contributor

@ILikeYourHat search for debug_meta field in the JSON, it's not there, that's why it does not demangle the stack trace on the server, your event should contain the debug_meta otherwise either you're not setting up the Gradle plugin correctly https://docs.sentry.io/platforms/android/proguard/ or you're likely having the issue mentioned above.

it's not only about uploading the proguard file to Sentry, the APK should contain a reference of the proguard id to make the association and this can be seen by either extracting the APK and looking into the assets folder or taking a look at the JSON and debug_meta

@ILikeYourHat
Copy link
Contributor Author

@marandaneto you are right, this is the issue in our case 🙈 we are building two artifacts: .apk (affected by this issue) and .aab (used by Google Play, unaffected). Obliviously tests were made on the .apk version 🙈

Thank you for your help! I am closing this issue, because it is unrelated to renamesourcefileattribute flag. I will open another one if something will still prevent me to use it.

One more question, when are you planning to release the new plugin version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants