diff --git a/public/proguard/README b/public/proguard/README new file mode 100644 index 0000000..62996f8 --- /dev/null +++ b/public/proguard/README @@ -0,0 +1,33 @@ +ProGuard, Java class file shrinker, optimizer, obfuscator, and preverifier +========================================================================== + +This distribution contains the following directories: + +- bin : simple wrapper scripts to run ProGuard, its GUI, and ReTrace +- lib : the main jars, compiled and ready to use with "java -jar ...." +- docs : the complete documentation, licenses, etc. in html format +- examples : some example configuration files +- src : the source code +- build : various alternative build scripts + + +The best place to start is docs/index.html + + +Example +======= + +If you want to give ProGuard a spin right away, try processing the ProGuard +jar itself: + + cd examples + java -jar ../lib/proguard.jar @proguard.pro + +The resulting proguard_out.jar contains the same application, but it's a lot +smaller. + +Enjoy! + +http://proguard.sourceforge.net/ + +Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu) diff --git a/public/proguard/VERSION b/public/proguard/VERSION new file mode 100644 index 0000000..4f8c639 --- /dev/null +++ b/public/proguard/VERSION @@ -0,0 +1 @@ +4.7 diff --git a/public/proguard/bin/proguard.bat b/public/proguard/bin/proguard.bat new file mode 100644 index 0000000..73cb313 --- /dev/null +++ b/public/proguard/bin/proguard.bat @@ -0,0 +1,14 @@ +@ECHO OFF + +REM Start-up script for ProGuard -- free class file shrinker, optimizer, +REM obfuscator, and preverifier for Java bytecode. +REM +REM Note: when passing file names containing spaces to this script, +REM you'll have to add escaped quotes around them, e.g. +REM "\"C:/My Directory/My File.txt\"" + +IF EXIST "%PROGUARD_HOME%" GOTO home +SET PROGUARD_HOME=.. +:home + +java -jar "%PROGUARD_HOME%"\lib\proguard.jar %* diff --git a/public/proguard/bin/proguard.sh b/public/proguard/bin/proguard.sh new file mode 100755 index 0000000..5adc047 --- /dev/null +++ b/public/proguard/bin/proguard.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Start-up script for ProGuard -- free class file shrinker, optimizer, +# obfuscator, and preverifier for Java bytecode. +# +# Note: when passing file names containing spaces to this script, +# you'll have to add escaped quotes around them, e.g. +# "\"/My Directory/My File.txt\"" + +PROGUARD_HOME=`dirname "$0"`/.. + +java -jar $PROGUARD_HOME/lib/proguard.jar "$@" diff --git a/public/proguard/bin/proguardgui.bat b/public/proguard/bin/proguardgui.bat new file mode 100644 index 0000000..4aa9aeb --- /dev/null +++ b/public/proguard/bin/proguardgui.bat @@ -0,0 +1,14 @@ +@ECHO OFF + +REM Start-up script for the GUI of ProGuard -- free class file shrinker, +REM optimizer, obfuscator, and preverifier for Java bytecode. +REM +REM Note: when passing file names containing spaces to this script, +REM you'll have to add escaped quotes around them, e.g. +REM "\"C:/My Directory/My File.txt\"" + +IF EXIST "%PROGUARD_HOME%" GOTO home +SET PROGUARD_HOME=.. +:home + +java -jar "%PROGUARD_HOME%"\lib\proguardgui.jar %* diff --git a/public/proguard/bin/proguardgui.sh b/public/proguard/bin/proguardgui.sh new file mode 100755 index 0000000..c734906 --- /dev/null +++ b/public/proguard/bin/proguardgui.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Start-up script for the GUI of ProGuard -- free class file shrinker, +# optimizer, obfuscator, and preverifier for Java bytecode. +# +# Note: when passing file names containing spaces to this script, +# you'll have to add escaped quotes around them, e.g. +# "\"/My Directory/My File.txt\"" + +PROGUARD_HOME=`dirname "$0"`/.. + +# On Linux, Java 1.6.0_24 and higher hang when starting the GUI: +# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7027598 +# We're using the -D option as a workaround. +java -DsuppressSwingDropSupport=true -jar $PROGUARD_HOME/lib/proguardgui.jar "$@" diff --git a/public/proguard/bin/retrace.bat b/public/proguard/bin/retrace.bat new file mode 100644 index 0000000..c13b766 --- /dev/null +++ b/public/proguard/bin/retrace.bat @@ -0,0 +1,14 @@ +@ECHO OFF + +REM Start-up script for Retrace -- companion tool for ProGuard, free class file +REM shrinker, optimizer, obfuscator, and preverifier for Java bytecode. +REM +REM Note: when passing file names containing spaces to this script, +REM you'll have to add escaped quotes around them, e.g. +REM "\"C:/My Directory/My File.txt\"" + +IF EXIST "%PROGUARD_HOME%" GOTO home +SET PROGUARD_HOME=.. +:home + +java -jar "%PROGUARD_HOME%"\lib\retrace.jar %* diff --git a/public/proguard/bin/retrace.sh b/public/proguard/bin/retrace.sh new file mode 100755 index 0000000..85fd314 --- /dev/null +++ b/public/proguard/bin/retrace.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Start-up script for Retrace -- companion tool for ProGuard, free class file +# shrinker, optimizer, obfuscator, and preverifier for Java bytecode. +# +# Note: when passing file names containing spaces to this script, +# you'll have to add escaped quotes around them, e.g. +# "\"/My Directory/My File.txt\"" + +PROGUARD_HOME=`dirname "$0"`/.. + +java -jar $PROGUARD_HOME/lib/retrace.jar "$@" diff --git a/public/proguard/docs/FAQ.html b/public/proguard/docs/FAQ.html new file mode 100644 index 0000000..bdc9c04 --- /dev/null +++ b/public/proguard/docs/FAQ.html @@ -0,0 +1,253 @@ + + + + + + +ProGuard FAQ + + + + +

Frequently Asked Questions

+ +

Contents

+ +
    +
  1. What is shrinking?
  2. +
  3. What is obfuscation?
  4. +
  5. What is preverification?
  6. +
  7. What kind of optimizations does ProGuard + support?
  8. +
  9. Can I use ProGuard to process my commercial + application?
  10. +
  11. Does ProGuard work with Java 2? Java 5? Java + 6?
  12. +
  13. Does ProGuard work with Java Micro Edition?
  14. +
  15. Does ProGuard work for Google Android + code?
  16. +
  17. Does ProGuard work for Blackberry + code?
  18. +
  19. Does ProGuard have support for Ant?
  20. +
  21. Does ProGuard come with a GUI?
  22. +
  23. Does ProGuard handle Class.forName + calls?
  24. +
  25. Does ProGuard handle resource files?
  26. +
  27. Does ProGuard encrypt strings constants?
  28. +
  29. Does ProGuard perform control flow + obfuscation?
  30. +
  31. Does ProGuard support incremental + obfuscation?
  32. +
  33. Can ProGuard obfuscate using reserved + keywords?
  34. +
  35. Can ProGuard reconstruct obfuscated stack + traces?
  36. +
+ +

What is shrinking?

+ +Java source code (.java files) is typically compiled to bytecode (.class +files). Bytecode is more compact than Java source code, but it may still +contain a lot of unused code, especially if it includes program libraries. +Shrinking programs such as ProGuard can analyze bytecode and remove +unused classes, fields, and methods. The program remains functionally +equivalent, including the information given in exception stack traces. + +

What is obfuscation?

+ +By default, compiled bytecode still contains a lot of debugging information: +source file names, line numbers, field names, method names, argument names, +variable names, etc. This information makes it straightforward to decompile +the bytecode and reverse-engineer entire programs. Sometimes, this is not +desirable. Obfuscators such as ProGuard can remove the debugging +information and replace all names by meaningless character sequences, making +it much harder to reverse-engineer the code. It further compacts the code as a +bonus. The program remains functionally equivalent, except for the class +names, method names, and line numbers given in exception stack traces. + +

What is preverification?

+ +When loading class files, the class loader performs some sophisticated +verification of the byte code. This analysis makes sure the code can't +accidentally or intentionally break out of the sandbox of the virtual machine. +Java Micro Edition and Java 6 introduced split verification. This means that +the JME preverifier and the Java 6 compiler add preverification information to +the class files (StackMap and StackMapTable attributes, respectively), in order +to simplify the actual verification step for the class loader. Class files can +then be loaded faster and in a more memory-efficient way. ProGuard can +perform the preverification step too, for instance allowing to retarget older +class files at Java 6. + +

What kind of optimizations does ProGuard support?

+ +Apart from removing unused classes, fields, and methods in the shrinking step, +ProGuard can also perform optimizations at the bytecode level, inside +and across methods. Thanks to techniques like control flow analysis, data flow +analysis, partial evaluation, static single assignment, global value numbering, +and liveness analysis, ProGuard can: + + +The positive effects of these optimizations will depend on your code and on +the virtual machine on which the code is executed. Simple virtual machines may +benefit more than advanced virtual machines with sophisticated JIT compilers. +At the very least, your bytecode may become a bit smaller. +

+Some notable optimizations that aren't supported yet: +

+ +

Can I use ProGuard to process my commercial application?

+ +Yes, you can. ProGuard itself is distributed under the GPL, but this +doesn't affect the programs that you process. Your code remains yours, and +its license can remain the same. + +

Does ProGuard work with Java 2? Java 5? Java 6? Java 7?

+ +Yes, ProGuard supports all JDKs from 1.1 up to and including 7.0. Java 2 +introduced some small differences in the class file format. Java 5 added +attributes for generics and for annotations. Java 6 introduced optional +preverification attributes. Java 7 made preverification obligatory and +introduced support for dynamic languages. ProGuard handles all versions +correctly. + +

Does ProGuard work with Java Micro Edition?

+ +Yes. ProGuard itself runs in Java Standard Edition, but you can freely +specify the run-time environment at which your programs are targeted, +including Java Micro Edition. ProGuard then also performs the required +preverification, producing more compact results than the traditional external +preverifier. +

+ProGuard also comes with an obfuscator plug-in for the JME Wireless +Toolkit. + +

Does ProGuard work for Google Android code?

+ +Yes. Google's dx compiler converts ordinary jar files into files +that run on Android devices. By preprocessing the original jar files, +ProGuard can significantly reduce the file sizes and boost the run-time +performance of the code. + +

Does ProGuard work for Blackberry code?

+ +It should. RIM's proprietary rapc compiler converts ordinary JME +jar files into cod files that run on Blackberry devices. The compiler performs +quite a few optimizations, but preprocessing the jar files with +ProGuard can generally still reduce the final code size by a few +percent. However, the rapc compiler also seems to contain some +bugs. It sometimes fails on obfuscated code that is valid and accepted by other +JME tools and VMs. Your mileage may therefore vary. + +

Does ProGuard have support for Ant?

+ +Yes. ProGuard provides an Ant task, so that it integrates seamlessly +into your Ant build processes. You can still use configurations in +ProGuard's own readable format. Alternatively, if you prefer XML, you +can specify the equivalent XML configuration. + +

Does ProGuard come with a GUI?

+ +Yes. First of all, ProGuard is perfectly usable as a command-line tool +that can easily be integrated into any automatic build process. For casual +users, there's also a graphical user interface that simplifies creating, +loading, editing, executing, and saving ProGuard configurations. + +

Does ProGuard handle Class.forName calls?

+ +Yes. ProGuard automatically handles constructs like +Class.forName("SomeClass") and SomeClass.class. The +referenced classes are preserved in the shrinking phase, and the string +arguments are properly replaced in the obfuscation phase. +

+With variable string arguments, it's generally not possible to determine their +possible values. They might be read from a configuration file, for instance. +However, ProGuard will note a number of constructs like +"(SomeClass)Class.forName(variable).newInstance()". These might +be an indication that the class or interface SomeClass and/or its +implementations may need to be preserved. The user can adapt his configuration +accordingly. + +

Does ProGuard handle resource files?

+ +Yes. ProGuard copies all non-class resource files, optionally adapting +their names and their contents to the obfuscation that has been applied. + +

Does ProGuard encrypt strings constants?

+ +No. Storing encrypted string constants in program code is fairly futile, since +the encryption has to be perfectly reversible by definition. Moreover, the +decryption costs additional memory and computation at run-time. If this feature +is ever incorporated, I'll provide a tool to decrypt the strings as well. + +

Does ProGuard perform flow obfuscation?

+ +Not explicitly. Control flow obfuscation injects additional branches into the +bytecode, in an attempt to fool decompilers. ProGuard does not do this, +in order to avoid any negative effects on performance and size. However, the +optimization step often already restructures the code to the point where most +decompilers get confused. + +

Does ProGuard support incremental obfuscation?

+ +Yes. This feature allows you to specify a previous obfuscation mapping file in +a new obfuscation step, in order to produce add-ons or patches for obfuscated +code. + +

Can ProGuard obfuscate using reserved keywords?

+ +Yes. You can specify your own obfuscation dictionary, such as a list of +reserved key words, identifiers with foreign characters, random source files, +or a text by Shakespeare. Note that this hardly improves the obfuscation. +Decent decompilers can automatically replace reserved keywords, and the effect +can be undone fairly easily, by obfuscating again with simpler names. + +

Can ProGuard reconstruct obfuscated stack traces?

+ +Yes. ProGuard comes with a companion tool, ReTrace, that can +'de-obfuscate' stack traces produced by obfuscated applications. The +reconstruction is based on the mapping file that ProGuard can write +out. If line numbers have been obfuscated away, a list of alternative method +names is presented for each obfuscated method name that has an ambiguous +reverse mapping. Please refer to the ProGuard User +Manual for more details. + +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/GPL.html b/public/proguard/docs/GPL.html new file mode 100644 index 0000000..c7a2458 --- /dev/null +++ b/public/proguard/docs/GPL.html @@ -0,0 +1,406 @@ + + + +GNU General Public License + + +

GNU General Public License

+

Table of Contents

+ + +

+ +


+ +

+ + + +

GNU GENERAL PUBLIC LICENSE

+

+Version 2, June 1991 + +

+ +
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ + + +

Preamble

+ +

+ The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +

+

+ When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +

+

+ To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +

+

+ For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +

+

+ We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +

+

+ Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +

+

+ Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +

+

+ The precise terms and conditions for copying, distribution and +modification follow. + +

+ + +

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

+ + +

+ +0. + This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

+ +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + +

+ +1. + You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +

+ +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

+ +2. + You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

+ +

+ +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +

+ +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

+ +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +

+ +3. + You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + + + +

+ +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

+ +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +

+ +4. + You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +

+ +5. + You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +

+ +6. + Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +

+ +7. + If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

+ +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

+ +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

+ +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +

+ +8. + If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +

+ +9. + The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

+ +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + +

+ + +10. + If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + + +

NO WARRANTY

+ +

+ +11. + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +

+ +12. + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +

+ + +

END OF TERMS AND CONDITIONS

+ + diff --git a/public/proguard/docs/GPL_exception.html b/public/proguard/docs/GPL_exception.html new file mode 100644 index 0000000..0a1cd4f --- /dev/null +++ b/public/proguard/docs/GPL_exception.html @@ -0,0 +1,56 @@ + + + +Special Exception to the GNU General Public License + + +

Special Exception to the GNU General Public License

+ +

+Copyright © 2002-2011 Eric Lafortune +

+ +

+This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. +

+ +

+This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +

+ +

+You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA +

+ +

+In addition, as a special exception, Eric Lafortune gives permission to link +the code of this program with the following stand-alone applications: +

+and distribute linked combinations including the two. You must obey the GNU +General Public License in all respects for all of the code used other than +these programs. If you modify this file, you may extend this exception to your +version of the file, but you are not obligated to do so. If you do not wish to +do so, delete this exception statement from your version. +

+ + + diff --git a/public/proguard/docs/acknowledgements.html b/public/proguard/docs/acknowledgements.html new file mode 100644 index 0000000..96ed635 --- /dev/null +++ b/public/proguard/docs/acknowledgements.html @@ -0,0 +1,76 @@ + + + + + + +ProGuard Acknowledgements + + + + +

Acknowledgements

+ +The first versions of ProGuard grew out of RetroGuard, which its +author Mark Welsh kindly made available under the GNU Lesser General Public +License. RetroGuard is a very nice piece of code, but it only performed +obfuscation. I started from the class file parsing code and wrote my own +shrinker, optimizer, obfuscator, and preverifier. As of version 4.0, all of the +original code has been rewritten, so the most obvious remaining similarity are +the program names. +

+ +Dirk Schnelle has contributed and maintained the first versions of the Ant +task. I have rewritten the implementation for version 3.0, but the XML schema +is still based on his work. +

+ +Since its first public release, many people have expressed their enthusiasm and +have chimed in with interesting ideas, bug reports, and bug fixes: Thorsten +Heit, Oliver Retzl, Jonathan Knudsen, Tarcisio Camara, Bob Drury, Dave Jarvis, +Marc Chapman, Dave Morehouse, Richard Osbaldeston, Peter Hawkins, Mark +Sherington, David Sitsky, James Manning, Ptolemy Oberin, Frank-Michael Moser, +QZ Shines, Thomas Singer, Michele Puccini, Roman Bednarek, Natalia Pujol, +Daniel Sjöblom, Jan Filipsky, Charles Smith, Gerrit Telkamp, Noel +Grandin, Torbjörn Söderstedt, Clemens Eisserer, Clark Bassett, +Eduard Welch, Dawid Weiss, Andrew Wilson, Sean Owen, Niels Gron, Ishan Mehta, +Steven Adams, Xavier Kral, Stefan Martin, Toby Reyelts, +and many others. Thanks! Your feedback has been invaluable. +

+ +Saikoa is providing the +financial resources for this project. +

+ +SourceForge is providing the resources for hosting this +project and many other projects. +

+ +The code and these web pages were written using Oracle/Sun's JDKs, Linux, +IntelliJ IDEA, GNU emacs, bash, sed, awk, and a whole host of other tools that +continue to make programming interesting. +

+ +And finally, I'm a great fan of Sanaware's Java Docking Library. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/alternatives.html b/public/proguard/docs/alternatives.html new file mode 100644 index 0000000..f235692 --- /dev/null +++ b/public/proguard/docs/alternatives.html @@ -0,0 +1,699 @@ + + + + + + +ProGuard Alternatives + + + + +

Alternatives

+ +There are quite a few Java class file shrinkers, optimizers, obfuscators, and +preverifiers out there. Users of ProGuard tell me it easily compares +with the best of them. However, you may want to check that out yourself. +

+This is a list of the programs of which I'm aware. Obviously, I've never +personally tested all of them. Many programs, even commercial ones, have been +abandoned. Please drop me a note if you know of any other shrinkers, +optimizers, obfuscators, or preverifiers, or if some information provided +below is incorrect. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Author/CompanyProgramShrink.Optim.Obfusc.Preverif.License
Eric LafortuneProGuardxxxxFree (GPL)
Jochen HoenickeJodexxx
Free (GPL)
Nate NystromBloatxx

Free
Hidetoshi OhuchiJargx
x
Free (BSD)
yWorksyGuardx
x
Free (no source)
MojoMinijarx


Free (Apache)
RiggsHill SoftwareGenJarx


Free (Apache)
ApacheAnt Classfilesetx


Free (Apache)
Carsten Elton SørensenTreeshakerx


Free (Apache)
Jörg SpielerUCDetectorx


Free (EPL)
Romain GuyHarvesterx


Free (BSD)
Emeric VernatDCDx


Free (LGPL)
Cristiano SadunPackx


Free (LGPL)
SableSoot
x

Free (LGPL)
Konstantin KnizhnikJavaGO
x

Free
SableJBCO

x
Free (LGPL)
Thorsten HeitJavaGuard

x
Free (LGPL)
Patrick MuellerMwobfu

x
Free (GPL)
BebboSoftBb_mug

x
Free (no source)
Vít ŠestákPreverifier


xFree (EPL)
PreEmptiveDashOProxxx
Commercial
ZelixKlassMasterxxx
Commercial
Sophia CradleSophiaCompressxxx
Commercial
Eastridge TechnologyJshrinkx
x
Commercial
LeeSoftwareSmokescreen Obfuscatorx
x
Commercial
InnaworksmBoosterxx
xCommercial
Sergey SverdlovJ.Class Optimizerxx

Commercial
SmardecAllatori
xx
Commercial
U. of ArizonaSandMark
xx
Commercial
Force 5JCloak

x
Commercial
Semantic DesignsObfuscator

x
Commercial
DuckwareJobfuscate

x
Commercial
ArxanGuardIT

x
Commercial
Vasile CalmatuiVasObfuLite

x
Free
IBM AlphaWorksJAXxxx
(discontinued)
NQ4Jogaxxx
(discontinued?)
Markus JansenJoptxxx
(disappeared?)
Alexander ShvetsCafeBabex
x
(disappeared?)
Brian AllietGcclassx


(disappeared?)
Christian GrothoffJamitx


(disappeared?)
Haruaki TamadaDonQuixote
xx
(disappeared?)
BajieJCMP
xx
(disappeared?)
Elegant SoftwareJMangle

x
(disappeared?)
Eron JokipiiJobe

x
(disappeared?)
JRCDeCaf

x
(disappeared?)
Dr. JavaMarvin Obfuscator

x
(disappeared?)
IBMWSDDxxx
Commercial (discontinued?)
S5 SystemsjPrestoxxx
Commercial (discontinued?)
Plumb DesignCondensityx
x
Commercial (discontinued)
4th PassSourceGuardx
x
Commercial (discontinued?)
CodingArtCodeShieldx
x
Commercial (discontinued?)
Software4jObfuscate4j

x
Commercial (discontinued?)
JAMM ConsultingObfuscatePro

x
Commercial (discontinued?)
JDevelopJSCO

x
Commercial (discontinued?)
4FangJMix

x
Commercial (discontinued?)
RetroLogicRetroGuardx
x
Commercial (disappeared?)
HelsethJObfuscatorx
x
Commercial (disappeared?)
Vega TechnologiesJZipperx
x
Commercial (disappeared?)
JProofJProof

x
Commercial (disappeared?)
ChainKeyJava Code Protector

x
Commercial (disappeared?)
2LKit2LKit Obfuscator

x
Commercial (disappeared?)
WingSoftWingGuard

x
Commercial (disappeared?)
HashJavaHashJava

x
Commercial (disappeared?)
GITSBlurfuscator

x
Commercial (disappeared?)
+

+All trademarks are property of their respective holders. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/checkmark.gif b/public/proguard/docs/checkmark.gif new file mode 100644 index 0000000..8afa677 Binary files /dev/null and b/public/proguard/docs/checkmark.gif differ diff --git a/public/proguard/docs/downloads.html b/public/proguard/docs/downloads.html new file mode 100644 index 0000000..e322ca6 --- /dev/null +++ b/public/proguard/docs/downloads.html @@ -0,0 +1,623 @@ + + + + + + + +ProGuard Downloads + + + + +

Downloads

+ +ProGuard is distributed under the terms of the GNU General Public +License. Please consult the license page for more +details. +

+ProGuard is written in Java, so it requires a Java Runtime Environment + (JRE 1.4 or higher). +

+You can download the latest release (containing the program jar, the +documentation you're reading now, examples, and the source code) from this +location: +

+

Download section (at SourceForge)
+

+ +If you're still working with an older version of ProGuard, check out +the summary of changes below, to see if you're missing something essential. +Better look at the up-to-date on-line version if +you're reading a local copy of this page. +

+The download section may also contain updates with sub-minor version numbers. +These versions are typically released shortly after their parent versions, for +applying emergency fixes. Please make sure to look at those if you are +encountering any problems with recent releases. +

+Finally, there may be beta versions of upcoming releases. They may be of +interest too, because they typically contain any less urgent bug fixes +collected since the previous release. +

+ +

Dec 2011
Version 4.7

+ + +

Feb 2011
Version 4.6

+ + +

Jun 2010
Version 4.5

+ + +

Jul 2009
Version 4.4

+ + +

Dec 2008
Version 4.3

+ + +

Mar 2008
Version 4.2

+ + +

Dec 2007
Version 4.1

+ + +

Sep 2007
Version 4.0

+ +Upgrade considerations: + + +

Dec 2007
Version 3.11

+ + +

Aug 2007
Version 3.10

+ + +

Jun 2007
Version 3.9

+ + +

Mar 2007
Version 3.8

+ + +

Dec 2006
Version 3.7

+ + +

May 2006
Version 3.6

+ + +

Jan 2006
Version 3.5

+ + +

Oct 2005
Version 3.4

+ + +

Jun 2005
Version 3.3

+ + +

Dec 2004
Version 3.2

+ + +

Nov 2004
Version 3.1

+ + +

Aug 2004
Version 3.0

+ + +

Mar 2004
Version 2.1

+ + +

Dec 2003
Version 2.0

+ + +

Aug 2003
Version 1.7

+ + +

May 2003
Version 1.6

+ + +

Jan 2003
Version 1.5

+ + +

Nov 2002
Version 1.4

+ + +

Sep 2002
Version 1.3

+ + +

Aug 2002
Version 1.2

+ + +

Jul 2002
Version 1.1

+ + +

Jun 2002
Version 1.0

+ + +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/drop1.gif b/public/proguard/docs/drop1.gif new file mode 100644 index 0000000..426d856 Binary files /dev/null and b/public/proguard/docs/drop1.gif differ diff --git a/public/proguard/docs/drop2.gif b/public/proguard/docs/drop2.gif new file mode 100644 index 0000000..b607542 Binary files /dev/null and b/public/proguard/docs/drop2.gif differ diff --git a/public/proguard/docs/drop3.gif b/public/proguard/docs/drop3.gif new file mode 100644 index 0000000..11ce424 Binary files /dev/null and b/public/proguard/docs/drop3.gif differ diff --git a/public/proguard/docs/favicon.ico b/public/proguard/docs/favicon.ico new file mode 100644 index 0000000..3923ec1 Binary files /dev/null and b/public/proguard/docs/favicon.ico differ diff --git a/public/proguard/docs/feedback.html b/public/proguard/docs/feedback.html new file mode 100644 index 0000000..197fc33 --- /dev/null +++ b/public/proguard/docs/feedback.html @@ -0,0 +1,120 @@ + + + + + + + +ProGuard Feedback + + + + +

Feedback

+ +By now, I've invested a fair amount of time in ProGuard. You can help +by providing feedback! If you have problems, bugs, bug fixes, ideas, +encouragements, etc., please get in touch: +

+

+

+I can't promise a swift answer, or any answer at all, for that matter, but I +like seeing any constructive comments. +

+ +ProGuard isn't a typical open source project, in the sense that I am +not looking for code contributions. Developing on my own allows me to +do things my way, without the overhead and compromises associated with larger +projects. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/index.html b/public/proguard/docs/index.html new file mode 100644 index 0000000..866fc3d --- /dev/null +++ b/public/proguard/docs/index.html @@ -0,0 +1,92 @@ + + + + + + + + + + + +ProGuard + + + + + + + +<body> +<p class="intro"> +<b>ProGuard</b> 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 for Java Micro +Edition. +</p> +<p> +Your browser doesn't support frames, but that's cool. +<p> +You can go straight to the <a href="main.html">main page</a>. + +<hr /> +<address> +Copyright &copy; 2002-2011 +<a target="other" href="http://www.lafortune.eu/">Eric Lafortune</a>. +</address> +</body> + + diff --git a/public/proguard/docs/license.html b/public/proguard/docs/license.html new file mode 100644 index 0000000..0a10092 --- /dev/null +++ b/public/proguard/docs/license.html @@ -0,0 +1,60 @@ + + + + + + +ProGuard License + + + + +

License

+ +ProGuard is free. You can use it freely for processing your +applications, commercial or not. Your code obviously remains yours after +having been processed, and its license can remain the same. +

+ +ProGuard itself is copyrighted, but its distribution license provides +you with some rights for modifying and redistributing its code and its +documentation. More specifically, ProGuard is distributed under the +terms of the GNU General Public License (GPL), version +2, as published by the Free +Software Foundation (FSF). In short, this means that you may freely +redistribute the program, modified or as is, on the condition that you make +the complete source code available as well. If you develop a program that is +linked with +ProGuard, the program as a whole has to be distributed at no charge +under the GPL. I am granting a special +exception to the latter clause (in wording suggested by +the FSF), for combinations with the following stand-alone +applications: Apache Ant, Apache Maven, the Google Android SDK, the Eclipse +ProGuardDT GUI, the EclipseME JME IDE, the Oracle NetBeans Java IDE, the Oracle +JME Wireless Toolkit, the Simple Build Tool for Scala, the NeoMAD Tools by +Neomades, the Javaground Tools, and the Sanaware Tools. + +

+The ProGuard user documentation represents an important part of this +work. It may only be redistributed without changes, along with the unmodified +version of the code. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/main.html b/public/proguard/docs/main.html new file mode 100644 index 0000000..0a89673 --- /dev/null +++ b/public/proguard/docs/main.html @@ -0,0 +1,102 @@ + + + + + + + + + +ProGuard Main + + + + +

Main

+ +

+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 for Java Micro +Edition. +

+Some uses of ProGuard are: + +

+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 and for the JME Wireless +Toolkit. +

+

+ProGuard is being used in various development contexts, ranging from +small Android apps to large Java applications and libraries. Its user base is +continuing to grow at a fast pace. In order to better manage the many +questions and requests, we are now providing professional support at +Saikoa. +

+The following sections provide more detailed information: + + +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/ant.html b/public/proguard/docs/manual/ant.html new file mode 100644 index 0000000..26c6853 --- /dev/null +++ b/public/proguard/docs/manual/ant.html @@ -0,0 +1,634 @@ + + + + + + +Ant Task + + + + +

Ant Task

+ +ProGuard can be run as a task in the Java-based build tool Ant (version +1.6.0 or higher). +

+ +Before you can use the proguard task, you have to tell Ant about +this new task. The easiest way is to add the following line to your +build.xml file: +

+ +

+<taskdef resource="proguard/ant/task.properties"
+         classpath="/usr/local/java/proguard/lib/proguard.jar" />
+
+

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

+ +There are three ways to configure the ProGuard task: using an external +configuration file, using embedded ProGuard configuration options, or using +the equivalent XML configuration tags. These three ways can be combined, +depending on practical circumstances and personal preference. +

+ +

1. An external ProGuard configuration file

+ +The simplest way to use the ProGuard task in an Ant build file is to keep your +ProGuard configuration file, and include it from Ant. You can include your +ProGuard configuration file by setting +the configuration +attribute of your +proguard task. Your ant build file will then look like this: +

+ +

+<taskdef resource="proguard/ant/task.properties"
+         classpath="/usr/local/java/proguard/lib/proguard.jar" />
+<proguard configuration="myconfigfile.pro"/>
+
+

+ +This is a convenient option if you prefer ProGuard's configuration style over +XML, if you want to keep your build file small, or if you have to share your +configuration with developers who don't use Ant. +

+ +

2. Embedded ProGuard configuration options

+ +Instead of keeping an external ProGuard configuration file, you can also copy +the contents of the file into the nested text of the proguard task +(the PCDATA area). Your Ant build file will then look like this: +

+ +

+<taskdef resource="proguard/ant/task.properties"
+         classpath="/usr/local/java/proguard/lib/proguard.jar" />
+<proguard>
+  -libraryjars ${java.home}/lib/rt.jar
+  -injars      in.jar
+  -outjars     out.jar
+
+  -keepclasseswithmembers public class * {
+      public static void main(java.lang.String[]);
+  }
+</proguard>
+
+

+ +Some minor syntactical changes are required in order to conform with the XML +standard. +

+ +Firstly, the # character cannot be used for comments in an XML +file. Comments must be enclosed by an opening <!-- and a +closing -->. All occurrences of the # character +can be removed. +

+ +Secondly, the use of < and > characters would +upset the structure of the XML build file. Environment variables are now +enclosed by an opening ${ and a closing }. This +syntax also allows you to use Ant properties within the ProGuard +configuration. Other occurrences of < and > +have to be encoded as &lt; and &gt;. +

+ +

3. XML configuration tags

+ +If you really prefer a full-blown XML configuration, you can replace the +ProGuard configuration options by XML configuration tags. The resulting +configuration will be equivalent, but much more verbose and difficult to read, +as XML goes. The remainder of this page presents the supported tags. For a +more extensive discussion of their meaning, please consult the traditional Usage section. You can find some sample configuration +files in the examples/ant directory of the ProGuard distribution. +

+ +

Task Attributes and Nested Elements

+ +The <proguard> task and the +<proguardconfiguration> task can have the following +attributes (only for <proguard>) and nested +elements: + +
+ +
configuration + = "filename"
+
Read and merge options from the given ProGuard-style configuration + file. Note: for reading XML-style configurations, use the configuration + element.
+ +
skipnonpubliclibraryclasses + = "boolean" + (default = false)
+
Ignore non-public library classes.
+ +
skipnonpubliclibraryclassmembers + = "boolean" + (default = true)
+
Ignore package visible library class members.
+ +
target + = "version" + (default = none)
+
Set the given version number in the processed classes.
+ +
forceprocessing + = "boolean" + (default = false)
+
Process the input, even if the output seems up to date.
+ +
printseeds + = "boolean or filename" + (default = false)
+
List classes and class members matched by the various keep + commands, to the standard output or to the given file.
+ +
shrink + = "boolean" + (default = true)
+
Shrink the input class files.
+ +
printusage + = "boolean or filename" + (default = false)
+
List dead code of the input class files, to the standard output or to the + given file.
+ +
optimize + = "boolean" + (default = true)
+
Optimize the input class files.
+ +
optimizationpasses + = "n" + (default = 1)
+
The number of optimization passes to be performed.
+ +
allowaccessmodification + = "boolean" + (default = false)
+
Allow the access modifiers of classes and class members to be modified, + while optimizing.
+ +
mergeinterfacesaggressively + = "boolean" + (default = false)
+
Allow any interfaces to be merged, while optimizing.
+ +
obfuscate + = "boolean" + (default = true)
+
Obfuscate the input class files.
+ +
printmapping + = "boolean or filename" + (default = false)
+
Print the mapping from old names to new names for classes and class members + that have been renamed, to the standard output or to the given file.
+ +
applymapping + = "filename" + (default = none)
+
Reuse the given mapping, for incremental obfuscation.
+ +
obfuscationdictionary + = "filename" + (default = none)
+
Use the words in the given text file as obfuscated field names and method + names.
+ +
classobfuscationdictionary + = "filename" + (default = none)
+
Use the words in the given text file as obfuscated class names.
+ +
packageobfuscationdictionary + = "filename" + (default = none)
+
Use the words in the given text file as obfuscated package names.
+ +
overloadaggressively + = "boolean" + (default = false)
+
Apply aggressive overloading while obfuscating.
+ +
useuniqueclassmembernames + = "boolean" + (default = false)
+
Ensure uniform obfuscated class member names for subsequent incremental + obfuscation.
+ +
usemixedcaseclassnames + = "boolean" + (default = true)
+
Generate mixed-case class names while obfuscating.
+ +
flattenpackagehierarchy + = "package_name" + (default = none)
+
Repackage all packages that are renamed into the single given parent + package.
+ +
repackageclasses + = "package_name" + (default = none)
+
Repackage all class files that are renamed into the single given + package.
+ +
keepparameternames + = "boolean" + (default = false)
+
Keep the parameter names and types of methods that are kept.
+ +
renamesourcefileattribute + = "string" + (default = none)
+
Put the given constant string in the SourceFile + attributes.
+ +
preverify + = "boolean" + (default = true)
+
Preverify the processed class files if they are targeted at Java Micro + Edition or at Java 6 or higher.
+ +
microedition + = "boolean" + (default = false)
+
Targets the processed class files at Java Micro Edition.
+ +
verbose + = "boolean" + (default = false)
+
Write out some more information during processing.
+ +
note + = "boolean" + (default = true)
+
Print notes about potential mistakes or omissions in the configuration. + Use the nested element dontnote for more + fine-grained control.
+ +
warn + = "boolean" + (default = true)
+
Print warnings about unresolved references. Use the nested + element dontwarn for more fine-grained + control. Only use this option if you know what you're doing!
+ +
ignorewarnings + = "boolean" + (default = false)
+
Print warnings about unresolved references, but continue processing + anyhow. Only use this option if you know what you're doing!
+ +
printconfiguration + = "boolean or filename" + (default = false)
+
Write out the entire configuration in traditional ProGuard style, to the + standard output or to the given file. Useful to replace unreadable + XML configurations.
+ +
dump + = "boolean or filename" + (default = false)
+
Write out the internal structure of the processed class files, to the + standard output or to the given file.
+ +
<injar + class_path + />
+
Specifies the program jars (or wars, ears, zips, or directories).
+ +
<outjar + class_path + />
+
Specifies the name of the output jars (or wars, ears, zips, or + directories).
+ +
<libraryjar + class_path + />
+
Specifies the library jars (or wars, ears, zips, or directories).
+ +
<keepdirectory name = "directory_name" + />
+ <keepdirectories filter = "directory_filter" + />
+
Keep the specified directories in the output jars (or wars, ears, zips, or + directories).
+ +
<keep + modifiers + class_specification + > + class_member_specifications + </keep>
+
Preserve the specified classes and class members.
+ +
<keepclassmembers + modifiers + class_specification + > + class_member_specifications + </keepclassmembers>
+
Preserve the specified class members, if their classes are preserved as + well.
+ +
<keepclasseswithmembers + modifiers + class_specification + > + class_member_specifications + </keepclasseswithmembers>
+
Preserve the specified classes and class members, if all of the + specified class members are present.
+ +
<keepnames + class_specification + > + class_member_specifications + </keepnames>
+
Preserve the names of the specified classes and class members (if + they aren't removed in the shrinking step).
+ +
<keepclassmembernames + class_specification + > + class_member_specifications + </keepclassmembernames>
+
Preserve the names of the specified class members (if they aren't removed + in the shrinking step).
+ +
<keepclasseswithmembernames + class_specification + > + class_member_specifications + </keepclasseswithmembernames>
+
Preserve the names of the specified classes and class members, if + all of the specified class members are present (after the shrinking + step).
+ +
<whyareyoukeeping + class_specification + > + class_member_specifications + </whyareyoukeeping>
+
Print details on why the given classes and class members are being kept in + the shrinking step.
+ +
<assumenosideeffects + class_specification + > + class_member_specifications + </assumenosideeffects>
+
Assume that the specified methods don't have any side effects, while + optimizing. Only use this option if you know what you're + doing!
+ +
<optimization name = "optimization_name" + />
+ <optimizations filter = ""optimization_filter" + />
+
Perform only the specified optimizations.
+ +
<keeppackagename name = "package_name" + />
+ <keeppackagenames filter = "package_filter" + />
+
Keep the specified package names from being obfuscated. If no name is + given, all package names are preserved.
+ +
<keepattribute name = "attribute_name" + />
+ <keepattributes filter = "attribute_filter" + />
+
Preserve the specified optional Java bytecode attributes, with optional + wildcards. If no name is given, all attributes are preserved.
+ +
<adaptclassstrings filter = "class_filter" + />
+
Adapt string constants in the specified classes, based on the obfuscated + names of any corresponding classes.
+ +
<adaptresourcefilenames filter = "file_filter" + />
+
Rename the specified resource files, based on the obfuscated names of the + corresponding class files.
+ +
<adaptresourcefilecontents filter = "file_filter" + />
+
Update the contents of the specified resource files, based on the + obfuscated names of the processed classes.
+ +
+ <dontnote filter = "class_filter" + />
+
Don't print notes about classes matching the specified class name + filter.
+ +
+ <dontwarn filter = "class_filter" + />
+
Don't print warnings about classes matching the specified class name + filter. Only use this option if you know what you're doing!
+ +
<configuration refid = "ref_id" + />
+
Includes the configuration specified in the + <proguardconfiguration> task (or + <proguard> task) with the attribute id = + "ref_id". Note that only the nested elements of this configuration + are considered, not the attributes. Also note: for reading ProGuard-style + configuration files, use the configuration + attribute.
+ +
+ +

Class Path Attributes and Nested Elements

+ +The jar tags are path tags, so they can have any of the path attributes (or +nested elements). The most common attributes are: + +
+ +
path = "path"
+
The names of the jars (or wars, ears, zips, or directories), separated by + the path separator.
+ +
location = "name" (or file + = "name", or dir = "name", or + name = "name")
+
Alternatively, the name of a single jar (or war, ear, zip, or + directory).
+ +
refid = "ref_id"
+
Alternatively, a reference to the path or file set with the attribute + id = "ref_id".
+ +
+ +In addition, the jar tags can have ProGuard-style filter attributes: + +
+ +
filter = + "file_filter"
+
An optional filter for all class file names and resource file names that + are encountered.
+ +
jarfilter = + "file_filter"
+
An optional filter for all jar names that are encountered.
+ +
warfilter = + "file_filter"
+
An optional filter for all war names that are encountered.
+ +
earfilter = + "file_filter"
+
An optional filter for all ear names that are encountered.
+ +
zipfilter = + "file_filter"
+
An optional filter for all zip names that are encountered.
+ +
+ +

Keep Modifier Attributes

+ +The keep tags can have the following modifier attributes: + +
+ +
allowshrinking + = "boolean" + (default = false)
+
Specifies whether the entry points specified in the keep tag may be + shrunk.
+ +
allowoptimization + = "boolean" + (default = false)
+
Specifies whether the entry points specified in the keep tag may be + optimized.
+ +
allowobfuscation + = "boolean" + (default = false)
+
Specifies whether the entry points specified in the keep tag may be + obfuscated.
+ +
+ +

Class Specification Attributes and Nested Elements

+ +The keep tags can have the following class_specification attributes and +class_member_specifications nested elements: + +
+ +
access = "access_modifiers"
+
The optional access modifiers of the class. Any space-separated list of + "public", "final", and "abstract", with optional negators "!".
+ +
annotation = "annotation_name"
+
The optional fully qualified name of an annotation of the class, with + optional wildcards.
+ +
type = "type"
+
The optional type of the class: one of "class", "interface", or + "!interface".
+ +
name = "class_name"
+
The optional fully qualified name of the class, with optional + wildcards.
+ +
extendsannotation = "annotation_name"
+
The optional fully qualified name of an annotation of the the class that + the specified classes must extend, with optional wildcards.
+ +
extends = "class_name"
+
The optional fully qualified name of the class the specified classes + must extend, with optional wildcards.
+ +
implements = "class_name"
+
The optional fully qualified name of the class the specified classes + must implement, with optional wildcards.
+ +
<field + class_member_specification + />
+
Specifies a field.
+ +
<method + class_member_specification + />
+
Specifies a method.
+ +
<constructor + class_member_specification + />
+
Specifies a constructor.
+ +
+ +

Class Member Specification Attributes

+ +The class member tags can have the following class_member_specification +attributes: + +
+ +
access = "access_modifiers"
+
The optional access modifiers of the class. Any space-separated list of + "public", "protected", "private", "static", etc., with optional negators + "!".
+ +
annotation = "annotation_name"
+
The optional fully qualified name of an annotation of the class member, + with optional wildcards.
+ +
type = "type"
+
The optional fully qualified type of the class member, with optional + wildcards. Not applicable for constructors, but required for methods for + which the parameters attribute is specified.
+ +
name = "name"
+
The optional name of the class member, with optional wildcards. Not + applicable for constructors.
+ +
parameters = "parameters"
+
The optional comma-separated list of fully qualified method parameters, + with optional wildcards. Not applicable for fields, but required for + constructors, and for methods for which the type attribute is + specified.
+ +
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/attention.gif b/public/proguard/docs/manual/attention.gif new file mode 100644 index 0000000..1a0c712 Binary files /dev/null and b/public/proguard/docs/manual/attention.gif differ diff --git a/public/proguard/docs/manual/examples.html b/public/proguard/docs/manual/examples.html new file mode 100644 index 0000000..14e0758 --- /dev/null +++ b/public/proguard/docs/manual/examples.html @@ -0,0 +1,1504 @@ + + + + + + +ProGuard Examples + + + + +

Examples

+ +Some typical useful configurations: +
    +
  1. A typical application
  2. +
  3. A typical applet
  4. +
  5. A typical midlet
  6. +
  7. A typical Java Card applet
  8. +
  9. A typical xlet
  10. +
  11. A simple Android activity
  12. +
  13. A complete Android application
  14. +
  15. A typical library
  16. +
  17. All possible applications in the input jars
  18. +
  19. All possible applets in the input jars
  20. +
  21. All possible midlets in the input jars
  22. +
  23. All possible Java Card applets in the input jars
  24. +
  25. All possible xlets in the input jars
  26. +
  27. All possible servlets in the input jars
  28. +
  29. Scala applications with the Scala runtime
  30. +
  31. Processing native methods
  32. +
  33. Processing callback methods
  34. +
  35. Processing enumeration classes
  36. +
  37. Processing serializable classes
  38. +
  39. Processing bean classes
  40. +
  41. Processing annotations
  42. +
  43. Processing database drivers
  44. +
  45. Processing ComponentUI classes
  46. +
  47. Processing RMI code
  48. +
  49. Processing resource files
  50. +
  51. Processing manifest files
  52. +
  53. Producing useful obfuscated stack traces
  54. +
  55. Obfuscating package names
  56. +
  57. Restructuring the output archives
  58. +
  59. Filtering the input and the output
  60. +
  61. Processing multiple applications at once
  62. +
  63. Incremental obfuscation
  64. +
  65. Preverifying class files for Java Micro Edition
  66. +
  67. Upgrading class files to Java 6
  68. +
  69. Finding dead code
  70. +
  71. Printing out the internal structure of class files
  72. +
  73. Using annotations to configure ProGuard
  74. +
+ +You can find some sample configuration files in the examples +directory of the ProGuard distribution. + +

A typical application

+ +To shrink, optimize, and obfuscate a simple Java application, you typically +create a configuration file like myconfig.pro, which can be used +with +
+bin/proguard @myconfig.pro
+
+

+The configuration file specifies the input, the output, and the entry points +of the application: +

+-injars       myapplication.jar
+-outjars      myapplication_out.jar
+-libraryjars  <java.home>/lib/rt.jar
+-printmapping myapplication.map
+
+-keep public class mypackage.MyMain {
+    public static void main(java.lang.String[]);
+}
+
+

+Note the use of the <java.home> system property. ProGuard +automatically replaces it when parsing the file. +

+The -keep option specifies the +entry point of the application that has to be preserved. +The access modifiers public and static are not +really required in this case, since we know a priori that the specified class +and method have the proper access flags. It just looks more familiar this way. +

+Note that all type names are fully specified: +mypackage.MyMain and java.lang.String[]. +

+We're writing out an obfuscation mapping file with -printmapping, for +de-obfuscating any stack traces later on, or for incremental obfuscation of +extensions. +

+We can further improve the results with a few additional options: +

+-optimizationpasses 3
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+
+These options are not required; they just shave off some extra bytes from the +output jar, by performing up to 3 optimization passes, and by aggressively +obfuscating class members and package names. +

+In general, you might need a few additional options for processing native methods, callback methods, +enumerations, serializable +classes, bean classes, annotations, and resource +files. + +

A typical applet

+ +These options shrink, optimize, and obfuscate the applet +mypackage.MyApplet: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+
+-keep public class mypackage.MyApplet
+
+

+The typical applet methods will be preserved automatically, since +mypackage.MyApplet is an extension of the Applet +class in the library rt.jar. +

+If applicable, you should add options for processing native +methods, callback methods, enumerations, serializable +classes, bean classes, annotations, and resource +files. + +

A typical midlet

+ +These options shrink, optimize, obfuscate, and preverify the midlet +mypackage.MyMIDlet: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+-microedition
+
+-keep public class mypackage.MyMIDlet
+
+

+Note how we're now targeting the Java Micro Edition run-time environment of +midpapi20.jar and cldcapi11.jar, instead of the Java +Standard Edition run-time environment rt.jar. You can target +other JME environments by picking the appropriate jars. +

+The typical midlet methods will be preserved automatically, since +mypackage.MyMIDlet is an extension of the MIDlet +class in the library midpapi20.jar. +

+The -microedition option +makes sure the class files are preverified for Java Micro Edition, producing +compact StackMap attributes. It is no longer necessary to run an +external preverifier. +

+Be careful if you do use the external preverify tool on a platform +with a case-insensitive filing system, such as Windows. Because this tool +unpacks your processed jars, you should then use ProGuard's -dontusemixedcaseclassnames +option. +

+If applicable, you should add options for processing native +methods and resource files. +

+Note that you will still have to adapt the midlet jar size in the +corresponding jad file; ProGuard doesn't do that for you. + +

A typical Java Card applet

+ +These options shrink, optimize, and obfuscate the Java Card applet +mypackage.MyApplet: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/javacard2.2.2/lib/api.jar
+-dontwarn    java.lang.Class
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+
+-keep public class mypackage.MyApplet
+
+

+The configuration is very similar to the configuration for midlets, except that +it now targets the Java Card run-time environment. This environment doesn't +have java.lang.Class, so we're telling ProGuard not to worry about it. + +

A typical xlet

+ +These options shrink, optimize, and obfuscate the xlet +mypackage.MyXlet: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/jtv1.1/javatv.jar
+-libraryjars /usr/local/java/cdc1.1/lib/cdc.jar
+-libraryjars /usr/local/java/cdc1.1/lib/btclasses.zip
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+
+-keep public class mypackage.MyXlet
+
+

+The configuration is very similar to the configuration for midlets, except that +it now targets the CDC run-time environment with the Java TV API. + +

A simple Android activity

+ +These options shrink, optimize, and obfuscate the single Android +activity mypackage.MyActivity: +
+-injars      bin/classes
+-outjars     bin/classes-processed.jar
+-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar
+
+-dontpreverify
+-repackageclasses ''
+-allowaccessmodification
+-optimizations !code/simplification/arithmetic
+
+-keep public class mypackage.MyActivity
+
+

+We're targeting the Android run-time and keeping the activity as an entry +point. +

+Preverification is irrelevant for the dex compiler and the Dalvik VM, so we +can switch it off with the +-dontpreverify option. +

+The -optimizations option +disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. +Note that the Dalvik VM also can't +handle aggressive overloading +(of static fields). +

+If applicable, you should add options for processing native +methods, callback methods, +enumerations, +annotations, and +resource files. + +

A complete Android application

+ +These options shrink, optimize, and obfuscate all public activities, services, +broadcast receivers, and content providers from the compiled classes and +external libraries: +
+-injars      bin/classes
+-injars      libs
+-outjars     bin/classes-processed.jar
+-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar
+
+-dontpreverify
+-repackageclasses ''
+-allowaccessmodification
+-optimizations !code/simplification/arithmetic
+-keepattributes *Annotation*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+
+-keep public class * extends android.view.View {
+    public <init>(android.content.Context);
+    public <init>(android.content.Context, android.util.AttributeSet);
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+    public void set*(...);
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * implements android.os.Parcelable {
+    static android.os.Parcelable$Creator CREATOR;
+}
+
+-keepclassmembers class **.R$* {
+    public static <fields>;
+}
+
+

+Most importantly, we're keeping all fundamental classes that may be referenced +by the AndroidManifest.xml file of the application. If your +manifest file contains other classes and methods, you may have to specify +those as well. +

+We're keeping annotations, since they might be used by custom +RemoteViews. +

+We're keeping any custom View extensions and other classes with +typical constructors, since they might be referenced from XML layout files. +

+We're also keeping the required static fields in Parcelable +implementations, since they are accessed by introspection. +

+Finally, we're keeping the static fields of referenced inner classes of +auto-generated R classes, just in case your code is accessing +those fields by introspection. Note that the compiler already inlines +primitive fields, so ProGuard can generally remove all these classes entirely +anyway (because the classes are not referenced and therefore not required). +

+If you're using additional Google APIs, you'll have to specify +those as well, for instance: +

+-libraryjars /usr/local/android-sdk/add-ons/google_apis-7_r01/libs/maps.jar
+
+

+If you're using Google's optional License Verification Library, you can +obfuscate its code along with your own code. You do have to preserve +its ILicensingService interface for the library to work: +

+-keep public interface com.android.vending.licensing.ILicensingService
+
+

+If you're using the Android Compatibility library, you should add the +following line, to let ProGuard know it's ok that the library references some +classes that are not available in all versions of the API: +

+-dontwarn android.support.**
+
+

+If applicable, you should add options for processing native +methods, callback methods, +enumerations, +and resource files. You may also want to add +options for producing useful stack traces. You can +find a complete sample configuration in examples/android.pro in +the ProGuard distribution. +

+The build process of the Android SDK (version 2.3 and higher) already +integrates ProGuard by default. You only need to enable it (for release +builds) by adding proguard.config=proguard.cfg to the file +build.properties. In case of problems, you may want to check if +the automatically generated file proguard.cfg contains the +settings discussed above. The generated Ant build file already sets the input +and output files for you. +

+For more information, you can consult the official Developer +Guide in the Android SDK. + +

A typical library

+ +These options shrink, optimize, and obfuscate an entire library, keeping all +public and protected classes and class members, native method names, and +serialization code. The processed version of the library can then still be +used as such, for developing code based on its public API. +
+-injars       in.jar
+-outjars      out.jar
+-libraryjars  <java.home>/lib/rt.jar
+-printmapping out.map
+
+-keepparameternames
+-renamesourcefileattribute SourceFile
+-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
+                SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
+
+-keep public class * {
+    public protected *;
+}
+
+-keepclassmembernames class * {
+    java.lang.Class class$(java.lang.String);
+    java.lang.Class class$(java.lang.String, boolean);
+}
+
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keepclassmembers class * implements java.io.Serializable {
+    static final long serialVersionUID;
+    private static final java.io.ObjectStreamField[] serialPersistentFields;
+    private void writeObject(java.io.ObjectOutputStream);
+    private void readObject(java.io.ObjectInputStream);
+    java.lang.Object writeReplace();
+    java.lang.Object readResolve();
+}
+
+

+This configuration should preserve everything we'll ever want to access in the +library. Only if there are any other non-public classes or methods that are +invoked dynamically, they should be specified using additional -keep options. +

+The -keepclassmembernames +option for the class$ methods is not strictly necessary. These +methods are inserted by the javac compiler and the +jikes compiler respectively, in JDK 1.2 and older, to implement +the .class construct. ProGuard will automatically detect them and +deal with them, even when their names have been obfuscated. However, other +obfuscators may rely on the original method names. It may therefore be helpful +to preserve them, in case these other obfuscators are ever used for further +obfuscation of the library. +

+The "Exceptions" attribute has to be preserved, so the compiler knows which +exceptions methods may throw. +

+The "InnerClasses" attribute (or more precisely, its source name part) has to +be preserved too, for any inner classes that can be referenced from outside the +library. The javac compiler would be unable to find the inner +classes otherwise. +

+The "Signature" attribute is required to be able to access generic types when +compiling in JDK 5.0 and higher. +

+The -keepparameternames +option keeps the parameter names in the "LocalVariableTable" and +"LocalVariableTypeTable" attributes of public library methods. Some IDEs can +present these names to the developers who use the library. +

+Finally, we're keeping the "Deprecated" attribute and the attributes for +producing useful stack traces. +

+We've also added some options for for processing native +methods, enumerations, serializable classes, and annotations, which are all discussed in their +respective examples. + +

All possible applications in the input jars

+ +These options shrink, optimize, and obfuscate all public applications in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+-printseeds
+
+-keepclasseswithmembers public class * {
+    public static void main(java.lang.String[]);
+}
+
+

+Note the use of -keepclasseswithmembers. +We don't want to preserve all classes, just all classes that have main +methods, and those methods. +

+The -printseeds option prints +out which classes exactly will be preserved, so we know for sure we're getting +what we want. +

+If applicable, you should add options for processing native +methods, callback methods, enumerations, serializable +classes, bean classes, annotations, and resource +files. + +

All possible applets in the input jars

+ +These options shrink, optimize, and obfuscate all public applets in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+-printseeds
+
+-keep public class * extends java.applet.Applet
+
+

+We're simply keeping all classes that extend the Applet class. +

+Again, the -printseeds option +prints out which applets exactly will be preserved. +

+If applicable, you should add options for processing native +methods, callback methods, enumerations, serializable +classes, bean classes, annotations, and resource +files. + +

All possible midlets in the input jars

+ +These options shrink, optimize, obfuscate, and preverify all public midlets in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+-microedition
+-printseeds
+
+-keep public class * extends javax.microedition.midlet.MIDlet
+
+

+We're simply keeping all classes that extend the MIDlet class. +

+The -microedition option +makes sure the class files are preverified for Java Micro Edition, producing +compact StackMap attributes. It is no longer necessary to run an +external preverifier. +

+Be careful if you do use the external preverify tool on a platform +with a case-insensitive filing system, such as Windows. Because this tool +unpacks your processed jars, you should then use ProGuard's -dontusemixedcaseclassnames +option. +

+The -printseeds option prints +out which midlets exactly will be preserved. +

+If applicable, you should add options for processing native +methods and resource files. +

+Note that you will still have to adapt the midlet jar size in the +corresponding jad file; ProGuard doesn't do that for you. + +

All possible Java Card applets in the input jars

+ +These options shrink, optimize, and obfuscate all public Java Card applets in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/javacard2.2.2/lib/api.jar
+-dontwarn    java.lang.Class
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+-printseeds
+
+-keep public class * implements javacard.framework.Applet
+
+

+We're simply keeping all classes that implement the Applet +interface. +

+The -printseeds option prints +out which applets exactly will be preserved. + +

All possible xlets in the input jars

+ +These options shrink, optimize, and obfuscate all public xlets in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/jtv1.1/javatv.jar
+-libraryjars /usr/local/java/cdc1.1/lib/cdc.jar
+-libraryjars /usr/local/java/cdc1.1/lib/btclasses.zip
+-overloadaggressively
+-repackageclasses ''
+-allowaccessmodification
+-printseeds
+
+-keep public class * implements javax.tv.xlet.Xlet
+
+

+We're simply keeping all classes that implement the Xlet interface. +

+The -printseeds option prints +out which xlets exactly will be preserved. + +

All possible servlets in the input jars

+ +These options shrink, optimize, and obfuscate all public servlets in +in.jar: +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+-libraryjars /usr/local/java/servlet/servlet.jar
+-printseeds
+
+-keep public class * implements javax.servlet.Servlet
+
+

+Keeping all servlets is very similar to keeping all applets. The servlet API +is not part of the standard run-time jar, so we're specifying it as a library. +Don't forget to use the right path name. +

+We're then keeping all classes that implement the Servlet +interface. We're using the implements keyword because it looks +more familiar in this context, but it is equivalent to extends, +as far as ProGuard is concerned. +

+The -printseeds option prints +out which servlets exactly will be preserved. +

+If applicable, you should add options for processing native +methods, callback methods, enumerations, serializable +classes, bean classes, annotations, and resource +files. + +

Scala applications with the Scala runtime

+ +These options shrink, optimize, and obfuscate all public Scala applications in +in.jar: +
+-injars      in.jar
+-injars      /usr/local/java/scala-2.9.1/lib/scala-library.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+
+-dontwarn scala.**
+
+-keepclasseswithmembers public class * {
+    public static void main(java.lang.String[]);
+}
+
+-keep class * implements org.xml.sax.EntityResolver
+
+-keepclassmembers class * {
+    ** MODULE$;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinPool {
+    long eventCount;
+    int  workerCounts;
+    int  runControl;
+    scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack;
+    scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinWorkerThread {
+    int base;
+    int sp;
+    int runState;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.ForkJoinTask {
+    int status;
+}
+
+-keepclassmembernames class scala.concurrent.forkjoin.LinkedTransferQueue {
+    scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head;
+    scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail;
+    scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe;
+}
+
+

+The configuration is essentially the same as +for processing applications, because Scala is +compiled to ordinary Java bytecode. However, the example processes the Scala +runtime library as well. The processed jar can be an order of magnitude +smaller and a few times faster than the original code (for the Scala code +examples, for instance). +

+The -dontwarn option tells +ProGuard not to complain about some artefacts in the Scala runtime, the way it +is compiled by the scalac compiler (at least in Scala 2.9.1 and +older). Note that this option should always be used with care. +

+The additional -keep +options make sure that some classes and some fields that are accessed by means +of introspection are not removed or renamed. +

+If applicable, you should add options for processing native +methods, callback methods, enumerations, serializable +classes, bean classes, annotations, and resource +files. +

Processing native methods

+ +If your application, applet, servlet, library, etc., contains native methods, +you'll want to preserve their names and their classes' names, so they can +still be linked to the native library. The following additional option will +ensure that: +
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+

+Note the use of -keepclasseswithmembernames. +We don't want to preserve all classes or all native methods; we just want to +keep the relevant names from being obfuscated. +

+ProGuard doesn't look at your native code, so it won't automatically preserve +the classes or class members that are invoked by the native code. These are +entry points, which you'll have to specify explicitly. Callback methods are discussed below as a typical example. + +

Processing callback methods

+ +If your application, applet, servlet, library, etc., contains callback +methods, which are called from external code (native code, scripts,...), +you'll want to preserve them, and probably their classes too. They are just +entry points to your code, much like, say, the main method of an application. +If they aren't preserved by other -keep options, something like +the following option will keep the callback class and method: +
+-keep class mypackage.MyCallbackClass {
+    void myCallbackMethod(java.lang.String);
+}
+
+

+This will preserve the given class and method from being removed or renamed. + +

Processing enumeration classes

+ +If your application, applet, servlet, library, etc., contains enumeration +classes, you'll have to preserve some special methods. Enumerations were +introduced in Java 5. The java compiler translates enumerations into classes +with a special structure. Notably, the classes contain implementations of some +static methods that the run-time environment accesses by introspection (Isn't +that just grand? Introspection is the self-modifying code of a new +generation). You have to specify these explicitly, to make sure they aren't +removed or obfuscated: +
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+ +

Processing serializable classes

+ +More complex applications, applets, servlets, libraries, etc., may contain +classes that are serialized. Depending on the way in which they are used, they +may require special attention: + +

+ +Note that the above options may preserve more classes and class members +than strictly necessary. For instance, a large number of classes may implement +the Serialization interface, yet only a small number may actually +ever be serialized. Knowing your application and tuning the configuration +often produces more compact results. + +

Processing bean classes

+ +If your application, applet, servlet, library, etc., makes extensive use of +introspection on bean classes to find bean editor classes, or getter and +setter methods, then configuration may become painful. There's not much else +you can do than making sure the bean class names, or the getter and setter +names don't change. For instance: +
+-keep public class mypackage.MyBean {
+    public void setMyProperty(int);
+    public int getMyProperty();
+}
+
+-keep public class mypackage.MyBeanEditor
+
+

+If there are too many elements to list explicitly, wildcards in class names +and method signatures might be helpful. This example should encompasses all +possible setters and getters in classes in the package mybeans: +

+-keep class mybeans.** {
+    void set*(***);
+    void set*(int, ***);
+
+    boolean is*(); 
+    boolean is*(int);
+
+    *** get*();
+    *** get*(int);
+}
+
+

+The '***' wildcard matches any type (primitive or non-primitive, +array or non-array). The methods with the 'int' arguments matches +properties that are lists. + +

Processing annotations

+ +If your application, applet, servlet, library, etc., uses annotations, you may +want to preserve them in the processed output. Annotations are represented by +attributes that have no direct effect on the execution of the code. However, +their values can be retrieved through introspection, allowing developers to +adapt the execution behavior accordingly. By default, ProGuard treats +annotation attributes as optional, and removes them in the obfuscation step. +If they are required, you'll have to specify this explicitly: +
+-keepattributes *Annotation*
+
+

+For brevity, we're specifying a wildcarded attribute name, which will match +RuntimeVisibleAnnotations, +RuntimeInvisibleAnnotations, +RuntimeVisibleParameterAnnotations, +RuntimeInvisibleParameterAnnotations, and +AnnotationDefault. Depending on the purpose of the processed +code, you could refine this selection, for instance not keeping the run-time +invisible annotations (which are only used at compile-time). +

+Some code may make further use of introspection to figure out the enclosing +methods of anonymous inner classes. In that case, the corresponding attribute +has to be preserved as well: +

+-keepattributes EnclosingMethod
+
+ +

Processing database drivers

+ +Database drivers are implementations of the Driver interface. +Since they are often created dynamically, you may want to preserve any +implementations that you are processing as entry points: +
+-keep class * implements java.sql.Driver
+
+

+This option also gets rid of the note that ProGuard prints out about +(java.sql.Driver)Class.forName constructs, if you are +instantiating a driver in your code (without necessarily implementing any +drivers yourself). + +

Processing ComponentUI classes

+ +Swing UI look and feels are implemented as extensions of the +ComponentUI class. For some reason, these have to contain a +static method createUI, which the Swing API invokes using +introspection. You should therefore always preserve the method as an entry +point, for instance like this: +
+-keep class * extends javax.swing.plaf.ComponentUI {
+    public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent);
+}
+
+

+This option also keeps the classes themselves. + +

Processing RMI code

+ +Reportedly, the easiest way to handle RMI code is to process the code with +ProGuard first and then invoke the rmic tool. If that is not +possible, you may want to try something like this: +
+-keepattributes Exceptions
+
+-keep interface * extends java.rmi.Remote {
+    <methods>;
+}
+
+-keep class * implements java.rmi.Remote {
+    <init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject);
+}
+
+

+The first -keep option keeps all your Remote interfaces and their +methods. The second one keeps all the implementations, along with their +particular RMI constructors, if any. +

+The Exceptions attribute has to be kept too, because the RMI +handling code performs introspection to check whether the method signatures +are compatible. + +

Processing resource files

+ +If your application, applet, servlet, library, etc., contains resource files, +it may be necessary to adapt their names and/or their contents when the +application is obfuscated. The following two options can achieve this +automatically: +
+-adaptresourcefilenames    **.properties,**.gif,**.jpg
+-adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF
+
+

+The -adaptresourcefilenames +option in this case renames properties files and image files in the processed +output, based on the obfuscated names of their corresponding class files (if +any). The -adaptresourcefilecontents +option looks for class names in properties files and in the manifest file, and +replaces these names by the obfuscated names (if any). You'll probably want to +adapt the filters to suit your application. + +

Processing manifest files

+ +As illustrated in the previous section, manifest files can be treated like +ordinary resource files. ProGuard can adapt obfuscated class names in the +files, but it won't make any other changes. If you want anything else, you +should apply an external tool. For instance, if a manifest file contains +signing information, you should sign the jar again after it has been +processed. +

+If you're merging several input jars into a single output jar, you'll have to +pick one, typically by specifying filters: +

+-injars  in1.jar
+-injars  in2.jar(!META-INF/MANIFEST.MF)
+-injars  in3.jar(!META-INF/MANIFEST.MF)
+-outjars out.jar
+
+

+The filters will let ProGuard copy the manifest file from the first jar and +ignore any manifest files in the second and third input jars. Note that +ProGuard will leave the order of the files in the jars unchanged; manifest +files are not necessarily put first. + +

Producing useful obfuscated stack traces

+ +These options let obfuscated applications or libraries produce stack traces +that can still be deciphered later on: +
+-printmapping out.map
+
+-renamesourcefileattribute SourceFile
+-keepattributes SourceFile,LineNumberTable
+
+

+We're keeping all source file attributes, but we're replacing their values by +the string "SourceFile". We could use any string. This string is already +present in all class files, so it doesn't take up any extra space. If you're +working with J++, you'll want to keep the "SourceDir" attribute as well. +

+We're also keeping the line number tables of all methods. +

+Whenever both of these attributes are present, the Java run-time environment +will include line number information when printing out exception stack traces. +

+The information will only be useful if we can map the obfuscated names back to +their original names, so we're saving the mapping to a file +out.map. The information can then be used by the ReTrace tool to restore the original stack trace. + +

Obfuscating package names

+ +Package names can be obfuscated in various ways, with increasing levels of +obfuscation and compactness. For example, consider the following classes: +
+mycompany.myapplication.MyMain
+mycompany.myapplication.Foo
+mycompany.myapplication.Bar
+mycompany.myapplication.extra.FirstExtra
+mycompany.myapplication.extra.SecondExtra
+mycompany.util.FirstUtil
+mycompany.util.SecondUtil
+
+

+Let's assume the class name mycompany.myapplication.MyMain is the +main application class that is kept by the configuration. All other class names +can be obfuscated. +

+By default, packages that contain classes that can't be renamed aren't renamed +either, and the package hierarchy is preserved. This results in obfuscated +class names like these: +

+mycompany.myapplication.MyMain
+mycompany.myapplication.a
+mycompany.myapplication.b
+mycompany.myapplication.a.a
+mycompany.myapplication.a.b
+mycompany.a.a
+mycompany.a.b
+
+

+The -flattenpackagehierarchy +option obfuscates the package names further, by flattening the package +hierarchy of obfuscated packages: +

+-flattenpackagehierarchy 'myobfuscated'
+
+

+The obfuscated class names then look as follows: +

+mycompany.myapplication.MyMain
+mycompany.myapplication.a
+mycompany.myapplication.b
+myobfuscated.a.a
+myobfuscated.a.b
+myobfuscated.b.a
+myobfuscated.b.b
+
+

+Alternatively, the -repackageclasses option +obfuscates the entire packaging, by combining obfuscated classes into a single +package: +

+-repackageclasses 'myobfuscated'
+
+The obfuscated class names then look as follows: +
+mycompany.myapplication.MyMain
+mycompany.myapplication.a
+mycompany.myapplication.b
+myobfuscated.a
+myobfuscated.b
+myobfuscated.c
+myobfuscated.d
+
+

+Additionally specifying the -allowaccessmodification +option allows access permissions of classes and class members to +be broadened, opening up the opportunity to repackage all obfuscated classes: +

+-repackageclasses 'myobfuscated'
+-allowaccessmodification
+
+The obfuscated class names then look as follows: +
+mycompany.myapplication.MyMain
+myobfuscated.a
+myobfuscated.b
+myobfuscated.c
+myobfuscated.d
+myobfuscated.e
+myobfuscated.f
+
+

+The specified target package can always be the root package. For instance: +

+-repackageclasses ''
+-allowaccessmodification
+
+The obfuscated class names are then the shortest possible names: +
+mycompany.myapplication.MyMain
+a
+b
+c
+d
+e
+f
+
+

+Note that not all levels of obfuscation of package names may be acceptable for +all code. Notably, you may have to take into account that your application may +contain resource files that have to be adapted. + +

Restructuring the output archives

+ +In simple applications, all output classes and resources files are merged into +a single jar. For example: +
+-injars  classes
+-injars  in1.jar
+-injars  in2.jar
+-injars  in3.jar
+-outjars out.jar
+
+

+This configuration merges the processed versions of the files in the +classes directory and the three jars into a single output jar +out.jar. +

+If you want to preserve the structure of your input jars (and/or wars, ears, +zips, or directories), you can specify an output directory (or a war, an ear, +or a zip). For example: +

+-injars  in1.jar
+-injars  in2.jar
+-injars  in3.jar
+-outjars out
+
+

+The input jars will then be reconstructed in the directory out, +with their original names. +

+You can also combine archives into higher level archives. For example: +

+-injars  in1.jar
+-injars  in2.jar
+-injars  in3.jar
+-outjars out.war
+
+

+The other way around, you can flatten the archives inside higher level +archives into simple archives: +

+-injars  in.war
+-outjars out.jar
+
+

+This configuration puts the processed contents of all jars inside +in.war (plus any other contents of in.war) into +out.jar. +

+If you want to combine input jars (and/or wars, ears, zips, or directories) +into output jars (and/or wars, ears, zips, or directories), you can group the +-injars and -outjars options. For example: +

+-injars base_in1.jar
+-injars base_in2.jar
+-injars base_in3.jar
+-outjars base_out.jar
+
+-injars  extra_in.jar
+-outjars extra_out.jar
+
+

+This configuration puts the processed results of all base_in*.jar +jars into base_out.jar, and the processed results of the +extra_in.jar into extra_out.jar. Note that only the +order of the options matters; the additional whitespace is just for clarity. +

+This grouping, archiving, and flattening can be arbitrarily complex. ProGuard +always tries to package output archives in a sensible way, reconstructing the +input entries as much as required. + +

Filtering the input and the output

+ +If you want even greater control, you can add +filters to the input and the output, +filtering out zips, ears, wars, jars, and/or ordinary files. For example, if +you want to disregard certain files from an input jar: +
+-injars  in.jar(!images/**)
+-outjars out.jar
+
+

+This configuration removes any files in the images directory and +its subdirectories. +

+Such filters can be convenient for avoiding warnings about duplicate files in +the output. For example, only keeping the manifest file from a first input jar: +

+-injars  in1.jar
+-injars  in2.jar(!META-INF/MANIFEST.MF)
+-injars  in3.jar(!META-INF/MANIFEST.MF)
+-outjars out.jar
+
+

+Another useful application is speeding up the processing by ProGuard, by +disregarding a large number of irrelevant classes in the runtime library jar: +

+-libraryjars <java.home>/lib/rt.jar(java/**,javax/**)
+
+

+The filter makes ProGuard disregard com.sun.** classes, for +instance , which don't affect the processing of ordinary applications. +

+It is also possible to filter the jars (and/or wars, ears, zips) themselves, +based on their names. For example: +

+-injars  in(**/acme_*.jar;)
+-outjars out.jar
+
+

+Note the semi-colon in the filter; the filter in front of it applies to jar +names. In this case, only acme_*.jar jars are read from the +directory in and its subdirectories. Filters for war names, ear +names, and zip names can be prefixed with additional semi-colons. All types of +filters can be combined. They are orthogonal. +

+On the other hand, you can also filter the output, in order to control what +content goes where. For example: +

+-injars  in.jar
+-outjars code_out.jar(**.class)
+-outjars resources_out.jar
+
+

+This configuration splits the processed output, sending **.class +files to code_out.jar, and all remaining files to +resources_out.jar. +

+Again, the filtering can be arbitrarily complex, especially when combined with +grouping input and output. + +

Processing multiple applications at once

+ +You can process several dependent or independent applications (or applets, +midlets,...) in one go, in order to save time and effort. ProGuard's input and +output handling offers various ways to keep the output nicely structured. +

+The easiest way is to specify your input jars (and/or wars, ears, zips, and +directories) and a single output directory. ProGuard will then reconstruct the +input in this directory, using the original jar names. For example, showing +just the input and output options: +

+-injars  application1.jar
+-injars  application2.jar
+-injars  application3.jar
+-outjars processed_applications
+
+

+After processing, the directory processed_applications will +contain processed versions of application jars, with their original names. + +

Incremental obfuscation

+ +After having processed an application, e.g. +ProGuard itself, you can still incrementally add other pieces of code that +depend on it, e.g. the ProGuard GUI: +
+-injars       proguardgui.jar
+-outjars      proguardgui_out.jar
+-injars       proguard.jar
+-outjars      proguard_out.jar
+-libraryjars  <java.home>/lib/rt.jar
+-applymapping proguard.map
+
+-keep public class proguard.gui.ProGuardGUI {
+    public static void main(java.lang.String[]);
+}
+
+

+We're reading both unprocessed jars as input. Their processed contents will go +to the respective output jars. The -applymapping option then +makes sure the ProGuard part of the code gets the previously produced +obfuscation mapping. The final application will consist of the obfuscated +ProGuard jar and the additional obfuscated GUI jar. +

+The added code in this example is straightforward; it doesn't affect the +original code. The proguard_out.jar will be identical to the one +produced in the initial processing step. If you foresee adding more complex +extensions to your code, you should specify the options -useuniqueclassmembernames, +-dontshrink, and -dontoptimize in the +original processing step. These options ensure that the obfuscated base +jar will always remain usable without changes. You can then specify the base +jar as a library jar: +

+-injars       proguardgui.jar
+-outjars      proguardgui_out.jar
+-libraryjars  proguard.jar
+-libraryjars  <java.home>/lib/rt.jar
+-applymapping proguard.map
+
+-keep public class proguard.gui.ProGuardGUI {
+    public static void main(java.lang.String[]);
+}
+
+ +

Preverifying class files for Java Micro Edition

+ +Even if you're not interested in shrinking, optimizing, and obfuscating your +midlets, as shown in the midlets example, you can still +use ProGuard to preverify the class files for Java Micro Edition. ProGuard +produces slightly more compact results than the traditional external +preverifier. +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/midpapi20.jar
+-libraryjars /usr/local/java/wtk2.5.2/lib/cldcapi11.jar
+
+-dontshrink
+-dontoptimize
+-dontobfuscate
+
+-microedition
+
+

+We're not processing the input, just making sure the class files are +preverified by targeting them at Java Micro Edition with the -microedition option. Note +that we don't need any -keep options to specify entry points; all +class files are simply preverified. + +

Upgrading class files to Java 6

+ +The following options upgrade class files to Java 6, by updating their +internal version numbers and preverifying them. The class files can then be +loaded more efficiently by the Java 6 Virtual Machine. +
+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+
+-dontshrink
+-dontoptimize
+-dontobfuscate
+
+-target 1.6
+
+

+We're not processing the input, just retargeting the class files with the -target option. They will +automatically be preverified for Java 6 as a result. Note that we don't need +any -keep options to specify entry points; all class files are +simply updated and preverified. + +

Finding dead code

+ +These options list unused classes, fields, and methods in the application +mypackage.MyApplication: +
+-injars      in.jar
+-libraryjars <java.home>/lib/rt.jar
+
+-dontoptimize
+-dontobfuscate
+-dontpreverify
+-printusage
+
+-keep public class mypackage.MyApplication {
+    public static void main(java.lang.String[]);
+}
+
+

+We're not specifying an output jar, just printing out some results. We're +saving some processing time by skipping the other processing steps. +

+The java compiler inlines primitive constants and String constants +(static final fields). ProGuard would therefore list such fields +as not being used in the class files that it analyzes, even if they are +used in the source files. We can add a -keepclassmembers option +that keeps those fields a priori, in order to avoid having them listed: +

+-keepclassmembers class * {
+    static final %                *;
+    static final java.lang.String *;
+}
+
+ +

Printing out the internal structure of class files

+ +These options print out the internal structure of all class files in the input +jar: +
+-injars in.jar
+
+-dontshrink
+-dontoptimize
+-dontobfuscate
+-dontpreverify
+
+-dump
+
+

+Note how we don't need to specify the Java run-time jar, because we're not +processing the input jar at all. + +

Using annotations to configure ProGuard

+ +The traditional ProGuard configuration allows to keep a clean separation +between the code and the configuration for shrinking, optimization, and +obfuscation. However, it is also possible to define specific annotations, +and then annotate the code to configure the processing. +

+You can find a set of such predefined annotations in the directory +examples/annotations/lib in the ProGuard distribution. +The annotation classes are defined in annotations.jar. The +corresponding ProGuard configuration (or meta-configuration, if you prefer) +is specified in annotations.pro. With these files, you can start +annotating your code. For instance, a java source file +Application.java can be annotated as follows: +

+@KeepApplication
+public class Application {
+  ....
+}
+
+

+The ProGuard configuration file for the application can then be simplified by +leveraging off these annotations: +

+-injars      in.jar
+-outjars     out.jar
+-libraryjars <java.home>/lib/rt.jar
+
+-include lib/annotations.pro
+
+

+The annotations are effectively replacing the application-dependent +-keep options. You may still wish to add traditional +-keep options for processing native +methods, enumerations, serializable classes, and annotations. +

+The directory examples/annotations contains more examples that +illustrate some of the possibilities. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/gui.html b/public/proguard/docs/manual/gui.html new file mode 100644 index 0000000..aa41b1b --- /dev/null +++ b/public/proguard/docs/manual/gui.html @@ -0,0 +1,479 @@ + + + + + + +ProGuard GUI + + + + +

Graphical User Interface

+ +You can find the ProGuard GUI jar in the lib directory of the +ProGuard distribution. To run the ProGuard graphical user interface, just type: +

+java -jar proguardgui.jar [-nosplash] [configuration_file] +

+The GUI will pop up in a window. With the -nosplash option, you +can switch off the short opening animation. If you have specified a ProGuard +configuration file, it will be loaded. The GUI works like a wizard. You can +edit the configuration and execute ProGuard through a few tabs: +

+ + + + + + + + + + + + + + + + +
ProGuardOptionally load an existing configuration file.
Input/OutputSpecify the program jars and library jars.
ShrinkingSpecify the shrinking options.
ObfuscationSpecify the obfuscation options.
OptimizationSpecify the optimization options.
InformationSpecify some options to get information.
ProcessView and save the resulting configuration, and run ProGuard.
+

+ +In addition, there is a tab to execute ReTrace interactively: +

+ + + + +
ReTraceSet up and run ReTrace, to de-obfuscate stack traces.
+

+ +You can freely toggle between the tabs by means of the buttons on the +left-hand side of the window, or by means of the Previous and +Next buttons at the bottom of the tabs. Tool tips briefly explain the +purpose of the numerous options and text fields, although a basic +understanding of the shrinking/optimization/obfuscation/preverification +process is assumed. Please refer to the Introduction of this manual. +

+ +

The ProGuard Tab

+ +The ProGuard tab presents a welcome message and one important button at +the bottom: +

+ + + + +
Load configuration...opens a file chooser to load an existing ProGuard configuration + file.
+

+ +If you don't want to load an existing configuration, you can just continue +creating a new configuration from scratch. +

+ +

The Input/Output Tab

+ +The Input/Output tab contains two lists, respectively to specify the +program jars (or wars, ears, zips, or directories), and the library jars (or +wars, ears, zips, or directories). + + +

+ +Each of these lists can be edited by means of a couple of buttons on the +right-hand side: +

+ + + + + + + + + + + + + + + + + + + + +
Add input... opens a file chooser to add an + input entry to the list of program jars.
Add output... opens a file chooser to add an + output entry to the list of program jars.
Add...opens a file chooser to add an entry to the list of library + jars.
Edit...opens a file chooser to edit the selected entry in the list.
Filter...opens a text entry field to add or edit the filters of the selected + entries in the list.
Removeremoves the selected entries from the list.
Move upmoves the selected entries one position up the list.
Move downmoves the selected entries one position down the list.
Move to librariesmoves the selected entries in the list of program jars to the list of + library jars.
Move to programmoves the selected entries in the list of library jars to the list of + program jars.
+

+ +Filters allow to filter files based on their names. One can specify filters +for class file names and resource file names, for jar file names, for war file +names, for ear file names, and for zip file names. Multiple entries in the +program list only make sense when combined with filters; each output file is +written to the first entry with a matching filter. +

+ +Input entries that are currently not readable are colored red. +

+ +The order of the entries in each list may matter, as the first occurrence of +any duplicate entries gets precedence, just as in conventional class paths. +

+ +Corresponding configuration options: +

+

+ +

The Shrinking Tab

+ +The Shrinking tab presents a number of options that affect the +shrinking step. The basic options are followed by a few lists of classes and +class members (fields and methods) that must be protected from shrinking (and +implicitly from obfuscation as well). +

+ +The fixed lists contain predefined entries that are typically useful for many +applications. Each of these entries can be toggled by means of a check box. +The text field following each entry allows to constrain the applicable classes +by means of a comma-separated list of wildcarded, fully-qualified class +names. The default is "*", which means that all input classes of the +corresponding type are considered. +

+ +For example, checking the Applications entry and filling in +"myapplications.**" after it would mean: keep all classes that have main +methods in the "myapplications" package and all of its subpackages. +

+ +The variable list at the bottom allows to define additional entries +yourself. The list can be edited by means of a couple of buttons on the +right-hand side: +

+ + + + + + + + + + + + +
Add...opens a window to add a new entry to the list.
Edit...opens a window to edit the selected entry in the list.
Removeremoves the selected entries from the list.
Move upmoves the selected entries one position up the list.
Move downmoves the selected entries one position down the list.
+

+ +The interface windows allow to specify classes, fields, and methods. They +contain text fields and check boxes to constrain these items. They have +Ok and Cancel buttons to apply or to cancel the operation. +

+ +For example, your application may be creating some classes dynamically using +Class.forName. You should then specify them here, so they are kept +by their original names. Press the Add... button to open the class +window. Fill out the fully-qualified class name in the Code text field, +and press the Ok button. Repeat this for all required classes. Wildcards +can be helpful to specify a large number of related classes in one go. If you +want to specify all implementations of a certain interface, fill out the +fully qualified interface name in the Extends/implements class instead. +

+ +For more advanced settings, it is advisable to become familiar with ProGuard's +configuration options through the Usage section and +the Examples section. We'll suffice with a brief +overview of the three dialogs provided by the GUI. +

+ +The keep class dialog appears when adding or editing new special keep +entries. It has text fields and selections for specifying and constraining +classes and class members to keep. The Advanced options / Basic +options button at the bottom of the dialog allows to toggle showing the +advanced options. + +

+

+ +The keep field dialog appears when adding or editing fields within the +above dialog. It has text fields and selections for specifying and +constraining fields to keep. Again, the Advanced options / Basic +options button at the bottom of the dialog allows to toggle showing the +advanced options. + +

+

+ +Similarly, the keep method dialog appears when adding or editing +methods within the keep class dialog. It has text fields and selections for +specifying and constraining methods to keep. Again, the Advanced +options / Basic options button at the bottom of the dialog allows +to toggle showing the advanced options. + +

+

+ +Corresponding configuration options: +

+

+ +

The Obfuscation Tab

+ +The Obfuscation tab presents a number of options that affect the +obfuscation step. The basic options are followed by a few lists of classes and +class members (fields and methods) that must be protected from obfuscation +(but not necessarily from shrinking). +

+ +The lists are manipulated in the same way as in the Shrinking Tab. +

+ +Corresponding configuration options: +

+

+ +

The Optimization Tab

+ +The Optimization tab presents a number of options that affect the +optimization step. The basic options are followed by a few lists of class +method calls that can be removed if ProGuard can determine that their results +are not being used. +

+ +The lists are manipulated in much the same way as in the Shrinking Tab. +

+ +Corresponding configuration options: +

+

+ +

The Information Tab

+ +The Information tab presents a number of options for preverification +and targeting, and for the information that ProGuard returns when processing +your code. The bottom list allows you to query ProGuard about why given +classes and class members are being kept in the shrinking step. +

+ +Corresponding configuration options: +

+

+ +

The Process Tab

+ +The Process tab has an output console for displaying the configuration +and the messages while processing. There are three important buttons at the +bottom: +

+ + + + + + + + +
View configurationdisplays the current ProGuard configuration in the console.
Save configuration...opens a file chooser to save the current ProGuard + configuration.
Process!executes ProGuard with the current configuration.
+

+ +

The ReTrace Tab

+ +The ReTrace tab has a panel with a few settings, an input text area for +the obfuscated stack trace, and an output console to view the de-obfuscated +stack trace: + + + +There are two buttons at the bottom: +

+ + + + + + +
Load stack trace...opens a file chooser to load an obfuscated stack trace.
ReTrace!executes ReTrace with the current settings.
+ +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/index.html b/public/proguard/docs/manual/index.html new file mode 100644 index 0000000..5b62d50 --- /dev/null +++ b/public/proguard/docs/manual/index.html @@ -0,0 +1,51 @@ + + + + + + +ProGuard Manual + + + + +

ProGuard

+ +
    +
  1. Introduction
  2. +
  3. Usage
  4. +
  5. Limitations
  6. +
  7. Examples
  8. +
  9. Troubleshooting
  10. +
  11. Reference Card
  12. +
  13. Graphical User Interface
  14. +
  15. Ant Task
  16. +
  17. JME Wireless Toolkit Integration
  18. +
+ +

ReTrace

+ +
    +
  1. Introduction
  2. +
  3. Usage
  4. +
  5. Examples
  6. +
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/introduction.html b/public/proguard/docs/manual/introduction.html new file mode 100644 index 0000000..bc71f4a --- /dev/null +++ b/public/proguard/docs/manual/introduction.html @@ -0,0 +1,173 @@ + + + + + + +ProGuard Introduction + + + + +

Introduction

+ +ProGuard is a Java class file shrinker, optimizer, obfuscator, and +preverifier. The shrinking step detects and removes unused classes, fields, +methods, and attributes. The optimization step analyzes and optimizes the +bytecode of the methods. The obfuscation step renames the remaining classes, +fields, and methods using short meaningless names. These first steps make the +code base smaller, more efficient, and harder to reverse-engineer. The final +preverification step adds preverification information to the classes, which is +required for Java Micro Edition or which improves the start-up time for Java +6. +

+Each of these steps is optional. For instance, ProGuard can also be used to +just list dead code in an application, or to preverify class files for +efficient use in Java 6. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Input jars
Shrunk code
Optim. codeOutput jars
- shrink →- optimize →- obfuscate →Obfusc. code- preverify →
Library jars------------------------------- (unchanged) -------------------------------→Library jars
+

+ +ProGuard typically reads the input jars (or wars, ears, zips, or +directories). It then shrinks, optimizes, obfuscates, and preverifies them. +Optionally, multiple optimization passes can be performed, each typically +followed by another shrinking step. ProGuard writes the processed results to +one or more output jars (or wars, ears, zips, or directories). The +input may contain resource files, whose names and contents can optionally be +updated to reflect the obfuscated class names. +

+ProGuard requires the library jars (or wars, ears, zips, or +directories) of the input jars to be specified. These are essentially the +libraries that you would need for compiling the code. ProGuard uses them to +reconstruct the class dependencies that are necessary for proper processing. +The library jars themselves always remain unchanged. You should still put them +in the class path of your final application. + +

Entry points

+ +In order to determine which code has to be preserved and which code can be +discarded or obfuscated, you have to specify one or more entry points to +your code. These entry points are typically classes with main methods, applets, +midlets, etc. + +

+The Usage section of this manual describes the +necessary -keep options and +the Examples section provides plenty of examples. + +

Reflection

+ +Reflection and introspection present particular problems for any automatic +processing of code. In ProGuard, classes or class members in your code that +are created or invoked dynamically (that is, by name) have to be specified as +entry points too. For example, Class.forName() constructs may +refer to any class at run-time. It is generally impossible to foresee which +classes have to be preserved (with their original names), since the class +names might be read from a configuration file, for instance. You therefore +have to specify them in your ProGuard configuration, with the same +simple -keep options. +

+However, ProGuard will already detect and handle the following cases for you: + +

+ +The names of the classes and class members may of course be different, but the +constructs should be literally the same for ProGuard to recognize them. The +referenced classes and class members are preserved in the shrinking phase, and +the string arguments are properly updated in the obfuscation phase. +

+Furthermore, ProGuard will offer some suggestions if keeping some classes or +class members appears necessary. For example, ProGuard will note constructs +like "(SomeClass)Class.forName(variable).newInstance()". These +might be an indication that the class or interface SomeClass +and/or its implementations may need to be preserved. You can then adapt your +configuration accordingly. +

+For proper results, you should at least be somewhat familiar with the code +that you are processing. Obfuscating code that performs a lot of reflection +may require trial and error, especially without the necessary information +about the internals of the code. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/limitations.html b/public/proguard/docs/manual/limitations.html new file mode 100644 index 0000000..3b28a30 --- /dev/null +++ b/public/proguard/docs/manual/limitations.html @@ -0,0 +1,69 @@ + + + + + + +ProGuard Limitations + + + + +

Limitations

+ +When using ProGuard, you should be aware of a few technical issues, all of +which are easily avoided or resolved: +

+

+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/optimizations.html b/public/proguard/docs/manual/optimizations.html new file mode 100644 index 0000000..4711f83 --- /dev/null +++ b/public/proguard/docs/manual/optimizations.html @@ -0,0 +1,172 @@ + + + + + + +Optimizations + + + + +

Optimizations

+ +The optimization step of ProGuard can be switched off with the +-dontoptimize option. For +more fine-grained control over individual optimizations, experts can use the +-optimizations option, +with a filter based on the optimization names listed below. The filter works +like any filter in ProGuard. +

+ +The following wildcards are supported: + + + + + + +
?matches any single character in an optimization name.
*matches any part of an optimization name.
+ +An optimization that is preceded by an exclamation mark '!' is +excluded from further attempts to match with subsequent +optimization names in the filter. Make sure to specify filters correctly, +since they are not checked for potential typos. +

+ +For example, +"code/simplification/variable,code/simplification/arithmetic" +only performs the two specified peephole optimizations. +

+ +For example, "!method/propagation/*" performs all optimizations, +except the ones that propagate values between methods. +

+ +For example, +"!code/simplification/advanced,code/simplification/*" only +performs all peephole optimizations. +

+Some optimizations necessarily imply other optimizations. These are then +indicated. Note that the list is likely to change over time, as optimizations +are added and reorganized. +

+ +

+
class/marking/final
+
Marks classes as final, whenever possible.
+ +
class/merging/vertical
+
Merges classes vertically in the class hierarchy, whenever possible.
+ +
class/merging/horizontal
+
Merges classes horizontally in the class hierarchy, whenever possible.
+ +
(⇒ code/removal/advanced)
+ field/removal/writeonly
+
Removes write-only fields.
+ +
field/marking/private
+
Marks fields as private, whenever possible.
+ +
(⇒ code/simplification/advanced)
+ field/propagation/value
+
Propagates the values of fields across methods.
+ +
method/marking/private
+
Marks methods as private, whenever possible (devirtualization).
+ +
(⇒ code/removal/advanced)
+ method/marking/static
+
Marks methods as static, whenever possible (devirtualization).
+ +
method/marking/final
+
Marks methods as final, whenever possible.
+ +
(⇒ code/removal/advanced)
+ method/removal/parameter
+
Removes unused method parameters.
+ +
(⇒ code/simplification/advanced)
+ method/propagation/parameter
+
Propagates the values of method parameters from method invocations to + the invoked methods.
+ +
(⇒ code/simplification/advanced)
+ method/propagation/returnvalue
+
Propagates the values of method return values from methods to their + invocations.
+ +
method/inlining/short
+
Inlines short methods.
+ +
method/inlining/unique
+
Inlines methods that are only called once.
+ +
method/inlining/tailrecursion
+
Simplifies tail recursion calls, whenever possible.
+ +
code/merging
+
Merges identical blocks of code by modifying branch targets.
+ +
code/simplification/variable
+
Performs peephole optimizations for variable loading and storing.
+ +
code/simplification/arithmetic
+
Performs peephole optimizations for arithmetic instructions.
+ +
code/simplification/cast
+
Performs peephole optimizations for casting operations.
+ +
code/simplification/field
+
Performs peephole optimizations for field loading and storing.
+ +
(⇒ code/removal/simple)
+ code/simplification/branch
+
Performs peephole optimizations for branch instructions.
+ +
code/simplification/string
+
Performs peephole optimizations for constant strings.
+ +
(best used with code/removal/advanced)
+ code/simplification/advanced
+
Simplifies code based on control flow analysis and data flow + analysis.
+ +
(⇒ code/removal/exception)
+ code/removal/advanced
+
Removes dead code based on control flow analysis and data flow + analysis.
+ +
(⇒ code/removal/exception)
+ code/removal/simple
+
Removes dead code based on a simple control flow analysis.
+ +
code/removal/variable
+
Removes unused variables from the local variable frame.
+ +
code/removal/exception
+
Removes exceptions with empty try blocks.
+ +
code/allocation/variable
+
Optimizes variable allocation on the local variable frame.
+
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/refcard.html b/public/proguard/docs/manual/refcard.html new file mode 100644 index 0000000..02a8e50 --- /dev/null +++ b/public/proguard/docs/manual/refcard.html @@ -0,0 +1,486 @@ + + + + + + +ProGuard Reference Card + + + + +

ProGuard Reference Card

+ +

Usage

+ +java -jar proguard.jar options ... +

+  Typically: +

+java -jar proguard.jar @myconfig.pro +

+ +

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@filenameShort for '-include filename'.
-include + filenameRead configuration options from the given file.
-basedirectory + directorynameSpecifies the base directory for subsequent relative file names.
-injars + class_pathSpecifies the program jars (or wars, ears, zips, or directories).
-outjars + class_pathSpecifies the name of the output jars (or wars, ears, zips, or + directories).
-libraryjars + class_pathSpecifies the library jars (or wars, ears, zips, or directories).
-skipnonpubliclibraryclassesIgnore non-public library classes.
-dontskipnonpubliclibraryclassesDon't ignore non-public library classes (the default).
-dontskipnonpubliclibraryclassmembersDon't ignore package visible library class members.
-keepdirectories + [directory_filter]Keep the specified directories in the output jars (or wars, ears, zips, or + directories).
-target + versionSet the given version number in the processed classes.
-forceprocessingProcess the input, even if the output seems up to date.
-keep + [,modifier,...] + class_specificationPreserve the specified classes and class members.
-keepclassmembers + [,modifier,...] + class_specificationPreserve the specified class members, if their classes are preserved as + well.
-keepclasseswithmembers + [,modifier,...] + class_specificationPreserve the specified classes and class members, if all of the + specified class members are present.
-keepnames + class_specificationPreserve the names of the specified classes and class members (if + they aren't removed in the shrinking step).
-keepclassmembernames + class_specificationPreserve the names of the specified class members (if they aren't removed + in the shrinking step).
-keepclasseswithmembernames + class_specificationPreserve the names of the specified classes and class members, if + all of the specified class members are present (after the shrinking + step).
-printseeds + [filename]List classes and class members matched by the various -keep + options, to the standard output or to the given file.
-dontshrinkDon't shrink the input class files.
-printusage + [filename]List dead code of the input class files, to the standard output or to the + given file.
-whyareyoukeeping + class_specificationPrint details on why the given classes and class members are being kept in + the shrinking step.
-dontoptimizeDon't optimize the input class files.
-optimizations + optimization_filterThe optimizations to be enabled and disabled.
-optimizationpasses + nThe number of optimization passes to be performed.
-assumenosideeffects + class_specificationAssume that the specified methods don't have any side effects, while + optimizing.
-allowaccessmodificationAllow the access modifiers of classes and class members to be modified, + while optimizing.
-mergeinterfacesaggressivelyAllow any interfaces to be merged, while optimizing.
-dontobfuscateDon't obfuscate the input class files.
-printmapping + [filename]Print the mapping from old names to new names for classes and class members + that have been renamed, to the standard output or to the given file.
-applymapping + filenameReuse the given mapping, for incremental obfuscation.
-obfuscationdictionary + filenameUse the words in the given text file as obfuscated field names and method names.
-classobfuscationdictionary + filenameUse the words in the given text file as obfuscated class names.
-packageobfuscationdictionary + filenameUse the words in the given text file as obfuscated package names.
-overloadaggressivelyApply aggressive overloading while obfuscating.
-useuniqueclassmembernamesEnsure uniform obfuscated class member names for subsequent incremental + obfuscation.
-dontusemixedcaseclassnamesDon't generate mixed-case class names while obfuscating.
-keeppackagenames + [package_filter]Keep the specified package names from being obfuscated.
-flattenpackagehierarchy + [package_name]Repackage all packages that are renamed into the single given parent + package.
-repackageclasses + [package_name]Repackage all class files that are renamed into the single given + package.
-keepattributes + [attribute_filter]Preserve the given optional attributes; typically + Exceptions, InnerClasses, + Signature, Deprecated, + SourceFile, SourceDir, + LineNumberTable, + LocalVariableTable, LocalVariableTypeTable, + Synthetic, EnclosingMethod, and + *Annotation*.
-keepparameternamesKeep the parameter names and types of methods that are kept.
-renamesourcefileattribute + [string]Put the given constant string in the SourceFile + attributes.
-adaptclassstrings + [class_filter]Adapt string constants in the specified classes, based on the obfuscated + names of any corresponding classes.
-adaptresourcefilenames + [file_filter]Rename the specified resource files, based on the obfuscated names of the + corresponding class files.
-adaptresourcefilecontents + [file_filter]Update the contents of the specified resource files, based on the + obfuscated names of the processed classes.
-dontpreverifyDon't preverify the processed class files.
-microeditionTarget the processed class files at Java Micro Edition.
-verboseWrite out some more information during processing.
-dontnote + [class_filter]Don't print notes about potential mistakes or omissions in the + configuration.
-dontwarn + [class_filter]Don't warn about unresolved references at all.
-ignorewarningsPrint warnings about unresolved references, but continue processing + anyhow.
-printconfiguration + [filename]Write out the internal structure of the processed class files, to the + standard output or to the given file.
-dump + [filename]Write out the entire configuration in traditional ProGuard style, to the + standard output or to the given file.
+

+Notes: +

+

+ +

Overview of Keep Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeepFrom being removed or renamedFrom being renamed
Classes and class members-keep-keepnames
Class members only-keepclassmembers-keepclassmembernames
Classes and class members, if class members present-keepclasseswithmembers-keepclasseswithmembernames
+

+ +

Keep Option Modifiers

+ + + + + + + + + + + + + + + + + + +
allowshrinkingThe entry points specified in the keep tag may be shrunk.
allowoptimizationThe entry points specified in the keep tag may be optimized.
allowobfuscationThe entry points specified in the keep tag may be obfuscated.
+

+ +

Class Specifications

+ +
+[@annotationtype] [[!]public|final|abstract ...] [!]interface|class classname
+    [extends|implements [@annotationtype] classname]
+[{
+    [@annotationtype] [[!]public|private|protected|static|volatile|transient ...] <fields> |
+                                                                      (fieldtype fieldname);
+    [@annotationtype] [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] <methods> |
+                                                                                           <init>(argumenttype,...) |
+                                                                                           classname(argumenttype,...) |
+                                                                                           (returntype methodname(argumenttype,...));
+    [@annotationtype] [[!]public|private|protected|static ... ] *;
+    ...
+}]
+
+

+Notes: +

+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/retrace/examples.html b/public/proguard/docs/manual/retrace/examples.html new file mode 100644 index 0000000..c372491 --- /dev/null +++ b/public/proguard/docs/manual/retrace/examples.html @@ -0,0 +1,345 @@ + + + + + + +ReTrace Examples + + + + +

Examples

+ +Some typical example uses: +
    +
  1. Restoring a stack trace with line numbers
  2. +
  3. Restoring a stack trace with line numbers + (verbose)
  4. +
  5. Restoring a stack trace without line numbers
  6. +
+ +

Restoring a stack trace with line numbers

+ +Assume for instance ProGuard itself has been obfuscated using the following +extra options: +
+-printmapping proguard.map
+
+-renamesourcefileattribute ProGuard
+-keepattributes SourceFile,LineNumberTable
+
+

+ +Now assume the processed application throws an exception, and we have saved the +stack trace in proguard.trace, shown below. Of course, in real +life ProGuard rarely throws exceptions, so this is a purposely generated +exception. :) + +

+Exception in thread "main" java.lang.Error: Random exception
+        at pro.bY.a(ProGuard:576)
+        at pro.bO.a(ProGuard:431)
+        at pro.bj.a(ProGuard:145)
+        at pro.bY.a(ProGuard:522)
+        at pro.bj.a(ProGuard:129)
+        at pro.bN.a(ProGuard:125)
+        at pro.bY.a(ProGuard:251)
+        at pro.bY.a(ProGuard:229)
+        at pro.l.a(ProGuard:55)
+        at pro.bo.b(ProGuard:405)
+        at pro.ci.a(ProGuard:51)
+        at pro.bo.a(ProGuard:356)
+        at pro.be.a(ProGuard:109)
+        at pro.bo.a(ProGuard:356)
+        at pro.be.a(ProGuard:186)
+        at pro.bg.a(ProGuard:369)
+        at pro.bY.a(ProGuard:286)
+        at pro.bh.a(ProGuard:55)
+        at pro.bg.b(ProGuard:408)
+        at pro.bY.a(ProGuard:190)
+        at pro.bg.a(ProGuard:369)
+        at pro.M.a(ProGuard:110)
+        at pro.bY.a(ProGuard:449)
+        at pro.M.a(ProGuard:99)
+        at pro.bo.a(ProGuard:372)
+        at pro.bY.a(ProGuard:649)
+        at pro.bY.a(ProGuard:112)
+        at pro.P.a(ProGuard:66)
+        at pro.p.a(ProGuard:83)
+        at pro.bU.a(ProGuard:69)
+        at pro.bo.a(ProGuard:356)
+        at pro.J.a(ProGuard:149)
+        at pro.I.a(ProGuard:49)
+        at pro.J.a(ProGuard:105)
+        at pro.cf.c(ProGuard:370)
+        at pro.cf.a(ProGuard:317)
+        at pro.bc.a(ProGuard:55)
+        at proguard.ProGuard.a(ProGuard:363)
+        at proguard.ProGuard.c(ProGuard:187)
+        at proguard.ProGuard.b(ProGuard:385)
+        at proguard.ProGuard.main(ProGuard:429)
+
+

+ +We can then use the following command to recover the stack trace: +

+java -jar retrace.jar proguard.map proguard.trace
+
+

+ +The output will look as follows: +

+Exception in thread "main" java.lang.Error: Random exception
+        at proguard.shrink.UsageMarker.visitInstruction(ProGuard:576)
+        at proguard.classfile.instruction.GenericInstruction.accept(ProGuard:431)
+        at proguard.classfile.CodeAttrInfo.instructionsAccept(ProGuard:145)
+        at proguard.shrink.UsageMarker.visitCodeAttrInfo(ProGuard:522)
+        at proguard.classfile.CodeAttrInfo.accept(ProGuard:129)
+        at proguard.classfile.ProgramMemberInfo.attributesAccept(ProGuard:125)
+        at proguard.shrink.UsageMarker.visitMemberInfo(ProGuard:251)
+        at proguard.shrink.UsageMarker.visitProgramMethodInfo(ProGuard:229)
+        at proguard.classfile.ProgramMethodInfo.accept(ProGuard:55)
+        at proguard.classfile.ProgramClassFile.methodAccept(ProGuard:405)
+        at proguard.classfile.visitor.NamedMethodVisitor.visitProgramClassFile(ProGuard:51)
+        at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
+        at proguard.classfile.visitor.ClassFileUpDownTraveler.visitProgramClassFile(ProGuard:109)
+        at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
+        at proguard.classfile.visitor.ClassFileUpDownTraveler.visitLibraryClassFile(ProGuard:186)
+        at proguard.classfile.LibraryClassFile.accept(ProGuard:369)
+        at proguard.shrink.UsageMarker.visitLibraryMethodInfo(ProGuard:286)
+        at proguard.classfile.LibraryMethodInfo.accept(ProGuard:55)
+        at proguard.classfile.LibraryClassFile.methodsAccept(ProGuard:408)
+        at proguard.shrink.UsageMarker.visitLibraryClassFile(ProGuard:190)
+        at proguard.classfile.LibraryClassFile.accept(ProGuard:369)
+        at proguard.classfile.ClassCpInfo.referencedClassAccept(ProGuard:110)
+        at proguard.shrink.UsageMarker.visitClassCpInfo(ProGuard:449)
+        at proguard.classfile.ClassCpInfo.accept(ProGuard:99)
+        at proguard.classfile.ProgramClassFile.constantPoolEntryAccept(ProGuard:372)
+        at proguard.shrink.UsageMarker.markCpEntry(ProGuard:649)
+        at proguard.shrink.UsageMarker.visitProgramClassFile(ProGuard:112)
+        at proguard.classfile.visitor.VariableClassFileVisitor.visitProgramClassFile(ProGuard:66)
+        at proguard.classfile.visitor.MultiClassFileVisitor.visitProgramClassFile(ProGuard:83)
+        at proguard.classfile.visitor.FilteredClassFileVisitor.visitProgramClassFile(ProGuard:69)
+        at proguard.classfile.ProgramClassFile.accept(ProGuard:356)
+        at proguard.classfile.ClassPool.classFileAccept(ProGuard:149)
+        at proguard.classfile.visitor.NamedClassFileVisitor.visitClassPool(ProGuard:49)
+        at proguard.classfile.ClassPool.accept(ProGuard:105)
+        at proguard.KeepCommand.executeShrinkingPhase(ProGuard:370)
+        at proguard.KeepCommand.execute(ProGuard:317)
+        at proguard.CompoundCommand.execute(ProGuard:55)
+        at proguard.ProGuard.executeCommands(ProGuard:363)
+        at proguard.ProGuard.shrink(ProGuard:187)
+        at proguard.ProGuard.execute(ProGuard:385)
+        at proguard.ProGuard.main(ProGuard:429)
+
+ +

Restoring a stack trace with line numbers (verbose)

+ +In the previous example, we could also use the verbose flag: +
+java -jar retrace.jar -verbose proguard.map proguard.trace
+
+

+ +The output will then look as follows: +

+Exception in thread "main" java.lang.Error: Random exception
+        at proguard.shrink.UsageMarker.void visitInstruction(proguard.classfile.ClassFile,proguard.classfile.instruction.Instruction)(ProGuard:576)
+        at proguard.classfile.instruction.GenericInstruction.void accept(proguard.classfile.ClassFile,proguard.classfile.instruction.InstructionVisitor)(ProGuard:431)
+        at proguard.classfile.CodeAttrInfo.void instructionsAccept(proguard.classfile.ClassFile,proguard.classfile.instruction.InstructionVisitor)(ProGuard:145)
+        at proguard.shrink.UsageMarker.void visitCodeAttrInfo(proguard.classfile.ClassFile,proguard.classfile.CodeAttrInfo)(ProGuard:522)
+        at proguard.classfile.CodeAttrInfo.void accept(proguard.classfile.ClassFile,proguard.classfile.visitor.AttrInfoVisitor)(ProGuard:129)
+        at proguard.classfile.ProgramMemberInfo.void attributesAccept(proguard.classfile.ProgramClassFile,proguard.classfile.visitor.AttrInfoVisitor)(ProGuard:125)
+        at proguard.shrink.UsageMarker.void visitMemberInfo(proguard.classfile.ProgramClassFile,proguard.classfile.ProgramMemberInfo)(ProGuard:251)
+        at proguard.shrink.UsageMarker.void visitProgramMethodInfo(proguard.classfile.ProgramClassFile,proguard.classfile.ProgramMethodInfo)(ProGuard:229)
+        at proguard.classfile.ProgramMethodInfo.void accept(proguard.classfile.ProgramClassFile,proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:55)
+        at proguard.classfile.ProgramClassFile.void methodAccept(proguard.classfile.visitor.MemberInfoVisitor,java.lang.String,java.lang.String)(ProGuard:405)
+        at proguard.classfile.visitor.NamedMethodVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:51)
+        at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
+        at proguard.classfile.visitor.ClassFileUpDownTraveler.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:109)
+        at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
+        at proguard.classfile.visitor.ClassFileUpDownTraveler.void visitLibraryClassFile(proguard.classfile.LibraryClassFile)(ProGuard:186)
+        at proguard.classfile.LibraryClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:369)
+        at proguard.shrink.UsageMarker.void visitLibraryMethodInfo(proguard.classfile.LibraryClassFile,proguard.classfile.LibraryMethodInfo)(ProGuard:286)
+        at proguard.classfile.LibraryMethodInfo.void accept(proguard.classfile.LibraryClassFile,proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:55)
+        at proguard.classfile.LibraryClassFile.void methodsAccept(proguard.classfile.visitor.MemberInfoVisitor)(ProGuard:408)
+        at proguard.shrink.UsageMarker.void visitLibraryClassFile(proguard.classfile.LibraryClassFile)(ProGuard:190)
+        at proguard.classfile.LibraryClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:369)
+        at proguard.classfile.ClassCpInfo.void referencedClassAccept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:110)
+        at proguard.shrink.UsageMarker.void visitClassCpInfo(proguard.classfile.ClassFile,proguard.classfile.ClassCpInfo)(ProGuard:449)
+        at proguard.classfile.ClassCpInfo.void accept(proguard.classfile.ClassFile,proguard.classfile.visitor.CpInfoVisitor)(ProGuard:99)
+        at proguard.classfile.ProgramClassFile.void constantPoolEntryAccept(proguard.classfile.visitor.CpInfoVisitor,int)(ProGuard:372)
+        at proguard.shrink.UsageMarker.void markCpEntry(proguard.classfile.ClassFile,int)(ProGuard:649)
+        at proguard.shrink.UsageMarker.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:112)
+        at proguard.classfile.visitor.VariableClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:66)
+        at proguard.classfile.visitor.MultiClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:83)
+        at proguard.classfile.visitor.FilteredClassFileVisitor.void visitProgramClassFile(proguard.classfile.ProgramClassFile)(ProGuard:69)
+        at proguard.classfile.ProgramClassFile.void accept(proguard.classfile.visitor.ClassFileVisitor)(ProGuard:356)
+        at proguard.classfile.ClassPool.void classFileAccept(proguard.classfile.visitor.ClassFileVisitor,java.lang.String)(ProGuard:149)
+        at proguard.classfile.visitor.NamedClassFileVisitor.void visitClassPool(proguard.classfile.ClassPool)(ProGuard:49)
+        at proguard.classfile.ClassPool.void accept(proguard.classfile.visitor.ClassPoolVisitor)(ProGuard:105)
+        at proguard.KeepCommand.void executeShrinkingPhase(proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:370)
+        at proguard.KeepCommand.void execute(int,proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:317)
+        at proguard.CompoundCommand.void execute(int,proguard.classfile.ClassPool,proguard.classfile.ClassPool)(ProGuard:55)
+        at proguard.ProGuard.void executeCommands(int)(ProGuard:363)
+        at proguard.ProGuard.void shrink()(ProGuard:187)
+        at proguard.ProGuard.void execute(java.lang.String[])(ProGuard:385)
+        at proguard.ProGuard.void main(java.lang.String[])(ProGuard:429)
+
+ + +

Restoring a stack trace without line numbers

+ +Assume for instance ProGuard itself has been obfuscated using the following +extra options, this time without preserving the line number tables: +
+-printmapping proguard.map
+
+

+ +A stack trace proguard.trace will then lack line number +information: +

+Exception in thread "main" java.lang.Error: Random exception
+        at pro.bY.a(Unknown Source)
+        at pro.bO.a(Unknown Source)
+        at pro.bj.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.bj.a(Unknown Source)
+        at pro.bN.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.l.a(Unknown Source)
+        at pro.bo.b(Unknown Source)
+        at pro.ci.a(Unknown Source)
+        at pro.bo.a(Unknown Source)
+        at pro.be.a(Unknown Source)
+        at pro.bo.a(Unknown Source)
+        at pro.be.a(Unknown Source)
+        at pro.bg.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.bh.a(Unknown Source)
+        at pro.bg.b(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.bg.a(Unknown Source)
+        at pro.M.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.M.a(Unknown Source)
+        at pro.bo.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.bY.a(Unknown Source)
+        at pro.P.a(Unknown Source)
+        at pro.p.a(Unknown Source)
+        at pro.bU.a(Unknown Source)
+        at pro.bo.a(Unknown Source)
+        at pro.J.a(Unknown Source)
+        at pro.I.a(Unknown Source)
+        at pro.J.a(Unknown Source)
+        at pro.cf.c(Unknown Source)
+        at pro.cf.a(Unknown Source)
+        at pro.bc.a(Unknown Source)
+        at proguard.ProGuard.a(Unknown Source)
+        at proguard.ProGuard.c(Unknown Source)
+        at proguard.ProGuard.b(Unknown Source)
+        at proguard.ProGuard.main(Unknown Source)
+
+

+ +We can still use the same command to recover the stack trace: +

+java -jar retrace.jar proguard.map proguard.trace
+
+

+ +The output will now give a list of alternative original method names for each +ambiguous obfuscated method name: +

+Exception in thread "main" java.lang.Error: Random exception
+        at proguard.shrink.UsageMarker.visitProgramClassFile(Unknown Source)
+                                       visitLibraryClassFile
+                                       visitProgramFieldInfo
+                                       visitProgramMethodInfo
+                                       visitMemberInfo
+                                       visitLibraryFieldInfo
+                                       visitLibraryMethodInfo
+                                       visitIntegerCpInfo
+                                       visitLongCpInfo
+                                       visitFloatCpInfo
+                                       visitDoubleCpInfo
+                                       visitStringCpInfo
+                                       visitUtf8CpInfo
+                                       visitFieldrefCpInfo
+                                       visitInterfaceMethodrefCpInfo
+                                       visitMethodrefCpInfo
+                                       visitClassCpInfo
+                                       visitNameAndTypeCpInfo
+                                       visitUnknownAttrInfo
+                                       visitInnerClassesAttrInfo
+                                       visitConstantValueAttrInfo
+                                       visitExceptionsAttrInfo
+                                       visitCodeAttrInfo
+                                       visitLineNumberTableAttrInfo
+                                       visitLocalVariableTableAttrInfo
+                                       visitSourceFileAttrInfo
+                                       visitDeprecatedAttrInfo
+                                       visitSyntheticAttrInfo
+                                       visitInstruction
+                                       visitCpInstruction
+                                       visitExceptionInfo
+                                       visitInnerClassesInfo
+                                       visitLocalVariableInfo
+                                       markCpEntry
+                                       markAsUnused
+                                       isUsed
+        at proguard.classfile.instruction.GenericInstruction.create(Unknown Source)
+                                                             isWide
+                                                             getLength
+                                                             accept
+        at proguard.classfile.CodeAttrInfo.getAttribute(Unknown Source)
+                                           getAttrInfoLength
+                                           readInfo
+                                           accept
+                                           instructionsAccept
+                                           exceptionsAccept
+        [...]
+        at proguard.KeepCommand.executeShrinkingPhase(Unknown Source)
+                                access$100
+        at proguard.KeepCommand.keepField(Unknown Source)
+                                ensureMultiClassFileVisitorForMembers
+                                execute
+                                executeObfuscationPhase
+                                access$002
+                                access$000
+                                access$102
+                                access$108
+        at proguard.CompoundCommand.addCommand(Unknown Source)
+                                    execute
+        at proguard.ProGuard.readCommands(Unknown Source)
+                             obfuscate
+                             executeCommands
+        at proguard.ProGuard.shrink(Unknown Source)
+        at proguard.ProGuard.check(Unknown Source)
+                             execute
+        at proguard.ProGuard.main(Unknown Source)
+
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/manual/retrace/index.html b/public/proguard/docs/manual/retrace/index.html new file mode 100644 index 0000000..7c45c28 --- /dev/null +++ b/public/proguard/docs/manual/retrace/index.html @@ -0,0 +1,37 @@ + + + + + + +ReTrace Manual + + + + +

ReTrace

+ +
    +
  1. Introduction
  2. +
  3. Usage
  4. +
  5. Examples
  6. +
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/retrace/introduction.html b/public/proguard/docs/manual/retrace/introduction.html new file mode 100644 index 0000000..f6b6a07 --- /dev/null +++ b/public/proguard/docs/manual/retrace/introduction.html @@ -0,0 +1,79 @@ + + + + + + +ReTrace Introduction + + + + +

Introduction

+ +ReTrace is a companion tool for ProGuard that 'de-obfuscates' +stack traces. +

+When an obfuscated program throws an exception, the resulting stack trace +typically isn't very informative. Class names and method names have been +replaced by short meaningless strings. Source file names and line numbers are +missing altogether. While this may be intentional, it can also be inconvenient +when debugging problems. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Original code- ProGuardObfuscated code
Mapping file
Readable stack traceReTrace -Obfuscated stack trace
+

+ReTrace can read an obfuscated stack trace and restore it to what it would +look like without obfuscation. The restoration is based on the mapping file +that ProGuard can write out during obfuscation. The mapping file links the +original class names and class member names to their obfuscated names. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/manual/retrace/usage.html b/public/proguard/docs/manual/retrace/usage.html new file mode 100644 index 0000000..a227635 --- /dev/null +++ b/public/proguard/docs/manual/retrace/usage.html @@ -0,0 +1,127 @@ + + + + + + +ReTrace Usage + + + + +

Usage

+ +You can find the ReTrace jar in the lib directory of the +ProGuard distribution. To run ReTrace, just type: +

+

+java -jar retrace.jar [options...] + mapping_file [stacktrace_file] +

+These are the arguments: + +
+
mapping_file
+ +
Specifies the name of the mapping file, produced by ProGuard with the + option + "-printmapping mapping_file", + while obfuscating the application that produced the stack trace.
+ +
stacktrace_file
+ +
Optionally specifies the name of the file containing the stack trace. If + no file is specified, a stack trace is read from the standard input. Blank + lines and unrecognized lines are ignored, as far as possible.
+
+ +The following options are supported: +
+
-verbose
+ +
Specifies to print out more informative stack traces that include not only + method names, but also method return types and arguments.
+ +
-regex regular_expression
+ +
Specifies the regular expression that is used to parse the lines in the + stack trace. Specifying a different regular expression allows to + de-obfuscate more general types of input than just stack traces. The + default is suitable for stack traces produced by most JVMs: +
+    (?:\s*%c:.*)|(?:\s*at\s+%c.%m\s*\(.*?(?::%l)?\)\s*)
+    
+ The regular expression is a Java regular expression (cfr. the documentation + of java.util.regex.Pattern), with a few additional wildcards: + + + + + + + + + + + + + + + +
%cmatches a class name (e.g. + "myapplication.MyClass").
%Cmatches a class name with slashes (e.g. + "myapplication/MyClass").
%tmatches a field type or method return type (e.g. + "myapplication.MyClass[]").
%fmatches a field name (e.g. + "myField").
%mmatches a method name (e.g. + "myMethod").
%amatches a list of method arguments (e.g. + "boolean,int").
%lmatches a line number inside a method (e.g. + "123").
+ Elements that match these wildcards are de-obfuscated, when possible. Note + that regular expressions must not contain any capturing groups. Use + non-capturing groups instead: (?:...) +
+
+ +The restored stack trace is printed to the standard output. The completeness +of the restored stack trace depends on the presence of line number tables in +the obfuscated class files: + + +

+ +Preserving line number tables is explained in detail in this example in the ProGuard User Manual. +

+ +Unobfuscated elements and obfuscated elements for which no mapping is available +will be left unchanged. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/manual/sections.html b/public/proguard/docs/manual/sections.html new file mode 100644 index 0000000..fb72573 --- /dev/null +++ b/public/proguard/docs/manual/sections.html @@ -0,0 +1,60 @@ + + + + + + + +Sections + + + + + +

+

+With support of +

+ + + + + + + + +

+ +Saikoa +

+ + + diff --git a/public/proguard/docs/manual/style.css b/public/proguard/docs/manual/style.css new file mode 100644 index 0000000..9a876aa --- /dev/null +++ b/public/proguard/docs/manual/style.css @@ -0,0 +1,105 @@ +@charset "iso-8859-1"; + +/* Global settings. */ + +body { + background: #FFFFFF; +} + +h1 { + text-align: center; +} + +h2 { + background: #EEEEFF; + padding: 10px; +} + +dt { + padding: 6px; +} + +dt div +{ + color: grey; + float: right; +} + +dd { + padding: 6px; +} + +pre { + padding: 10px; + background: #E0E0E0; +} + +ul.spacious li +{ + padding: 8px; +} + +a +{ + text-decoration: none; +} + +a.button { + color: #000000; + text-decoration: none; + background: #E0E0E0; + border: 1px outset #FFFFFF; + float: right; +} + +/* Settings for variable width code. */ + +p.code { + padding: 10px; + background: #E0E0E0; +} + + +/* Settings for diagrams. */ + +table.diagram { + padding: 8px; + border: none; + border-spacing: 2px; +} + +td.transparentblock { + text-align: center; + padding: 10px 0px; +} + +td.whiteblock { + width: 100px; + text-align: center; + border: 1px solid #C0C0C0; + background: #E0E0E0; + padding: 10px 0px; +} + +td.lightblock { + width: 100px; + text-align: center; + border: 1px solid #8888FF; + background: #BBBBFF; + padding: 20px 0px; +} + +td.darkblock { + width: 100px; + text-align: center; + background: #8888FF; + padding: 20px 0px; +} + +/* Settings for buttons. */ + +td.button { + background: #E0E0E0; + border: 1px outset #FFFFFF; + font-weight: bold; +} diff --git a/public/proguard/docs/manual/troubleshooting.html b/public/proguard/docs/manual/troubleshooting.html new file mode 100644 index 0000000..6b0c1a9 --- /dev/null +++ b/public/proguard/docs/manual/troubleshooting.html @@ -0,0 +1,729 @@ + + + + + + +ProGuard Troubleshooting + + + + +

Troubleshooting

+ +While preparing a configuration for processing your code, you may bump into a +few problems. The following sections discuss some common issues and solutions: + +

Problems while processing

+ + +

Unexpected observations after processing

+ + +

Problems while converting to Android Dalvik bytecode

+ + + +

Problems while preverifying for Java Micro Edition

+ + + +

Problems at run-time

+ + + +

Problems while processing

+ +ProGuard may print out some notes and non-fatal warnings: + +
+
Note: can't find dynamically referenced class
+ +
ProGuard can't find a class or interface that your code is accessing by + means of introspection. You should check if you want to add the jar that + contains this class.
+ +
Note: ... calls '(...)Class.forName(variable).newInstance()'
+ +
ProGuard lists all class casts of dynamically created class instances, + like "(MyClass)Class.forName(variable).newInstance()". + Depending on your application, you may need to keep the mentioned classes + with an option like "-keep class MyClass", or their + implementations with an option like "-keep class * implements + MyClass". You can switch off these notes by specifying the + -dontnote option.
+ +
Note: ... accesses a field/method '...' dynamically
+ +
ProGuard lists a number of constructs like + ".getField("myField")". Depending on your application, you + may need to figure out where the mentioned class members are defined and + keep them with an option like "-keep class MyClass { MyFieldType + myField; }". Otherwise, ProGuard might remove or obfuscate the + class members, since it can't know which ones they are exactly. It does + list possible candidates, for your information. You can switch off these + notes by specifying the -dontnote option.
+ +
Note: the configuration keeps the entry point '...', but not the descriptor class '...'
+ +
Your configuration contains a -keep option to preserve the + given method (or field), but no -keep option for the given + class that is an argument type or return type in the method's descriptor. + You may then want to keep the class too. Otherwise, ProGuard will + obfuscate its name, thus changing the method's signature. The method might + then become unfindable as an entry point, e.g. if it is part of a public + API. You can switch off these notes by specifying the -dontnote option.
+ +
Note: the configuration doesn't specify which class members to keep for class '...'
+ +
Your configuration contains + a -keepclassmembers/-keepclasseswithmembers option to + preserve fields or methods in the given class, but it doesn't specify + which fields or methods. This way, the option simply won't have any + effect. You probably want to specify one or more fields or methods, as + usual between curly braces. You can specify all fields or methods with a + wildcard "*;". You can switch off these notes by specifying + the -dontnote option.
+ +
Note: duplicate definition of program/library class
+ +
Your program jars or library jars contain multiple definitions of the + listed classes. ProGuard continues processing as usual, only considering + the first definitions. The warning may be an indication of some problem + though, so it's advisable to remove the duplicates. A convenient way to do + so is by specifying filters on the input jars or library jars. You can + switch off these notes by specifying the -dontnote option.
+ +
Warning: can't write resource ... Duplicate zip entry
+ +
Your input jars contain multiple resource files with the same name. + ProGuard continues copying the resource files as usual, skipping any files + with previously used names. Once more, the warning may be an indication of + some problem though, so it's advisable to remove the duplicates. A + convenient way to do so is by specifying filters on the input jars. There + is no option to switch off these warnings.
+ +
+

+ +ProGuard may terminate when it encounters parsing errors or I/O errors, or +some more serious warnings: + +

+
Warning: can't find superclass or interface
Warning: can't find referenced class
+ +
If there are unresolved references to classes or interfaces, you most + likely forgot to specify an essential library. For proper processing, all + libraries that are referenced by your code must be specified, including + the Java run-time library. For specifying libraries, use + the -libraryjars option. +

+ For example, if ProGuard complains that it can't find a + javax.crypto class, you probably still have to specify + jce.jar, next to the more common rt.jar. +

+ If you're missing a library and you're absolutely sure it isn't used + anyway, you can try your luck with the -ignorewarnings option, + or even the -dontwarn + option. Only use these options if you really know what you're doing + though. +

+ For example, if you're developing for Android, and ProGuard complains that + it can't find a java.awt class, then some library that you + are using is referring to java.awt. This is a bit shady, since + Android doesn't have this package at all, but if your application works + anyway, you can let ProGuard accept it with "-dontwarn + java.awt.**".

+ +
Error: Can't find any super classes of ... (not even immediate super class ...)
Error: Can't find common super class of ... and ...
+ +
It seems like you tried to avoid the warnings from the previous paragraph + by specifying + -ignorewarnings + or -dontwarn, but it didn't + work out. ProGuard's optimization step and preverification step really + need the missing classes to make sense of the code. Preferably, you would + solve the problem by adding the missing library, as discussed. If you're + sure the class that references the missing class isn't used either, you + could also try filtering it out from the input, by adding a filter to the + corresponding -injars option: + "-injars + myapplication.jar(!somepackage/SomeUnusedClass.class)". Hopefully, + you can access the configuration of your build process for such a + modification. As a final solution, you could switch off optimization + (-dontoptimize) and + preverification + (-dontpreverify).
+ +
Warning: can't find referenced field/method
+ +
If there are unresolved references to class members in input classes, your + class files are most likely inconsistent. Possibly, some class file didn't + get recompiled properly, or some class file was left behind after its + source file was removed. Try removing all class files, recompiling them, + zipping them up, and running ProGuard again. +

+ If your program classes reside in the same packages as library classes, + and refer to their package visible class members, then you should also + specify the + -dontskipnonpubliclibraryclassmembers + option.

+ +
Warning: can't find enclosing class/method
+ +
If there are unresolved references to classes that are defined inside + methods in your input, once more, your class files are most likely + inconsistent. Possibly, some class file didn't get recompiled properly, or + some class file was left behind after its source file was removed. Try + removing all class files, recompiling them, zipping them up, and running + ProGuard again.
+ +
Warning: library class ... depends on program class ...
+ +
If any of your library classes depend on your program classes, by + extending, implementing or just referencing them, your processed code will + generally be unusable. Program classes can depend on library classes, but + not the other way around. Program classes are processed, while library + classes always remain unchanged. It is therefore impossible to adapt + references from library classes to program classes, for instance if the + program classes are renamed. You should define a clean separation between + program code (specified with -injars) and library code + (specified with -libraryjars), and try + again.
+ +
Warning: class file ... unexpectedly contains class ...
+ +
The given class file contains a definition for the given class, but the + directory name of the file doesn't correspond to the package name of the + class. ProGuard will accept the class definition, but the current + implementation will not write out the processed version. Please make sure + your input classes are packaged correctly. Notably, class files that are + in the WEB-INF/classes directory in a war should be packaged + in a jar and put in the WEB-INF/lib directory. If you don't + mind these classes not being written to the output, you can specify the -ignorewarnings option, + or even the -dontwarn + option.
+ +
Warning: ... is not being kept as ..., but remapped to ...
+ +
There is a conflict between a -keep option in the + configuration, and the mapping file, in the obfuscation step. The given + class name or class member name can't be kept by its original name, as + specified in the configuration, but it has to be mapped to the other given + name, as specified in the mapping file. You should adapt your + configuration or your mapping file to remove the conflict. Alternatively, + if you're sure the renaming won't hurt, you can specify the -ignorewarnings option, + or even the -dontwarn + option.
+ +
Warning: field/method ... can't be mapped to ...
+ +
There is a conflict between some new program code and the mapping file, in + the obfuscation step. The given class member can't be mapped to the given + name, because it would conflict with another class member that is already + being mapped to the same name. This can happen if you are performing + incremental obfuscation, applying an obfuscation mapping file from an + initial obfuscation step. For instance, some new class may have been added + that extends two existing classes, introducing a conflict in the name + space of its class members. If you're sure the class member receiving + another name than the one specified won't hurt, you can specify the -ignorewarnings option, + or even the -dontwarn + option. Note that you should always use the -useuniqueclassmembernames + option in the initial obfuscation step, in order to reduce the risk of + conflicts.
+ +
Error: Unsupported class version number
+ +
You are trying to process class files compiled for a recent version of + Java that your copy of ProGuard doesn't support yet. You should check if + there is a more recent release + on-line.
+ +
Error: You have to specify '-keep' options
+ +
You either forgot to specify -keep options, or you mistyped the + class names. ProGuard has to know exactly what you want to keep: an + application, an applet, a servlet, a midlet,..., or any combination of + these. Without the proper seed specifications, ProGuard would shrink, + optimize, or obfuscate all class files away.
+ +
Error: Expecting class path separator ';' before 'Files\Java\...' (in Windows)
+ +
If the path of your run-time jar contains spaces, like in "Program Files", + you have to enclose it with single or double quotes, as explained in the + section on file names. This is actually + true for all file names containing special characters, on all + platforms.
+ +
Error: Can't read [.../lib/rt.jar] (No such file or directory) (in MacOS X)
+ +
In MacOS X, the run-time classes may be in a different place than on most + other platforms. You'll then have to adapt your configuration, replacing + the path <java.home>/lib/rt.jar by + <java.home>/../Classes/classes.jar.
+ +
Internal problem starting the ProGuard GUI (Cannot write XdndAware property) (in Linux)
+ +
In Linux, at least with Java 6, the GUI may not start properly, due to + Sun + Bug #7027598. The work-around at this time is to specify the JVM + option -DsuppressSwingDropSupport=true when running the + GUI.
+ +
+ +
+

+ +Should ProGuard crash while processing your application: + +

+
OutOfMemoryError
+ +
You can try increasing the heap size of the Java virtual machine (with the + usual -Xms and -Xmx options). You can also + reduce the amount of memory that ProGuard needs by removing unnecessary + library jars from your configuration, or by filtering out unused library + packages and classes. Remember that only classes or interfaces that are + extended or implemented by classes in your input jars are required.
+ +
StackOverflowError
+ +
This error might occur when processing a large code base on Windows + (surprisingly, not so easily on Linux). In theory, increasing the stack + size of the Java virtual machine (with the usual -Xss option) + should help too. In practice however, the -Xss setting + doesn't have any effect on the main thread, due to Sun Bug + #4362291. As a result, this solution will only work when running + ProGuard in a different thread, e.g. from its GUI.
+ +
Unexpected error
+ +
ProGuard has encountered an unexpected condition, typically in the + optimization step. It may or may not recover. You should be able to avoid + it using the -dontoptimize option. In + any case, please report the problem, preferably with the simplest example + that causes ProGuard to crash.
+ +
Otherwise...
+ +
Maybe your class files are corrupt. See if recompiling them and trying + again helps. If not, please report the problem, preferably with the + simplest example that causes ProGuard to crash.
+ +
+

+ +

Unexpected observations after processing

+ +If ProGuard seems to run fine, but your processed code doesn't look right, +there might be a couple of reasons: + +
+
Disappearing classes
+ +
If you are working on Windows and it looks like some classes have + disappeared from your output, you should make sure you're not writing your + output class files to a directory (or unpacking the output jar). On + platforms with case-insensitive file systems, such as Windows, unpacking + tools often let class files with similar lower-case and upper-case names + overwrite each other. If you really can't switch to a different operating + system, you could consider using ProGuard's -dontusemixedcaseclassnames + option. +

+ Also, you should make sure your class files are in directories that + correspond to their package names. ProGuard will read misplaced class + files, but it will currently not write their processed versions. Notably, + class files that are in the WEB-INF/classes directory in a + war should be packaged in a jar and put in the WEB-INF/lib + directory.

+ +
Classes or class members not being kept
+ +
If ProGuard is not keeping the right classes or class members, make sure + you are using fully qualified class names. If the package name of some + class is missing, ProGuard won't match the elements that you might be + expecting. It may help to double-check for typos too. You can use the -printseeds option to see + which elements are being kept exactly. +

+ If you are using marker interfaces to keep other classes, the marker + interfaces themselves are probably being removed in the shrinking step. + You should therefore always explicitly keep any marker interfaces, with + an option like "-keep interface MyMarkerInterface". +

+ Similarly, if you are keeping classes based on annotations, you may have to + avoid that the annotation classes themselves are removed in the shrinking + step. You can explicitly keep all annotation classes in your program code + with an option like "-keep @interface *".

+ +
Variable names not being obfuscated
+ +
If the names of the local variables and parameters in your obfuscated code + don't look obfuscated, because they suspiciously resemble the names of + their types, it's probably because the decompiler that you are using is + coming up with those names. ProGuard's obfuscation step does remove the + original names entirely, unless you explicitly keep the + LocalVariableTable or LocalVariableTypeTable + attributes.
+ +
+ +

Problems while converting to Android Dalvik bytecode

+ +If ProGuard seems to run fine, but the dx tool in the Android SDK subsequently +fails with an error: + +
+
SimException: local variable type mismatch
+ +
This error indicates that ProGuard's optimization step has not been able + to maintain the correct debug information about local variables. This can + happen if some code is optimized radically. Possible work-arounds: let the + java compiler not produce debug information (-g:none), or let + ProGuard's obfuscation step remove the debug information again + (by not keeping the attributes LocalVariableTable + and LocalVariableTypeTable + with -keepattributes), + or otherwise just disable optimization + (-dontoptimize).
+ +
Conversion to Dalvik format failed with error 1
+ +
This error may have various causes, but if dx is tripping over some code + processed by ProGuard, you should make sure that you are using the latest + version of ProGuard. You can just copy the ProGuard jars + to android-sdk/tools/proguard/lib. If that doesn't help, + please report the problem, preferably with the simplest example that still + brings out the error.
+ +
+ +

Problems while preverifying for Java Micro Edition

+ +If ProGuard seems to run fine, but the external preverifier subsequently +produces errors, it's usually for a single reason: + +
+
InvalidClassException, class loading error, or verification error
+ +
If you get any such message from the preverifier, you are probably working + on a platform with a case-insensitive file system, such as Windows. The + preverify tool always unpacks the jars, so class files with + similar lower-case and upper-case names overwrite each other. You can use + ProGuard's -dontusemixedcaseclassnames + option to work around this problem. +

+ If the above doesn't help, there is probably a bug in the optimization + step of ProGuard. Make sure you are using the latest version. You should + be able to work around the problem by using the -dontoptimize option. You + can check the bug database to see if it is a known problem (often with a + fix). Otherwise, please report it, preferably with the simplest example on + which you can find ProGuard to fail.

+ +
+ +Note that it is no longer necessary to use an external preverifier. With the +-microedition option, +ProGuard will preverify the class files for Java Micro Edition. +

+ +

Problems at run-time

+ +If ProGuard runs fine, but your processed application doesn't work, there +might be several reasons: + +
+
Stack traces without class names or line numbers
+ +
If your stack traces don't contain any class names or lines numbers, + even though you are keeping the proper attributes, make sure this debugging + information is present in your compiled code to start with. Notably the Ant + javac task has debugging information switched off by default.
+ +
NoClassDefFoundError
+ +
Your class path is probably incorrect. It should at least contain all + library jars and, of course, your processed program jar.
+ +
ClassNotFoundException
+ +
Your code is probably calling Class.forName, trying to create + the missing class dynamically. ProGuard can only detect constant name + arguments, like Class.forName("mypackage.MyClass"). For + variable name arguments like Class.forName(someClass), you + have to keep all possible classes using the appropriate -keep option, e.g. "-keep + class mypackage.MyClass" or "-keep class * implements + mypackage.MyInterface".
+ +
NoSuchMethodException
+ +
Your code is probably calling something like + myClass.getMethod, trying to find some method dynamically. + Since ProGuard can't always detect this automatically, you have to keep + the missing method in using the appropriate -keep option, e.g. "-keep + class mypackage.MyClass { void myMethod(); }". +

+ More specifically, if the method reported as missing is + values or valueOf, you probably have to keep + some methods related to enumerations.

+ +
MissingResourceException or NullPointerException
+ +
Your processed code may be unable to find some resource files. ProGuard + simply copies resource files over from the input jars to the output jars. + Their names and contents remain unchanged, unless you specify the options + -adaptresourcefilenames + and/or -adaptresourcefilecontents. +

+ Furthermore, directory entries in jar files aren't copied, unless you + specify the option -keepdirectories. + Note that Sun advises against calling Class.getResource() for + directories (Sun + Bug #4761949).

+ +
Disappearing annotations
+ +
By default, the obfuscation step removes all annotations. If your + application relies on annotations to function properly, you should + explicitly keep them with + -keepattributes + *Annotation*.
+ +
Invalid or corrupt jarfile
+ +
You are probably starting your application with the java option + -jar instead of the option -classpath. The java + virtual machine returns with this error message if your jar doesn't + contain a manifest file (META-INF/MANIFEST.MF), if the + manifest file doesn't specify a main class (Main-Class: ...), + or if the jar doesn't contain this main class. You should then make sure + that the input jar contains a valid manifest file to start with, that this + manifest file is the one that is copied (the first manifest file that is + encountered), and that the main class is kept in your configuration,
+ +
InvalidJarIndexException: Invalid index
+ +
At least one of your processed jar files contains an index file + META-INF/INDEX.LIST, listing all class files in the jar. + ProGuard by default copies files like these unchanged. ProGuard may however + remove or rename classes, thus invalidating the file. You should filter the + index file out of the input + (-injars in.jar(!META-INF/INDEX.LIST)) or update the file + after having applied ProGuard (jar -i out.jar). +
+ +
InvalidClassException, class loading error, or verification error (in Java Micro Edition)
+ +
If you get such an error in Java Micro Edition, you may have forgotten to + specify the -microedition option, so + the processed class files are preverified properly.
+ +
Error: No Such Field or Method, Error verifying method (in a Java Micro Edition emulator)
+ +
If you get such a message in a Motorola or Sony Ericsson phone emulator, + it's because these emulators don't like packageless classes and/or + overloaded fields and methods. You can work around it by not using the + options -repackageclasses + '' and -overloadaggressively. + If you're using the JME WTK plugin, you can adapt the configuration + proguard/wtk/default.pro that's inside the + proguard.jar.
+ +
Failing midlets (on a Java Micro Edition device)
+ +
If your midlet runs in an emulator and on some devices, but not on some + other devices, this is probably due to a bug in the latter devices. For + some older Motorola and Nokia phones, you might try specifying the -useuniqueclassmembernames + option. It avoids overloading class member names, which triggers a bug in + their java virtual machine. +

+ You might also try using the -dontusemixedcaseclassnames + option. Even if the midlet has been properly processed and then + preverified on a case-sensitive file system, the device itself might not + like the mixed-case class names. Notably, the Nokia N-Gage emulator works + fine, but the actual device seems to exhibit this problem.

+ +
Disappearing loops
+ +
If your code contains empty busy-waiting loops, ProGuard's optimization + step may remove them. More specifically, this happens if a loop + continuously checks the value of a non-volatile field that is changed in a + different thread. The specifications of the Java Virtual Machine require + that you always mark fields that are accessed across different threads + without further synchronization as volatile. If this is not + possible for some reason, you'll have to switch off optimization using the + -dontoptimize + option.
+ +
SecurityException: SHA1 digest error
+ +
You may have forgotten to sign your program jar after having + processed it with ProGuard.
+ +
ClassCastException: class not an enum, or
IllegalArgumentException: class not an enum type
+ +
You should make sure you're preserving the special methods of enumeration + types, which the run-time environment calls by introspection. The required + options are shown in the examples.
+ +
ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
+ +
You are probably processing annotations involving enumerations. Again, you + should make sure you're preserving the special methods of the enumeration + type, as shown in the examples.
+ +
CompilerError: duplicate addition
+ +
You are probably compiling or running some code that has been obfuscated + with the -overloadaggressively + option. This option triggers a bug in + sun.tools.java.MethodSet.add in Sun's JDK 1.2.2, which is + used for (dynamic) compilation. You should then avoid this option.
+ +
ClassFormatError: repetitive field name/signature
+ +
You are probably processing some code that has been obfuscated before with + the -overloadaggressively + option. You should then use the same option again in the second processing + round.
+ +
ClassFormatError: Invalid index in LocalVariableTable in class file
+ +
If you are keeping the LocalVariableTable or + LocalVariableTypeTable attributes, ProGuard's optimizing step + is sometimes unable to update them consistently. You should then let the + obfuscation step remove these attributes or disable the optimization + step.
+ +
NoSuchMethodError or AbstractMethodError
+ +
You should make sure you're not writing your output class files to a + directory on a platform with a case-insensitive file system, such as + Windows. Please refer to the section about disappearing classes for details. +

+ Furthermore, you should check whether you have specified your program jars + and library jars properly. Program classes can refer to library classes, + but not the other way around. +

+ If all of this seems ok, perhaps there's a bug in ProGuard (gasp!). If so, + please report it, preferably with the simplest example on which you can + find ProGuard to fail.

+ +
VerifyError
+ +
Verification errors when executing a program are almost certainly the + result of a bug in the optimization step of ProGuard. Make sure you are + using the latest version. You should be able to work around the problem by + using the -dontoptimize + option. You can check the bug database to see if it is a known problem + (often with a fix). Otherwise, please report it, preferably with the + simplest example on which ProGuard fails.
+ +
+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/usage.html b/public/proguard/docs/manual/usage.html new file mode 100644 index 0000000..d84810e --- /dev/null +++ b/public/proguard/docs/manual/usage.html @@ -0,0 +1,1243 @@ + + + + + + +ProGuard Usage + + + + +

Usage

+ +To run ProGuard, just type: +

+java -jar proguard.jar options ... +

+You can find the ProGuard jar in the lib directory of the +ProGuard distribution. Alternatively, the bin directory contains +some short Linux and Windows scripts containing this command. Typically, you'll +put most options in a configuration file (say, myconfig.pro), and +just call: +

+java -jar proguard.jar @myconfig.pro +

+You can combine command line options and options from configuration files. For +instance: +

+java -jar proguard.jar @myconfig.pro -verbose +

+

+You can add comments in a configuration file, starting with a +# character and continuing until the end of the line. +

+Extra whitespace between words and delimiters is ignored. File names with +spaces or special characters should be quoted with single or double quotes. +

+Options can be grouped arbitrarily in arguments on the command line and in +lines in configuration files. This means that you can quote arbitrary sections +of command line options, to avoid shell expansion of special characters, for +instance. +

+The order of the options is generally irrelevant. For quick experiments, you +can abbreviate them to their first unique characters. +

+ +The sections below provide more details: +

+ +

Input/Output Options

+ +
+
@filename
+ +
Short for '-include + filename'.
+ +
-include + filename
+ +
Recursively reads configuration options from the given file + filename.
+ +
-basedirectory + directoryname
+ +
Specifies the base directory for all subsequent relative file names in + these configuration arguments or this configuration file.
+ +
-injars + class_path
+ +
Specifies the input jars (or wars, ears, zips, or directories) of the + application to be processed. The class files in these jars will be + processed and written to the output jars. By default, any non-class files + will be copied without changes. Please be aware of any temporary files + (e.g. created by IDEs), especially if you are reading your input files + straight from directories. The entries in the class path can be filtered, + as explained in the filters section. For better + readability, class path entries can be specified using multiple + -injars options.
+ +
-outjars + class_path
+ +
Specifies the names of the output jars (or wars, ears, zips, or + directories). The processed input of the preceding -injars + options will be written to the named jars. This allows you to collect the + contents of groups of input jars into corresponding groups of output jars. + In addition, the output entries can be filtered, as explained in + the filters section. Each processed class file + or resource file is then written to the first output entry with a matching + filter, within the group of output jars. +

+ You must avoid letting the output files overwrite any input files. For + better readability, class path entries can be specified using multiple + -outjars options. Without any -outjars options, + no jars will be written.

+ +
-libraryjars + class_path
+ +
Specifies the library jars (or wars, ears, zips, or directories) of the + application to be processed. The files in these jars will not be included + in the output jars. The specified library jars should at least contain the + class files that are extended by application class files. Library + class files that are only called needn't be present, although their + presence can improve the results of the optimization step. The entries in + the class path can be filtered, as explained in the filters section. For better readability, class path + entries can be specified using multiple -libraryjars options. +

+ Please note that the boot path and the class path set for running ProGuard + are not considered when looking for library classes. This means that you + explicitly have to specify the run-time jar that your code will use. + Although this may seem cumbersome, it allows you to process applications + targeted at different run-time environments. For example, you can process + J2SE applications as well as JME midlets, just by specifying the + appropriate run-time jar.

+ +
-skipnonpubliclibraryclasses
+ +
Specifies to skip non-public classes while reading library jars, to speed + up processing and reduce memory usage of ProGuard. By default, ProGuard + reads non-public and public library classes alike. However, non-public + classes are often not relevant, if they don't affect the actual program + code in the input jars. Ignoring them then speeds up ProGuard, without + affecting the output. Unfortunately, some libraries, including recent JSE + run-time libraries, contain non-public library classes that are extended + by public library classes. You then can't use this option. ProGuard will + print out warnings if it can't find classes due to this option being + set.
+ +
-dontskipnonpubliclibraryclasses
+ +
Specifies not to ignore non-public library classes. As of version 4.5, this + is the default setting.
+ +
-dontskipnonpubliclibraryclassmembers
+ +
Specifies not to ignore package visible library class members (fields and + methods). By default, ProGuard skips these class members while parsing + library classes, as program classes will generally not refer to them. + Sometimes however, program classes reside in the same packages as library + classes, and they do refer to their package visible class members. In + those cases, it can be useful to actually read the class members, in order + to make sure the processed code remains consistent.
+ +
-keepdirectories + [directory_filter]
+ +
Specifies the directories to be kept in the output jars (or wars, ears, or + directories). By default, directory entries are removed. This reduces the + jar size, but it may be undesirable if the program code tries to find them + with constructs like "MyClass.class.getResource("")". If the + option is specified without a filter, all directories are kept. With a + filter, only matching directories are kept.
+ +
-target version
+ +
Specifies the version number to be set in the processed class files. The + version number can be one of 1.0, 1.1, + 1.2, 1.3, 1.4, 1.5 (or + just 5), 1.6 (or just 6), or + 1.7 (or just 7). By default, the version numbers + of the class files are left unchanged. For example, you may want to + upgrade class files to Java 6, by + changing their version numbers and having them preverified.
+ +
-forceprocessing
+ +
Specifies to process the input, even if the output seems up to date. The + up-to-dateness test is based on a comparison of the date stamps of the + specified input, output, and configuration files or directories.
+ +
+

+ +

Keep Options

+ +
+
-keep + [,modifier,...] + class_specification
+ +
Specifies classes and class members (fields and methods) to be preserved + as entry points to your code. For example, in order to keep an application, you can specify + the main class along with its main method. In order to process a library, you should specify all + publicly accessible elements.
+ +
-keepclassmembers + [,modifier,...] + class_specification
+ +
Specifies class members to be preserved, if their classes are preserved as + well. For example, you may want to keep all serialization fields and + methods of classes that implement the Serializable + interface.
+ +
-keepclasseswithmembers + [,modifier,...] + class_specification
+ +
Specifies classes and class members to be preserved, on the condition that + all of the specified class members are present. For example, you may want + to keep all applications that + have a main method, without having to list them explicitly.
+ +
-keepnames + class_specification
+ +
Short for -keep,allowshrinking + class_specification +

+ Specifies classes and class members whose names are to be preserved, if + they aren't removed in the shrinking phase. For example, you may want to + keep all class names of classes + that implement the Serializable interface, so that the + processed code remains compatible with any originally serialized classes. + Classes that aren't used at all can still be removed. Only applicable when + obfuscating.

+ +
-keepclassmembernames + class_specification
+ +
Short for -keepclassmembers,allowshrinking + class_specification +

+ Specifies class members whose names are to be preserved, if they aren't + removed in the shrinking phase. For example, you may want to preserve the + name of the synthetic class$ methods + when processing a library compiled by + JDK 1.2 or older, so obfuscators can detect it again when processing an + application that uses the processed library (although ProGuard itself + doesn't need this). Only applicable when obfuscating.

+ +
-keepclasseswithmembernames + class_specification
+ +
Short for -keepclasseswithmembers,allowshrinking + class_specification +

+ Specifies classes and class members whose names are to be preserved, on + the condition that all of the specified class members are present after + the shrinking phase. For example, you may want to keep all native method names and the names + of their classes, so that the processed code can still link with the + native library code. Native methods that aren't used at all can still be + removed. If a class file is used, but none of its native methods are, its + name will still be obfuscated. Only applicable when obfuscating.

+ +
-printseeds + [filename]
+ +
Specifies to exhaustively list classes and class members matched by the + various -keep options. The list is printed to the standard + output or to the given file. The list can be useful to verify if the + intended class members are really found, especially if you're using + wildcards. For example, you may want to list all the applications or all the applets that you are keeping.
+ +
+

+ +

Shrinking Options

+ +
+
-dontshrink
+ +
Specifies not to shrink the input class files. By default, shrinking is + applied; all classes and class members are removed, except for the ones + listed by the various -keep options, and the ones on which + they depend, directly or indirectly. A shrinking step is also applied + after each optimization step, since some optimizations may open the + possibility to remove more classes and class members.
+ +
-printusage + [filename]
+ +
Specifies to list dead code of the input class files. The list is printed + to the standard output or to the given file. For example, you can list the unused code of an application. + Only applicable when shrinking.
+ +
-whyareyoukeeping + class_specification
+ +
Specifies to print details on why the given classes and class members are + being kept in the shrinking step. This can be useful if you are wondering + why some given element is present in the output. In general, there can be + many different reasons. This option prints the shortest chain of methods + to a specified seed or entry point, for each specified class and class + member. In the current implementation, the shortest chain that is + printed out may sometimes contain circular deductions -- these do not + reflect the actual shrinking process. If the -verbose option if specified, the traces + include full field and method signatures. Only applicable when + shrinking.
+ +
+

+ +

Optimization Options

+ +
+
-dontoptimize
+ +
Specifies not to optimize the input class files. By default, optimization + is enabled; all methods are optimized at a bytecode level.
+ +
-optimizations + optimization_filter
+ +
Specifies the optimizations to be enabled and disabled, at a more + fine-grained level. Only applicable when optimizing. This is an expert + option.
+ +
-optimizationpasses n
+ +
Specifies the number of optimization passes to be performed. By default, a + single pass is performed. Multiple passes may result in further + improvements. If no improvements are found after an optimization pass, the + optimization is ended. Only applicable when optimizing.
+ +
-assumenosideeffects + class_specification
+ +
Specifies methods that don't have any side effects (other than maybe + returning a value). In the optimization step, ProGuard will then remove + calls to such methods, if it can determine that the return values aren't + used. Note that ProGuard will analyze your program code to find such + methods automatically. It will not analyze library code, for which this + option can thus be useful. For example, you could specify the method + System.currentTimeMillis(), so that any idle calls to it will + be removed. Note that ProGuard applies the option to the entire hierarchy + of the specified methods. Only applicable when optimizing. In general, + making assumptions can be dangerous; you can easily break the processed + code. Only use this option if you know what you're doing!
+ +
-allowaccessmodification
+ +
Specifies that the access modifiers of classes and class members may be + broadened during processing. This can improve the results of the + optimization step. For instance, when inlining a public getter, it may be + necessary to make the accessed field public too. Although Java's binary + compatibility specifications formally do not require this (cfr. The Java Language Specification, Second Edition, Section 13.4.6), some virtual machines would have problems with the + processed code otherwise. Only applicable when optimizing (and when + obfuscating with the -repackageclasses option). +

+ Counter-indication: you probably shouldn't use this option when + processing code that is to be used as a library, since classes and class + members that weren't designed to be public in the API may become + public.

+ +
-mergeinterfacesaggressively
+ +
Specifies that interfaces may be merged, even if their implementing + classes don't implement all interface methods. This can reduce the size of + the output by reducing the total number of classes. Note that Java's + binary compatibility specifications allow such constructs (cfr. The Java Language Specification, Second Edition, Section 13.5.3), even if they are not allowed in the Java language + (cfr. The Java Language Specification, Second Edition, Section 8.1.4). Only applicable when optimizing. +

+ Counter-indication: setting this option can reduce the performance + of the processed code on some JVMs, since advanced just-in-time + compilation tends to favor more interfaces with fewer implementing + classes. Worse, some JVMs may not be able to handle the resulting code. + Notably: +

+ +
+

+ +

Obfuscation Options

+ +
+
-dontobfuscate
+ +
Specifies not to obfuscate the input class files. By default, obfuscation + is applied; classes and class members receive new short random names, + except for the ones listed by the various -keep options. + Internal attributes that are useful for debugging, such as source files + names, variable names, and line numbers are removed.
+ +
-printmapping + [filename]
+ +
Specifies to print the mapping from old names to new names for classes and + class members that have been renamed. The mapping is printed to the + standard output or to the given file. For example, it is required for + subsequent incremental + obfuscation, or if you ever want to make sense again of obfuscated stack traces. Only + applicable when obfuscating.
+ +
-applymapping + filename
+ +
Specifies to reuse the given name mapping that was printed out in a + previous obfuscation run of ProGuard. Classes and class members that are + listed in the mapping file receive the names specified along with them. + Classes and class members that are not mentioned receive new names. The + mapping may refer to input classes as well as library classes. This option + can be useful for incremental + obfuscation, i.e. processing add-ons or small patches to an existing + piece of code. In such cases, you should consider whether you also need + the option -useuniqueclassmembernames. + Only a single mapping file is allowed. Only applicable when + obfuscating.
+ +
-obfuscationdictionary + filename
+ +
Specifies a text file from which all valid words are used as obfuscated + field and method names. By default, short names like 'a', 'b', etc. are + used as obfuscated names. With an obfuscation dictionary, you can specify + a list of reserved key words, or identifiers with foreign characters, for + instance. White space, punctuation characters, duplicate words, and + comments after a # sign are ignored. Note that an + obfuscation dictionary hardly improves the obfuscation. Decent compilers + can automatically replace them, and the effect can fairly simply be undone + by obfuscating again with simpler names. The most useful application is + specifying strings that are typically already present in class files (such + as 'Code'), thus reducing the class file sizes just a little bit more. + Only applicable when obfuscating.
+ +
-classobfuscationdictionary + filename
+ +
Specifies a text file from which all valid words are used as obfuscated + class names. The obfuscation dictionary is similar to the one of the + option -obfuscationdictionary. + Only applicable when obfuscating.
+ +
-packageobfuscationdictionary + filename
+ +
Specifies a text file from which all valid words are used as obfuscated + package names. The obfuscation dictionary is similar to the one of the + option -obfuscationdictionary. + Only applicable when obfuscating.
+ +
-overloadaggressively
+ +
Specifies to apply aggressive overloading while obfuscating. Multiple + fields and methods can then get the same names, as long as their arguments + and return types are different (not just their arguments). This option can + make the processed code even smaller (and less comprehensible). Only + applicable when obfuscating. +

+ Counter-indication: the resulting class files fall within the Java + bytecode specification (cfr. The Java Virtual Machine Specification, Second Edition, first + paragraphs of Section 4.5 and Section 4.6), even though this kind of overloading is not allowed in + the Java language (cfr. The Java Language Specification, Second Edition, Section 8.3 and Section 8.4.7). Still, some tools have problems with it. Notably: +

+ +
-useuniqueclassmembernames
+ +
Specifies to assign the same obfuscated names to class members that have + the same names, and different obfuscated names to class members that have + different names (for each given class member signature). Without the + option, more class members can be mapped to the same short names like 'a', + 'b', etc. The option therefore increases the size of the resulting code + slightly, but it ensures that the saved obfuscation name mapping can + always be respected in subsequent incremental obfuscation steps. +

+ For instance, consider two distinct interfaces containing methods with the + same name and signature. Without this option, these methods may get + different obfuscated names in a first obfuscation step. If a patch is then + added containing a class that implements both interfaces, ProGuard will + have to enforce the same method name for both methods in an incremental + obfuscation step. The original obfuscated code is changed, in order to + keep the resulting code consistent. With this option in the initial + obfuscation step, such renaming will never be necessary. +

+ This option is only applicable when obfuscating. In fact, if you are + planning on performing incremental obfuscation, you probably want to avoid + shrinking and optimization altogether, since these steps could remove or + modify parts of your code that are essential for later additions.

+ +
-dontusemixedcaseclassnames
+ +
Specifies not to generate mixed-case class names while obfuscating. By + default, obfuscated class names can contain a mix of upper-case characters + and lower-case characters. This creates perfectly acceptable and usable + jars. Only if a jar is unpacked on a platform with a case-insensitive + filing system (say, Windows), the unpacking tool may let similarly named + class files overwrite each other. Code that self-destructs when it's + unpacked! Developers who really want to unpack their jars on Windows can + use this option to switch off this behavior. Note that the obfuscated jars + will become larger as a result. Only applicable when obfuscating.
+ +
-keeppackagenames + [package_filter]
+ +
Specifies not obfuscate the given package names. The optional filter is a + comma-separated list of package names. Package names can contain ?, + *, and ** wildcards, and they can be preceded by the + ! negator. Only applicable when obfuscating.
+ +
-flattenpackagehierarchy + [package_name]
+ +
Specifies to repackage all packages that are renamed, by moving them into + the single given parent package. Without argument or with an empty string + (''), the packages are moved into the root package. This option is one + example of further obfuscating package + names. It can make the processed code smaller and less comprehensible. + Only applicable when obfuscating.
+ +
-repackageclasses + [package_name]
+ +
Specifies to repackage all class files that are renamed, by moving them + into the single given package. Without argument or with an empty string + (''), the package is removed completely. This option option overrides the + -flattenpackagehierarchy + option. It is another example of further obfuscating package names. It can + make the processed code even smaller and less comprehensible. Its + deprecated name is -defaultpackage. Only applicable when + obfuscating. +

+ Counter-indication: classes that look for resource files in their + package directories will no longer work properly if they are moved + elsewhere. When in doubt, just leave the packaging untouched by not using + this option.

+ +
-keepattributes + [attribute_filter]
+ +
Specifies any optional attributes to be preserved. The attributes can be + specified with one or more -keepattributes directives. The + optional filter is a comma-separated list of attribute names. Attribute + names can contain ?, *, and ** wildcards, and they + can be preceded by the ! negator. Typical optional attributes are + Exceptions, Signature, Deprecated, + SourceFile, SourceDir, + LineNumberTable, LocalVariableTable, + LocalVariableTypeTable, Synthetic, + EnclosingMethod, RuntimeVisibleAnnotations, + RuntimeInvisibleAnnotations, + RuntimeVisibleParameterAnnotations, + RuntimeInvisibleParameterAnnotations, and + AnnotationDefault. The InnerClasses attribute + name can be specified as well, referring to the source name part of this + attribute. For example, you should at least keep the + Exceptions, InnerClasses, and + Signature attributes + when processing a library. You should + also keep the SourceFile and + LineNumberTable attributes + for producing useful obfuscated stack + traces. Finally, you may want + to keep annotations if your code + depends on them. Only applicable when obfuscating.
+ +
-keepparameternames
+ +
Specifies to keep the parameter names and types of methods that are kept. + This option actually keeps trimmed versions of the debugging attributes + LocalVariableTable and + LocalVariableTypeTable. It can be useful when + processing a library. Some IDEs can + use the information to assist developers who use the library, for example + with tool tips or autocompletion. Only applicable when obfuscating.
+ +
-renamesourcefileattribute + [string]
+ +
Specifies a constant string to be put in the SourceFile + attributes (and SourceDir attributes) of the class files. + Note that the attribute has to be present to start with, so it also has to + be preserved explicitly using the -keepattributes directive. + For example, you may want to have your processed libraries and + applications produce useful obfuscated + stack traces. Only applicable when obfuscating.
+ +
-adaptclassstrings + [class_filter]
+ +
Specifies that string constants that correspond to class names should be + obfuscated as well. Without a filter, all string constants that correspond + to class names are adapted. With a filter, only string constants in + classes that match the filter are adapted. For example, if your code + contains a large number of hard-coded strings that refer to classes, and + you prefer not to keep their names, you may want to use this option. + Primarily applicable when obfuscating, although corresponding classes are + automatically kept in the shrinking step too.
+ +
-adaptresourcefilenames + [file_filter]
+ +
Specifies the resource files to be renamed, based on the obfuscated names + of the corresponding class files (if any). Without a filter, all resource + files that correspond to class files are renamed. With a filter, only + matching files are renamed. For example, see processing resource files. Only + applicable when obfuscating.
+ +
-adaptresourcefilecontents + [file_filter]
+ +
Specifies the resource files whose contents are to be updated. Any class + names mentioned in the resource files are renamed, based on the obfuscated + names of the corresponding classes (if any). Without a filter, the + contents of all resource files updated. With a filter, only matching files + are updated. The resource files are parsed and written using the + platform's default character set. You can change this default character set + by setting the environment variable LANG or the Java system + property file.encoding. For an example, + see processing resource files. + Only applicable when obfuscating.
+ +
+

+ +

Preverification Options

+ +
+
-dontpreverify
+ +
Specifies not to preverify the processed class files. By default, class + files are preverified if they are targeted at Java Micro Edition or at + Java 6 or higher. For Java Micro Edition, preverification is required, so + you will need to run an external preverifier on the processed code if you + specify this option. For Java 6, preverification is not required (yet), + but it improves the efficiency of the class loading in the Java Virtual + Machine.
+ +
-microedition
+ +
Specifies that the processed class files are targeted at Java Micro + Edition. The preverifier will then add the appropriate StackMap + attributes, which are different from the default StackMapTable attributes + for Java Standard Edition. For example, you will need this option if you + are processing midlets.
+ +
+

+ +

General Options

+ +
+
-verbose
+ +
Specifies to write out some more information during processing. If the + program terminates with an exception, this option will print out the entire + stack trace, instead of just the exception message.
+ +
-dontnote + [class_filter]
+ +
Specifies not to print notes about potential mistakes or omissions in the + configuration, like typos in class names, or like missing options that + might be useful. The optional filter is a regular expression; ProGuard + doesn't print notes about classes with matching names.
+ +
-dontwarn + [class_filter]
+ +
Specifies not to warn about unresolved references and other important + problems at all. The optional filter is a regular expression; ProGuard + doesn't print warnings about classes with matching names. Ignoring + warnings can be dangerous. For instance, if the unresolved classes or + class members are indeed required for processing, the processed code will + not function properly. Only use this option if you know what you're + doing!
+ +
-ignorewarnings
+ +
Specifies to print any warnings about unresolved references and other + important problems, but to continue processing in any case. Ignoring + warnings can be dangerous. For instance, if the unresolved classes or + class members are indeed required for processing, the processed code will + not function properly. Only use this option if you know what you're + doing!
+ +
-printconfiguration + [filename]
+ +
Specifies to write out the entire configuration that has been parsed, with + included files and replaced variables. The structure is printed to the + standard output or to the given file. This can sometimes be useful for + debugging configurations, or for converting XML configurations into a more + readable format.
+ +
-dump + [filename]
+ +
Specifies to write out the internal structure of the class files, after + any processing. The structure is printed to the standard output or to the + given file. For example, you may want to write out the contents of a given jar + file, without processing it at all.
+ +
+

+ +

Class Paths

+ +ProGuard accepts a generalization of class paths to specify input files and +output files. A class path consists of entries, separated by the traditional +path separator (e.g. ':' on Unix, or ';' on Windows platforms). +The order of the entries determines their priorities, in case of duplicates. +

+Each input entry can be: +

+

+The paths of directly specified class files and resource files is ignored, so +class files should generally be part of a jar file, a war file, an ear file, a +zip file, or a directory. In addition, the paths of class files should not have +any additional directory prefixes inside the archives or directories. + +

+Each output entry can be: +

+

+When writing output entries, ProGuard will generally package the results in a +sensible way, reconstructing the input entries as much as required. Writing +everything to an output directory is the most straightforward option: the +output directory will contain a complete reconstruction of the input entries. +The packaging can be almost arbitrarily complex though: you could process an +entire application, packaged in a zip file along with its documentation, +writing it out as a zip file again. The Examples section shows a few ways +to restructure output archives. +

+Files and directories can be specified as discussed in the section on file names below. +

+In addition, ProGuard provides the possibility to filter the class path +entries and their contents, based on their full relative file names. Each +class path entry can be followed by up to 5 types of file filters between parentheses, separated by +semi-colons: +

+

+If fewer than 5 filters are specified, they are assumed to be the latter +filters. Any empty filters are ignored. More formally, a filtered class path +entry looks like this: +

+classpathentry([[[[zipfilter;]earfilter;]warfilter;]jarfilter;]filefilter)
+
+

+Square brackets "[]" mean that their contents are optional. +

+For example, "rt.jar(java/**.class,javax/**.class)" matches all +class files in the java and javax directories inside +the rt jar. +

+For example, "input.jar(!**.gif,images/**)" matches all files in +the images directory inside the input jar, except +gif files. +

+Note that the different filters are applied to all corresponding file types, +irrespective of their nesting levels in the input; they are orthogonal. +

+For example, +"input.war(lib/**.jar,support/**.jar;**.class,**.gif)" only +considers jar files in the lib and support +directories in the input war, not any other jar files. It then +matches all class files and gif files that are encountered. +

+The filters allow for an almost infinite number of packaging and repackaging +possibilities. The Examples section provides a few more examples +for filtering input and output. +

+ +

File Names

+ +ProGuard accepts absolute paths and relative paths for the various file names +and directory names. A relative path is interpreted as follows: + +

+The names can contain Java system properties delimited by '<' and +'>'. The system properties +are automatically replaced by their respective values. +

+For example, <java.home>/lib/rt.jar will automatically be +expanded to something like /usr/local/java/jdk/jre/lib/rt.jar. +Similarly, <user.home> will be expanded to the user's home +directory, and <user.dir> will be expanded to the current +working directory. +

+Names with special characters like spaces and parentheses must be quoted with +single or double quotes. Note that each file name in a list of names has to be +quoted individually. Also note that the quotes themselves may need to be +escaped when used on the command line, to avoid them being gobbled by the +shell. +

+For example, on the command line, you could use an option like '-injars +"my program.jar":"/your directory/your program.jar"'. +

+ +

File Filters

+ +Like general filters, a file filter is a +comma-separated list of file names that can contain wildcards. Only files with +matching file names are read (in the case of input jars), or written (in the +case of output jars). The following wildcards are supported: + + + + + + + + +
?matches any single character in a file name.
*matches any part of a filename not containing the directory + separator.
**matches any part of a filename, possibly containing any number of + directory separators.
+ +For example, "java/**.class,javax/**.class" matches all +class files in the java and javax. +

+ +Furthermore, a file name can be preceded by an exclamation mark '!' to +exclude the file name from further attempts to match with +subsequent file names. +

+For example, "!**.gif,images/**" matches all files in the +images directory, except gif files. +

+The Examples section provides a few more examples for filtering input and output. + +

Filters

+ +ProGuard offers options with filters for many different aspects of the +configuration: names of files, directories, classes, packages, attributes, +optimizations, etc. +

+A filter is a list of comma-separated names that can contain wildcards. Only +names that match an item on the list pass the filter. The supported wildcards +depend on the type of names for which the filter is being used, but the +following wildcards are typical: + + + + + + + + +
?matches any single character in a name.
*matches any part of a name not containing the package separator or + directory separator.
**matches any part of a name, possibly containing any number of + package separators or directory separators.
+ +For example, "foo,*bar" matches the name foo and +all names ending with bar. +

+ +Furthermore, a name can be preceded by a negating exclamation mark '!' +to exclude the name from further attempts to match +with subsequent names. So, if a name matches an item in the filter, it +is accepted or rejected right away, depending on whether the item has a +negator. If the name doesn't match the item, it is tested against the next +item, and so on. It if doesn't match any items, it is accepted or rejected, +depending on the whether the last item has a negator or not. +

+For example, "!foobar,*bar" matches all names ending with +bar, except foobar. +

+ +

Overview of Keep Options

+ +The various -keep options for shrinking and obfuscation may seem +a bit confusing at first, but there's actually a pattern behind them. The +following table summarizes how they are related: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeepFrom being removed or renamedFrom being renamed
Classes and class members-keep-keepnames
Class members only-keepclassmembers-keepclassmembernames
Classes and class members, if class members present-keepclasseswithmembers-keepclasseswithmembernames
+

+ +Each of these -keep options is of course followed by a +specification of the classes and class +members (fields and methods) to which it should be applied. +

+If you're not sure which option you need, you should probably simply use +-keep. It will make sure the specified classes and class members +are not removed in the shrinking step, and not renamed in the obfuscation step. +

+ + +
+attention + +Always remember: +
    +
  • Specifying a class without class members only preserves the class as an + entry point — any class members may then still be removed, optimized, + or obfuscated.
  • +
  • Specifying a class member only preserves the class member as an entry + point — any associated code may still be optimized and adapted.
  • +
+
+

+ +

Keep Option Modifiers

+ +
+
allowshrinking
+ +
Specifies that the entry points specified in the -keep + option may be shrunk, even if they have to be preserved otherwise. That + is, the entry points may be removed in the shrinking step, but if they are + necessary after all, they may not be optimized or obfuscated.
+ +
allowoptimization
+ +
Specifies that the entry points specified in the -keep + option may be optimized, even if they have to be preserved otherwise. That + is, the entry points may be altered in the optimization step, but they may + not be removed or obfuscated. This modifier is only useful for achieving + unusual requirements.
+ +
allowobfuscation
+ +
Specifies that the entry points specified in the -keep + option may be obfuscated, even if they have to be preserved otherwise. That + is, the entry points may be renamed in the obfuscation step, but they may + not be removed or optimized. This modifier is only useful for achieving + unusual requirements.
+ +
+

+ +

Class Specifications

+ +A class specification is a template of classes and class members (fields and +methods). It is used in the various -keep options and in the +-assumenosideeffects option. The corresponding option is only +applied to classes and class members that match the template. +

+The template was designed to look very Java-like, with some extensions for +wildcards. To get a feel for the syntax, you should probably look at the examples, but this is an attempt at a complete formal +definition: +

+ +

+[@annotationtype] [[!]public|final|abstract|@ ...] [!]interface|class|enum classname
+    [extends|implements [@annotationtype] classname]
+[{
+    [@annotationtype] [[!]public|private|protected|static|volatile|transient ...] <fields> |
+                                                                      (fieldtype fieldname);
+    [@annotationtype] [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] <methods> |
+                                                                                           <init>(argumenttype,...) |
+                                                                                           classname(argumenttype,...) |
+                                                                                           (returntype methodname(argumenttype,...));
+    [@annotationtype] [[!]public|private|protected|static ... ] *;
+    ...
+}]
+
+

+Square brackets "[]" mean that their contents are optional. Ellipsis dots +"..." mean that any number of the preceding items may be specified. A vertical +bar "|" delimits two alternatives. Non-bold parentheses "()" just group parts +of the specification that belong together. The indentation tries to clarify +the intended meaning, but white-space is irrelevant in actual configuration +files. +

+

+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/manual/wtk.html b/public/proguard/docs/manual/wtk.html new file mode 100644 index 0000000..196b9ca --- /dev/null +++ b/public/proguard/docs/manual/wtk.html @@ -0,0 +1,70 @@ + + + + + + +ProGuard JME Wireless Toolkit Integration + + + + +

JME Wireless Toolkit Integration

+ +ProGuard can be seamlessly integrated in Oracle'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. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/quality.html b/public/proguard/docs/quality.html new file mode 100644 index 0000000..a8bbf05 --- /dev/null +++ b/public/proguard/docs/quality.html @@ -0,0 +1,56 @@ + + + + + + +ProGuard Quality + + + + +

Quality

+ +In order to get a feel for the quality of the ProGuard code, it is run +through a regular automatic build process. This process produces numerous +statistics on the source code, Java lint comments, Java documentation +comments, the Java documentation itself, html lint comments on the Java +documentation, spell checks, compilation results, an output jar, dead code +analysis, a shrunk and obfuscated jar (using ProGuard itself!), test runs with +memory and performance analyses, etc. Most analyses are produced using freely +available tools. The results are poured into a convenient set of web pages +using bash/sed/awk scripts. You're welcome to have a look at an uploaded +snapshot of one of these runs: +

+

Automated Code Analysis and Testing Pages (at SourceForge)
+

+The pages will appear in a new window, which you probably want to view at +full-screen size. +

+ +In addition, ProGuard is tested against a constantly growing test suite +(more than 900 tests at this time of writing). These small programs contain a +wide range of common and uncommon constructs, in order to detect any regression +problems as soon as possible. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/results.html b/public/proguard/docs/results.html new file mode 100644 index 0000000..ca833ac --- /dev/null +++ b/public/proguard/docs/results.html @@ -0,0 +1,170 @@ + + + + + + +ProGuard Results + +ProGuard Results + + + +

Results

+ +ProGuard successfully processes any Java bytecode, ranging from small +midlets to entire run-time libraries. It primarily reduces the size of the +processed code, with some potential increase in efficiency as an added bonus. +The improvements obviously depend on the original code. The table below +presents some typical results: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Input ProgramOriginal sizeAfter shrinkingAfter optim.After obfusc.Total reductionTimeMemory usage
Worm, a sample midlet from Oracle's JME10.3 K9.8 K9.6 K8.5 K18 %2 s19 M
Javadocking, a docking library290 K281 K270 K201 K30 %12 s32 M
ProGuard itself648 K579 K557 K348 K46 %28 s66 M
JDepend, a Java quality metrics tool57 K36 K33 K28 K51 %6 s24 M
the run-time classes from Oracle's Java 653 M23 M22 M18 M66 %16 min270 M
Tomcat, the Apache servlet container1.1 M466 K426 K295 K74 %17 s44 M
JavaNCSS, a Java source metrics tool632 K242 K212 K152 K75 %20 s36 M
Ant, the Apache build tool2.4 M401 K325 K242 K90 %23 s61 M
+

+Results were measured with ProGuard 4.0 on a 2.6 GHz Pentium 4 with 512 MB +of memory, using Sun JDK 1.5.0 in Fedora Core 3 Linux. All of this technology +and software has evolved since, but the gist of the results remains the same. +

+The program sizes include companion libraries. The shrinking step produces the +best results for programs that use only small parts of their libraries. The +obfuscation step can significantly shrink large programs even further, since +the identifiers of their many internal references can be replaced by short +identifiers. +

+The Java 6 run-time classes are the most complex example. The classes perform +a lot of introspection, interacting with the native code of the virtual +machine. The 1500+ lines of configuration were largely composed by automated +analysis, complemented by a great deal of trial and error. The configuration +is probably not complete, but the resulting library successfully serves as a +run-time environment for running applications like ProGuard and the ProGuard +GUI. +

+For small inputs, timings are governed by the reading and parsing of the jars. +For large inputs, the optimization step becomes more important. For instance, +processing the Java 6 run-time classes without optimization only takes 2 +minutes. +

+Memory usage (the amount of physical memory used by ProGuard while processing) +is governed by the basic java virtual machine and by the total size of the +library jars and program jars. + +


+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/saikoalogo.png b/public/proguard/docs/saikoalogo.png new file mode 100644 index 0000000..5b34172 Binary files /dev/null and b/public/proguard/docs/saikoalogo.png differ diff --git a/public/proguard/docs/screenshot_console.gif b/public/proguard/docs/screenshot_console.gif new file mode 100644 index 0000000..8aea61e Binary files /dev/null and b/public/proguard/docs/screenshot_console.gif differ diff --git a/public/proguard/docs/screenshot_console_small.gif b/public/proguard/docs/screenshot_console_small.gif new file mode 100644 index 0000000..3f55f5b Binary files /dev/null and b/public/proguard/docs/screenshot_console_small.gif differ diff --git a/public/proguard/docs/screenshot_gui1.gif b/public/proguard/docs/screenshot_gui1.gif new file mode 100644 index 0000000..233e180 Binary files /dev/null and b/public/proguard/docs/screenshot_gui1.gif differ diff --git a/public/proguard/docs/screenshot_gui2.gif b/public/proguard/docs/screenshot_gui2.gif new file mode 100644 index 0000000..aecdb35 Binary files /dev/null and b/public/proguard/docs/screenshot_gui2.gif differ diff --git a/public/proguard/docs/screenshot_gui3.gif b/public/proguard/docs/screenshot_gui3.gif new file mode 100644 index 0000000..17950ee Binary files /dev/null and b/public/proguard/docs/screenshot_gui3.gif differ diff --git a/public/proguard/docs/screenshot_gui4.gif b/public/proguard/docs/screenshot_gui4.gif new file mode 100644 index 0000000..31e60fa Binary files /dev/null and b/public/proguard/docs/screenshot_gui4.gif differ diff --git a/public/proguard/docs/screenshot_gui5.gif b/public/proguard/docs/screenshot_gui5.gif new file mode 100644 index 0000000..1313db2 Binary files /dev/null and b/public/proguard/docs/screenshot_gui5.gif differ diff --git a/public/proguard/docs/screenshot_gui6.gif b/public/proguard/docs/screenshot_gui6.gif new file mode 100644 index 0000000..c200b97 Binary files /dev/null and b/public/proguard/docs/screenshot_gui6.gif differ diff --git a/public/proguard/docs/screenshot_gui7.gif b/public/proguard/docs/screenshot_gui7.gif new file mode 100644 index 0000000..bc5d6ed Binary files /dev/null and b/public/proguard/docs/screenshot_gui7.gif differ diff --git a/public/proguard/docs/screenshot_gui8.gif b/public/proguard/docs/screenshot_gui8.gif new file mode 100644 index 0000000..95a1a30 Binary files /dev/null and b/public/proguard/docs/screenshot_gui8.gif differ diff --git a/public/proguard/docs/screenshots.html b/public/proguard/docs/screenshots.html new file mode 100644 index 0000000..64805a9 --- /dev/null +++ b/public/proguard/docs/screenshots.html @@ -0,0 +1,67 @@ + + + + + + +ProGuard Screenshots + + + + +

Screenshots

+ + +
+ +GUI screenshot + + +ProGuard +Input/Output +Shrinking +Optimization +Obfuscation +Information +Process +ReTrace + + +The graphical user interface to ProGuard works like a wizard. It allows +you to browse through the presented tabs and fill them out. +

+You can click on the small tab buttons to see the full-size versions of the +tabs. + +

+ +Console screenshot + +Of course, real developers don't need all this point-and-click fluff. They +write short configuration files using their favorite text editors and invoke +ProGuard from the command-line. +

+You can click on the image to see the full-size version. + +

+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + diff --git a/public/proguard/docs/screenshots_gui_small.gif b/public/proguard/docs/screenshots_gui_small.gif new file mode 100644 index 0000000..bc32ccb Binary files /dev/null and b/public/proguard/docs/screenshots_gui_small.gif differ diff --git a/public/proguard/docs/sections.html b/public/proguard/docs/sections.html new file mode 100644 index 0000000..622277a --- /dev/null +++ b/public/proguard/docs/sections.html @@ -0,0 +1,64 @@ + + + + + + + +Sections + + + + + +

+

+With support of +

+ + + + + + + + +

+ +Saikoa +

+ + + + + diff --git a/public/proguard/docs/sflogo.png b/public/proguard/docs/sflogo.png new file mode 100644 index 0000000..142a6f9 Binary files /dev/null and b/public/proguard/docs/sflogo.png differ diff --git a/public/proguard/docs/steel.gif b/public/proguard/docs/steel.gif new file mode 100644 index 0000000..307b57a Binary files /dev/null and b/public/proguard/docs/steel.gif differ diff --git a/public/proguard/docs/style.css b/public/proguard/docs/style.css new file mode 100644 index 0000000..dd8418d --- /dev/null +++ b/public/proguard/docs/style.css @@ -0,0 +1,223 @@ + +@charset "iso-8859-1"; + +/* Global settings. */ + +body +{ + background: #FFFFFF; +} + +h1 +{ + text-align: center; +} + +h2 +{ + text-align: center; +} + +h3 +{ + background: #EEEEFF; + padding: 10px; +} + +h3 div +{ + font-weight: normal; + font-size: 80%; + float: right; +} + +table +{ + width: 100%; +} + +th +{ + padding: 4px; +} + +tr.disappeared td +{ + background: #EEEEEE; +} + +td +{ + background: #EEEEFF; + padding: 8px; +} + +ul.spacious li +{ + padding: 8px; +} + +a +{ + text-decoration: none; +} + +img +{ + border: none; +} + +a.button { + color: #000000; + text-decoration: none; + background: #E0E0E0; + border: 1px outset #FFFFFF; + float: right; +} + +/* Settings for the introductory paragraph. */ + +p.intro +{ + background: #EEEEFF; + padding: 10px; + border: 1px solid #000000; +} + +/* Settings for the title frame. */ + +body.title +{ + margin: 0px; + padding: 0px; + background: #C0C0C0; +} + +div.title +{ + height: 48px; + margin: 0px; + padding: 0px; + border-width: 1px; + border-style: solid; + border-color: #FFFFFF #808080 #808080 #FFFFFF; + background: url("steel.gif"); +} + +div.title h1 +{ + margin: 0px; + padding: 0px; + padding-top: 8px; + padding-left: 40%; + float: left; +} + +div.title div +{ + margin: 0px; + padding: 0px; + padding-top: 12px; + padding-right: 20px; + float: right; +} + +/* Settings for the section frames. */ + +body.navigation +{ + margin: 0px; + padding: 0px; +} + +ul.navigation +{ + margin: 0px; + padding: 0px; + list-style: none; + text-align: center; + background: url("steel.gif"); +} + +ul.navigation li +{ + margin: 0px; + padding: 0px; + border-width: 1px; + border-style: solid; + border-color: #FFFFFF #808080 #808080 #FFFFFF; + color: #000000; + font-weight: bold; +} + +ul.navigation li.title +{ + margin: 0px; + padding: 4px 10px; + background: #E0E0E0; +} + +ul.navigation li a +{ + margin: 0px; + padding: 6px 0px; + background: transparent; + color: #000000; + text-decoration: none; + display: block; +} + +ul.navigation li a:hover, +ul.navigation li a:focus +{ + background: #FFFFFF; +} + +/* Settings for the yellow note tables. */ + +table.note +{ + width: 408px; + border: none; + border-spacing: 0px; +} + +td.shadow8 +{ + width: 8px; + padding: 0px; + margin: 0px; + vertical-align: bottom; + background: transparent; +} + +td.shadow400 +{ + width: 400px; + padding: 0px; + margin: 0px; + text-align: right; + background: transparent; +} + +td.note +{ + width: 380px; + background: #FFFFC0; + padding: 0px; + margin: 0px; +} + +p.note +{ + padding: 0px; + margin: 0px 10px; + text-align: center; +} + +p.author +{ + padding: 0px; + margin: 0px 10px; + text-align: right; +} diff --git a/public/proguard/docs/testimonials.html b/public/proguard/docs/testimonials.html new file mode 100644 index 0000000..d37ddcd --- /dev/null +++ b/public/proguard/docs/testimonials.html @@ -0,0 +1,133 @@ + + + + + + +ProGuard Testimonials + + + + +

Testimonials

+ +And now for some shameless self-glorification and name-dropping... +

+ProGuard is probably the most popular java shrinker, optimizer, and +obfuscator world-wide. It is being used by developers at companies and +organizations like IBM, HP, Siemens, Nokia, Google, and NATO. It is the +default tool in many development environments like Oracle's Wireless Toolkit, +Netbeans, EclipseME, Google's Android SDK, and more. Although the quotes below +probably don't represent official views of any kind, encouragements like these +do keep me happy. +

+ +

+ + + + +

+ProGuard is the ultimate java obfuscator! +

+

P.S, IBM

+

+ +Also: +

+ + + + +

+ProGuard is pure quality - powerful and trouble-free. +

+

M.B., Statestep

+

+ +And: +

+ + + + +

+It is the simplest and most robust obfuscator we have ever used. +

+

I.I., Hewlett-Packard

+

+ +And indeed: +

+ + + + +

+ProGuard rules. Much easier to use than the commercial alternatives. +

+

B.G., Quiotix Corp.

+

+ +Straight from ProGuard's open discussion forum: +

+

+ + + + +

+After searching for, trying to trial, and futzing with numerous other +obfuscators and shrinkers, ProGuard stands out as the simplest, most robust, +and accurate shrinker of them all. +

+

D.J., Joot

+

+ +From the article "Obfuscating MIDlet Suites with ProGuard" at developers.sun.com: +

+

+ + + + +

+Its friendly license, attractive price tag, compelling performance, and +powerful configuration options make it an excellent addition to your MIDlet +development toolbox. +

+

J.K., Sun

+

+ +And, of course, the price is stunning: +

+

+ + + + +

+You could've been rich. +

+

My mother

+ +
+ +
+Copyright © 2002-2011 +Eric Lafortune. +
+ + + diff --git a/public/proguard/docs/title.gif b/public/proguard/docs/title.gif new file mode 100644 index 0000000..5e6ca26 Binary files /dev/null and b/public/proguard/docs/title.gif differ diff --git a/public/proguard/docs/title.html b/public/proguard/docs/title.html new file mode 100644 index 0000000..50838b1 --- /dev/null +++ b/public/proguard/docs/title.html @@ -0,0 +1,17 @@ + + + + + + +ProGuard + + + +
+

ProGuard

+
Version 4.7
+
+ + + diff --git a/public/proguard/lib/proguard.jar b/public/proguard/lib/proguard.jar new file mode 100644 index 0000000..56d68ba Binary files /dev/null and b/public/proguard/lib/proguard.jar differ diff --git a/public/proguard/lib/proguardgui.jar b/public/proguard/lib/proguardgui.jar new file mode 100644 index 0000000..5cf8f81 Binary files /dev/null and b/public/proguard/lib/proguardgui.jar differ diff --git a/public/proguard/lib/retrace.jar b/public/proguard/lib/retrace.jar new file mode 100644 index 0000000..a872adb Binary files /dev/null and b/public/proguard/lib/retrace.jar differ