Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deobfuscate an Android stacktrace using mapping file

Tags:

I got a stacktrace from the crashreporting system and it is obfuscated, like

... Failed resolution of: Lru/test/c/b/a; ...

I have a mapping file.

How to deobfuscate this stacktrace using mapping.txt?

like image 833
Maksim Turaev Avatar asked May 06 '19 14:05

Maksim Turaev


People also ask

How do I Deobfuscate an Android app?

Choose an app. Select Android vitals > Deobfuscation files from the left menu. Click Upload next to a version of your software. Upload the ProGuard mapping file for your app's version.

What is ReTrace mapping file in Android?

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.

What is ProGuard mapping file?

A mapping file contains the original names and the obfuscated names of classes, fields, and methods. ProGuard can write out such a file while obfuscating an application or a library, with the option -printmapping . ReTrace requires the mapping file to restore obfuscated stack traces to more readable versions.


1 Answers

Get deobfuscated crash stacktrace from your app page

Upload your mapping.txt to your app PlayStore page with the following steps:

  1. Sign in to your Play Console.
  2. Select an app.
  3. On the left menu, click Android vitals > Deobfuscation files.
  4. Next to a version of your app, click Upload.
  5. Upload the ProGuard mapping file for the version of your app.

After doing so, to view your deobfuscated crash stack traces:

  1. Sign in to your Play Console.
  2. Select an app.
  3. On the left menu, click Android vitals > ANRs & Crashes.
  4. Select a crash.
  5. On the "Stack Traces" tab, you'll see your deobfuscated stack traces.

You can check this link for more details.

Deobfuscate a piece of stacktrace

To convert the code by yourself use the retrace script (retrace.bat on Windows; retrace.sh on Mac/Linux). It is located in the ~/Android/sdk/tools/proguard/bin/ directory. The script takes the mapping.txt file and your stack trace, producing a new, readable stack trace. The syntax for using the retrace tool is:

retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]
like image 150
Ricardo Avatar answered Oct 19 '22 16:10

Ricardo