Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deobfuscate R8 Stack traces?

I have an app and it crashes just like every good app should! A little while ago, the Android build tools started using R8 instead of Proguard. It worked and it sped up my build, so I left it alone. Then came an exception stack trace that I had to deobfuscate. I used the proguard UI, The retrace.bat script, and the commandline, but the supposedly deobfuscated stack trace still looked obfuscated.

Looking at the mapping.txt generated, I see a bunch of numbers (line numbers?) in the mapping that I don't recall having seen before. I suspect these are the reason why the deobfusctaors above all fail.

Is there any way to currently deobfuscate such stack traces?

Also posted as https://issuetracker.google.com/137078989

like image 219
copolii Avatar asked Jul 09 '19 18:07

copolii


People also ask

How do you Deobfuscate stack trace?

Get deobfuscated crash stacktrace from your app pageSign in to your Play Console. Select an app. On the left menu, click Android vitals > Deobfuscation files. Next to a version of your app, click Upload.

How do I get Deobfuscation file?

Select an app. On the left menu, select Quality > Android vitals > Crashes & ANRs. Select a crash. In the "Stack Traces" section, you'll see your deobfuscated and symbolicated stack traces.

How do I enable R8 on my Android?

Enabling R8 in your project To enable R8, open build. gradle module app file and add this piece of code inside the buildTypes . The code inside the release{} block means that this will be applied to the release build version of your application. If you launch the app in the emulator, this code is not executed.

What is a retrace mapping file?

R8 retrace is a tool for obtaining the original stack trace from an obfuscated stack trace. The stack trace is reconstructed by matching class and method names in a mapping file to their original definitions.


1 Answers

Please make sure to download the latest version of ProGuard from https://sourceforge.net/projects/proguard/ to get a version of retrace which will work with the R8 mapping files.

If that still does not produce the correct stack trace file a new bug (or update the existing).

like image 123
sgjesse Avatar answered Sep 22 '22 01:09

sgjesse