Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard retrace isnt mapping the stack trace to the actual source

I have been using the eclipse built in proguard tool to obsucate the code, which Works fine. However when I try to retrace the stack trace of the obfuscated code, retrace doesn't output an un-obfuscated stacktrace.

I have double check the mapping.txt to sure that i am using the right one.

here is my stack trace

ERROR/AndroidRuntime(19398): 
FATAL EXCEPTION: Thread-35
ERROR/AndroidRuntime(19398): java.lang.NullPointerException
ERROR/AndroidRuntime(19398):     at android.graphics.Canvas.throwIfRecycled(Canvas.java:954)
ERROR/AndroidRuntime(19398):     at android.graphics.Canvas.drawBitmap(Canvas.java:980)
ERROR/AndroidRuntime(19398):     at com.excelectronic.b.aa.a(ProGuard:535)
ERROR/AndroidRuntime(19398):     at com.excelectronic.g.f.a(ProGuard:220)
ERROR/AndroidRuntime(19398):     at com.excelectronic.game.GameView.a(ProGuard:198)
ERROR/AndroidRuntime(19398):     at com.excelectronic.game.GameView.onDraw(ProGuard:98)
ERROR/AndroidRuntime(19398):     at com.excelectronic.game.ac.run(ProGuard:121)

and using the command

retrace.bat -verbose mapping.txt obfuscated_trace.txt
like image 821
Jawad Avatar asked Jun 07 '11 11:06

Jawad


2 Answers

ProGuard's ReTrace tool by default expects the stack traces to be nicely formatted, the way they are printed out by java. This means that it expects line breaks in the proper places and no prefixes like "ERROR/AndroidRuntime(19398)".

Alternatively, you can modify the regular expression that ReTrace uses for parsing the stack traces.

like image 96
Eric Lafortune Avatar answered Sep 21 '22 12:09

Eric Lafortune


Use traceview to extract the original Java stack trace before using ReTrace.

like image 45
Olivier Dennemont Avatar answered Sep 18 '22 12:09

Olivier Dennemont