Configure ProGuard to Retain Line Numbers in Stack Traces

来源:互联网 发布:人体解剖软件中文版 编辑:程序博客网 时间:2024/06/12 01:02

在使用Proguard进行代码混淆的时候,为了便于以后发布版本 debug比较方便,希望在堆栈记录中 保留行号信息,可以在proguard 文件中增加以下两行:


-renamesourcefileattribute SourceFile    -keepattributes SourceFile,LineNumberTable


The first line ensures that source file names are hidden (will be named "SourceFile" in stack traces), the second instructs ProGuard to include the line numbers.


下图是截屏的一段 Log信息





如紫色框标记所示



参考:https://coderwall.com/p/fazk4g