ProGuard 集成EclipseME 配置

混淆首选项

混淆首选项控制对包进行混淆的过程。 EclipseME使用Proguard 来完成混淆过程。

screenshot

首选项项目:

项目内容
Proguard Root Directory 在这里你可以指定Proguard安装路径。 如果你要对你的程序混淆,必须安装Proguard。
Use Specified Arguments 默认情况下, EclipseME会使用如下参数来调用Proguard进行混淆:

-dontusemixedcaseclassnames -dontnote -defaultpackage ''

在某些场合你需要指定不同的参数时, 可以将"Use specified arguments"(使用指定参数) 这个选项选中并且在文本框里填上参数。

Microsoft Windows 用户特别注意: 默认情况下, ProGuard假定你使用的操作系统会区分文件名中的大小写。 (比如 A.javaa.java 是两个不同的文件)很明显,Microsoft Windows不是这样的操作系统。 Windows用户要确定为ProGuard指定了- dontusemixedcaseclassnames 选项。 如果你没有这样做,而你的工程文件又超过了26个类的话, ProGuard默认 使用变换大小写的方式为混淆后的类命名。显然这会覆盖原来的类。 安全起见,从EclipseME 0.9.0发行版开始 -dontusemixedcaseclassnames 选项被包含到了传给 ProGuard的默认选项中去。 如果你是*NIX用户并且你的工程中的类超过26个的话, 去掉该选项你可以得到一个稍微小点的JAR文件。
Proguard Keep Expressions 在这里你可以设置一个表达式是的某些类不被混淆。表达式中用到的关键字 请参阅Proguard文档。 默认的表达式会保留所有的MIElet类以及他们的方法不被混淆。

回头看看Proguard的配置资料

http://proguard.sourceforge.net/

JME Wireless Toolkit Integration

ProGuard can be seamlessly integrated in Sun's Wireless Toolkit (WTK) for Java Micro Edition (JME).

The WTK already comes with a plug-in for ProGuard. Alternatively, ProGuard offers its own plug-in. This latter implementation is recommended, as it more up to date and it solves some problems. It is also somewhat more efficient, invoking the ProGuard engine directly, instead of writing out a configuration file and running ProGuard in a separate virtual machine.

In order to integrate this plug-in in the toolkit, you'll have to put the following lines in the file {j2mewtk.dir}/wtklib/Linux/ktools.properties or {j2mewtk.dir}/wtklib/Windows/ktools.properties (whichever is applicable).

 

obfuscator.runner.class.name: proguard.wtk.ProGuardObfuscator
obfuscator.runner.classpath: /usr/local/java/proguard/lib/proguard.jar

Please make sure the class path is set correctly for your system.

Once ProGuard has been set up, you can apply it to your projects as part of the build process. The build process is started from the WTK menu bar:

 

Project -> Package -> Create Obfuscated Package

This option will compile, shrink, obfuscate, verify, and install your midlets for testing.

Should you ever need to customize your ProGuard configuration for the JME WTK, you can adapt the configuration file proguard/wtk/default.pro that's inside the proguard.jar.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风口猪炒股指标

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值