Proguard retrace isnt mapping the stack trace to the actual source

爱⌒轻易说出口 提交于 2019-12-07 02:51:51

问题


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

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/6264408/proguard-retrace-isnt-mapping-the-stack-trace-to-the-actual-source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!