Recently, I wrote a blog post for Android devs that use ProGuard. If you ever needed to debug obfuscated stack traces, then this cheat sheet is for you. By the end of this, you will have a more human-readable stacktrace. I'm bringing it up because I have to keep referring to it every time in order to remember the right command line syntax. And, I spent quite a bit of time looking up how to do this so that hopefully others won't have to waste as much time as me.
There are two ways of de-obfuscating the stack trace -- command line and GUI (Graphical User Interface):
1) Open <android-sdk>/tools/proguard/bin/proguardgui.bat
2) Select the “ReTrace” option on the left column.
3) Add your mapping file and obfuscated stack trace.
4) Click “ReTrace!”
COMMAND LINE METHOD
1) You will need your ProGuard’s mapping.txt file and the stack trace (Ex: stacktrace.txt) that you want to de-obfuscate.
2) The easiest way to do the next step is copy both these files into your <android_sdk_root>/tools/proguard/bin.
3) If you are on Windows, run the following command in the same directory as the files (make sure you change to your own file names):
4) out.txt will have the stack trace de-obfuscated. Now you can debug much easier and faster than before.Code:retrace.bat -verbose mapping.txt stacktrace.txt > out.txt
Source (includes pictures): Simply Advanced | Android: How To Decode ProGuard?s Obfuscated Code From Stack Trace
Let me know if you have any problems, questions, or suggestions for this small cheat sheet.
- Danial Goodwin -