Proguard的回扫缺少行号 [英] Proguard retrace missing line numbers

查看:167
本文介绍了Proguard的回扫缺少行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的Andr​​oid应用程序deobfucate堆栈跟踪。我构建的应用程序和运行回扫时使用ProGuard的似乎工作,或多或少。

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".

下面是我的ProGuard-project.txt文件:

Here is my proguard-project.txt file:

-keepattributes LineNumberTable
-assumenosideeffects class android.util.Log {
    public static int v(...);
    public static int d(...);
}

这是我的堆栈跟踪:

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?

推荐答案

原来答案是Android文档中(信不信由你)。我想我错过了周围的第一次。您需要指定的源文件,像这样的:

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

在renamsesourcefileattribute将导致所有源文件的名称为的SourceFile(或任何你把)。 回扫不关心源文件名,但如果你离开它,它决定忽略的行号。

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.

这篇关于Proguard的回扫缺少行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆