Android的ProGuard的回行号行号、Android、ProGuard

2023-09-04 09:21:39 作者:高冷病友

有没有办法让ProGuard的返回那里的崩溃发生了行号? 我可以使用回扫去的方法,但往往对于像 NullPointerException异常有太多的可能性,并在大块$ C $了C它非常难确定的根本原因,你必须检查每一个对象,它的生命周期,以确保没有错误。这将真正帮助,如果ProGuard的可能缩小,这归因于行号给我。

Is there a way to get ProGuard to return a line number where the crash happened? I can use retrace to get to the method, but often for things like NullPointerException there are too many possibilities and in a large piece of code its extremely hard to determine the underlying cause as you have to check every object and it's life cycle to make sure nothing is wrong. It would really help if ProGuard could narrow this down to a line number for me.

推荐答案

将此行添加到您的ProGuard-project.txt文件。

Add this line to your proguard-project.txt file.

// will keep line numbers and file name obfuscation
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

http://proguard.sourceforge.net/index.html#manual/usage.html