Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

howto in eclipse debug the Proguard obfuscated apk file

I got a crash in my app after using Proguard and signing and exporting with a new key.
The same code works in normal eclipse debug mode.

I read everywhere i should use the mapping.txt to find the code that failed. But how to do that, I have google this for 2 hour now and no answer is working.

Im now signing the apk file with the debug.keystore and using the default password "android".
Someone say i should android:debuggable="false" in my application tag to make Proguard obfuscate my debug session in eclipse.

Is this right?
Any help would be grate

on the Proguard Android Developer page I cannot find a way to do this

"When your obfuscated code outputs a stack trace, the method names are obfuscated, which makes debugging ha"

What "stack trace" and from where?

On the page Proguard Manual I cannot find an explanation

like image 416
Erik Avatar asked Sep 12 '11 17:09

Erik


People also ask

How do you debug an obfuscated code?

To debug obfuscated JavaScript code, you need to use a JavaScript formatter or beautifier. Go to the following link to beautify JavaScript, In the left section, add your obfuscated JavaScript code and click Beautify as shown below, On clicking, you can see Beautified JavaScript code in the right section.

How do I decompile obfuscated APK?

Android applications can be reverse engineered using a host of freely available tools such as Apktool, dex2jar, dexdump, Jadx, JD-GUI, CFR and Procyon. These tools are used to dump the executable code and, in some cases, reconstruct the source code.


2 Answers

You can de-obfuscate the stack trace most easily using the Proguard GUI. You'll find this with your Android SDK.

sdk\tools\proguard\bin\proguardgui.bat
  1. Run the GUI above from the path above.
  2. Click the 'ReTrace' button at the bottom of the panel on the left.
  3. Add the path to your Mapping File (mapping.txt) in the 'Mapping file' text box.
  4. Paste a copy of your stack trace in the 'Obfuscated stack trace' text box.
  5. Click 'ReTrace' in the bottom right.
  6. Happy Debugging!

enter image description here

like image 192
Will Calderwood Avatar answered Oct 12 '22 11:10

Will Calderwood


Not within Eclipse.

Outside of Eclipse, use Retrace function within ProGuard. You'll also need the dumped stacktrace and mapping.txt found under your project's proguard directory to reverse the obfuscated stacktrace. Remember to save a copy of mapping.txt (preferably outside of your project's workspace) each time you deploy a new version of your Android app.

like image 40
ChuongPham Avatar answered Oct 12 '22 13:10

ChuongPham