Proguard Retrace not working with stacktrace runtime info like E/AndroidRuntime(10237):

荒凉一梦 提交于 2019-11-29 17:53:21

问题


I need to remove lines from my proguard.trace file like E/AndroidRuntime(10237): in order for retrace to work. Basically I am looking at log file and need to remove this lines or retrace does not work. Am I missing something or do I need to do this for every stacktrace? Basically its the information before that appears at the beginning of a stacktrace line like

 E/AndroidRuntime(10237):  at com.test.a.b.c(UnnownSource) :134

Here is the whole stacktrace:

E/AndroidRuntime(10237): FATAL EXCEPTION: main
E/AndroidRuntime(10237): java.lang.ArithmeticException: divide by zero
E/AndroidRuntime(10237):    at ub.a(SourceFile:180)
E/AndroidRuntime(10237):    at wp.getView(SourceFile:290)

E/AndroidRuntime(10237):    at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(10237):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10237):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(10237):    at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime(10237):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime(10237):    at dalvik.system.NativeStart.main(Native Method)
      etc
E/        ( 2623): Dumpstate > /data/log/dumpstate_app_error

So I am running ./retrace.sh mapping.txt proguard.retrace the contents of which is above. It will not retrace unless I remove E/AndroidRuntime(10237): Am I missing some options to retrace. How do trace files need to be prepared for this to work? I don't think its the mapping file because it works after I remove the first part of the line.


回答1:


Proguard wants each "at" on a separate line, and only with white space before it. If it sees anything but white space before the at, it will not unobfuscate it.




回答2:


Recent versions of ReTrace can parse stack traces with the logcat prefixes like "E/AndroidRuntime(10237):", so it should no longer be a problem.

If you have a stack trace format that ReTrace can't parse, you can always specify your own regular expression with the option -regex.




回答3:


Try recat. It's a python script based on logcat-color, made exactly for this scenario, on-the-fly logcat deobfuscation (doesn't work on Windows though). The main idea is that it deobfuscates each part of the log (tags/messages) separately.



来源:https://stackoverflow.com/questions/10542797/proguard-retrace-not-working-with-stacktrace-runtime-info-like-e-androidruntime

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