Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 312
Code Droid Avatar asked May 10 '12 22:05

Code Droid


2 Answers

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.

like image 69
Behr Avatar answered Sep 29 '22 11:09

Behr


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.

like image 26
Eric Lafortune Avatar answered Sep 29 '22 10:09

Eric Lafortune