【版权声明:本文为博主原创文章,未经博主允许不得转载!】
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or higher, or for Java Micro Edition.
ProGuard 是免费的java 类文件压缩、优化、混淆和预验证工具。它通过检测并移除不用的类、属性和方法来压缩类。它通过去除无用的指令优化java bytecode。它通过使用短的、无语义的名称对类、属性和方法的名称重命名而进行混淆。最后,它将使用java 6以上版本的或者J2ME的运行时环境对此压缩、优化、混淆后的代码进行预验证。
Some uses of ProGuard are:
- Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints.
- Making programs and libraries harder to reverse-engineer.
- Listing dead code, so it can be removed from the source code.
- Retargeting and preverifying existing class files for Java 6 or higher, to take full advantage of their faster class loading.
ProGuard被用于:
- 创建更为紧凑的代码,从而生成更小的打包文件、获得更快的网络传输,加载更为迅速,并占用更小的空间。
- 使得程序和类库难于反编译。
- 列出那些能被移出源代码的“死”代码。
- 针对java 6+以上运行时环境,重新设定和预验证现存的类文件,以利用新版本运行时环境的类快速加载技术。
ProGuard's main advantage compared to other Java obfuscators is probably its compact template-based configuration. A few intuitive command line options or a simple configuration file are usually sufficient. The user manual explains all available options and shows examples of this powerful configuration style.
ProGuard is fast. It only takes seconds to process programs and libraries of several megabytes. The results section presents actual figures for a number of applications.
ProGuard is a command-line tool with an optional graphical user interface. It also comes with plugins for Ant, for Gradle, and for the JME Wireless Toolkit.
ProGuard 和其它java混淆器相比的主要优点就是它紧凑的模版配置,通常使用几个直观的命令行options或者一个简单的配置文件就足够了。本手册解释所有可用的options,并对强大的配置方式进行示例。
ProGuard 速度很快。处理几M的程序和类库只需要几秒的时间。Results章节将会呈现许多程序的实际计算情况。
ProGuard 是一个带有可选GUI的命令行工具。同时它也带有能和ant、Gradle和JME Wireless Toolkit一起工作的插件。
ProGuard now has a sibling optimizer and obfuscator for Android: DexGuard. It focuses on code protection, with additional features like string encryption, class encryption, and dex splitting. It directly targets Dalvik bytecode and streamlines the Android build process.
ProGuard 针对Android平台有一个优化和混淆的同门兄弟:DexGuard。它主要关注在代码保护,添加了一些诸如字符串加密、类加密以及dex文件切割等特性。它主要针对的是Dalvik 平台的bytecode。同时流水线整个Android的build过程。
The following sections provide more detailed information:
- Main: this overview page.
- Results: some results obtained with ProGuard, including timings and memory usage.
- FAQ: answers to some Frequently Asked Questions.
- Manual: the complete ProGuard user manual, with examples and troubleshooting tips.
- Quality: a discussion of the (excellent) quality of ProGuard's code.
- Screenshots: some impressions of what ProGuard looks like.
- Testimonials: what users think of ProGuard.
- License: ProGuard is free, under a GPL license.
- Downloads: download the ProGuard package yourself.
- Feedback: tell me about your experiences, or learn from others on our forums.
- Acknowledgements: people who have been helpful.
- Alternatives: other Java obfuscators, optimizers, and shrinkers.
如下章节提供了更为详细的信息:
- Main:本章节,简单介绍。
- Results:使用ProGuard前后的结果对比,包括时耗和内存占用。
- FAQ:常见问题及解答。
- Manual:完整的ProGuard用户手册,包括示例和排错提示。
- Quality:关于ProGuard代码(杰出的)质量的讨论。
- Screenshots:ProGuard的初步印象。
- Testimonials:ProGuard的客户评价
- License:ProGuard使用GPL许可,免费使用。
- Downloads:如何下载ProGuard。
- Feedback:反馈您的经验以及从我们的论坛所学到的东西。
- Acknowledgements:致谢
- Alternatives:其它java混淆、优化和压缩工具介绍。