How to decode ProGuard's obfuscated code precisely?

Adam

I am using ProGuard in my application and problem is when users report some problem to my console and I can't decode it precisely because of "Unknown source".

Here is example of stacktrace:

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at com.my.package.j.a(Unknown Source)
at com.a.a.c.c.j(Unknown Source)
at com.a.a.c.c.b(Unknown Source)
at com.a.a.c.e.run(Unknown Source)
at java.lang.Thread.run(Thread.java:856)

Then I am using this code to decode it:

./retrace.sh -verbose mapping.txt stacktrace.txt > out.txt

And here is output:

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at com.my.package.MyFragment$10.void output(int,java.lang.String)(Unknown Source)
at com.stericson.RootTools.execution.Shell.void readOutput()(Unknown Source)
at com.stericson.RootTools.execution.Shell.void closeCustomShell()(Unknown Source)
                                           com.stericson.RootTools.execution.Shell startShell(int)
                                           void access$200(com.stericson.RootTools.execution.Shell)
at com.stericson.RootTools.execution.Shell$2.void run()(Unknown Source)
at java.lang.Thread.run(Thread.java:856)

It only shows name of Fragment when error occurred, but I also need exact line and method.

ben-efiz

Your question has actually two parts.

1) Why are you missing the line information?

You are removing the line information during obfuscation. You need the following rules in your proguard.cfg

-renamesourcefileattribute MyApplication
-keepattributes SourceFile,LineNumberTable

Find details for retracing line numbers here: http://proguard.sourceforge.net/manual/retrace/examples.html#with

2) Why is it missing some method/class name, in your example

com.my.package.MyFragment$10.void

This is because $10 is most likely an anonymous class declaration which will be treated differently during compiling and subsequent obfuscation. First easy solution is of course to get rid of the anonymous declaration and declare it somewhere. Another solution would be to add the following line again to your proguard.cfg

-keepattributes EnclosingMethod

This of course will again not remove some information and will reduce your obfuscation.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

IBM Worklight 6.2 - decode proguard obfuscated trace

From Dev

how to reverse php obfuscated code?

From Dev

Does Proguard de-obfuscate obfuscated Strings when optimizing the code?

From Dev

Decoding Analytics report's obfuscated (Proguard) exception location

From Dev

How is this valid Java code? (obfuscated Java)

From Dev

How does this obfuscated javascript code work?

From Dev

How to create a Cordova plugin for Android with obfuscated code?

From Dev

How to defeat deobfuscation of obfuscated javascript code?

From Dev

How to create a Cordova plugin for Android with obfuscated code?

From Dev

How does this obfuscated javascript code work?

From Dev

Custom obfuscated class name in proguard

From Dev

How to use the GUI of Proguard? Problems with keeping the right classes from being obfuscated

From Dev

ProGuard : Obfuscated jar is not working but un-obfuscated jar is working

From Dev

How to decode this encrypted code?

From Dev

How to decode this code?

From Dev

how to decode following code

From Dev

How to decode Seagate's hard drive date code in a Bash script

From Dev

How to Identify malicious code inside lua scripts that may be obfuscated/encrypted

From Dev

How to get line number of error in obfuscated .NET code?

From Dev

how to use obfuscated c# executive code in create setup file?

From Dev

Exclude obfuscated jar from lib folder with ProGuard

From Dev

Is it possible to decompile the jar file obfuscated by proguard?

From Dev

Reflection: How to create a precisely filtered list of the Assembly's types?

From Dev

How to filter precisely on date?

From Dev

How to UnObfuscate, Obfuscated Javascript?

From Dev

How to decode this hex code javascript?

From Dev

how to decode javascript packed code

From Dev

Obfuscated apk code crash log

From Dev

Not able to understand Obfuscated C code

Related Related

  1. 1

    IBM Worklight 6.2 - decode proguard obfuscated trace

  2. 2

    how to reverse php obfuscated code?

  3. 3

    Does Proguard de-obfuscate obfuscated Strings when optimizing the code?

  4. 4

    Decoding Analytics report's obfuscated (Proguard) exception location

  5. 5

    How is this valid Java code? (obfuscated Java)

  6. 6

    How does this obfuscated javascript code work?

  7. 7

    How to create a Cordova plugin for Android with obfuscated code?

  8. 8

    How to defeat deobfuscation of obfuscated javascript code?

  9. 9

    How to create a Cordova plugin for Android with obfuscated code?

  10. 10

    How does this obfuscated javascript code work?

  11. 11

    Custom obfuscated class name in proguard

  12. 12

    How to use the GUI of Proguard? Problems with keeping the right classes from being obfuscated

  13. 13

    ProGuard : Obfuscated jar is not working but un-obfuscated jar is working

  14. 14

    How to decode this encrypted code?

  15. 15

    How to decode this code?

  16. 16

    how to decode following code

  17. 17

    How to decode Seagate's hard drive date code in a Bash script

  18. 18

    How to Identify malicious code inside lua scripts that may be obfuscated/encrypted

  19. 19

    How to get line number of error in obfuscated .NET code?

  20. 20

    how to use obfuscated c# executive code in create setup file?

  21. 21

    Exclude obfuscated jar from lib folder with ProGuard

  22. 22

    Is it possible to decompile the jar file obfuscated by proguard?

  23. 23

    Reflection: How to create a precisely filtered list of the Assembly's types?

  24. 24

    How to filter precisely on date?

  25. 25

    How to UnObfuscate, Obfuscated Javascript?

  26. 26

    How to decode this hex code javascript?

  27. 27

    how to decode javascript packed code

  28. 28

    Obfuscated apk code crash log

  29. 29

    Not able to understand Obfuscated C code

HotTag

Archive