I'm trying to deobfucate a stack trace from my Android app. I used proguard when building the app and running retrace seem to work, more or less.
What isn't working is decoding the line numbers. No line numbers are shown on the output and it lists several choices for each "at".
Here is my proguard-project.txt file:
-keepattributes LineNumberTable
-assumenosideeffects class android.util.Log {
public static int v(...);
public static int d(...);
}
This is my stack trace:
uncaught exception
java.lang.NullPointerException
at com.myapp.myapp.dbaccess.ag.a(Unknown Source)
at com.myuapp.myapp.dbaccess.x.a(Unknown Source)
at com.myapp.myapp.dbaccess.x.a(Unknown Source)
at com.myapp.myapp.main.ab.run(Unknown Source)
And here is the output:
uncaught exception
java.lang.NullPointerException
at com.myapp.myapp.dbaccess.ZNodeCache.com.myapp.myapp.dbaccess.ZNode getNodeFromCache(long)(Unknown Source)
com.myapp.myapp.dbaccess.ZRoot getRootFromCache()
com.myapp.myapp.dbaccess.ZNode getNodeFromDb(long,boolean)
com.myapp.myapp.dbaccess.ZNode$Array getChildrenForExport(com.myapp.myapp.dbaccess.ZNode)
... many more ...
at com.myapp.myapp.dbaccess.XmlImport.com.myapp.myapp.dbaccess.XmlImport$Results importFile(java.lang.String)(Unknown Source)
void _doImport(java.io.InputStream,com.myapp.myapp.dbaccess.XmlImport$Results)
void importFile(java.io.InputStream)
void importNode(org.xmlpull.v1.XmlPullParser,com.myapp.myapp.dbaccess.ZNode)
... many more ...
at com.myapp.myapp.dbaccess.XmlImport.com.myapp.myapp.dbaccess.XmlImport$Results importFile(java.lang.String)(Unknown Source)
void _doImport(java.io.InputStream,com.myapp.myapp.dbaccess.XmlImport$Results)
void importFile(java.io.InputStream)
void importNode(org.xmlpull.v1.XmlPullParser,com.myapp.myapp.dbaccess.ZNode)
... many more ...
at com.myapp.myapp.main.MainActivity$3.void run()(Unknown Source)
I must be missing another configuration parameter; any ideas?
It should be located at build/outputs/proguard/release/mapping. txt in your application module's directory. In the latest version of ProGuard and Android Studio, the file is located at build/outputs/mapping/release/mapping. txt .
A mapping file contains the original names and the obfuscated names of classes, fields, and methods. ProGuard can write out such a file while obfuscating an application or a library, with the option -printmapping . ReTrace requires the mapping file to restore obfuscated stack traces to more readable versions.
Turns out the answer is in the Android documentation (believe it or not). I guess I missed it the first time around. You need to specify the source file, like this:
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
The renamsesourcefileattribute will cause all source files to have the name SourceFile (or whatever you put). "retrace" doesn't care what the source file name is, but if you leave it out, it decides to ignore the line numbers.
This goes in proguard-project.txt which, if you're using Android Studio, you'll find in "your project".app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With