Proguard - 保留 J2ME/BlackBerry 应用程序的行号



我在网上搜索了所有内容,这个问题让我发疯。我正在使用ANT和Proguard构建一个移动应用程序(J2ME,BB)。

在我的javac任务中,我添加了调试级参数,如下所示:

<javac srcdir="${src.dir}" destdir="${tmp.dir}${application.name}" failonerror="true" source="1.4" target="1.4" debug="true" debuglevel="lines,vars,source">

在我的保护任务中,我有:

<proguard defaultpackage="" usemixedcaseclassnames="false" note="false" microedition="true" verbose="true" printmapping="true" optimizationpasses="10" renamesourcefileattribute="SourceFile">
...
...
<keepattribute name="LineNumberTable" />
<keepattribute name="SourceFile" /> 
</proguard>

但是,当我在 Eclipse 中查看输出控制台时(在构建我的应用程序并在模拟器上启动它之后),我没有看到行号,只是这样的东西:

at com.mycomp.myapp.Main.a(+47)
at gd.a(+24)
at fq.a(+368)
at fq.b(+188)
at com.mycomp.myapp.Main.run(+29)

我正在使用 Proguard 4.8。

非常感谢您的帮助,

您在 Proguard 中使用了正确的设置:

<keepattribute name="LineNumberTable" />

你在控制台上看到行号了吗?,这对我有用。

最新更新