Restoring an obfuscated stack trace

The ProGuard obfuscation process results in an obfuscated stack trace. To recover the original stack trace, you can run a retrace script.

Before you begin

To restore the obfuscated stack trace, you must have a copy of the mapping.txt file that is generated for the release build of your application. This file is created in the proguard directory of your project each time you build with ProGuard.
Note: For each build for which you might need to restore a stack trace, copy the mapping.txt file or save it under a new name because subsequent builds will overwrite the file.

Procedure

  1. Navigate to the directory where ProGuard is installed. (Usually sdk_root/tools/proguard/bin/).
  2. Run the following command, as appropriate to your operating system:
    retrace.bat|retrace.sh [-verbose] mapping.txt [stacktrace_file] > stacktrace_out.txt
    where

    stacktrace_file is the name of the stack trace file that you want to restore to readable form.

    mapping.txt file is the instance of this file that you saved for the specific release build.

    stacktrace_out.txt is the file that contains the unobfuscated stack trace.

Results

A readable stack trace is written to stacktrace_out.txt.