j2mepolish中obfuscator(混淆器)的应用
时间:2010-05-17 来源:myjiushizhe
我们知道在j2mepolish带有一个ant构件工具,且有一个build.xml文件。在build.xml里边定义了一个工程的编译(compile)、混淆(obfuscate)、打包(package).....等命令。所以很多人都喜欢用j2mepolish来的ant来管理一个j2me工程的编译打包工作,即使他们没用到polish, 避免了用ant时写build文件的麻烦。
build.xml:
Java代码
现在我主要谈谈polish中的obfuscator(混淆器)的应用。我们知道J2ME的应用开发极大地受到了设备的限制。通常可下载类应用限制在几百K左右,设备本身限制在64k、100k、128k等不等。尽管现在的手机的内存可以达到1G(有些可以用内存卡),但一个应用程序的大小还是尽可能小好,因为这可能影响程序的性能。
build.xml:
Java代码
- <build
- symbols="ExampleSymbol, AnotherExample"
- imageLoadStrategy="foreground"
- fullscreen="menu"
- usePolishGui="true"
- >
- <!-- midlets definition -->
- <midlet class="de.enough.polish.example.MenuMidlet" name="Example" />
- <!-- project-wide variables - used for preprocessing -->
- <variables>
- <variable name="update-url" value="http://www.enough.de/update" />
- </variables>
- <!-- obfuscator settings -->
- <obfuscator name="ProGuard"
- useDefaultPacakge="true"
- unless="test" />
- <!-- debug settings -->
- <debug showLogOnError="true"
- verbose="true"
- level="error"
- if="test"
- >
- <filter package="de.enough.polish.example" level="debug" />
- <filter class="de.enough.polish.ui.Gauge" level="info" />
- </debug>
- </build>
<build
symbols="ExampleSymbol, AnotherExample"
imageLoadStrategy="foreground"
fullscreen="menu"
usePolishGui="true"
>
<!-- midlets definition -->
<midlet class="de.enough.polish.example.MenuMidlet" name="Example" />
<!-- project-wide variables - used for preprocessing -->
<variables>
<variable name="update-url" value="http://www.enough.de/update" />
</variables>
<!-- obfuscator settings -->
<obfuscator name="ProGuard"
useDefaultPacakge="true"
unless="test" />
<!-- debug settings -->
<debug showLogOnError="true"
verbose="true"
level="error"
if="test"
>
<filter package="de.enough.polish.example" level="debug" />
<filter class="de.enough.polish.ui.Gauge" level="info" />
</debug>
</build>
现在我主要谈谈polish中的obfuscator(混淆器)的应用。我们知道J2ME的应用开发极大地受到了设备的限制。通常可下载类应用限制在几百K左右,设备本身限制在64k、100k、128k等不等。尽管现在的手机的内存可以达到1G(有些可以用内存卡),但一个应用程序的大小还是尽可能小好,因为这可能影响程序的性能。
相关阅读 更多 +










