diff --git a/lib/FastInfoset-1.2.15-javadoc.jar b/lib/FastInfoset-1.2.15-javadoc.jar deleted file mode 100644 index 46cdbd3..0000000 Binary files a/lib/FastInfoset-1.2.15-javadoc.jar and /dev/null differ diff --git a/lib/FastInfoset-1.2.15.jar b/lib/FastInfoset-1.2.15.jar deleted file mode 100644 index 2671209..0000000 Binary files a/lib/FastInfoset-1.2.15.jar and /dev/null differ diff --git a/lib/animal-sniffer-annotations-1.17-javadoc.jar b/lib/animal-sniffer-annotations-1.17-javadoc.jar deleted file mode 100644 index 27f74ca..0000000 Binary files a/lib/animal-sniffer-annotations-1.17-javadoc.jar and /dev/null differ diff --git a/lib/animal-sniffer-annotations-1.17.jar b/lib/animal-sniffer-annotations-1.17.jar deleted file mode 100644 index 6ec7a60..0000000 Binary files a/lib/animal-sniffer-annotations-1.17.jar and /dev/null differ diff --git a/lib/asm-9.2-javadoc.jar b/lib/asm-9.2-javadoc.jar deleted file mode 100644 index 87d321a..0000000 Binary files a/lib/asm-9.2-javadoc.jar and /dev/null differ diff --git a/lib/asm-9.2.jar b/lib/asm-9.2.jar deleted file mode 100644 index 3557ae4..0000000 Binary files a/lib/asm-9.2.jar and /dev/null differ diff --git a/lib/asm-analysis-9.2-javadoc.jar b/lib/asm-analysis-9.2-javadoc.jar deleted file mode 100644 index 8aebf6d..0000000 Binary files a/lib/asm-analysis-9.2-javadoc.jar and /dev/null differ diff --git a/lib/asm-analysis-9.2.jar b/lib/asm-analysis-9.2.jar deleted file mode 100644 index 9d575ca..0000000 Binary files a/lib/asm-analysis-9.2.jar and /dev/null differ diff --git a/lib/asm-commons-9.2-javadoc.jar b/lib/asm-commons-9.2-javadoc.jar deleted file mode 100644 index cba0590..0000000 Binary files a/lib/asm-commons-9.2-javadoc.jar and /dev/null differ diff --git a/lib/asm-commons-9.2.jar b/lib/asm-commons-9.2.jar deleted file mode 100644 index 01028a0..0000000 Binary files a/lib/asm-commons-9.2.jar and /dev/null differ diff --git a/lib/asm-tree-9.2-javadoc.jar b/lib/asm-tree-9.2-javadoc.jar deleted file mode 100644 index b9baae8..0000000 Binary files a/lib/asm-tree-9.2-javadoc.jar and /dev/null differ diff --git a/lib/asm-tree-9.2.jar b/lib/asm-tree-9.2.jar deleted file mode 100644 index 0a6833a..0000000 Binary files a/lib/asm-tree-9.2.jar and /dev/null differ diff --git a/lib/asm-util-9.2-javadoc.jar b/lib/asm-util-9.2-javadoc.jar deleted file mode 100644 index c858099..0000000 Binary files a/lib/asm-util-9.2-javadoc.jar and /dev/null differ diff --git a/lib/asm-util-9.2.jar b/lib/asm-util-9.2.jar deleted file mode 100644 index 3afe6e6..0000000 Binary files a/lib/asm-util-9.2.jar and /dev/null differ diff --git a/lib/axml-2.1.2-javadoc.jar b/lib/axml-2.1.2-javadoc.jar deleted file mode 100644 index e750602..0000000 Binary files a/lib/axml-2.1.2-javadoc.jar and /dev/null differ diff --git a/lib/axml-2.1.2.jar b/lib/axml-2.1.2.jar deleted file mode 100644 index b9e1014..0000000 Binary files a/lib/axml-2.1.2.jar and /dev/null differ diff --git a/lib/checker-compat-qual-2.5.2-javadoc.jar b/lib/checker-compat-qual-2.5.2-javadoc.jar deleted file mode 100644 index 54bb1e4..0000000 Binary files a/lib/checker-compat-qual-2.5.2-javadoc.jar and /dev/null differ diff --git a/lib/checker-compat-qual-2.5.2.jar b/lib/checker-compat-qual-2.5.2.jar deleted file mode 100644 index 633d2c2..0000000 Binary files a/lib/checker-compat-qual-2.5.2.jar and /dev/null differ diff --git a/lib/commons-io-2.7-javadoc.jar b/lib/commons-io-2.7-javadoc.jar deleted file mode 100644 index 2e2b1e0..0000000 Binary files a/lib/commons-io-2.7-javadoc.jar and /dev/null differ diff --git a/lib/commons-io-2.7.jar b/lib/commons-io-2.7.jar deleted file mode 100644 index 5889458..0000000 Binary files a/lib/commons-io-2.7.jar and /dev/null differ diff --git a/lib/dexlib2-2.5.2-javadoc.jar b/lib/dexlib2-2.5.2-javadoc.jar deleted file mode 100644 index 3e04372..0000000 Binary files a/lib/dexlib2-2.5.2-javadoc.jar and /dev/null differ diff --git a/lib/dexlib2-2.5.2.jar b/lib/dexlib2-2.5.2.jar deleted file mode 100644 index 392b3fc..0000000 Binary files a/lib/dexlib2-2.5.2.jar and /dev/null differ diff --git a/lib/error_prone_annotations-2.2.0-javadoc.jar b/lib/error_prone_annotations-2.2.0-javadoc.jar deleted file mode 100644 index f12432b..0000000 Binary files a/lib/error_prone_annotations-2.2.0-javadoc.jar and /dev/null differ diff --git a/lib/error_prone_annotations-2.2.0.jar b/lib/error_prone_annotations-2.2.0.jar deleted file mode 100644 index c8e27b5..0000000 Binary files a/lib/error_prone_annotations-2.2.0.jar and /dev/null differ diff --git a/lib/failureaccess-1.0.1-javadoc.jar b/lib/failureaccess-1.0.1-javadoc.jar deleted file mode 100644 index 39bb3d4..0000000 Binary files a/lib/failureaccess-1.0.1-javadoc.jar and /dev/null differ diff --git a/lib/failureaccess-1.0.1.jar b/lib/failureaccess-1.0.1.jar deleted file mode 100644 index 9b56dc7..0000000 Binary files a/lib/failureaccess-1.0.1.jar and /dev/null differ diff --git a/lib/functionaljava-4.2-javadoc.jar b/lib/functionaljava-4.2-javadoc.jar deleted file mode 100644 index 17dec14..0000000 Binary files a/lib/functionaljava-4.2-javadoc.jar and /dev/null differ diff --git a/lib/functionaljava-4.2.jar b/lib/functionaljava-4.2.jar deleted file mode 100644 index 8aa667d..0000000 Binary files a/lib/functionaljava-4.2.jar and /dev/null differ diff --git a/lib/guava-27.1-android-javadoc.jar b/lib/guava-27.1-android-javadoc.jar deleted file mode 100644 index 16abcc8..0000000 Binary files a/lib/guava-27.1-android-javadoc.jar and /dev/null differ diff --git a/lib/guava-27.1-android.jar b/lib/guava-27.1-android.jar deleted file mode 100644 index 8648a60..0000000 Binary files a/lib/guava-27.1-android.jar and /dev/null differ diff --git a/lib/heros-1.2.3-javadoc.jar b/lib/heros-1.2.3-javadoc.jar deleted file mode 100644 index d70e6fe..0000000 Binary files a/lib/heros-1.2.3-javadoc.jar and /dev/null differ diff --git a/lib/heros-1.2.3.jar b/lib/heros-1.2.3.jar deleted file mode 100644 index 7a99325..0000000 Binary files a/lib/heros-1.2.3.jar and /dev/null differ diff --git a/lib/istack-commons-runtime-3.0.7-javadoc.jar b/lib/istack-commons-runtime-3.0.7-javadoc.jar deleted file mode 100644 index d4f703e..0000000 Binary files a/lib/istack-commons-runtime-3.0.7-javadoc.jar and /dev/null differ diff --git a/lib/istack-commons-runtime-3.0.7.jar b/lib/istack-commons-runtime-3.0.7.jar deleted file mode 100644 index 2fe5b82..0000000 Binary files a/lib/istack-commons-runtime-3.0.7.jar and /dev/null differ diff --git a/lib/j2objc-annotations-1.1-javadoc.jar b/lib/j2objc-annotations-1.1-javadoc.jar deleted file mode 100644 index a7c633d..0000000 Binary files a/lib/j2objc-annotations-1.1-javadoc.jar and /dev/null differ diff --git a/lib/j2objc-annotations-1.1.jar b/lib/j2objc-annotations-1.1.jar deleted file mode 100644 index 4b6f127..0000000 Binary files a/lib/j2objc-annotations-1.1.jar and /dev/null differ diff --git a/lib/jasmin-3.0.3-javadoc.jar b/lib/jasmin-3.0.3-javadoc.jar deleted file mode 100644 index b527eff..0000000 Binary files a/lib/jasmin-3.0.3-javadoc.jar and /dev/null differ diff --git a/lib/jasmin-3.0.3.jar b/lib/jasmin-3.0.3.jar deleted file mode 100644 index 54c07e0..0000000 Binary files a/lib/jasmin-3.0.3.jar and /dev/null differ diff --git a/lib/java_cup-0.9.2-javadoc.jar b/lib/java_cup-0.9.2-javadoc.jar deleted file mode 100644 index d5ec29b..0000000 Binary files a/lib/java_cup-0.9.2-javadoc.jar and /dev/null differ diff --git a/lib/java_cup-0.9.2.jar b/lib/java_cup-0.9.2.jar deleted file mode 100644 index 66217a8..0000000 Binary files a/lib/java_cup-0.9.2.jar and /dev/null differ diff --git a/lib/javax.activation-api-1.2.0-javadoc.jar b/lib/javax.activation-api-1.2.0-javadoc.jar deleted file mode 100644 index cc6c3c4..0000000 Binary files a/lib/javax.activation-api-1.2.0-javadoc.jar and /dev/null differ diff --git a/lib/javax.activation-api-1.2.0.jar b/lib/javax.activation-api-1.2.0.jar deleted file mode 100644 index 986c365..0000000 Binary files a/lib/javax.activation-api-1.2.0.jar and /dev/null differ diff --git a/lib/javax.annotation-api-1.3.2-javadoc.jar b/lib/javax.annotation-api-1.3.2-javadoc.jar deleted file mode 100644 index 7461923..0000000 Binary files a/lib/javax.annotation-api-1.3.2-javadoc.jar and /dev/null differ diff --git a/lib/javax.annotation-api-1.3.2.jar b/lib/javax.annotation-api-1.3.2.jar deleted file mode 100644 index a8a470a..0000000 Binary files a/lib/javax.annotation-api-1.3.2.jar and /dev/null differ diff --git a/lib/jaxb-api-2.4.0-b180725.0427-javadoc.jar b/lib/jaxb-api-2.4.0-b180725.0427-javadoc.jar deleted file mode 100644 index 0d77c93..0000000 Binary files a/lib/jaxb-api-2.4.0-b180725.0427-javadoc.jar and /dev/null differ diff --git a/lib/jaxb-api-2.4.0-b180725.0427.jar b/lib/jaxb-api-2.4.0-b180725.0427.jar deleted file mode 100644 index 5dea8fe..0000000 Binary files a/lib/jaxb-api-2.4.0-b180725.0427.jar and /dev/null differ diff --git a/lib/jaxb-runtime-2.4.0-b180830.0438-javadoc.jar b/lib/jaxb-runtime-2.4.0-b180830.0438-javadoc.jar deleted file mode 100644 index 1c1b556..0000000 Binary files a/lib/jaxb-runtime-2.4.0-b180830.0438-javadoc.jar and /dev/null differ diff --git a/lib/jaxb-runtime-2.4.0-b180830.0438.jar b/lib/jaxb-runtime-2.4.0-b180830.0438.jar deleted file mode 100644 index b5194f6..0000000 Binary files a/lib/jaxb-runtime-2.4.0-b180830.0438.jar and /dev/null differ diff --git a/lib/jsr305-3.0.2-javadoc.jar b/lib/jsr305-3.0.2-javadoc.jar deleted file mode 100644 index defc108..0000000 Binary files a/lib/jsr305-3.0.2-javadoc.jar and /dev/null differ diff --git a/lib/jsr305-3.0.2.jar b/lib/jsr305-3.0.2.jar deleted file mode 100644 index 59222d9..0000000 Binary files a/lib/jsr305-3.0.2.jar and /dev/null differ diff --git a/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar b/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar deleted file mode 100644 index 45832c0..0000000 Binary files a/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar and /dev/null differ diff --git a/lib/polyglot-2006-javadoc.jar b/lib/polyglot-2006-javadoc.jar deleted file mode 100644 index d5ec29b..0000000 Binary files a/lib/polyglot-2006-javadoc.jar and /dev/null differ diff --git a/lib/polyglot-2006.jar b/lib/polyglot-2006.jar deleted file mode 100644 index 1b9a05d..0000000 Binary files a/lib/polyglot-2006.jar and /dev/null differ diff --git a/lib/slf4j-api-1.7.32-javadoc.jar b/lib/slf4j-api-1.7.32-javadoc.jar deleted file mode 100644 index 258dc48..0000000 Binary files a/lib/slf4j-api-1.7.32-javadoc.jar and /dev/null differ diff --git a/lib/slf4j-api-1.7.32.jar b/lib/slf4j-api-1.7.32.jar deleted file mode 100644 index b16a078..0000000 Binary files a/lib/slf4j-api-1.7.32.jar and /dev/null differ diff --git a/lib/soot-4.3.0-javadoc.jar b/lib/soot-4.3.0-javadoc.jar deleted file mode 100644 index 93e30db..0000000 Binary files a/lib/soot-4.3.0-javadoc.jar and /dev/null differ diff --git a/lib/soot-4.3.0.jar b/lib/soot-4.3.0.jar deleted file mode 100644 index 40b2ac6..0000000 Binary files a/lib/soot-4.3.0.jar and /dev/null differ diff --git a/lib/stax-ex-1.8-javadoc.jar b/lib/stax-ex-1.8-javadoc.jar deleted file mode 100644 index b701a79..0000000 Binary files a/lib/stax-ex-1.8-javadoc.jar and /dev/null differ diff --git a/lib/stax-ex-1.8.jar b/lib/stax-ex-1.8.jar deleted file mode 100644 index 5e60637..0000000 Binary files a/lib/stax-ex-1.8.jar and /dev/null differ diff --git a/lib/txw2-2.4.0-b180830.0438-javadoc.jar b/lib/txw2-2.4.0-b180830.0438-javadoc.jar deleted file mode 100644 index bf15047..0000000 Binary files a/lib/txw2-2.4.0-b180830.0438-javadoc.jar and /dev/null differ diff --git a/lib/txw2-2.4.0-b180830.0438.jar b/lib/txw2-2.4.0-b180830.0438.jar deleted file mode 100644 index b7ddeaa..0000000 Binary files a/lib/txw2-2.4.0-b180830.0438.jar and /dev/null differ diff --git a/lib/xmlpull-1.1.3.4d_b4_min.jar b/lib/xmlpull-1.1.3.4d_b4_min.jar deleted file mode 100644 index 43486c2..0000000 Binary files a/lib/xmlpull-1.1.3.4d_b4_min.jar and /dev/null differ diff --git a/proguard/LICENSE b/proguard/LICENSE deleted file mode 100644 index d159169..0000000 --- a/proguard/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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. - - GNU GENERAL PUBLIC LICENSE - 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: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -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: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -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 - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/proguard/bin/proguard.bat b/proguard/bin/proguard.bat deleted file mode 100644 index daf2c1a..0000000 --- a/proguard/bin/proguard.bat +++ /dev/null @@ -1,14 +0,0 @@ -@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=%~dp0\.. -:home - -java -jar "%PROGUARD_HOME%\lib\proguard.jar" %* diff --git a/proguard/bin/proguard.sh b/proguard/bin/proguard.sh deleted file mode 100644 index 3ee60ed..0000000 --- a/proguard/bin/proguard.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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\"" - -# Account for possibly missing/basic readlink. -# POSIX conformant (dash/ksh/zsh/bash). -PROGUARD=`readlink -f "$0" 2>/dev/null` -if test "$PROGUARD" = '' -then - PROGUARD=`readlink "$0" 2>/dev/null` - if test "$PROGUARD" = '' - then - PROGUARD="$0" - fi -fi - -PROGUARD_HOME=`dirname "$PROGUARD"`/.. - -java -jar "$PROGUARD_HOME/lib/proguard.jar" "$@" diff --git a/proguard/bin/proguardgui.bat b/proguard/bin/proguardgui.bat deleted file mode 100644 index c328f5b..0000000 --- a/proguard/bin/proguardgui.bat +++ /dev/null @@ -1,14 +0,0 @@ -@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=%~dp0\.. -:home - -java -jar "%PROGUARD_HOME%\lib\proguardgui.jar" %* diff --git a/proguard/bin/proguardgui.sh b/proguard/bin/proguardgui.sh deleted file mode 100644 index aba7f62..0000000 --- a/proguard/bin/proguardgui.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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\"" - -# Account for possibly missing/basic readlink. -# POSIX conformant (dash/ksh/zsh/bash). -PROGUARD=`readlink -f "$0" 2>/dev/null` -if test "$PROGUARD" = '' -then - PROGUARD=`readlink "$0" 2>/dev/null` - if test "$PROGUARD" = '' - then - PROGUARD="$0" - fi -fi - -PROGUARD_HOME=`dirname "$PROGUARD"`/.. - -# 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/proguard/bin/retrace.bat b/proguard/bin/retrace.bat deleted file mode 100644 index ae16dde..0000000 --- a/proguard/bin/retrace.bat +++ /dev/null @@ -1,14 +0,0 @@ -@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=%~dp0\.. -:home - -java -jar "%PROGUARD_HOME%\lib\retrace.jar" %* diff --git a/proguard/bin/retrace.sh b/proguard/bin/retrace.sh deleted file mode 100644 index 2f274de..0000000 --- a/proguard/bin/retrace.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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\"" - -# Account for possibly missing/basic readlink. -# POSIX conformant (dash/ksh/zsh/bash). -PROGUARD=`readlink -f "$0" 2>/dev/null` -if test "$PROGUARD" = '' -then - PROGUARD=`readlink "$0" 2>/dev/null` - if test "$PROGUARD" = '' - then - PROGUARD="$0" - fi -fi - -PROGUARD_HOME=`dirname "$PROGUARD"`/.. - -java -jar "$PROGUARD_HOME/lib/retrace.jar" "$@" diff --git a/proguard/docs/downloads.md b/proguard/docs/downloads.md deleted file mode 100644 index 01725f0..0000000 --- a/proguard/docs/downloads.md +++ /dev/null @@ -1,19 +0,0 @@ -**ProGuard** is distributed under the terms of the GNU General Public License. -Please consult the [license page](license.md) for more details. - -ProGuard is written in Java, so it requires a Java Runtime Environment -(JRE 1.8 or higher). - -You can download ProGuard in various forms: - -- [Pre-built artifacts](https://search.maven.org/search?q=g:com.guardsquare) at Maven Central -- A [Git repository of the source code](https://github.com/Guardsquare/proguard) at Github -- The [complete ProGuard manual](https://www.guardsquare.com/proguard) at Guardsquare - -You can find major releases, minor releases with important bug fixes, and -beta releases with the latest new features and any less urgent bug fixes. - -If you're still working with an older version of ProGuard, check out the -[release notes](releasenotes.md), to see if you're missing something essential. -Unless noted otherwise, ProGuard remains compatible across versions, so -don't be afraid to update. diff --git a/proguard/docs/index.md b/proguard/docs/index.md deleted file mode 100644 index 483c63e..0000000 --- a/proguard/docs/index.md +++ /dev/null @@ -1,36 +0,0 @@ -**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. The -resulting applications and libraries are smaller, faster, and a bit better -hardened against reverse engineering. - -Typical applications: - -- Reducing the size of apps for faster downloads, shorter startup - times, and smaller memory footprints. -- Optimizing code for better performance on mobile devices. - -**ProGuard**'s main advantage compared to other Java obfuscators is probably -its compact template-based configuration. A few intuitive command line options -or a simple configuration file are usually sufficient. The user manual -explains all available options and shows examples of this powerful -configuration style. - -**ProGuard** is fast. It only takes seconds to process programs and libraries -of several megabytes. The results section presents actual figures for a number -of applications. - -**ProGuard** is a command-line tool with an optional graphical user interface. -It also comes with plugins for Ant, for Gradle, and for the JME Wireless -Toolkit. It is already part of Google's Android SDK, where it can be enabled -with a simple flag. - -**ProGuard** provides basic protection against reverse engineering and -tampering, with basic name obfuscation. -[**DexGuard**](http://www.guardsquare.com/dexguard), its specialized -commercial extension for Android, focuses further on the protection of apps, -additionally optimizing, obfuscating and encrypting strings, classes, -resources, resource files, asset files, and native libraries. Professional -developers should definitely consider it for security-sensitive apps. - diff --git a/proguard/docs/manual/FAQ.md b/proguard/docs/manual/FAQ.md deleted file mode 100644 index 9248b2c..0000000 --- a/proguard/docs/manual/FAQ.md +++ /dev/null @@ -1,212 +0,0 @@ -## What is shrinking? {: #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 name obfuscation? {: #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. Shrinkers such as **ProGuard** can remove the debugging -information and replace all names by meaningless character sequences, making -apps smaller. The program remains functionally equivalent, except for the class -names, method names, and line numbers given in exception stack traces. - -## What is preverification? {: #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** automatically preverifies the code that it processes. - -## What kind of optimizations does ProGuard support? {: #optimization} - -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: - -- Evaluate constant expressions. -- Remove unnecessary field accesses and method calls. -- Remove unnecessary branches. -- Remove unnecessary comparisons and instanceof tests. -- Remove unused code blocks. -- Merge identical code blocks. -- Reduce variable allocation. -- Remove write-only fields and unused method parameters. -- Inline constant fields, method parameters, and return values. -- Inline methods that are short or only called once. -- Simplify tail recursion calls. -- Merge classes and interfaces. -- Make methods private, static, and final when possible. -- Make classes static and final when possible. -- Replace interfaces that have single implementations. -- Perform over 200 peephole optimizations, like replacing `"The answer is - "+42` by `"The answer is 42"`. -- Optionally remove logging code. - -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. - -## Can I use ProGuard to process my commercial application? {: #commercial} - -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, 5,..., 19? {: #jdk1.4} - -Yes, **ProGuard** supports all JDKs from 1.1 up to and including 19. 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. Java 8 added more attributes and -default methods. Java 9 added support for modules. Java 11 added dynamic -constants and nest-based access control. Java 14 added records. Java 15 -added sealed classes. -**ProGuard** handles all versions correctly. - -## Does ProGuard work with Java Micro Edition? {: #jme} - -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. - -## Does ProGuard Support Android Apps? - -The **ProGuard Gradle Plugin** is compatible with Android Gradle Plugin (AGP) versions 4.x - 7.x. - -The **ProGuard** [keep rules configuration format](configuration/usage.md) is also supported by R8 (the default Android shrinker), -so you can use your R8, ProGuard and DexGuard keep rules interchangeably. - -See [Gradle Plugin setup](setup/gradleplugin.md) page for more information. - -## Does ProGuard have support for Ant? {: #ant} - -Yes. **ProGuard** provides an Ant task, so that it integrates seamlessly into -your Ant build process. You can still use configurations in **ProGuard**'s own -readable format. Alternatively, if you prefer XML, you can specify the -equivalent XML configuration. - -See [Ant setup](setup/ant.md) page for more information. - -## Does ProGuard have support for Java/Kotlin Gradle projects? {: #gradle} - -Yes. **ProGuard** also provides a Gradle task, so that it integrates into your -Gradle build process. You can specify configurations in **ProGuard**'s own -format or embedded in the Groovy configuration. - -See [Gradle setup](setup/gradle.md) page for more information. - -## Does ProGuard have support for Maven? {: #maven} - -While we don't officially provide a Maven integration and -we cannot provide support there are solutions available, -their offered functionality is not guaranteed by Guardsquare. - -Some open-source implementations: - -- [https://github.com/wvengen/proguard-maven-plugin](https://github.com/wvengen/proguard-maven-plugin) -- [https://github.com/dingxin/proguard-maven-plugin](https://github.com/dingxin/proguard-maven-plugin) - -## Does ProGuard come with a GUI? {: #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? {: #forname} - -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 developer can adapt his configuration -accordingly. - -## Does ProGuard handle resource files? {: #resource} - -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 string constants? {: #encrypt} - -No. String encryption in program code has to be perfectly reversible by -definition, so it only improves the obfuscation level. It increases the -footprint of the code. However, by popular demand, **ProGuard**'s -closed-source sibling for Android, -[**DexGuard**](http://www.guardsquare.com/dexguard), does provide string -encryption, along with more protection techniques against static and dynamic -analysis. - -## Does ProGuard perform control flow obfuscation? - -No. Control flow obfuscation injects additional branches into the bytecode, in -an attempt to fool decompilers. **ProGuard** does not do this, except to some -extent in its optimization techniques. **ProGuard**'s closed-source sibling -for Android, [**DexGuard**](http://www.guardsquare.com/dexguard), does offer -control flow obfuscation, as one of the many additional techniques to harden -Android apps. - -## Does ProGuard support incremental obfuscation? {: #incremental} - -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? {: #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? {: #stacktrace} - -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](manual/index.md) for more -details. - -## How is DexGuard different from ProGuard? - -[**DexGuard**](http://www.guardsquare.com/dexguard) is a commercial extension -of **ProGuard**: - -- **DexGuard** is specialized for Android applications and libraries: it - optimizes and obfuscates not just the bytecode, but also the manifest file, - resources, resource files, asset files, and native libraries. -- **DexGuard** focuses on making apps self-defending against reverse - engineering and tampering. **DexGuard**'s techniques for obfuscation, - encryption, and detection are a lot stronger than **ProGuard**'s basic name - obfuscation. -- **DexGuard** is backward compatible with **ProGuard**: it reads the same - configuration. It already comes with tuned configuration for the Android - runtime and for common Android libraries. diff --git a/proguard/docs/manual/building.md b/proguard/docs/manual/building.md deleted file mode 100644 index b582727..0000000 --- a/proguard/docs/manual/building.md +++ /dev/null @@ -1,71 +0,0 @@ -# Building ProGuard - -!!! info - - **ProGuard** is distributed under the terms of the GNU General Public License. Please consult the [license page](license/license.md) for more details. - -Building ProGuard is easy - you'll need: - -* a Java 8 JDK installed -* a clone of the [ProGuard](https://github.com/Guardsquare/proguard.git) repository - -You can then execute a composite build with the following Gradle command: - -=== "Linux/macOS" - ```bash - ./gradlew assemble - ``` - -=== "Windows" - ```bash - gradlew assemble - ``` - - -The artifacts will be generated in the `lib` directory. You can then execute ProGuard using the -scripts in `bin`, for example: - -=== "Linux/macOS" - - ```bash - bin/proguard.sh - ``` - -=== "Windows" - - ```bash - bin\proguard.bat - ``` - -## Publish to Maven local - - -You can publish the artifacts to your local Maven cache (something like `~/.m2/`): - -=== "Linux/macOS" - ```bash - ./gradlew publishToMavenLocal - ``` - -=== "Windows" - ```bash - gradlew publishToMavenLocal - ``` - -## Building a release distribution - -You can build tar and zip archives with the binaries and documentation: - - -=== "Linux/macOS" - - ```bash - ./gradlew distTar distZip - ``` - -=== "Windows" - - ```bash - gradlew distTar distZip - ``` - diff --git a/proguard/docs/manual/configuration/attributes.md b/proguard/docs/manual/configuration/attributes.md deleted file mode 100644 index 554dd66..0000000 --- a/proguard/docs/manual/configuration/attributes.md +++ /dev/null @@ -1,176 +0,0 @@ -Class files essentially define classes, their fields, and their methods. A lot -of essential and non-essential data are attached to these classes, fields, and -methods as *attributes*. For instance, attributes can contain bytecode, source -file names, line number tables, etc. - -ProGuard's obfuscation step removes attributes that are generally not -necessary for executing the code. With the -[`-keepattributes`](usage.md#keepattributes) option, you can specify a filter -for attributes that you do want to keep, for instance if your code accesses -them through reflection, or if you want to preserve some compilation or -debugging information. The filter works like any [filter](usage.md#filters) in -ProGuard. - -The following wildcards are supported: - -| Wildcard | Meaning -|-----|---------------------------------------------------- -| `?` | matches any single character in an attribute name. -| `*` | matches any part of an attribute name. - -An attribute name that is preceded by an exclamation mark '**!**' is -*excluded* from further attempts to match with *subsequent* attribute names in -the filter. Make sure to specify filters correctly, since they are not checked -for potential typos. - -For example, the following setting preserves the optional attributes that are -typically necessary when processing code that is intended to be used as a -library: -```proguard --keepattributes Exceptions,InnerClasses,Signature,Deprecated, - SourceFile,LineNumberTable,*Annotation*,EnclosingMethod -``` - -The Java bytecode specifications currently specify the following list of -attributes. - -## Optional attributes - -ProGuard's obfuscation step by default discards the following optional -attributes. You can keep them with the -[`-keepattributes`](usage.md#keepattributes) option. - -`SourceFile` -: Specifies the name of the source file from which the class file was - compiled. If present, this name is reported in stack traces. - -`SourceDir`
(J++ extension)
-: Specifies the name of the source directory from which the class file was - compiled. - -`Record`
(Java 14 or higher)
-: Specifies the components of a record class. Code may access this information - by reflection. - -`InnerClasses` -: Specifies the relationship between a class and its inner classes and outer - classes. Other than this and the naming convention with a '\$' separator - between the names of inner classes and outer classes, inner classes are just - like ordinary classes. Compilers may need this information to find classes - referenced in a compiled library. Code may access this information by - reflection, for instance to derive the simple name of the class. - -`PermittedSubclasses`
(Java 15 or higher)
-: Specifies the allowed extensions or implementations of sealed classes or - interfaces. - -`EnclosingMethod`
(Java 5 or higher)
-: Specifies the method in which the class was defined. Compilers may need this - information to find classes referenced in a compiled library. Code may - access this information by reflection, for instance to derive the simple - name of the class. - -`Deprecated` -: Indicates that the class, field, or method is deprecated. - -`Synthetic` -: Indicates that the class, field, or method was generated by the compiler. - -`Signature`
(Java 5 or higher)
-: Specifies the generic signature of the class, field, or method. Compilers - may need this information to properly compile classes that use generic types - from compiled libraries. Code may access this signature by reflection. - -`MethodParameters`
(Java 8 or higher)
-: Specifies the names and access flags of the parameters of the method. Code - may access this information by reflection. - -`Exceptions` -: Specifies the exceptions that a method may throw. Compilers may use this - information to enforce catching them. - -`LineNumberTable` -: Specifies the line numbers of the method. If present, these line numbers are - reported in stack traces. - -`LocalVariableTable` -: Specifies the names and types of local variables of the method. If present, - some IDEs may use this information for helping with auto-completion. - -`LocalVariableTypeTable`
(Java 5 or higher)
-: Specifies the names and generic types of local variables of the method. If - present, some IDEs may use this information for helping with - auto-completion. - -`RuntimeVisibleAnnotations`
(Java 5 or higher)
-: Specifies the annotations that are visible at run-time, for classes, fields, - and methods. Compilers and annotation processors may use these annotations. - Code may access them by reflection. - -`RuntimeInvisibleAnnotations`
(Java 5 or higher)
- -: Specifies the annotations that are visible at compile-time, for classes, - fields, and methods. Compilers and annotation processors may use these - annotations. - -`RuntimeVisibleParameterAnnotations`
(Java 5 or higher)
- -: Specifies the annotations that are visible at run-time, for method - parameters. Compilers and annotation processors may use these annotations. - Code may access them by reflection. - -`RuntimeInvisibleParameterAnnotations`
(Java 5 or higher)
- -: Specifies the annotations that are visible at compile-time, for method - parameters. Compilers and annotation processors may use these annotations. - -`RuntimeVisibleTypeAnnotations`
(Java 8 or higher)
-: Specifies the annotations that are visible at run-time, for generic types, - instructions, etc. Compilers and annotation processors may use these - annotations. Code may access them by reflection. - -`RuntimeInvisibleTypeAnnotations`
(Java 8 or higher)
- -: Specifies the annotations that are visible at compile-time, for generic - types, instructions, etc. Compilers and annotation processors may use these - annotations. - -`AnnotationDefault`
(Java 5 or higher)
-: Specifies a default value for an annotation. - -## Essential attributes - -ProGuard automatically keeps the following essential attributes, processing -them as necessary. We're listing them for the sake of completeness: - -`ConstantValue` -: Specifies a constant integer, float, class, string, etc. - -`Code` -: Specifies the actual bytecode of a method. - -`StackMap`
(Java Micro Edition)
-: Provides preverification information. The Java Virtual Machine can use this - information to speed up the verification step when loading a class. - -`StackMapTable`
(Java 6 or higher)
-: Provides preverification information. The Java Virtual Machine can use this - information to speed up the verification step when loading a class. - -`BootstrapMethods`
(Java 7 or higher)
-: Specifies the methods to bootstrap dynamic method invocations. - -`Module`
(Java 9 or higher)
-: Specifies the dependencies of a _module_. - -`ModuleMainClass`
(Java 9 or higher)
-: Specifies the main class of a _module_. - -`ModulePackages`
(Java 9 or higher)
-: Specifies the packages of a _module_. - -`NestHost`
(Java 11 or higher)
-: Specifies the host class of a _nest_, for example an outer class. - -`NestMembers`
(Java 11 or higher)
-: Specifies the members of a _nest_, for example the inner classes. diff --git a/proguard/docs/manual/configuration/examples.md b/proguard/docs/manual/configuration/examples.md deleted file mode 100644 index 240f773..0000000 --- a/proguard/docs/manual/configuration/examples.md +++ /dev/null @@ -1,1409 +0,0 @@ -You can find some sample configuration files in the `examples` directory -of the ProGuard distribution. - -## Processing different types of applications {: #applicationtypes} - -### A typical application {: #application} - -To shrink, optimize, and obfuscate a simple Java application, you -typically create a configuration file like `myconfig.pro`, which you can -then use with -```sh -bin/proguard @myconfig.pro -``` - -The configuration file specifies the input, the output, and the entry -points of the application: -```proguard --injars myapplication.jar --outjars myapplication_out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --printmapping myapplication.map - --keep public class com.example.MyMain { - public static void main(java.lang.String[]); -} -``` - -Note the use of the `` system property. ProGuard automatically -replaces it when parsing the file. In this example, the library jar is the -base Java runtime module, minus some unwanted files. For Java 8 or older, the -Java runtime jar would be `/lib/rt.jar` instead. You may need -additional modules or jars if your application depends on them. - -The [`-keep`](usage.md#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: `com.example.MyMain` and -`java.lang.String[]`. - -You can refine your keep rules using the ProGuard Playground which visualizes -how your keep rules match the entities in your app. - - - -We're writing out an obfuscation mapping file with -[`-printmapping`](usage.md#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: -```proguard --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](#repackaging). - -In general, you might need a few additional options for processing [native -methods](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -### A typical applet {: #applet} - -These options shrink, optimize, and obfuscate the applet -`com.example.MyApplet`: -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --keep public class com.example.MyApplet -``` - -The typical applet methods will be preserved automatically, since -`com.example.MyApplet` is an extension of the `Applet` class in the library -`rt.jar`. - -If applicable, you should add options for processing [native -methods](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -### A typical midlet {: #midlet} - -These options shrink, optimize, obfuscate, and preverify the midlet -`com.example.MyMIDlet`: -```proguard --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 com.example.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 -`com.example.MyMIDlet` is an extension of the `MIDlet` class in the library -`midpapi20.jar`. - -The [`-microedition`](usage.md#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`](usage.md#dontusemixedcaseclassnames) option. - -If applicable, you should add options for processing [native methods](#native) -and [resource files](#resourcefiles). - -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 {: #jcapplet} - -These options shrink, optimize, and obfuscate the Java Card applet -`com.example.MyApplet`: -```proguard --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 com.example.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 {: #xlet} - -These options shrink, optimize, and obfuscate the xlet `com.example.MyXlet`: -```proguard --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 com.example.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 typical library {: #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. -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --printmapping out.map - --keep public class * { - public protected *; -} - --keepparameternames --renamesourcefileattribute SourceFile --keepattributes Signature,Exceptions,*Annotation*, - InnerClasses,PermittedSubclasses,EnclosingMethod, - Deprecated,SourceFile,LineNumberTable - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - --keepclassmembers,allowoptimization 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 a developers ever wants 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`](usage.md#keep) options. - -The "Signature" attribute is required to be able to access generic types. - -The "Exceptions" attribute has to be preserved, so the compiler knows -which exceptions methods may throw. - -The various "\*Annotations\*" attributes contain any annotations, which -developers might need to access through reflection. - -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 "PermittedSubclasses" attribute defines sealed classes, which developers -can't extend further. - -The "EnclosingMethod" attribute marks classes that are defined inside methods. - -The "Deprecated" attribute marks any deprecated classes, fields, or -methods, which may be useful for developers to know. - -The [`-keepparameternames`](usage.md#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](#stacktrace). - -We've also added some options for for processing [native methods](#native), -[enumerations](#enumerations), [serializable classes](#serializable), and -[annotations](#annotations), which are all discussed in their respective -examples. - -### All possible applications in the input jars {: #applications} - -These options shrink, optimize, and obfuscate all public applications in -`in.jar`: -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --printseeds - --keepclasseswithmembers public class * { - public static void main(java.lang.String[]); -} -``` - -Note the use of [`-keepclasseswithmembers`](usage.md#keepclasseswithmembers). -We don't want to preserve all classes, just all classes that have main -methods, _and_ those methods. - -The [`-printseeds`](usage.md#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](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -### All possible applets in the input jars {: #applets} - -These options shrink, optimize, and obfuscate all public applets in `in.jar`: -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --libraryjars /jmods/java.desktop.jmod(!**.jar;!module-info.class) --printseeds - --keep public class * extends java.applet.Applet -``` - -We're simply keeping all classes that extend the `Applet` class. - -Again, the [`-printseeds`](usage.md#printseeds) option prints out which -applets exactly will be preserved. - -If applicable, you should add options for processing [native -methods](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -### All possible midlets in the input jars {: #midlets} - -These options shrink, optimize, obfuscate, and preverify all public midlets in -`in.jar`: -```proguard --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`](usage.md#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`](usage.md#dontusemixedcaseclassnames) option. - -The [`-printseeds`](usage.md#printseeds) option prints out which midlets -exactly will be preserved. - -If applicable, you should add options for processing [native methods](#native) -and [resource files](#resourcefiles). - -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 {: #jcapplets} - -These options shrink, optimize, and obfuscate all public Java Card -applets in `in.jar`: -```proguard --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`](usage.md#printseeds) option prints out which applets -exactly will be preserved. - -### All possible xlets in the input jars {: #xlets} - -These options shrink, optimize, and obfuscate all public xlets in `in.jar`: -```proguard --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`](usage.md#printseeds) option prints out which xlets exactly -will be preserved. - -### All possible servlets in the input jars {: #servlets} - -These options shrink, optimize, and obfuscate all public servlets in `in.jar`: -```proguard --injars in.jar --outjars out.jar --libraryjars /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`](usage.md#printseeds) option prints out which -servlets exactly will be preserved. - -If applicable, you should add options for processing [native -methods](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -### Scala applications with the Scala runtime {: #scala} - -These options shrink, optimize, and obfuscate all public Scala applications in -`in.jar`: -```proguard --injars in.jar --injars /usr/local/java/scala-2.9.1/lib/scala-library.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --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](#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`](usage.md#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`](usage.md#keepoverview) 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](#native), [callback methods](#callback), -[enumerations](#enumerations), [serializable classes](#serializable), [bean -classes](#beans), [annotations](#annotations), and [resource -files](#resourcefiles). - -## Processing common code constructs {: #commonconstructs} - -### Processing native methods {: #native} - -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: -```proguard --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} -``` - -Note the use of -[`-keepclasseswithmembernames`](usage.md#keepclasseswithmembernames). We don't -want to preserve all classes or all native methods; we just want to keep the -relevant names from being obfuscated. The modifier -[includedescriptorclasses](usage.md#includedescriptorclasses) additionally -makes sure that the return types and parameter types aren't renamed either, so -the entire signatures remain compatible with the native libraries. - -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](#callback) are discussed below as a typical example. - -### Processing callback methods {: #callback} - -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`](usage.md#keep) options, something -like the following option will keep the callback class and method: -```proguard --keep class com.example.MyCallbackClass { - void myCallbackMethod(java.lang.String); -} -``` - -This will preserve the given class and method from being removed or renamed. - -### Processing enumeration classes {: #enumerations} - -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: -```proguard --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} -``` - -### Processing serializable classes {: #serializable} - -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: - -- Often, serialization is simply a means of transporting data, without - long-term storage. Classes that are shrunk and obfuscated should then - continue to function fine with the following additional options: -```proguard - -keepclassmembers class * implements java.io.Serializable { - 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(); - } -``` - - The [`-keepclassmembers`](usage.md#keepclassmembers) option makes sure - that any serialization methods are kept. By using this option instead of - the basic `-keep` option, we're not forcing preservation of *all* - serializable classes, just preservation of the listed members of classes - that are actually used. - -- Sometimes, the serialized data are stored, and read back later into newer - versions of the serializable classes. One then has to take care the classes - remain compatible with their unprocessed versions and with future processed - versions. In such cases, the relevant classes will most likely have - `serialVersionUID` fields. The following options should then be sufficient - to ensure compatibility over time: -```proguard - -keepnames class * implements java.io.Serializable - - -keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - private static final java.io.ObjectStreamField[] serialPersistentFields; - !static !transient ; - private void writeObject(java.io.ObjectOutputStream); - private void readObject(java.io.ObjectInputStream); - java.lang.Object writeReplace(); - java.lang.Object readResolve(); - } -``` - - The `serialVersionUID` and `serialPersistentFields` lines makes sure those - fields are preserved, if they are present. The `` line preserves - all non-static, non-transient fields, with their original names. The - introspection of the serialization process and the de-serialization - process will then find consistent names. - -- Occasionally, the serialized data have to remain compatible, but the classes - involved lack `serialVersionUID` fields. I imagine the original code will - then be hard to maintain, since the serial version UID is then computed from - a list of features the serializable class. Changing the class ever so - slightly may change the computed serial version UID. The list of features is - specified in the section on [Stream Unique - Identifiers](http://docs.oracle.com/javase/8/docs/platform/serialization/spec/class.html#a4100) - of Sun's [Java Object Serialization - Specification](http://docs.oracle.com/javase/8/docs/platform/serialization/spec/serialTOC.html). - The following directives should at least partially ensure compatibility with - the original classes: -```proguard - -keepnames class * implements java.io.Serializable - - -keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - private static final java.io.ObjectStreamField[] serialPersistentFields; - !static !transient ; - !private ; - !private ; - private void writeObject(java.io.ObjectOutputStream); - private void readObject(java.io.ObjectInputStream); - java.lang.Object writeReplace(); - java.lang.Object readResolve(); - } -``` - - The new options force preservation of the elements involved in the UID - computation. In addition, the user will have to manually specify all - interfaces of the serializable classes (using something like "`-keep - interface MyInterface`"), since these names are also used when computing - the UID. A fast but sub-optimal alternative would be simply keeping all - interfaces with "`-keep interface *`". - -- In the rare event that you are serializing lambda expressions in Java 8 or - higher, you need to preserve some methods and adapt the hard-coded names of - the classes in which they occur: -```proguard - -keepclassmembers class * { - private static synthetic java.lang.Object $deserializeLambda$(java.lang.invoke.SerializedLambda); - } - - -keepclassmembernames class * { - private static synthetic *** lambda$*(...); - } - - -adaptclassstrings com.example.Test -``` - - This should satisfy the reflection in the deserialization code of the Java - run-time. - -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 {: #beans} - -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: -```proguard --keep public class com.example.MyBean { - public void setMyProperty(int); - public int getMyProperty(); -} - --keep public class com.example.MyBeanEditor -``` - -If there are too many elements to list explicitly, wildcards in class -names and method signatures might be helpful. This example preserves all -possible setters and getters in classes in the package `mybeans`: -```proguard --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 {: #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: -```proguard --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: -```proguard --keepattributes EnclosingMethod -``` - -### Processing database drivers {: #database} - -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: -```proguard --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 {: #componentui} - -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: -```proguard --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 common libraries {: #commonlibraries} - -### Processing RMI code {: #rmi} - -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: -```proguard --keepattributes Exceptions - --keep interface * extends java.rmi.Remote { - ; -} - --keep class * implements java.rmi.Remote { - (java.rmi.activation.ActivationID, java.rmi.MarshalledObject); {: #activation} -} -``` - -The first [`-keep`](usage.md#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. - -### Optimizing Gson code {: #gson} - -ProGuard [optimizes Gson code](optimizations.md#gson), by detecting which -domain classes are serialized using the Gson library, and then replacing the -reflection-based implementation by more efficient hard-coded serialization. - -The GSON optimization is enabled by default and doesn't require any additional -configuration. If you've disabled optimization, the GSON library still relies -on reflection on the fields of the classes that it serializes. You then need -to preserve the parameterless constructor and the serialized fields from being -removed, optimized, or obfuscated. For example: -```proguard --keepclassmembers class com.example.SerializedClass { - ; - (); -} -``` - -While creating the configuration, you can specify the option -[`-addconfigurationdebugging`](usage.md#addconfigurationdebugging), to get -feedback on the necessary settings at run-time. - -Alternatively, you can make sure the fields are explicitly annotated with -`@SerializedName`, so the names of the fields can be obfuscated. You can -then keep all of them at the same time with: -```proguard --keepclasseswithmembers,allowobfuscation,includedescriptorclasses class * { - @com.google.gson.annotations.SerializedName ; -} - --keepclassmembers enum * { - @com.google.gson.annotations.SerializedName ; -} -``` - -### Processing dependency injection {: #injection} - -If your application is using JEE-style dependency injection, the application -container will automatically assign instances of resource classes to fields -and methods that are annotated with `@Resource`. The container applies -introspection, even accessing private class members directly. It typically -constructs a resource name based on the type name and the class member name. -We then have to avoid that such class members are removed or renamed: -```proguard --keepclassmembers class * { - @javax.annotation.Resource *; -} -``` - -The Spring framework has another similar annotation `@Autowired`: -```proguard --keepclassmembers class * { - @org.springframework.beans.factory.annotation.Autowired *; -} -``` - -## Further processing possibilities {: #furtherpossibilities} - -### Processing resource files {: #resourcefiles} - -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: -```proguard --adaptresourcefilenames **.properties,**.gif,**.jpg --adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF -``` - -The [`-adaptresourcefilenames`](usage.md#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`](usage.md#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 {: #manifestfiles} - -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](usage.md#filters): -```proguard --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 {: #stacktrace} - -These options let obfuscated applications or libraries produce stack traces -that can still be deciphered later on: -```proguard --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](../tools/retrace.md) tool to -restore the original stack trace. - -### Obfuscating package names {: #repackaging} - -Package names can be obfuscated in various ways, with increasing levels of -obfuscation and compactness. For example, consider the following classes: -```proguard -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: -```proguard -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`](usage.md#flattenpackagehierarchy) option -obfuscates the package names further, by flattening the package hierarchy of -obfuscated packages: -```proguard --flattenpackagehierarchy 'myobfuscated' -``` - -The obfuscated class names then look as follows: -```proguard -mycompany.myapplication.MyMain -mycompany.myapplication.a -mycompany.myapplication.b -myobfuscated.a.a -myobfuscated.a.b -myobfuscated.b.a -myobfuscated.b.b -``` - -Alternatively, the [`-repackageclasses`](usage.md#repackageclasses) option -obfuscates the entire packaging, by combining obfuscated classes into a single -package: -```proguard --repackageclasses 'myobfuscated' -``` - -The obfuscated class names then look as follows: -```proguard -mycompany.myapplication.MyMain -mycompany.myapplication.a -mycompany.myapplication.b -myobfuscated.a -myobfuscated.b -myobfuscated.c -myobfuscated.d -``` - -Additionally specifying the -[`-allowaccessmodification`](usage.md#allowaccessmodification) option allows -access permissions of classes and class members to be broadened, opening up -the opportunity to repackage all obfuscated classes: -```proguard --repackageclasses 'myobfuscated' --allowaccessmodification -``` - -The obfuscated class names then look as follows: -```proguard -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: -```proguard --repackageclasses '' --allowaccessmodification -``` - -The obfuscated class names are then the shortest possible names: -```proguard -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](#resourcefiles) that have to be adapted. - -### Removing logging code {: #logging} - -You can let ProGuard remove logging code. The trick is to specify that the -logging methods don't have side-effects — even though they actually do, since -they write to the console or to a log file. ProGuard will take your word for -it and remove the invocations (in the optimization step) and if possible the -logging classes and methods themselves (in the shrinking step). - -For example, this configuration removes invocations of some -logging methods: -```proguard --assumenosideeffects class com.example.MyLogger { - public static boolean isLoggable(java.lang.String, int); - public static int v(...); - public static int i(...); - public static int w(...); - public static int d(...); - public static int e(...); -} -``` - -The wildcards are a shortcut to match all versions of the methods. Be careful -not to use a `*` wildcard to match all methods, because it would also match -methods like `wait()`, higher up the hierarchy. Removing those invocations -will generally break your code. - -Note that you generally can't remove logging code that uses -`System.out.println`, since you would be removing all invocations of -`java.io.PrintStream#println`, which could break your application. You can -work around it by creating your own logging methods and let ProGuard remove -those. - -Logging statements often contain implicit calls that perform string -concatenation. They no longer serve a purpose after the logging calls have -been removed. You can let ProGuard clean up such constructs as well by -providing additional hints: -```proguard --assumenoexternalsideeffects class java.lang.StringBuilder { - public java.lang.StringBuilder(); - public java.lang.StringBuilder(int); - public java.lang.StringBuilder(java.lang.String); - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); - public java.lang.String toString(); -} - --assumenoexternalreturnvalues public final class java.lang.StringBuilder { - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); -} -``` - -Be careful specifying your own assumptions, since they can easily break -your code. - -### Restructuring the output archives {: #restructuring} - -In simple applications, all output classes and resources files are merged into -a single jar. For example: -```proguard --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 apks, aars, -wars, ears, jmods, zips, or directories), you can specify an output directory -(or an apk, an aar, a war, an ear, a jmod, or a zip). For example: -```proguard --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: -```proguard --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: -```proguard --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 apks, aars, wars, ears, jmods, zips, -or directories) into output jars (and/or apks, aars, wars, ears, jmods, zips, -or directories), you can group the [`-injars`](usage.md#injars) and -[`-outjars`](usage.md#outjars) options. For example: -```proguard --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 {: #filtering} - -If you want even greater control, you can add [filters](usage.md#filters) to -the input and the output, filtering out apks, jars, aars, wars, ears, jmods, -zips, and/or ordinary files. For example, if you want to disregard certain -files from an input jar: -```proguard --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: -```proguard --injars in1.jar --injars in2.jar(!META-INF/MANIFEST.MF) --injars in3.jar(!META-INF/MANIFEST.MF) --outjars out.jar -``` - -Another useful application is ignoring unwanted files from the runtime library -module: -```proguard --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -``` - -The filter makes ProGuard disregard redundant jars inside the module, and -module info classes that would only cause conflicts with duplicate names. - -It is also possible to filter the jars (and/or apks, aabs, aars, wars, ears, -jmods, zips) themselves, based on their names. For example: -```proguard --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: -```proguard --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 {: #multiple} - -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: -```proguard --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 {: #incremental} - -After having [processed an application](#application), e.g. ProGuard itself, -you can still incrementally add other pieces of code that depend on it, e.g. -the ProGuard GUI: -```proguard --injars proguardgui.jar --outjars proguardgui_out.jar --injars proguard.jar --outjars proguard_out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --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`](usage.md#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`](usage.md#useuniqueclassmembernames), -[`-dontshrink`](usage.md#dontshrink), and -[`-dontoptimize`](usage.md#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: -```proguard --injars proguardgui.jar --outjars proguardgui_out.jar --libraryjars proguard.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --applymapping proguard.map - --keep public class proguard.gui.ProGuardGUI { - public static void main(java.lang.String[]); -} -``` - -## Other uses {: #otheruses} - -### Preverifying class files for Java Micro Edition {: #microedition} - -Even if you're not interested in shrinking, optimizing, and obfuscating your -midlets, as shown in the [midlets example](#midlets), 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. -```proguard --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`](usage.md#microedition) option. Note that we don't need any -[`-keep`](usage.md#keep) options to specify entry points; all class files are -simply preverified. - -### Upgrading old class files to Java 6 {: #upgrade} - -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. -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --dontshrink --dontoptimize --dontobfuscate - --target 1.6 -``` - -We're not processing the input, just retargeting the class files with the -[`-target`](usage.md#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 {: #deadcode} - -These options list unused classes, fields, and methods in the application -`com.example.MyApplication`: -```proguard --injars in.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --dontoptimize --dontobfuscate --dontpreverify --printusage - --keep public class com.example.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`](usage.md#keepclassmembers) option that -keeps those fields a priori, in order to avoid having them listed: -```proguard --keepclassmembers class * { - static final % *; - static final java.lang.String *; -} -``` - -### Printing out the internal structure of class files {: #structure} - -These options print out the internal structure of all class files in the -input jar: -```proguard --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 {: #annotated} - -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 `lib/annotations.jar` in -the ProGuard distribution. The corresponding ProGuard configuration (or -meta-configuration, if you prefer) is specified in -`annotations/annotations.pro`. With these files, you can start annotating your -code. For instance, a java source file `Application.java` can be annotated as -follows: -```java -@KeepApplication -public class Application { - .... -} -``` - -The ProGuard configuration file for the application can then be simplified by -leveraging these annotations: -```proguard --injars in.jar --outjars out.jar --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --include lib/annotations.pro -``` - -The annotations are effectively replacing the application-dependent `-keep` -options. You may still wish to add traditional [`-keep`](usage.md#keep) -options for processing [native methods](#native), -[enumerations](#enumerations), [serializable classes](#serializable), and -[annotations](#annotations). - -The directory `examples/annotations` contains more examples that illustrate -some of the possibilities. diff --git a/proguard/docs/manual/configuration/optimizations.md b/proguard/docs/manual/configuration/optimizations.md deleted file mode 100644 index a8a2e68..0000000 --- a/proguard/docs/manual/configuration/optimizations.md +++ /dev/null @@ -1,221 +0,0 @@ -The optimization step of ProGuard can be switched off with the -[`-dontoptimize`](usage.md#dontoptimize) option. For more fine-grained -control over individual optimizations, experts can use the -[`-optimizations`](usage.md#optimizations) option, with a filter based -on the optimization names listed below. The filter works like any -[filter](usage.md#filters) in ProGuard. - -The following wildcards are supported: - -| Wildcard | Meaning -|-----|------------------------------------------------------- -| `?` | 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 for newer versions, as -optimizations are added and reorganized. - -`library/gson` -: Optimizes usages of the Gson library, whenever possible. See [Gson - optimization](optimizations.md#gson) for more details. - -`class/marking/final` -: Marks classes as final, whenever possible. - -`class/unboxing/enum` -: Simplifies enum types to integer constants, 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. - -`class/merging/wrapper` -: Merges wrapper classes with their wrapped classes, whenever possible. - -`field/removal/writeonly`
(⇒ `code/removal/advanced`)
-: Removes write-only fields. - -`field/marking/private` -: Marks fields as private, whenever possible. - -`field/generalization/class` -: Generalizes the classes of field accesses, whenever possible. - -`field/specialization/type` -: Specializes the types of fields, whenever possible - -`field/propagation/value`
(⇒ `code/simplification/advanced`)
-: Propagates the values of fields across methods. - -`method/marking/private` -: Marks methods as private, whenever possible (*devirtualization*). - -`method/marking/static`
(⇒ `code/removal/advanced`)
-: Marks methods as static, whenever possible (*devirtualization*). - -`method/marking/final` -: Marks methods as final, whenever possible. - -`method/marking/synchronized` -: Unmarks methods as synchronized, whenever possible. - -`method/removal/parameter`
(⇒ `code/removal/advanced`)
-: Removes unused method parameters. - -`method/generalization/class` -: Generalizes the classes of method invocations, whenever possible. - -`method/specialization/parametertype` -: Specializes the types of method parameters, whenever possible. - -`method/specialization/returntype` -: Specializes the types of method return values, whenever possible. - -`method/propagation/parameter`
(⇒ `code/simplification/advanced`)
-: Propagates the values of method parameters from method invocations to the - invoked methods. - -`method/propagation/returnvalue`
(⇒ `code/simplification/advanced`)
-: 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/simplification/branch`
(⇒ `code/removal/simple`)
-: Performs peephole optimizations for branch instructions. - -`code/simplification/object` -: Performs peephole optimizations for object instantiation. - -`code/simplification/string` -: Performs peephole optimizations for constant strings. - -`code/simplification/math` -: Performs peephole optimizations for Math method calls. - -`code/simplification/advanced`
(*best used with* `code/removal/advanced`)
-: Simplifies code based on control flow analysis and data flow analysis. - -`code/removal/advanced`
(⇒ `code/removal/exception`)
-: Removes dead code based on control flow analysis and data flow analysis. - -`code/removal/simple`
(⇒ `code/removal/exception`)
-: 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. - -ProGuard also provides some unofficial settings to control -optimizations, that may disappear in future versions. These are Java -system properties, which can be set as JVM arguments (with `-D...`): - -`maximum.inlined.code.length` (default = 8 bytes) -: Specifies the maximum code length (expressed in bytes) of short methods - that are eligible to be inlined. Inlining methods that are too long may - unnecessarily inflate the code size. - -`maximum.resulting.code.length` (default = 8000 bytes for JSE, 2000 bytes for JME) -: Specifies the maximum resulting code length (expressed in bytes) allowed - when inlining methods. Many Java virtual machines do not apply just-in-time - compilation to methods that are too long, so it's important not to let them - grow too large. - -## Aggressive optimization - -ProGuard provides the `-optimizeaggressively` option. If set, this enables more -aggressive assumptions during optimization. This might lead to -improved performance and/or reduced code size, but might result in different behavior in rare cases. -For example, reading from an array might cause an -`ArrayIndexOutOfBoundsException` to be thrown. Strictly speaking, this means -that such an instruction can have a side effect. If this instruction is removed -during optimization, the code will thus behave differently under specific -circumstances. By default, such instructions are always preserved. Setting this -option will lead to these instructions being candidates for removal during -optimization. Additionally, class merging is only enabled when this option is set. - -## Gson optimization {: #gson} - -ProGuard optimizes Gson code by detecting which domain classes are serialized -using the Gson library. It replaces the reflection-based implementation of -GSON for reading and writing fields with injected and optimized code that -accesses the fields of the domain classes directly when reading and writing -JSON. The benefits of this optimization are the following: - -- Domain classes used in conjunction with GSON can be freely obfuscated. -- The injected serialization code gives better performance compared to the - GSON implementation, which relies on reflection. -- Less configuration is needed as the optimization automatically keeps classes - and fields that are required for serialization. - -### Configuration - -The Gson optimization is enabled by default and doesn't require any additional -configuration, as long as the application code doesn't use unsupported Gson -features(see [Known limitations](optimizations.md#gsonlimitations)). - -### Known limitations {: #gsonlimitations} - -ProGuard can not optimize the following use cases of Gson: - -- Serializing classes containing one of the following Gson annotations: - - `@JsonAdapter` - - `@Since` - - `@Until` -- Serializing classes that have generic type variables in their signature. -- Serializing classes using a Gson instance that was built with one of the - following settings on the GsonBuilder: - - `excludeFieldsWithModifier` - - `setFieldNamingPolicy` - -When one of the above Gson features is used, ProGuard automatically preserves -the original Gson implementation for all affected domain classes. - -This means that the serialized fields of these domain classes need to be -explicitly kept again in the ProGuard configuration so that they can be -safely accessed through reflection. diff --git a/proguard/docs/manual/configuration/usage.md b/proguard/docs/manual/configuration/usage.md deleted file mode 100644 index 38fc112..0000000 --- a/proguard/docs/manual/configuration/usage.md +++ /dev/null @@ -1,1020 +0,0 @@ -This page lists all available options for ProGuard, grouped logically. - -!!! android R8 - R8, the default Android shrinker, is compatible with ProGuard keep rules. - -## Input/Output Options {: #iooptions} - -`@`{: #at} [*filename*](#filename) -: Short for '[`-include`](#include) [*filename*](#filename)'. - -`-include`{: #include} [*filename*](#filename) -: Recursively reads configuration options from the given file *filename*. - -`-basedirectory`{: #basedirectory} [*directoryname*](#filename) -: Specifies the base directory for all subsequent relative file names in - these configuration arguments or this configuration file. - -`-injars`{: #injars} [*class\_path*](#classpath) -: Specifies the input jars (or apks, aabs, aars, wars, ears, jmods, 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](#filefilters) section. For better - readability, class path entries can be specified using multiple `-injars` - options. - -`-outjars`{: #outjars} [*class\_path*](#classpath) -: Specifies the names of the output jars (or apks, aabs, aars, wars, ears, - jmods, zips, or directories). The processed input of the preceding - [`-injars`](usage.md#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](#filefilters) 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`](usage.md#outjars) options. Without any - [`-outjars`](usage.md#outjars) options, no jars will be written. - -`-libraryjars`{: #libraryjars} [*class\_path*](#classpath) -: Specifies the library jars (or apks, aabs, aars, wars, ears, jmods, zips, - 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](#filefilters) 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](examples.md#application) as well as [JME - midlets](examples.md#midlet), just by specifying the appropriate - run-time jar. - -`-skipnonpubliclibraryclasses`{: #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`{: #dontskipnonpubliclibraryclasses} -: Specifies not to ignore non-public library classes. As of version 4.5, - this is the default setting. - -`-dontskipnonpubliclibraryclassmembers`{: #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`{: #keepdirectories} \[*[directory\_filter](#filefilters)*\] -: Specifies the directories to be kept in the output jars (or apks, aabs, - aars, wars, ears, jmods, zips, or directories). By default, directory - entries are removed. This reduces the jar size, but it may break your - program if the code tries to find them with constructs like - "`com.example.MyClass.class.getResource("")`". You'll then want to keep the - directory corresponding to the package, "`-keepdirectories com.example`". If - the option is specified without a filter, all directories are kept. With a - filter, only matching directories are kept. For instance, "`-keepdirectories - mydirectory`" matches the specified directory, "`-keepdirectories - mydirectory/*`" matches its immediate subdirectories, and "`-keepdirectories - mydirectory/**`" matches all of its subdirectories. - -`-target`{: #target} *version* -: **Deprecated: this option is only applicable for Java class file versions <= 11.** - Specifies the version number to be set in the processed class files. The - version number can be one of `1.0`,..., `1.9`, or the more recent short - numbers `5`,..., `12`. By default, the version numbers of the class files - are left unchanged. For example, you may want to [upgrade class files to - Java 6](examples.md#upgrade). ProGuard changes their version numbers and - preverifies them. You can also downgrade class files to older versions than - Java 8. ProGuard changes their version numbers and backports Java 8 - constructs. ProGuard generally doesn't backport changes in the Java runtime, - except for the Java 8 stream API and the Java 8 date API, if you add the - backported libraries `net.sourceforge.streamsupport` and `org.threeten` as - input, respectively. - -`-forceprocessing`{: #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 {: #keepoptions} - -!!! tip "ProGuard Playground" - The [**ProGuard Playground**](https://playground.proguard.com) is a useful tool to help you further tweak the keep rules. - - - - -`-keep`{: #keep} \[[,*modifier*](#keepoptionmodifiers),...\] [*class\_specification*](#classspecification) -: 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](examples.md#application), you can specify the main class along - with its main method. In order to [process a library](examples.md#library), - you should specify all publicly accessible elements. - -`-keepclassmembers`{: #keepclassmembers} \[[,*modifier*](#keepoptionmodifiers),...\] [*class\_specification*](#classspecification) -: 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](examples.md#serializable) of classes that implement the - `Serializable` interface. - -`-keepclasseswithmembers`{: #keepclasseswithmembers} \[[,*modifier*](#keepoptionmodifiers),...\] [*class\_specification*](#classspecification) -: 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](examples.md#applications) that have a main method, - without having to list them explicitly. - -`-keepnames`{: #keepnames} [*class\_specification*](#classspecification) -: Short for [`-keep`](#keep),[`allowshrinking`](#allowshrinking) - [*class\_specification*](#classspecification) 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](examples.md#serializable) 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`{: #keepclassmembernames} [*class\_specification*](#classspecification) -: Short for - [`-keepclassmembers`](#keepclassmembers),[`allowshrinking`](#allowshrinking) - [*class\_specification*](#classspecification) 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](examples.md#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`{: #keepclasseswithmembernames} [*class\_specification*](#classspecification) -: Short for - [`-keepclasseswithmembers`](#keepclasseswithmembers),[`allowshrinking`](#allowshrinking) - [*class\_specification*](#classspecification) 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](examples.md#native) 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. - -`-if`{: #if} [*class\_specification*](#classspecification) -: Specifies classes and class members that must be `present` to activate the - subsequent keep option ([`-keep`](usage.md#keep), - [`-keepclassmembers`](usage.md#keepclassmembers),...). The condition and - the subsequent keep option can share wildcards and references to wildcards. - For example, you can keep classes on the condition that classes with related - names exist in your project, with frameworks like - [Dagger](examples.md#dagger) and [Butterknife](examples.md#butterknife). - -`-printseeds`{: #printseeds} \[[*filename*](#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](examples.md#applications) or all - the [applets](examples.md#applets) that you are keeping. - -## Shrinking Options {: #shrinkingoptions} - -`-dontshrink`{: #dontshrink} -: Specifies not to shrink the input. By default, ProGuard shrinks the code: it - removes all unused classes and class members. It only keeps the ones listed - by the various [`-keep`](usage.md#keep) options, and the ones on which they - depend, directly or indirectly. It also applies a shrinking step after each - optimization step, since some optimizations may open up the possibility to - remove more classes and class members. - -`-printusage`{: #printusage} \[[*filename*](#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](examples.md#deadcode). Only applicable when - shrinking. - -`-whyareyoukeeping`{: #whyareyoukeeping} [*class\_specification*](#classspecification) -: 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`](#verbose) option if specified, the - traces include full field and method signatures. Only applicable when - shrinking. - -## Optimization Options {: #optimizationoptions} - -`-dontoptimize`{: #dontoptimize} -: Specifies not to optimize the input class files. By default, ProGuard - optimizes all code. It inlines and merges classes and class members, and - it optimizes all methods at a bytecode level. - -`-optimizations`{: #optimizations} [*optimization\_filter*](optimizations.md) -: Specifies the optimizations to be enabled and disabled, at a more - fine-grained level. Only applicable when optimizing. *This is an expert - option.* - -`-optimizationpasses`{: #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`{: #assumenosideeffects} [*class\_specification*](#classspecification) -: Specifies methods that don't have any side effects, other than possibly - returning a value. For example, the method `System.currentTimeMillis()` - returns a value, but it doesn't have any side effects. In the optimization - step, ProGuard can then remove calls to such methods, if it can determine - that the return values aren't used. ProGuard will analyze your program code - to find such methods automatically. It will not analyze library code, for - which this option can therefore be useful. For example, you could specify - the method `System.currentTimeMillis()`, so that any idle calls to it will - be removed. With some care, you can also use the option to [remove logging - code](examples.md#logging). 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!* - -`-assumenoexternalsideeffects`{: #assumenoexternalsideeffects} [*class\_specification*](#classspecification) -: Specifies methods that don't have any side effects, except possibly on the - instances on which they are called. This statement is weaker than - [`-assumenosideeffects`](#assumenosideeffects), because it allows side - effects on the parameters or the heap. For example, the - `StringBuffer#append` methods have side effects, but no external side - effects. This is useful when [removing logging code](examples.md#logging), - to also remove any related string concatenation code. Only applicable when - optimizing. Making assumptions can be dangerous; you can easily break the - processed code. *Only use this option if you know what you're doing!* - -`-assumenoescapingparameters`{: #assumenoescapingparameters} [*class\_specification*](#classspecification) -: Specifies methods that don't let their reference parameters escape to the - heap. Such methods can use, modify, or return the parameters, but not store - them in any fields, either directly or indirectly. For example, the method - `System.arrayCopy` does not let its reference parameters escape, but method - `System.setSecurityManager` does. Only applicable when optimizing. Making - assumptions can be dangerous; you can easily break the processed code. *Only - use this option if you know what you're doing!* - -`-assumenoexternalreturnvalues`{: #assumenoexternalreturnvalues} [*class\_specification*](#classspecification) -: Specifies methods that don't return reference values that were already on - the heap when they are called. For example, the `ProcessBuilder#start` - returns a `Process` reference value, but it is a new instance that wasn't on - the heap yet. Only applicable when optimizing. Making assumptions can be - dangerous; you can easily break the processed code. *Only use this option if - you know what you're doing!* - -`-assumevalues`{: #assumevalues} [*class\_specification*](#classspecification) -: Specifies fixed values or ranges of values for primitive fields and - methods. Making assumptions can be dangerous; you can easily break the - processed code. *Only use this option if you know what you're doing!* - -`-allowaccessmodification`{: #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, Third - Edition](http://docs.oracle.com/javase/specs/jls/se12/html/index.html), - [Section - 13.4.6](http://docs.oracle.com/javase/specs/jls/se12/html/jls-13.html#jls-13.4.6)), - some virtual machines would have problems with the processed code otherwise. - Only applicable when optimizing (and when obfuscating with the - [`-repackageclasses`](#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`{: #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, Third - Edition](http://docs.oracle.com/javase/specs/jls/se12/html/index.html), - [Section - 13.5.3](http://docs.oracle.com/javase/specs/jls/se12/html/jls-13.html#jls-13.5.3)), - even if they are not allowed in the Java language (cfr. [The Java Language - Specification, Third - Edition](http://docs.oracle.com/javase/specs/jls/se12/html/index.html), - [Section - 8.1.4](http://docs.oracle.com/javase/specs/jls/se12/html/jls-8.html#jls-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: - - - Sun's JRE 1.3 may throw an `InternalError` when encountering - more than 256 *Miranda* methods (interface methods - without implementations) in a class. - -`-optimizeaggressively`{: #optimizeaggressively} -: Enables more aggressive assumptions during optimization. This might lead to - improved performance and/or reduced code size, but might result in different behavior in rare cases. - For example, reading from an array might cause an - `ArrayIndexOutOfBoundsException` to be thrown. Strictly speaking, this means - that such an instruction can have a side effect. If this instruction is removed - during optimization, the code will thus behave differently under specific - circumstances. By default, such instructions are always preserved. Setting this - option will lead to these instructions being candidates for removal during - optimization. Additionally, class merging is only enabled when this option is set. - -## Obfuscation Options {: #obfuscationoptions} - -`-dontobfuscate`{: #dontobfuscate} -: Specifies not to obfuscate the input class files. By default, ProGuard - obfuscates the code: it assigns new short random names to classes and - class members. It removes internal attributes that are only useful for - debugging, such as source files names, variable names, and line numbers. - -`-printmapping`{: #printmapping} \[[*filename*](#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](examples.md#incremental), or if you ever want to - make sense again of [obfuscated stack traces](examples.md#stacktrace). Only - applicable when obfuscating. - -`-applymapping`{: #applymapping} [*filename*](#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](examples.md#incremental), i.e. - processing add-ons or small patches to an existing piece of code. If the - structure of the code changes fundamentally, ProGuard may print out warnings - that applying a mapping is causing conflicts. You may be able to reduce this - risk by specifying the option - [`-useuniqueclassmembernames`](#useuniqueclassmembernames) in both - obfuscation runs. Only a single mapping file is allowed. Only applicable - when obfuscating. - -`-obfuscationdictionary`{: #obfuscationdictionary} [*filename*](#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`{: #classobfuscationdictionary} [*filename*](#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`](#obfuscationdictionary). Only applicable when - obfuscating. - -`-packageobfuscationdictionary`{: #packageobfuscationdictionary} [*filename*](#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`](#obfuscationdictionary). Only applicable - when obfuscating. - -`-overloadaggressively`{: #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, as required by Java bytecode (not just their - arguments, as required by the Java language). 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](http://docs.oracle.com/javase/specs/jvms/se12/html/index.html), - first paragraphs of [Section - 4.5](http://docs.oracle.com/javase/specs/jvms/se12/html/jvms-4.html#jvms-4.5) - and [Section - 4.6](http://docs.oracle.com/javase/specs/jvms/se12/html/jvms-4.html#jvms-4.6)), - even though this kind of overloading is not allowed in the Java language - (cfr. [The Java Language Specification, Third - Edition](http://docs.oracle.com/javase/specs/jls/se12/html/index.html), - [Section - 8.3](http://docs.oracle.com/javase/specs/jls/se12/html/jls-8.html#jls-8.3) - and [Section - 8.4.5](http://docs.oracle.com/javase/specs/jls/se12/html/jls-8.html#jls-8.4.5)). - Still, some tools have problems with it. Notably: - - - Sun's JDK 1.2.2 `javac` compiler produces an exception when - compiling with such a library (cfr. [Bug - \#4216736](http://bugs.sun.com/view_bug.do?bug_id=4216736)). You - probably shouldn't use this option for processing libraries. - - Sun's JRE 1.4 and later fail to serialize objects with - overloaded primitive fields. - - Sun's JRE 1.5 `pack200` tool reportedly has problems with - overloaded class members. - - The class `java.lang.reflect.Proxy` can't handle - overloaded methods. - - Google's Dalvik VM can't handle overloaded static fields. - -`-useuniqueclassmembernames`{: #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`{: #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. Obfuscated jars will become slightly - larger as a result. Only applicable when obfuscating. - -`-keeppackagenames`{: #keeppackagenames} \[*[package\_filter](#filters)*\] -: Specifies not to 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`{: #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](examples.md#repackaging). It - can make the processed code smaller and less comprehensible. Only applicable - when obfuscating. - -`-repackageclasses`{: #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 overrides the - [`-flattenpackagehierarchy`](#flattenpackagehierarchy) option. It is another - example of further [obfuscating package names](examples.md#repackaging). - 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`{: #keepattributes} \[*[attribute\_filter](attributes.md)*\] -: Specifies any optional attributes to be preserved. The attributes can be - specified with one or more [`-keepattributes`](usage.md#keepattributes) - directives. The optional filter is a comma-separated list of [attribute - names](attributes.md) that Java virtual machines and ProGuard support. - Attribute names can contain **?**, **\***, and **\*\*** wildcards, and they - can be preceded by the **!** negator. For example, you should at least keep - the `Exceptions`, `InnerClasses`, and `Signature` attributes when - [processing a library](examples.md#library). You should also keep the - `SourceFile` and `LineNumberTable` attributes for [producing useful - obfuscated stack traces](examples.md#stacktrace). Finally, you may want to - [keep annotations](examples.md#annotations) if your code depends on them. - Only applicable when obfuscating. - -`-keepparameternames`{: #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](examples.md#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. - - When processing Kotlin metadata the Kotlin function, constructor and property setter - parameter names are also kept. - -`-renamesourcefileattribute`{: #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`](usage.md#keepattributes) directive. For example, you - may want to have your processed libraries and applications produce [useful - obfuscated stack traces](examples.md#stacktrace). Only applicable when - obfuscating. - -`-keepkotlinmetadata`{: #keepkotlinmetadata} {: .deprecated} -: ** Deprecated: use `-keep class kotlin.Metadata` instead. ** - Specifies to process `kotlin.Metadata` annotations if present. - Currently only shrinking and obfuscation of its content is supported. - Classes containing such annotations should be excuded from optimization - if this option is enabled. - -`-adaptclassstrings`{: #adaptclassstrings} \[*[class\_filter](#filters)*\] -: 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`{: #adaptresourcefilenames} \[*[file\_filter](#filefilters)*\] -: 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](examples.md#resourcefiles). Only applicable when obfuscating. - -`-adaptresourcefilecontents`{: #adaptresourcefilecontents} \[*[file\_filter](#filefilters)*\] -: Specifies the resource files and native libraries 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). Any function - names in the native libraries are renamed, based on the obfuscated names of - the corresponding native methods (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 UTF-8 encoding. For an - example, see [processing resource files](examples.md#resourcefiles). Only - applicable when obfuscating. *Caveat:* You probably only want to apply this - option to text files and native libraries, since parsing and adapting - general binary files as text files can cause unexpected problems. Therefore, - make sure that you specify a sufficiently narrow filter. - -## Preverification Options {: #preverificationoptions} - -`-dontpreverify`{: #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 optional, but as of Java - 7, it is required. - -`-microedition`{: #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](examples.md#midlets). - -`-android`{: #android} -: Specifies that the processed class files are targeted at the Android - platform. ProGuard then makes sure some features are compatible with - Android. - -## General Options {: #generaloptions} - -`-verbose`{: #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`{: #dontnote} \[*[class\_filter](#filters)*\] -: Specifies not to print notes about potential mistakes or omissions in the - configuration, such as typos in class names or missing options that might be - useful. The optional filter is a regular expression; ProGuard doesn't print - notes about classes with matching names. - -`-dontwarn`{: #dontwarn} \[*[class\_filter](#filters)*\] -: 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`{: #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`{: #printconfiguration} \[[*filename*](#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 to - debug configurations, or to convert XML configurations into a more - readable format. - -`-dump`{: #dump} \[[*filename*](#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](examples.md#structure), without processing it at all. - -`-addconfigurationdebugging`{: #addconfigurationdebugging} -: Specifies to instrument the processed code with debugging statements that - print out suggestions for missing ProGuard configuration. This can be very - useful to get practical hints _at run-time_, if your processed code crashes - because it still lacks some configuration for reflection. For example, the - code may be [serializing classes with the GSON library](examples.md#gson) - and you may need some configuration for it. You can generally just - copy/paste the suggestions from the console into your configuration file. - *Counter-indication:* do not use this option in release versions, as it adds - obfuscation information to the processed code. - -## Class Paths {: #classpath} - -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: - -- A class file or resource file, -- An apk file, containing any of the above, -- A jar file, containing any of the above, -- An aar file, containing any of the above, -- A war file, containing any of the above, -- An ear file, containing any of the above, -- A jmod file, containing any of the above, -- A zip file, containing any of the above, -- A directory (structure), containing any of the above. - -The paths of directly specified class files and resource files is -ignored, so class files should generally be part of a jar file, an aar -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: - -- An apk file, in which all class files and resource files will - be collected. -- A jar file, in which any and all of the above will be collected, -- An aar file, in which any and all of the above will be collected, -- A war file, in which any and all of the above will be collected, -- An ear file, in which any and all of the above will be collected, -- A jmod file, in which any and all of the above will be collected, -- A zip file, in which any and all of the above will be collected, -- A directory, in which any and all of the above will be collected. - -When writing output entries, ProGuard generally packages 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](examples.md#restructuring). - -Files and directories can be specified as discussed in the section on -[file names](#filename) 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 8 types of [file -filters](#filefilters) between parentheses, separated by semi-colons: - -- A filter for all jmod names that are encountered, -- A filter for all aar names that are encountered, -- A filter for all apk names that are encountered, -- A filter for all zip names that are encountered, -- A filter for all ear names that are encountered, -- A filter for all war names that are encountered, -- A filter for all jar names that are encountered, -- A filter for all class file names and resource file names that - are encountered. - -If fewer than 8 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([[[[[[[jmodfilter;]aarfilter;]apkfilter;]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. - -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](examples.md#filtering). - -## File Names {: #filename} - -ProGuard accepts absolute paths and relative paths for the various file -names and directory names. A relative path is interpreted as follows: - -- relative to the base directory, if set, or otherwise -- relative to the configuration file in which it is specified, if any, - or otherwise -- relative to the working directory. - -The names can contain Java system properties (or Ant properties, when -using Ant), delimited by angular brackets, '**<**' and '**>**'. -The properties are automatically replaced by their corresponding values. - -For example, `/lib/rt.jar` is automatically expanded to -something like `/usr/local/java/jdk/jre/lib/rt.jar`. Similarly, -`` is expanded to the user's home directory, and `` -is expanded to the current working directory. - -Names with special characters like spaces and parentheses must be quoted -with single or double quotes. Each file name in a list of names has to -be quoted individually. 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 {: #filefilters} - -Like general [filters](#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: - -| Wildcard | Meaning -|------|----------------------------------------------------------------------------------------- -| `?` | 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](examples.md#filtering). - -## Filters {: #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: - -| Wildcard | Meaning -|------|----------------------------------------------------------------------------------------------------------- -| `?` | 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 {: #keepoverview} - -The various [`-keep`](usage.md#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: - -| Keep | From being removed or renamed | From being renamed -|-----------------------------------------------------|------------------------------------------------------|-------------------------------------------------------------- -| Classes and class members | [`-keep`](#keep) | [`-keepnames`](#keepnames) -| Class members only | [`-keepclassmembers`](#keepclassmembers) | [`-keepclassmembernames`](#keepclassmembernames) -| Classes and class members, if class members present | [`-keepclasseswithmembers`](#keepclasseswithmembers) | [`-keepclasseswithmembernames`](#keepclasseswithmembernames) - -Each of these [`-keep`](usage.md#keep) options is of course followed by a -[specification](#classspecification) 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. - -!!! warning "" - - If you specify a class, without class members, ProGuard only - preserves the class and its parameterless constructor as - entry points. It may still remove, optimize, or obfuscate its other - class members. - - If you specify a method, ProGuard only preserves the method as an - entry point. Its code may still be optimized and adapted. - -## Keep Option Modifiers {: #keepoptionmodifiers} - -`includedescriptorclasses` -: Specifies that any classes in the type descriptors of the methods and - fields that the [-keep](#keep) option keeps should be kept as well. This is - typically useful when [keeping native method names](examples.md#native), to - make sure that the parameter types of native methods aren't renamed either. - Their signatures then remain completely unchanged and compatible with the - native libraries. - -`includecode` -: Specifies that code attributes of the methods that the [-keep](#keep) - option keeps should be kept as well, i.e. may not be optimized or obfuscated. - This is typically useful for already optimized or obfuscated classes, - to make sure that their code is not modified during optimization. - -`allowshrinking` -: Specifies that the entry points specified in the [-keep](#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](#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](#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 {: #classspecification} - -A class specification is a template of classes and class members (fields -and methods). It is used in the various [`-keep`](usage.md#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](examples.md), 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 ...] - | (fieldtype fieldname [= values]); - - [@annotationtype] - [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] - | (argumenttype,...) | classname(argumenttype,...) | (returntype methodname(argumenttype,...) [return values]); - }] - -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. - -- The `class` keyword refers to any interface or class. The - `interface` keyword restricts matches to interface classes. The - `enum` keyword restricts matches to enumeration classes. Preceding - the `interface` or `enum` keywords by a `!` restricts matches to - classes that are not interfaces or enumerations, respectively. - -- Every *classname* must be fully qualified, e.g. `java.lang.String`. - Inner classes are separated by a dollar sign "`$`", e.g. - `java.lang.Thread$State`. Class names may be specified as regular - expressions containing the following wildcards: - - | Wildcard | Meaning - |-------|----------- - | `?` | matches any single character in a class name, but not the package separator. For example, "`com.example.Test?`" matches "`com.example.Test1`" and "`com.example.Test2`", but not "`com.example.Test12`". - | `*` | matches any part of a class name not containing the package separator. For example, "`com.example.*Test*`" matches "`com.example.Test`" and "`com.example.YourTestApplication`", but not "`com.example.mysubpackage.MyTest`". Or, more generally, "`com.example.*`" matches all classes in "`com.example`", but not in its subpackages. - | `**` | matches any part of a class name, possibly containing any number of package separators. For example, "`**.Test`" matches all `Test` classes in all packages except the root package. Or, "`com.example.**`" matches all classes in "`com.example`" and in its subpackages. - | `` | matches the _n_'th matched wildcard in the same option. For example, "`com.example.*Foo<1>`" matches "`com.example.BarFooBar`". - - For additional flexibility, class names can actually be - comma-separated lists of class names, with optional `!` negators, - just like file name filters. This notation doesn't look very - Java-like, so it should be used with moderation. - For convenience and for backward compatibility, the class name `*` - refers to any class, irrespective of its package, when used on its own (e.g. `-keep class *`). - -- The `extends` and `implements` specifications are typically used to - restrict classes with wildcards. They are currently equivalent, - specifying that only classes extending or implementing the given - class (directly or indirectly) qualify. The given class itself is not - included in this set. If required, it should be specified in a separate - option. - -- The `@` specifications can be used to restrict classes and class - members to the ones that are annotated with the specified - annotation types. An *annotationtype* is specified just like a - *classname*. - -- Fields and methods are specified much like in Java, except that - method argument lists don't contain argument names (just like in - other tools like `javadoc` and `javap`). The specifications can also - contain the following catch-all wildcards: - - | Wildcard | Meaning - |-------------|------------------------------ - | `` | matches any constructor. - | `` | matches any field. - | `` | matches any method. - | `*` | matches any field or method. - - Note that the above wildcards don't have return types. Only the - `` wildcard has an argument list. - - Fields and methods may also be specified using regular expressions. - Names can contain the following wildcards: - - | Wildcard | Meaning - |-------|----------------------------------------------------------------- - | `?` | matches any single character in a method name. - | `*` | matches any part of a method name. - | `` | matches the _n_'th matched wildcard in the same option. - - Types in descriptors can contain the following wildcards: - - | Wildcard | Meaning - |-------|----------------------------------------------------------------------------------------- - | `%` | matches any primitive type ("`boolean`", "`int`", etc) or "`void`" type. - | `?` | matches any single character in a class name. - | `*` | matches any part of a class name not containing the package separator. - | `**` | matches any part of a class name, possibly containing any number of package separators. - | `***` | matches any type (primitive or non-primitive, array or non-array). - | `...` | matches any number of arguments of any type. - | `` | matches the _n_'th matched wildcard in the same option. - - Note that the `?`, `*`, and `**` wildcards will never match - primitive types. Furthermore, only the `***` wildcards will match - array types of any dimension. For example, "`** get*()`" matches - "`java.lang.Object getObject()`", but not "`float getFloat()`", - nor "`java.lang.Object[] getObjects()`". - -- Constructors can also be specified using their short class names - (without package) or using their full class names. As in the Java - language, the constructor specification has an argument list, but no - return type. - -- The class access modifiers and class member access modifiers are - typically used to restrict wildcarded classes and class members. - They specify that the corresponding access flags have to be set for - the member to match. A preceding `!` specifies that the - corresponding access flag should be unset. - - Combining multiple flags is allowed (e.g. `public static`). It means - that both access flags have to be set (e.g. `public` *and* - `static`), except when they are conflicting, in which case at least - one of them has to be set (e.g. at least `public` *or* `protected`). - - ProGuard supports the additional modifiers `synthetic`, `bridge`, - and `varargs`, which may be set by compilers. - -- With the option [`-assumevalues`](#assumevalues), fields and methods - with primitive return types can have *values* or *ranges of values*. - The assignment keyword is `=` or `return`, interchangeably. For - example, "`boolean flag = true;`" or "`int method() return 5;`". - Ranges of values are separated by `..`, for example, - "`int f = 100..200;`". A range includes its begin value and - end value. diff --git a/proguard/docs/manual/feedback.md b/proguard/docs/manual/feedback.md deleted file mode 100644 index 270a80c..0000000 --- a/proguard/docs/manual/feedback.md +++ /dev/null @@ -1,40 +0,0 @@ -By now, we've invested an enormous amount of time in **ProGuard**. You can -help by providing feedback! If you have problems, bugs, bug fixes, ideas, -encouragements, etc., please let us know. - -At [Guardsquare](http://www.guardsquare.com/), we develop ProGuard and its -professional siblings DexGuard (for Android) and iXGuard (for iOS). If you -find ProGuard useful and you are interested in more features or professional -support, this is the place to go. - -ProGuard is currently hosted on GitHub: - -- You can report issues on our - [issue tracker](https://github.com/Guardsquare/proguard/issues). - -- You can clone the - [source code](https://github.com/Guardsquare/proguard) yourself and create - [pull requests](https://github.com/Guardsquare/proguard/pulls). - -!!! tip - The [***Guardsquare Community***](https://community.guardsquare.com/) is the place to be for all your ProGuard-related questions and feedback. - -You may also find answers on -[Stack Overflow](http://stackoverflow.com/questions/tagged/proguard). - -ProGuard used to be hosted on Sourceforge: - -- You can still read answers in the [help - forum](https://sourceforge.net/projects/proguard/forums/forum/182456). - -- You can still find discussions in the [open discussion - forum](https://sourceforge.net/projects/proguard/forums/forum/182455). - -- We still have reports on the - [bug tracking page](http://sourceforge.net/p/proguard/bugs/). - -- We still have new ideas on the the - [feature request page](http://sourceforge.net/p/proguard/feature-requests/). - -- You can still find all earlier versions in the - [download section](https://sourceforge.net/projects/proguard/files/). diff --git a/proguard/docs/manual/home.md b/proguard/docs/manual/home.md deleted file mode 100644 index 033df10..0000000 --- a/proguard/docs/manual/home.md +++ /dev/null @@ -1,126 +0,0 @@ -Welcome to the manual for **ProGuard** version 7.3 ([what's new?](releasenotes.md)). - -ProGuard is an open-sourced Java class file shrinker, optimizer, obfuscator, and -preverifier. As a result, ProGuard processed applications and libraries are smaller and faster. - -- The ***shrinking step*** detects and removes unused classes, fields, methods, and -attributes. -- The ***optimizer step*** optimizes bytecode and removes unused instructions. -- The ***name obfuscation step*** renames the remaining classes, fields, and methods using short meaningless names. -- The final ***preverification step*** adds preverification information to the classes, which is required for Java Micro Edition and for Java 6 and higher. - -The default Android shrinker, R8, is compatible with ProGuard [configuration](configuration/usage.md). - -If you are getting started with ProGuard, please follow the [Quick Start](building.md) guide in order to arrive at a basic setup for your application or library as quickly as possible. - -Experienced users can directly consult the [Configuration section](configuration/usage.md) where all features are described. - -If during the process you run into any issues, please make sure to check the [Troubleshooting section](troubleshooting/troubleshooting.md). - -## How it works - -
-
-
-
Input jars
-
shrink
-
optimize
-
obfuscate
-
preverify
-
Output jars
-
-
-
Library jars
-
(unchanged)
-
Library jars
-
-
-
- -ProGuard first reads the **input jars** (or aars, wars, ears, zips, apks, or -directories). It then subsequently shrinks, optimizes, obfuscates, and -preverifies them. You can optionally let ProGuard perform multiple -optimization passes. ProGuard writes the processed results to one or more -**output jars** (or aars, wars, ears, zips, apks, 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 aars, wars, ears, zips, apks, 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, activities, etc. - -- In the **shrinking step**, ProGuard starts from these seeds and recursively - determines which classes and class members are used. All other classes and - class members are discarded. -- In the **optimization step**, ProGuard further optimizes the code. Among - other optimizations, classes and methods that are not entry points can be - made private, static, or final, unused parameters can be removed, and some - methods may be inlined. -- In the **name obfuscation step**, ProGuard renames classes and class members that - are not entry points. In this entire process, keeping the entry points - ensures that they can still be accessed by their original names. -- The **preverification step** is the only step that doesn't have to know the - entry points. - -The [Usage section](configuration/usage.md) of this manual describes the necessary [`-keep` -options](configuration/usage.md#keepoptions) and the [Examples section](configuration/examples.md) -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 compute 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`](configuration/usage.md#keep) -options. - -However, ProGuard already detects and handles the following cases for you: - -- `Class.forName("SomeClass")` -- `SomeClass.class` -- `SomeClass.class.getField("someField")` -- `SomeClass.class.getDeclaredField("someField")` -- `SomeClass.class.getMethod("someMethod", null)` -- `SomeClass.class.getMethod("someMethod", new Class[] { A.class,... })` -- `SomeClass.class.getDeclaredMethod("someMethod", null)` -- `SomeClass.class.getDeclaredMethod("someMethod", new Class[] { A.class,... })` -- `AtomicIntegerFieldUpdater.newUpdater(SomeClass.class, "someField")` -- `AtomicLongFieldUpdater.newUpdater(SomeClass.class, "someField")` -- `AtomicReferenceFieldUpdater.newUpdater(SomeClass.class, SomeType.class, "someField")` - -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. - -!!! tip - Generate an instrumented build to allow ProGuard finding cases of reflection at *run-time*. The tailored configuration advice for your application will be outputted to the console, and can be copy/pasted to your configuration. To do so, just enable the option [`-addconfigurationdebugging`](configuration/usage.md#addconfigurationdebugging) - - -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. diff --git a/proguard/docs/manual/languages/java.md b/proguard/docs/manual/languages/java.md deleted file mode 100644 index 282d3a9..0000000 --- a/proguard/docs/manual/languages/java.md +++ /dev/null @@ -1,6 +0,0 @@ -## Java language support - -!!! Warning - ProGuard no longer supports backporting, and cannot backport class files compiled with Java >11. - -Provide supports Java versions up to and including 19. diff --git a/proguard/docs/manual/languages/kotlin.md b/proguard/docs/manual/languages/kotlin.md deleted file mode 100644 index 24978c9..0000000 --- a/proguard/docs/manual/languages/kotlin.md +++ /dev/null @@ -1,83 +0,0 @@ -The Kotlin compiler injects code and metadata into the classes that it generates to support features not natively supported by the Java and Android environments. The metadata injected by the Kotlin compiler takes the shape of an annotation added to classes which leaks semantic information that can aid attackers. - - - -## Configuration - -In most cases, you do not need to keep Kotlin metadata for app projects - therefore, no configuration changes are necessary and the Kotlin metadata can be safely removed. -However, there are two common reasons to explicitly keep the metadata, [reflection](#reflection) and [libraries](#library-projects). - -ProGuard will only keep the Kotlin metadata of a class if you explicitly keep that class or one of its members, and you add the `-keep class kotlin.Metadata` option to your configuration. -Note that this option may also be required by an SDK of your project, and indirectly added as a consumer rule. - -For example, if you have the following keep rule for a Kotlin class named `com.example.KotlinExample`, by default the class will be kept but its metadata will not: - -``` -# Keep the class com.example.KotlinExample --keep class com.example.KotlinExample -``` - -You can add `-keep class kotlin.Metadata` to your configuration to instruct ProGuard to keep and adapt Kotlin metadata: - -``` -# Add this option to tell ProGuard to keep and adapt Kotlin metadata --keep class kotlin.Metadata -``` - - -### App Projects - - -The most common case to keep Kotlin metadata would be if you use the [kotlin-reflect](https://kotlinlang.org/docs/reference/reflection.html) library. Just like when using Java reflection, you will need `-keep` rules in your configuration to keep the specific classes and members accessed through reflection. - -In this case, to instruct ProGuard to keep and adapt the corresponding Kotlin metadata, add the following to your configuration: - -``` --keep class kotlin.Metadata -``` - -A popular framework that relies on reflection is [Jackson](https://github.com/FasterXML/jackson-module-kotlin). - -### Library Projects - -When developing an SDK that exposes Kotlin-specific features to its users, you need to preserve the metadata of the public API. -These include features such as named parameters, suspend functions, top-level functions and type aliases. - -In the case of a library, you would already be keeping the public API, so you can simply add the following -to your configuration: - -``` --keep class kotlin.Metadata -``` - -## Protection - -### Obfuscation - -ProGuard will apply the same obfuscations to Kotlin identifiers in metadata, such as class or member names, to match those in the Java class files. -This ensures that, even where the Kotlin metadata is required, no sensitive names remain in the metadata. - -### Shrinking - -ProGuard will remove all unused Kotlin metadata components such as unused functions and properties. -This ensures that, even where the Kotlin metadata is required, only the used components are kept. - - - -### Data Classes - -Data classes in Kotlin have an auto-generated `toString` method that lists all properties -of the class and their value. ProGuard automatically detects these classes and adapts -the names of properties to their obfuscated counterpart. - -### Intrinsics Null Checks - -To better support java interoperability, Kotlin injects numerous method calls to e.g. -check that a parameter is not null when it wasn't marked as `Nullable`. In pure Kotlin -codebases, these injected method calls are unnecessary and instead leak information -via their parameters (e.g. names of checked parameters). - -ProGuard automatically detects calls to these methods and removes the Strings to -ensure that the resulting code contains no references to original parameter names, member names etc. - - diff --git a/proguard/docs/manual/license/gpl.md b/proguard/docs/manual/license/gpl.md deleted file mode 100644 index c4c141a..0000000 --- a/proguard/docs/manual/license/gpl.md +++ /dev/null @@ -1,259 +0,0 @@ -# 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: - -- **a)** You must cause the modified files to carry prominent notices stating - that you changed the files and the date of any change. -- **b)** You must cause any work that you distribute or publish, that in whole - or in part contains or is derived from the Program or any part thereof, to - be licensed as a whole at no charge to all third parties under the terms of - this License. -- **c)** If the modified program normally reads commands interactively when - run, you must cause it, when started running for such interactive use in the - most ordinary way, to print or display an announcement including an - appropriate copyright notice and a notice that there is no warranty (or - else, saying that you provide a warranty) and that users may redistribute - the program under these conditions, and telling the user how to view a copy - of this License. (Exception: if the Program itself is interactive but does - not normally print such an announcement, your work based on the Program is - not required to print an announcement.) - -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: - -- **a)** Accompany it with the complete corresponding machine-readable source - code, which must be distributed under the terms of Sections 1 and 2 above on - a medium customarily used for software interchange; or, -- **b)** Accompany it with a written offer, valid for at least three years, to - give any third party, for a charge no more than your cost of physically - performing source distribution, a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of Sections 1 - and 2 above on a medium customarily used for software interchange; or, -- **c)** Accompany it with the information you received as to the offer to - distribute corresponding source code. (This alternative is allowed only for - noncommercial distribution and only if you received the program in object - code or executable form with such an offer, in accord with Subsection b - above.) - -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. diff --git a/proguard/docs/manual/license/gplexception.md b/proguard/docs/manual/license/gplexception.md deleted file mode 100644 index c8b9ef4..0000000 --- a/proguard/docs/manual/license/gplexception.md +++ /dev/null @@ -1,36 +0,0 @@ -# Special Exception to the GNU General Public License - -Copyright © 2002-2020 Guardsquare NV - -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, Guardsquare NV gives permission to link -the code of this program with the following stand-alone applications: - -- Gradle, -- Apache Ant, -- Apache Maven, -- the Google Android SDK, -- the Intel TXE/DAL SDK, -- the Eclipse ProGuardDT GUI, -- the EclipseME JME IDE, -- the Oracle NetBeans Java IDE, -- the Oracle JME Wireless Toolkit, and -- the Simple Build Tool for Scala (and its scripts). - -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/proguard/docs/manual/license/license.md b/proguard/docs/manual/license/license.md deleted file mode 100644 index be47c3f..0000000 --- a/proguard/docs/manual/license/license.md +++ /dev/null @@ -1,26 +0,0 @@ -**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 unchanged. - -The **ProGuard code** 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.md) (GPL), version 2, as published by -the [Free Software Foundation](http://www.fsf.org/) (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. - -We are granting a [special exception](gplexception.md) to the latter clause -(in wording suggested by the -[FSF](http://www.gnu.org/copyleft/gpl-faq.html#GPLIncompatibleLibs)), for -combinations with the following stand-alone applications: Gradle, Apache Ant, -Apache Maven, the Google Android SDK, the Intel TXE/DAL SDK, the Eclipse -ProGuardDT GUI, the EclipseME JME IDE, the Oracle NetBeans Java IDE, the -Oracle JME Wireless Toolkit, and the Simple Build Tool for Scala. - -The **ProGuard user documentation** is copyrighted as well. It may only -be redistributed without changes, along with the unmodified version of -the code. diff --git a/proguard/docs/manual/quickstart.md b/proguard/docs/manual/quickstart.md deleted file mode 100644 index 60e3cbf..0000000 --- a/proguard/docs/manual/quickstart.md +++ /dev/null @@ -1,78 +0,0 @@ -# Quick Start - -This page will guide you through the basic steps of processing your application or library with ProGuard. -For details on advanced settings or more background information please refer to the relevant parts of the manual. - - -There are two ways to execute ProGuard: - -1. Standalone -2. Integrated mode in your Gradle, Ant or Maven project. - -You can also build ProGuard from [source](https://github.com/Guardsquare/proguard) by following the [build instructions](building.md). - -## Standalone - -Firstly, download a [ProGuard release](https://github.com/Guardsquare/proguard/releases) or [build ProGuard](building.md) from source. -ProGuard can then be executed directly from the command line by calling a script found in the `bin` directory: - -=== "Linux/macOS" - ```bash - bin/proguard.sh -injars path/to/my-application.jar \ - -outjars path/to/obfuscated-application.jar \ - -libraryjars path/to/java/home/lib/rt.jar - ``` - -=== "Windows" - ```bat - bin\proguard.bat -injars path/to/my-application.jar ^ - -outjars path/to/obfuscated-application.jar ^ - -libraryjars path/to/java/home/lib/rt.jar - ``` - -For more detailed information see [standalone mode](setup/standalone.md). - -## Integrated - -The ProGuard artifacts are hosted at [Maven Central](https://search.maven.org/search?q=g:com.guardsquare). - -### Android Gradle project - -When working on your Android application (apk, aab) or library (aar), you can include ProGuard in your Gradle build by: - -- Using ProGuard's Gradle plugin, which you can apply in your `build.gradle` file (AGP 4.x - 7.x). -- Using the integrated ProGuard by disabling R8 in your `gradle.properties` (only applicable for AGP < 7). - -For more detailed information see [Android Gradle](setup/gradleplugin.md). - -### Java or Kotlin Gradle project - -Your non-mobile Java or Kotlin applications can execute ProGuard's Gradle task: -```proguard -task myProguardTask(type: proguard.gradle.ProGuardTask) { -..... -} -``` - -For more detailed information see [Java/Kotlin Gradle](setup/gradle.md). - -### Ant project - -You can also include ProGuard in your Ant build, all you have to do is to include the related task into your `build.xml` file: -```xml - -``` - -For more detailed information see [Ant](setup/ant.md). - - -### Maven project - -!!! warning - While we don't officially provide a maven integration and we cannot provide support there are solutions available, their offered functionality is not guaranteed by Guardsquare. - -Some open-source implementations: - -- [https://github.com/wvengen/proguard-maven-plugin](https://github.com/wvengen/proguard-maven-plugin) -- [https://github.com/dingxin/proguard-maven-plugin](https://github.com/dingxin/proguard-maven-plugin) diff --git a/proguard/docs/manual/refcard.md b/proguard/docs/manual/refcard.md deleted file mode 100644 index 6f76156..0000000 --- a/proguard/docs/manual/refcard.md +++ /dev/null @@ -1,141 +0,0 @@ -## Usage - -| OS | Command -|------------|----------------------------- -| Windows: | `proguard` *options* ... -| Linux/Mac: | `proguard.sh` *options* ... - -Typically: - -| OS | Command -|------------|----------------------------- -| Windows: | `proguard @myconfig.pro` -| Linux/Mac: | `proguard.sh @myconfig.pro` - -## Options - -| Option | Meaning -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------- -| [`@`](configuration/usage.md#at)[*filename*](configuration/usage.md#filename) | Short for '`-include` *filename*'. -| [`-include`](configuration/usage.md#include) [*filename*](configuration/usage.md#filename) | Read configuration options from the given file. -| [`-basedirectory`](configuration/usage.md#basedirectory) [*directoryname*](configuration/usage.md#filename) | Specifies the base directory for subsequent relative file names. -| [`-injars`](configuration/usage.md#injars) [*class\_path*](configuration/usage.md#classpath) | Specifies the program jars (or apks, aabs, aars, wars, ears, jmods, zips, or directories). -| [`-outjars`](configuration/usage.md#outjars) [*class\_path*](configuration/usage.md#classpath) | Specifies the names of the output jars (or apks, aabs, aars, wars, ears, jmods, zips, or directories). -| [`-libraryjars`](configuration/usage.md#libraryjars) [*class\_path*](configuration/usage.md#classpath) | Specifies the library jars (or apks, aabs, aars, wars, ears, jmods, zips, or directories). -| [`-skipnonpubliclibraryclasses`](configuration/usage.md#skipnonpubliclibraryclasses) | Ignore non-public library classes. -| [`-dontskipnonpubliclibraryclasses`](configuration/usage.md#dontskipnonpubliclibraryclasses) | Don't ignore non-public library classes (the default). -| [`-dontskipnonpubliclibraryclassmembers`](configuration/usage.md#dontskipnonpubliclibraryclassmembers) | Don't ignore package visible library class members. -| [`-keepdirectories`](configuration/usage.md#keepdirectories) \[[*directory\_filter*](configuration/usage.md#filters)\] | Keep the specified directories in the output jars (or wars, ears, zips, or directories). -| [`-target`](configuration/usage.md#target) *version* | **deprecated** Set the given version number in the processed classes. -| [`-forceprocessing`](configuration/usage.md#forceprocessing) | Process the input, even if the output seems up to date. -| [`-keep`](configuration/usage.md#keep) \[[,*modifier*](configuration/usage.md#keepoptionmodifiers),...\] [*class\_specification*](configuration/usage.md#classspecification) | Preserve the specified classes *and* class members. -| [`-keepclassmembers`](configuration/usage.md#keepclassmembers) \[[,*modifier*](configuration/usage.md#keepoptionmodifiers),...\] [*class\_specification*](configuration/usage.md#classspecification) | Preserve the specified class members, if their classes are preserved as well. -| [`-keepclasseswithmembers`](configuration/usage.md#keepclasseswithmembers) \[[,*modifier*](configuration/usage.md#keepoptionmodifiers),...\] [*class\_specification*](configuration/usage.md#classspecification) | Preserve the specified classes *and* class members, if all of the specified class members are present. -| [`-keepnames`](configuration/usage.md#keepnames) [*class\_specification*](configuration/usage.md#classspecification) | Preserve the names of the specified classes *and* class members (if they aren't removed in the shrinking step). -| [`-keepclassmembernames`](configuration/usage.md#keepclassmembernames) [*class\_specification*](configuration/usage.md#classspecification) | Preserve the names of the specified class members (if they aren't removed in the shrinking step). -| [`-keepclasseswithmembernames`](configuration/usage.md#keepclasseswithmembernames) [*class\_specification*](configuration/usage.md#classspecification) | Preserve the names of the specified classes *and* class members, if all of the specified class members are present (after the shrinking step). -| [`-if`](configuration/usage.md#if) [*class\_specification*](configuration/usage.md#classspecification) | Specify classes and class members that must be present to activate the subsequent `keep` option. -| [`-printseeds`](configuration/usage.md#printseeds) \[[*filename*](configuration/usage.md#filename)\] | List classes and class members matched by the various [`-keep`](configuration/usage.md#keep) options, to the standard output or to the given file. -| [`-dontshrink`](configuration/usage.md#dontshrink) | Don't shrink the input class files. -| [`-printusage`](configuration/usage.md#printusage) \[[*filename*](configuration/usage.md#filename)\] | List dead code of the input class files, to the standard output or to the given file. -| [`-whyareyoukeeping`](configuration/usage.md#whyareyoukeeping) [*class\_specification*](configuration/usage.md#classspecification) | Print details on why the given classes and class members are being kept in the shrinking step. -| [`-dontoptimize`](configuration/usage.md#dontoptimize) | Don't optimize the input class files. -| [`-optimizations`](configuration/usage.md#optimizations) [*optimization\_filter*](configuration/optimizations.md) | The optimizations to be enabled and disabled. -| [`-optimizationpasses`](configuration/usage.md#optimizationpasses) *n* | The number of optimization passes to be performed. -| [`-assumenosideeffects`](configuration/usage.md#assumenosideeffects) [*class\_specification*](configuration/usage.md#classspecification) | Assume that the specified methods don't have any side effects, while optimizing. -| [`-assumenoexternalsideeffects`](configuration/usage.md#assumenoexternalsideeffects) [*class\_specification*](configuration/usage.md#classspecification) | Assume that the specified methods don't have any external side effects, while optimizing. -| [`-assumenoescapingparameters`](configuration/usage.md#assumenoescapingparameters) [*class\_specification*](configuration/usage.md#classspecification) | Assume that the specified methods don't let any reference parameters escape to the heap, while optimizing. -| [`-assumenoexternalreturnvalues`](configuration/usage.md#assumenoexternalreturnvalues) [*class\_specification*](configuration/usage.md#classspecification) | Assume that the specified methods don't return any external reference values, while optimizing. -| [`-assumevalues`](configuration/usage.md#assumevalues) [*class\_specification*](configuration/usage.md#classspecification) | Assume fixed values or ranges of values for primitive fields and methods, while optimizing. -| [`-allowaccessmodification`](configuration/usage.md#allowaccessmodification) | Allow the access modifiers of classes and class members to be modified, while optimizing. -| [`-mergeinterfacesaggressively`](configuration/usage.md#mergeinterfacesaggressively) | Allow any interfaces to be merged, while optimizing. -| [`-dontobfuscate`](configuration/usage.md#dontobfuscate) | Don't obfuscate the input class files. -| [`-printmapping`](configuration/usage.md#printmapping) \[[*filename*](configuration/usage.md#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`](configuration/usage.md#applymapping) [*filename*](configuration/usage.md#filename) | Reuse the given mapping, for incremental obfuscation. -| [`-obfuscationdictionary`](configuration/usage.md#obfuscationdictionary) [*filename*](configuration/usage.md#filename) | Use the words in the given text file as obfuscated field names and method names. -| [`-classobfuscationdictionary`](configuration/usage.md#classobfuscationdictionary) [*filename*](configuration/usage.md#filename) | Use the words in the given text file as obfuscated class names. -| [`-packageobfuscationdictionary`](configuration/usage.md#packageobfuscationdictionary) [*filename*](configuration/usage.md#filename) | Use the words in the given text file as obfuscated package names. -| [`-overloadaggressively`](configuration/usage.md#overloadaggressively) | Apply aggressive overloading while obfuscating. -| [`-useuniqueclassmembernames`](configuration/usage.md#useuniqueclassmembernames) | Ensure uniform obfuscated class member names for subsequent incremental obfuscation. -| [`-dontusemixedcaseclassnames`](configuration/usage.md#dontusemixedcaseclassnames) | Don't generate mixed-case class names while obfuscating. -| [`-keeppackagenames`](configuration/usage.md#keeppackagenames) \[*[package\_filter](configuration/usage.md#filters)*\] | Keep the specified package names from being obfuscated. -| [`-flattenpackagehierarchy`](configuration/usage.md#flattenpackagehierarchy) \[*package\_name*\] | Repackage all packages that are renamed into the single given parent package. -| [`-repackageclasses`](configuration/usage.md#repackageclasses) \[*package\_name*\] | Repackage all class files that are renamed into the single given package. -| [`-keepattributes`](configuration/usage.md#keepattributes) \[*[attribute\_filter](configuration/usage.md#filters)*\] | Preserve the given optional attributes; typically `Exceptions`, `InnerClasses`, `Signature`, `Deprecated`, `SourceFile`, `SourceDir`, `LineNumberTable`, `LocalVariableTable`, `LocalVariableTypeTable`, `Synthetic`, `EnclosingMethod`, and `*Annotation*`. -| [`-keepparameternames`](configuration/usage.md#keepparameternames) | Keep the parameter names and types of methods that are kept. -| [`-renamesourcefileattribute`](configuration/usage.md#renamesourcefileattribute) \[*string*\] | Put the given constant string in the `SourceFile` attributes. -| [`-adaptclassstrings`](configuration/usage.md#adaptclassstrings) \[[*class\_filter*](configuration/usage.md#filters)\] | Adapt string constants in the specified classes, based on the obfuscated names of any corresponding classes. -| [`-keepkotlinmetadata`](configuration/usage.md#keepkotlinmetadata) ** deprecated ** | Keep and adapt Kotlin metadata. -| [`-adaptresourcefilecontents`](configuration/usage.md#adaptresourcefilecontents) \[[*file\_filter*](configuration/usage.md#filefilters)\] | Update the contents of the specified resource files, based on the obfuscated names of the processed classes. -| [`-dontpreverify`](configuration/usage.md#dontpreverify) | Don't preverify the processed class files. -| [`-microedition`](configuration/usage.md#microedition) | Target the processed class files at Java Micro Edition. -| [`-android`](configuration/usage.md#android) | Target the processed class files at Android. -| [`-verbose`](configuration/usage.md#verbose) | Write out some more information during processing. -| [`-dontnote`](configuration/usage.md#dontnote) \[[*class\_filter*](configuration/usage.md#filters)\] | Don't print notes about potential mistakes or omissions in the configuration. -| [`-dontwarn`](configuration/usage.md#dontwarn) \[[*class\_filter*](configuration/usage.md#filters)\] | Don't warn about unresolved references at all. -| [`-ignorewarnings`](configuration/usage.md#ignorewarnings) | Print warnings about unresolved references, but continue processing anyhow. -| [`-printconfiguration`](configuration/usage.md#printconfiguration) \[[*filename*](configuration/usage.md#filename)\] | Write out the entire configuration, in traditional ProGuard style, to the standard output or to the given file. -| [`-dump`](configuration/usage.md#dump) \[[*filename*](configuration/usage.md#filename)\] | Write out the internal structure of the processed class files, to the standard output or to the given file. -| [`-addconfigurationdebugging`](configuration/usage.md#addconfigurationdebugging) | Instrument the processed code with debugging statements that print out suggestions for missing ProGuard configuration. -| [`-optimizeaggressively`](configuration/usage.md#optimizeaggressively) | Enables more aggressive assumptions during optimization - -Notes: - -- *class\_path* is a list of jars, apks, aabs, aars, wars, ears, jmods, zips, - and directories, with optional filters, separated by path separators. -- *filename* can contain Java system properties delimited by - '**<**' and '**>**'. -- If *filename* contains special characters, the entire name should be - quoted with single or double quotes. - -## Overview of `Keep` Options {: #keepoverview} - -| Keep | From being removed or renamed | From being renamed -|-----------------------------------------------------|--------------------------------------------------------------|------------------------------------------------------------------------ -| Classes and class members | [`-keep`](configuration/usage.md#keep) | [`-keepnames`](configuration/usage.md#keepnames) -| Class members only | [`-keepclassmembers`](configuration/usage.md#keepclassmembers) | [`-keepclassmembernames`](configuration/usage.md#keepclassmembernames) -| Classes and class members, if class members present | [`-keepclasseswithmembers`](configuration/usage.md#keepclasseswithmembers) | [`-keepclasseswithmembernames`](configuration/usage.md#keepclasseswithmembernames) - -The [**ProGuard Playground**](https://playground.proguard.com) is a useful tool to help you further tweak the keep rules. - - - -## Keep Option Modifiers {: #keepoptionmodifiers} - -| Modifier | Meaning -|-----------------------------------------------------------------|--------------------------------------------------------------------------- -| [`includedescriptorclasses`](configuration/usage.md#includedescriptorclasses) | Also keep any classes in the descriptors of specified fields and methods. -| [`includecode`](configuration/usage.md#includecode) | Also keep the code of the specified methods unchanged. -| [`allowshrinking`](configuration/usage.md#allowshrinking) | Allow the specified entry points to be removed in the shrinking step. -| [`allowoptimization`](configuration/usage.md#allowoptimization) | Allow the specified entry points to be modified in the optimization step. -| [`allowobfuscation`](configuration/usage.md#allowobfuscation) | Allow the specified entry points to be renamed in the obfuscation step. - -## Class Specifications {: #classspecification} - - [@annotationtype] [[!]public|final|abstract|@ ...] [!]interface|class|enum classname - [extends|implements [@annotationtype] classname] - [{ - [@annotationtype] - [[!]public|private|protected|static|volatile|transient ...] - | (fieldtype fieldname [= values]); - - [@annotationtype] - [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] - | (argumenttype,...) | classname(argumenttype,...) | (returntype methodname(argumenttype,...)); - - [@annotationtype] [[!]public|private|protected|static ... ] *; - ... - }] - -Notes: - -- Class names must always be fully qualified, i.e. including their - package names. -- Types in *classname*, *annotationtype*, *returntype*, and - *argumenttype* can contain wildcards: '`?`' for a single character, - '`*`' for any number of characters (but not the package separator), - '`**`' for any number of (any) characters, '`%`' for any primitive - type, '`***`' for any type, '`...`' for any number of arguments, and - '``' for the *n*'th matched wildcard in the same option. -- *fieldname* and *methodname* can contain wildcards as well: '`?`' - for a single character and '`*`' for any number of characters. diff --git a/proguard/docs/manual/releasenotes.md b/proguard/docs/manual/releasenotes.md deleted file mode 100644 index 2f388d8..0000000 --- a/proguard/docs/manual/releasenotes.md +++ /dev/null @@ -1,1101 +0,0 @@ -## Version 7.3.2 - -### Java support - -- Add support for Java 20. (#294) - -### Improved - -- Merge classes only when `-optimizeaggressively` is set. - -### Bugfixes - -- Fix potential `ArrayIndexOutOfBoundsException` when processing Kotlin metadata. (#297) - -## Version 7.3.1 - -### Kotlin support - -- Add support for Kotlin 1.8. - -### Improved - -- Conservative optimization is now the default. Previously, it could be enabled by setting the `optimize.conservatively` system property. This has been replaced with the `-optimizeaggressively` option, which sets optimization to aggressive. -- Improve optimization performance in edge cases with generated code. (#283) - -### Bugfixes - -- Fix `-keepparameternames` to keep Kotlin function, constructor and property setter parameter names. -- Fix `-keepparameternames` to keep Kotlin annotation constructor parameter names. -- Fix `-keepparameternames` to keep Kotlin interface parameter names. -- Fix potential `NullPointerException` while processing enum classes with invalid Kotlin metadata. -- Fix potential `Instruction has invalid constant index size` error during GSON optimization. -- Fix member specialization & generalization optimizations. -- Fix potential "Сan't find referenced class ClassName$DefaultImpls" warnings. (#290) - -## Version 7.3.0 - -### Java support - -To allow ProGuard to continue to optimize, obfuscate and shrink Java class files ProGuard now supports all Java versions including Java 19. - -- Add support for Java 19. (`PGD-247`) - -### Kotlin support - -ProGuard 7.3 deprecates the `-keepkotlinmetadata` option. You can use `-keep class kotlin.Metadata` instead -which automatically enables processing of Kotlin metadata. Some consumer rules, from libraries -such as `kotlin-reflect`, already contain this rule. - -- Add support for Kotlin 1.7. -- Improve support for Kotlin library projects. (`T3752`) -- Automatically process Kotlin Metadata when keeping the `kotlin.Metadata` annotation. (`T3116`) - -### Improved - -- Improve app startup times when using `-addconfigurationdebugging`. (`T17153`) -- Automatically process Kotlin Metadata when keeping the `kotlin.Metadata` annotation. (`T3116`) - -### Bug fixes - -- Prevent merging classes with native methods that would result in UnsatisfiedLinkError. -- Fix optimization of simple enums (optimization `class/unboxing/enums`). -- Prevent potential build time `NullPointerException` when processing Kotlin interface methods. -- Fix ProGuard Gradle Plugin not working correctly on Windows. (`PGD-272`) - -## Version 7.2.2 - -### Bug fixes - -- Fix "Can't save configuration file" error in ProGuardGUI. (`PGD-220`) -- Fix rule configurations that extend annotation classes. (`PGD-229`) -- Fix "No matching variant" Gradle plugin error when using Gradle 7.4 and Java 8. (`PGD-2311`) -- Fix potential Kotlin metadata initialization issue when using the `-Xno-optimized-callable-references` compiler option. (`T16486`) -- Fix missing warnings in ProGuardGUI. (`PGD-239`) - -### Improved - -- Remove Kotlin Intrinsics strings by default, without requiring the `-keepkotlinmetadata` option. (`T16518`) - -## Version 7.2.1 - -### Improved - -- Remove `throwUninitializedProperty` parameter strings when using `-keepkotlinmetadata`. (`T4696`) - -### Bug fixes - -- Fix possible `NullPointerException` in the `ConigurationLogger` when printing rules about constructors. - -## Version 7.2.1 - - -### Java Support - -- Update maximum supported Java class version to 62.65535 (Java 18 ea). (T13973) -- Deprecate `-target` for classes compiled with Java > 11. (`T13968`) - - -### Improved - -- Add [`consumerRuleFilter`](setup/gradleplugin.md#consumerrulefilter) to the ProGuard Gradle plugin. (`T4134`) - -### Bug fixes - -- Prevent the generation of Windows reserved names. (`T3937`) -- Prevent "Expecting type and name" parse error when using the `androidx.window` library in an Android project. (`T13715`) -- Fix shrinking of annotations during GSON optimization. - -## Version 7.2 - - -### Java Support - -New Java versions are released every 6 months. -To allow ProGuard to continue to optimize, obfuscate and shrink Java class files ProGuard now supports all Java versions including Java 17. - -- Add support for Java 17. (`PGD-132`) - - -### Kotlin Support - -New Kotlin versions are released every 6 months. -To allow ProGuard to continue to optimize, obfuscate and shrink Kotlin generated class files and their corresponding metadata ProGuard now supports Kotlin reading Kotlin classes from version 1.0 to 1.6 and writing Kotlin metadata with version 1.5 (readable by Kotlin reflection library / compiler 1.4 - 1.6). - -- Add support for processing Kotlin 1.5 and 1.6 metadata. (`PGD-179`, `DGD-3467`, `PGC-31`, `T4777`) -- Add support for matching Kotlin inline class type parameters when using `includedescriptorclasses` keep rule modifier (requires `-keepkotlinmetadata`). (`T13653`) - -### Improved - -- Upgrade log4j2 dependency to 2.17.1 in response to CVE-2021-44228, CVE-2021-45046, CVE-2021-45105 and CVE-2021-44832 -- Improve build speed when using `-keepkotlinmetadata`. (`T5205`) - -### Bug fixes - -- Fix potential `NullPointerException` when initializing Kotlin callable references. (`T5899`) -- Prevent requiring `--enable-preview` on a JVM for Java 16 class files (write class file version `60.0` instead of `60.65535`). -- Fix potential `StringIndexOutOfBoundsException` during signing. (`T7004`) -- Fix potential `StackOverflowError` when processing Java 16 records with type annotations. (`PGD-182`) -- Fix potential `StringOutOfBoundsException` when processing Kotlin callable references. (`T5927`) -- Fix potential `NullPointerException` when processing Kotlin callable references. (`T6138`) -- Fix potential `Stack size becomes negative` exception when processing large methods. (`T5721`) -- Fix potential `ClassFormatError` due to adding multiple annotation attributes when processing Kotlin code. -- Fix potential `NullPointerException` due to missing classes. -- Prevent possible `LinkageError` when making package-private final methods that are shadowed protected. (`T7056`) - - -## Version 7.1.2 - -### Bug fixes - -- Prevent possible R8 compilation error when using enum default values in an interface definition. -- Fix enabling of optimization when `proguard-android-optimize.txt` is specified as the default in the Gradle plugin. - - -## Version 7.1.1 - -### Miscellaneous - -#### Bug fixes - -- Fix initialization and obfuscation of Kotlin callable references when using Kotlin 1.4. (`T5631`) -- Fail build when `IncompleteClassHierarchyException` is encountered. (`T5007`) -- Fix potential hanging of ProGuard process during optimization or obfuscation. - -## Version 7.1 (June 2021) - -### AGP 7 compatible Gradle plugin - -The way ProGuard is integrated into Android projects is changing because AGP 7 will no longer allow developers to disable R8 with the `android.enableR8` Gradle property. - -ProGuard 7.1 includes a new Gradle plugin which allows for a seamless integration with this new AGP version. A detailed and step-by-step guide for transition from the previous plugin is provided in the [upgrading guide](setup/upgrading.md). - -- Simple integration with Android Gradle Projects by adding a dependency on the -[ProGuard Gradle Plugin artifact](https://mvnrepository.com/artifact/com.guardsquare/proguard-gradle/7.1.0) and applying the `com.guardsquare.proguard` plugin, as presented in the [Gradle plugin setup instructions](setup/gradleplugin.md). - -### Java support - -New Java versions are released every 6 months. -To allow ProGuard to continue to optimize, obfuscate and shrink Java class files we have added support for the latest releases, up to Java 16. -This includes - -- Add support for processing Java 14, 15 and 16 class files. (`PGC-0015`, `PGD-0064`) -- Add support for Java 14 sealed classes. (`PGD-0064`) -- Add support for records (previewed in Java 15/16, targeted for Java 17). (`PGD-0064`) - -### New optimizations - -ProGuard 7.1 adds 5 new code [optimizations](configuration/optimizations.md). -These optimization aim at reducing the number of classes required by the application and help pinpointing the specialized type wherever possible. This can have a positive impact on code shrinking and application performances. - - - `method/specialization/returntype` - specializes the types of method return values, whenever possible. - - `method/specialization/parametertype` - specializes the types of method parameters, whenever possible. - - `method/generalization/class` - generalizes the classes of method invocations, whenever possible. - - `field/specialization/type` - specializes the types of fields, whenever possible. - - `field/generalization/class` - generalizes the classes of field accesses, whenever possible. - -### Maven central - -ProGuard was previously hosted at JCenter, but this repository has recently been removed. -ProGuard is now published to [Maven Central](https://mvnrepository.com/artifact/com.guardsquare/proguard-gradle/7.1.0). - - - Simple integration : follow the [Gradle plugin setup instructions](setup/gradleplugin.md) to select the `mavenCentral()` repository and dependencies to the `proguard-gradle` artifact. - -### Easier configuration - -The [`-addconfigurationdebugging`](configuration/usage.md#addconfigurationdebugging) allows to help configuring ProGuard `-keep` rules. -For more details and to see this in action have a look at [Configuring ProGuard, an Easy Step-by-Step Tutorial](https://www.guardsquare.com/blog/configuring-proguard-an-easy-step-by-step-tutorial). - -`-addconfigurationdebugging` previously reported `-keep` rule suggestions for classes, methods or fields that did not exist in the app. Such `-keep` rules are not necessary. - -ProGuard 7.1 improves the suggestion of `-keep` rules by only suggesting rules for classes, methods and fields that were actually in the original application (`DGD-3264`). - -- More precise keep rule suggestions provided by `-addconfigurationdebugging`. -- Easier ProGuard -keep rules configuration. -- Reduced ProGuard configuration size. - -### Miscellaneous - -#### Improvements - - - Remove Gradle plugin dependency on Android build tools. (`PGD-0066`) - - Improve error message when missing classes result in an incomplete class hierarchy. (`DGD-0013`) - - Improve speed of horizontal class merging. (`DGD-1471`) - - Fix potential `NullPointerException` during GSON optimization. (`T3568`, `T3607`) - - Fix potential dangling switch labels and next local index in `GsonDeserializationOptimizer`. - - Fix potential `NoClassDefFoundError` at runtime after applying Gson optimization to library project. (`T2374`) - - Improve general performance and stability of optimization. - -#### Bug fixes - - - Fix `ProGuardTask` Gradle task compatibility with Gradle 7. (`PGD-0136`) - - Fix potentially incorrect class merging optimizations that could cause a run-time `NullPointerException`. (`DGD-3377`) - - Fix Gradle task error when using an existing `-outjar` directory. (`PGD-0106`) - - Fix potential class merging optimization issue resulting in `ArrayIndexOutOfBoundsException` during build. (`DGD-1995`) - - Fix enum unboxing for already obfuscated code. (`DGD-0567`) - - Fix potential parameter removal optimization issue when optimizing constructors. (`PGD-0018`, `PGD-0019`) - - Fix potential `IllegalArgumentException` (Stack size becomes negative) in `class/merging/wrapper` optimization. (`DGD-2587`) - - Fix wrapper class merging with `new`/`dup`/`astore` sequences. (`DGD-1564`) - - Fix potential incorrect removal of exception handlers during optimization. (`DGD-3036`) - - Fix potential, incorrect advanced code optimizations. (`DGD-3289`) - - Disallow merging of nest hosts or members during class merging optimization. (`PGD-0037`) - - Fix packaging of Ant plugin. (`PGD-0052`) - - Fix potential IllegalArgumentException in GSON optimization. (`PGD-0047`) - - Fix writing of kept directories. (`PGD-0110`) - - Fix storage and alignment of uncompressed zip entries. (`DGD-2390`) - - Fix processing of constant boolean arrays. (`DGD-2338`) - - Prevent injected classes from being merged into other classes. - -## Version 7.0 (Jun 2020) - -| Version| Issue | Module | Explanation -|--------|----------|----------|---------------------------------- -| 7.0.1 | DGD-2382 | CORE | Fixed processing of Kotlin 1.4 metadata annotations. -| 7.0.1 | DGD-2494 | CORE | Fix naming conflict resolution potentially resulting in the renaming of library members. -| 7.0.1 | | RETRACE | Extend expressions supported by Retrace. -| 7.0.0 | | CORE | Added support for [Kotlin metadata](languages/kotlin.md), with new option `-keepkotlinmetadata`. -| 7.0.0 | PGD-32 | CORE | Allowing Java 14 class files. -| 7.0.0 | | CORE | Optimizing away instance references to constructor-less classes. -| 7.0.0 | DGD-1489 | CORE | Fixed potential `IllegalArgumentException` with message `Value "x" is not a reference value` when optimizing code with conditional casts. -| 7.0.0 | PGD-12 | CORE | Fixed building gradle plugin. - -## Version 6.2 (Oct 2019) - -| Version| Issue | Module | Explanation -|--------|----------|----------|---------------------------------- -| 6.2.2 | | GRADLE | Fixed missing runtime dependencies. -| 6.2.1 | PGD-12 | GRADLE | Fixed build of Gradle plugin. -| 6.2.1 | DGD-827 | CORE | Fixed retracing of obfuscated class / method names in some cases. -| 6.2.1 | PGD-15 | CORE | Fixed potential `ClassFormatError` due to corrupt LineNumberTables when processing class files generated by groovy 2.5.5+. -| 6.2.1 | DGD-1503 | CORE | Added default filter to prevent processing of versioned class files. -| 6.2.1 | DGD-1364 | DOCS | Documented the mapping file format. -| 6.2.1 | DGD-950 | CORE | Fixed potential `EmptyStackException` when generating mapping files with inlined methods in rare cases. -| 6.2.1 | PGD-10 | CORE | Fixed potential `VerifyError` when optimizing classes with class version `11+` due to nest based access. -| 6.2.1 | PGD-11 | CORE | Fixed gradle example for processing libraries. -| 6.2.1 | PGD-8 | CORE | Fixed potential `IllegalArgumentException` with message `Value "x" is not a reference value` when optimizing code with conditional casts. -| 6.2.1 | DGD-1424 | CORE | Fixed incomplete fix in case of inlining method with type annotations. -| 6.2.0 | DGD-1359 | CORE | Fixed removal of non-static write-only fields (optimization `field/removal/writeonly`). -| 6.2.0 | DGD-1424 | CORE | Fixed potential build error when inlining methods into code attributes with type annotations. -| 6.2.0 | PGD-764 | GUI | Fixed text fields for obfuscation dictionaries. -| 6.2.0 | PGD-751 | GUI | Fixed boilerplate settings and foldable panels. -| 6.2.0 | DGD-1418 | CORE | Fixed class member access checking for backporting of closures. -| 6.2.0 | DGD-1359 | CORE | Fixed removal of write-only fields. -| 6.2.0 | PGD-756 | CORE | Fixed detection of functional interfaces. -| 6.2.0 | DGD-1317 | CORE | Fixed potential build errors when optimizing methods with many parameters. -| 6.2.0 | PGD-753 | CORE | Fixed processing of signature attributes in constructors of inner classes and enum types. -| 6.2.0 | PGD-759 | CORE | Fixed backporting of Java 8 API types when used as parameters in private methods. -| 6.2.0 | PGD-1 | CORE | Fixed optimization of exception handling in Kotlin runtime. - -## Version 6.1 (May 2019) - -- \[PGD-750\] Fixed UnsupportedOperationException when optimizing enum types - in closure arguments. -- \[DGD-1276\] Fixed optimization of Groovy code constructs causing Dalvik - conversion errors. -- \[DGD-1258\] Fixed potential VerifyError in JVM caused by inlining methods - from super class. -- \[PGD-752\] Fixed preverification of initializers with inlined exception - throwing code. -- \[PGD-755\] Fixed compatibility with older versions of ProGuard - when used in combination with the Android gradle plugin. -- Fixed potential NullPointerException when using keep rules with - includecode modifier. -- \[PGD-749\] Fixed merging of classes containing type annotations with empty - targets. -- \[PGD-748\] Fixed optimization of exceptions as unused parameters. -- \[PGD-747\] Removed unwanted logging injection for native library loading. -- \[PGD-745\] Fixed IllegalArgumentException for comparison of constant arrays - with NaN float/double values. -- \[PGD-744\] Fixed potential ClassCastException when optimizing method handles - of simple enum types. -- \[DGD-504\] Fixed potential build errors when optimizing Kotlin - code that combines `let` and the Elvis operator `?:`. -- \[PGD-741\] Improved incremental obfuscation. -- \[DGD-1050\] Fixed obfuscation of enums in annotations, for - conversion by dx or D8. -- \[PGD-739\] Fixed the counter for the number of inlined - constant parameters. -- \[PGD-188\] Added support for Java 10, 11, and 12. -- \[PGD-740\] Fixed shrinking of nest member attributes. -- \[PGD-735\] Fixed processing of parameter annotations in - constructors of inner classes and enum types. -- \[PGD-734\] Fixed processing of lambda expressions for non-obvious - functional interfaces. -- Added optimization of code that uses the GSON library, removing - reflection to improve size and performance of the processed code. -- Added automatic backporting of code using the Java 8 stream API, - enabled by adding net.sourceforge.streamsupport as a library. -- Added automatic backporting of Java 8 time API, enabled by adding - org.threeten as a library. -- Added option `-assumevalues`, with corresponding optimizations on - integer intervals. -- \[PGD-731\] Fixed incorrect error message about generics in - wildcard expressions. -- \[PGD-730\] Fixed infinite loop in optimization. -- \[PGD-720\] Fixed unboxed enum types being compared to null. -- Fixed writing out mapping files with duplicate lines. -- Fixed potentially inconsistent local variable type table. -- Fixed backporting of default interface methods if an interface - extends another one. -- Now uniformly reading and writing text files with UTF-8 encoding. -- \[PGD-708\] Fixed possible verification error due to exception - handlers in Kotlin initializers. -- \[PGD-712\] Fixed NullPointerException triggered by `module-info` - classes with `requires` without version. -- \[PGD-709\] Improved error messages for problems parsing wildcards. - -## Version 6.0 (Feb 2018) - -- \[PGD-701\] Fixed potential VerifyError in the presence of branches - to instruction offset 0. -- Fixed backporting of lambda functions using the alternative - factory method. -- \[PGD-699\] Fixed obfuscation of closures that implement - multiple interfaces. -- \[PGD-694\] Fixed classes prefix when writing output to directories. -- \[PGD-186\] Added support for Java 10. -- \[PGD-698\] Fixed possible NullPointerException when - parsing configuration. -- \[PGD-655\] Fixed access from static methods to protected methods - in superclasses. -- \[PGD-693\] Fixed obfuscation of closures for functional interfaces - with default methods. -- Added new option `-if`, to specify conditions for [`-keep`](configuration/usage.md#keep) options. -- Added new option `-addconfigurationdebugging`, to instrument the - code to get feedback about missing configuration at runtime. -- Added new option [`-android`](configuration/usage.md#android) to tune processing for Android. -- Added support for references to matched wildcards in regular - expressions in `-keep` options. -- Added new options `-assumenoexternalsideeffects`, - `-assumenoescapingparameters`, and `-assumenoexternalreturnvalues`, - to express fine-grained assumptions for better code optimization. -- Added backporting of Java 8 code. -- Added backporting and support for Java 9 code. -- Improved vertical class merging. -- \[PGD-689\] Fixed optimization potentially causing unexpected error - while processing Kotlin bytecode. -- \[PGD-690\] Fixed NullPointerException when editing keep - specifications in GUI. -- \[PGD-688\] Fixed UnsupportedOperationException while optimizing - type annotations. -- \[PGD-654\] Fixed processing of MethodParameters attributes with - nameless parameters. -- \[PGD-662\] Fixed obfuscation causing clashing private and default - method names. -- \[PGD-684\] Fixed obfuscation of extensions of functional interfaces - that are implemented with closures. -- \[PGD-681\] Fixed potential IllegalArgumentException in - simplification of tail recursion. -- \[PGD-672\] Fixed memory leak writing compressed zip entries. -- \[PGD-652\] Fixed possible NullPointerException due to missing - variable initialization. -- \[PGD-641\] Fixed possible NullPointerException due to optimized - enum types. -- \[PGD-630\] Fixed possible NullPointerException in - optimization step. -- \[PGD-637\] Fixed simplification of enum types in - invokedynamic calls. -- Fixed merging of classes sometimes resulting in final methods - being overridden. -- Fixed simplification of enum types that are stored in arrays. -- Fixed VerifyError triggered by merging classes with - shrinking disabled. - -## Version 5.3 (Sep 2016) - -- Avoiding obfuscated name clashes with library classes. -- Fixed processing of generic signatures with inner classes. -- Fixed processing of generic signatures with array types as bounds. -- Fixed processing of wide branch instructions. -- Fixed shrinking of nameless parameters attribute. -- Fixed optimization of code with unreachable exception handlers. -- Fixed optimization of enum types with custom fields. -- Fixed optimization of enum types with custom static methods. -- Fixed optimization of lambda method types. -- Fixed optimization of parameter annotations. -- Fixed optimization of swap/pop constructs. -- Fixed adapting class access for referenced class members. -- Fixed adapting invocations for referenced class members. -- Preserving class member signature classes if - `includedescriptorclasses` is specified. -- Allowing empty output jars if [`-ignorewarnings`](configuration/usage.md#ignorewarnings) is specified. -- Avoiding exceptions when inlining invalid line number - instruction offsets. -- Fixed preverification of wildcard exceptions. -- Fixed ReTrace for field names. -- Fixed ReTrace for negative line numbers. -- Improved ReTrace regular expression for Logback and Log4j. -- Added Gradle build file. -- Updated documentation and examples. - -## Version 5.2 (Jan 2015) - -- Added encoding of optimized line numbers in ProGuard. -- Added decoding of optimized stack frames in ReTrace. -- Added overflow checks when writing out class files. -- Fixed shrinking of default methods in subinterfaces. -- Fixed optimization of closures with signatures containing - merged classes. -- Fixed conservative optimization of instructions that may - throw exceptions. -- Fixed internal processing of primitive array types. -- Updated documentation and examples. - -## Version 5.1 (Oct 2014) - -- Fixed processing of various kinds of closures in Java 8. -- Fixed shrinking of generic signatures in classes and methods. -- Fixed shrinking of debug information about generic local - variable types. -- Fixed optimization of default implementations in interfaces. -- Fixed optimization of variable initializations. -- Fixed obfuscation of internal class names in strings. -- Updated documentation and examples. - -## Version 5.0 (Aug 2014) - -- Added support for Java 8. -- Added [`-keep`](configuration/usage.md#keep) modifier `includedescriptorclasses`. -- Added automatic suggestions for keeping attributes. -- Clearing preverification information when `-dontpreverify` - is specified. -- Extended optimization support for conservative optimization with - java system property `optimize.conservatively`. -- Fixed occasional preverification problem. -- Fixed shrinking of generic class signatures. -- Fixed shrinking of generic variable signatures. -- Fixed analysis of unused parameters for bootstrap methods in - library classes. -- Fixed inlining problem of non-returning subroutines. -- Fixed possible IllegalArgumentException and - ArrayIndexOutOfBoundsException in enum simplification. -- Fixed unnecessary notes about dynamic class instantiations with - constant class names. -- Fixed preverification of unnecessary casts of null values. -- Fixed lazy resolution of output jars in Gradle task. -- Fixed processing of synthetic code with alternative - initializer invocations. -- Improved handling of symbolic links in shell scripts. -- Improved default path in Windows bat files. -- Updated documentation and examples. - -## Version 4.11 (Dec 2013) - -- Added simplification of basic enum types. -- Added reading and writing of apk and aar archives. -- Fixed criteria for class merging. -- Fixed simplification of variable initializations. -- Fixed simplification of redundant boolean variables. -- Fixed optimization of unused stack entries in exception handlers. -- Fixed correction of access flags after class merging, method - inlining, and class repackaging. -- Refined criterion for method inlining. -- Updated documentation and examples. - -## Version 4.10 (Jul 2013) - -- Made Gradle task resolve files lazily. -- Enabled as-needed execution in Gradle task. -- Using standard string interpolation for Gradle configuration. -- Reduced log levels for console output in Gradle task. -- Updated documentation and examples. - -## Version 4.9 (Mar 2013) - -- Added Gradle task. -- Added more peephole optimizations for strings. -- Improved optimization of classes with static initializers. -- Improved processing of finally blocks compiled with JDK 1.4 - or older. -- Fixed shrinking of access widening abstract methods, for the - Dalvik VM. -- Fixed overly aggressive shrinking of class annotations. -- Fixed processing of unused classes in generic signatures. -- Fixed merging of classes with similar class members. -- Added java system property `optimize.conservatively` to allow for - instructions intentionally throwing `NullPointerException`, - `ArrayIndexOutOfBoundsException`, or `ClassCastException` without - other useful effects. -- Fixed optimization of unnecessary variable initializations. -- Fixed optimization of code involving NaN. -- Fixed inlining of methods that are supposed to be kept. -- Fixed preverification of artificially convoluted dup constructs. -- Fixed quotes for java commands in .bat scripts. -- Improved handling of non-sequential line number information. -- Now requiring Java 5 or higher for running ProGuard. -- Updated build files. -- Updated documentation and examples. - -## Version 4.8 (May 2012) - -- Added more peephole optimizations for strings. -- Added support for multiple external configuration files in - Ant configurations. -- Added support for Ant properties in external configuration files. -- Fixed parsing of empty file filters on input and output. -- Fixed parsing of '\*' wildcard for file filters and name filters. -- Fixed obfuscation of private methods that are overridden in concrete - classes with intermediary abstract classes and interfaces - (workaround for Oracle bugs \#6691741 and \#6684387). -- Fixed optimization of complex finally blocks, compiled with JDK 1.4 - or earlier. -- Fixed optimizing signatures of methods that are marked as not having - side effects. -- Fixed optimization of long local variables possibly causing - verification error for register pairs. -- Fixed merging of classes defined inside methods. -- Fixed stack consistency in optimization step. -- No longer removing debug information about unused parameters, for - `-keepparameternames` or `-keepattributes`. -- Fixed updating manifest files with carriage return characters. -- Now removing unreachable code in preverification step. -- Improved default regular expression for stack traces in ReTrace. -- Updated documentation and examples. - -## Version 4.7 (Dec 2011) - -- Added support for Java 7. -- Parsing unquoted file names with special characters more leniently. -- Added support for instance methods overriding class methods. -- Added removal of unused parameterless constructors. -- Added removal of empty class initializers. -- Added peephole optimizations for constant strings. -- Avoiding idle optimization passes. -- Improved removal of unused constants after obfuscation. -- Fixed removal of unused classes referenced by annotations. -- Fixed simplifying parameters of constructors that should actually - be preserved. -- Fixed simplifying parameters of large numbers of - similar constructors. -- Fixed exceptions in optimization of unusual obfuscated code. -- Fixed NullPointerException when specifying `-keepclassmembers` - without specific class or class members. -- Fixed potential problems with mixed-case class name dictionaries - when not allowing mixed-case class names. -- Fixed obfuscation of classes with EnclosingMethod attributes that - don't specify methods. -- Fixed preverification of returning try blocks with finally blocks, - inside try blocks, when compiled with JDK 1.4. -- Fixed sorting of interfaces containing generics. -- Fixed paths in shell scripts. -- Fixed filling in of text fields showing class obfuscation dictionary - and package obfuscation dictionary from configuration in GUI. -- Worked around Oracle Java 6/7 bug \#7027598 that locked the GUI - on Linux. -- Updated documentation and examples. - -## Version 4.6 (Feb 2011) - -- Added support for synthetic, bridge, and varargs modifiers - in configuration. -- Added detection of atomic updater construction with - constant arguments. -- Fixed merging of package visible classes. -- Fixed optimization of fields that are only accessed by reflection. -- Fixed optimization of read-only or write-only fields that - are volatile. -- Fixed handling of side-effects due to static initializers. -- Fixed handling of bridge flags in obfuscation step. -- Fixed handling of super flag when merging classes. -- Fixed updating of variable tables when optimizing variables. -- Fixed removal of unused parameters with 32 or more parameters. -- Fixed incorrect removal of exception handler for - instanceof instruction. -- Fixed inlining of methods with unusual exception handlers. -- Fixed optimization of unusual code causing stack underflow. -- Fixed keeping of constructor parameter names. -- Fixed unwanted wrapping of non-standard META-INF files. -- Fixed filtering of warnings about references to array types. -- Fixed overriding of warning option and note option in Ant task. -- Improved detection of file name extensions for canonical paths. -- Improved printing of seeds specified by [`-keep`](configuration/usage.md#keep) options. -- Improved printing of notes about unkept classes. -- Improved checking whether output is up to date. -- Updated documentation and examples. - -## Version 4.5 (Jun 2010) - -- Added option `-keepparameternames`. -- [`-dontskipnonpubliclibraryclasses`](configuration/usage.md#dontskipnonpubliclibraryclasses) is now set by default. Added - `-skipnonpubliclibraryclasses` as an option. -- Made processing independent of order of input classes to get even - more deterministic output. -- Improved constant field propagation. -- Improved renaming of resource files in subdirectories of packages. -- Avoiding making fields in interfaces private. -- Optimizing exception handlers for monitorexit instruction. -- Reduced maximum allowed code length after inlining from 8000 bytes - to 7000 bytes. -- Fixed missing warnings about missing library classes. -- Fixed shrinking of annotations with arrays of length 0. -- Fixed handling of -0.0 and NaN values when simplifying expressions. -- Fixed copying of exception handlers when simplifying tail - recursion calls. -- Fixed optimization of introspected fields. -- Fixed simplification of unnecessary variable initializations. -- Fixed evaluation of subroutines in pre-JDK 1.5 code. -- Fixed updating of access flags in inner classes information. -- Fixed disabling of field privatization. -- Fixed invocations of privatized methods. -- Fixed updating of local variable debug information in - optimization step. -- Fixed print settings without file name in GUI. -- Fixed field privatization setting in GUI. -- Fixed saving incorrectly quoted arguments in GUI. -- Fixed handling of regular expressions with only negators. -- Fixed unwanted wrapping of non-standard META-INF files. -- Fixed regular expression pattern for constructors in ReTrace. -- Updated documentation and examples. - -## Version 4.4 (Jul 2009) - -- Added new peephole optimizations. -- Added option [`-optimizations`](configuration/usage.md#optimizations) for fine-grained configuration - of optimizations. -- Added option [`-adaptclassstrings`](configuration/usage.md#adaptclassstrings) for adapting string constants that - correspond to obfuscated classes. -- Added option [`-keeppackagenames`](configuration/usage.md#keeppackagenames) for keeping specified package names - from being obfuscated. -- Added option [`-keepdirectories`](configuration/usage.md#keepdirectories) for keeping specified directory - entries in output jars. -- Extended options [`-dontnote`](configuration/usage.md#dontnote) and [`-dontwarn`](configuration/usage.md#dontwarn) for fine-grained - configuration of notes and warnings. -- Added option `-regex` in ReTrace, for specifying alternative regular - expressions to parse stack traces. -- Extended renaming of resource files based on obfuscation. -- Improved inlining of constant parameters and removal of - unused parameters. -- Avoiding bug in IBM's JVM for JSE, in optimization step. -- Avoiding ArrayIndexOutOfBoundsException in optimization step. -- Fixed configuration with annotations that are not - preserved themselves. -- Fixed preverification of invocations of super constructors with - arguments containing ternary operators. -- Fixed processing of unreachable exception handlers. -- Fixed merging of exception classes. -- Fixed repeated method inlining. -- Fixed inlining of finally blocks surrounded by large try blocks, - compiled with JDK 1.4 or earlier. -- Fixed optimization of complex finally blocks, compiled with JDK 1.4 - or earlier. -- Fixed obfuscation of anonymous class names, if `EnclosingMethod` - attributes are being kept. -- Fixed obfuscation of inner class names in generic types. -- Fixed decoding of UTF-8 strings containing special characters. -- Fixed copying of debug information and annotations when - merging classes. -- Fixed writing out of unknown attributes. -- Fixed updating manifest files with split lines. -- Updated documentation and examples. - -## Version 4.3 (Dec 2008) - -- Added class merging. -- Added static single assignment analysis. -- Added support for annotation and enumeration class types - in configuration. -- Refined shrinking of fields in case of unusual - `-keepclassmembers` options. -- Added simplification of tail recursion calls. -- Added new peephole optimizations. -- Fixed optimization of unused variable initializations causing - negative stack sizes. -- Fixed optimization of unusual initialization code - causing NullPointerExceptions. -- Fixed optimization of half-used long and double parameters. -- Fixed processing of complex generics signatures. -- Working around suspected java compiler bug with parameter - annotations on constructors of non-static inner classes. -- Fixed obfuscation of classes with inner classes whose names - are preserved. -- Fixed access of protected methods in repackaged classes. -- Added options [`-classobfuscationdictionary`](configuration/usage.md#classobfuscationdictionary) and - `-packageobfuscationdictionary`. -- Adapting more types of resource file names based on obfuscation. -- Extended warnings about incorrect dependencies. -- Added start-up scripts and build scripts. -- Updated documentation and examples. - -## Version 4.2 (Mar 2008) - -- Refined data flow analysis in optimization step. -- Fixed handling of exceptions when inlining subroutines. -- Fixed inlining of incompatible code constructs between different - java versions. -- Fixed computation of local variable frame size. -- Fixed optimization of infinite loops. -- Fixed optimization of subroutine invocations. -- Fixed optimization of floating point remainder computations. -- Fixed removal of unused parameters in method descriptors containing - arrays of longs or doubles. -- Added undocumented java system properties - `maximum.inlined.code.length` (default is 8) and - `maximum.resulting.code.length` (defaults are 8000 for JSE and 2000 - for JME), for expert users who read release notes. -- Fixed processing of generic types in Signature attributes in - shrinking and optimization steps. -- Fixed processing of inner class names in Signature attributes in - obfuscation step. -- Improved adapting resource file names following obfuscated - class names. -- Fixed interpretation of package names in GUI. -- Fixed default settings for Xlets in GUI. -- Updated documentation and examples. - -## Version 4.1 (Dec 2007) - -- Fixed shrinking of default annotation element values. -- Fixed optimization of invocations of methods in same class that are - accessed through extensions. -- Fixed optimization of invocations of synchronized methods without - other side-effects. -- Fixed optimization of some non-returning subroutines. -- Fixed handling of local variable debug information when - inlining methods. -- Avoiding StackOverflowErrors during optimization of complex methods. -- Fixed obfuscation of potentially ambiguous non-primitive constants - in interfaces. -- Fixed preverification of some code constructs involving String, - Class, and exception types. -- The Ant task now allows empty `` and - `` elements. -- Updated documentation and examples. - -## Version 4.0 (Sep 2007) - -- Added preverifier for Java 6 and Java Micro Edition, with new - options `-microedition` and `-dontpreverify`. -- Added new option [`-target`](configuration/usage.md#target) to modify java version of processed - class files. -- Made [`-keep`](configuration/usage.md#keep) options more orthogonal and flexible, with option - modifiers `allowshrinking`, `allowoptimization`, and - `allowobfuscation`. -- Added new wildcards for class member descriptors: "`***`", matching - any type, and "`...`", matching any number of arguments. -- Added support for configuration by means of annotations. -- Improved shrinking of unused annotations. -- Added check on modification times of input and output, to avoid - unnecessary processing, with new option `-forceprocessing`. -- Added new options [`-flattenpackagehierarchy`](configuration/usage.md#flattenpackagehierarchy) and `-repackageclasses` - (replacing `-defaultpackage`) to control obfuscation of - package names. -- Added new options [`-adaptresourcefilenames`](configuration/usage.md#adaptresourcefilenames) and - `-adaptresourcefilecontents`, with file filters, to update resource - files corresponding to obfuscated class names. -- Added detection of dynamically accessed fields and methods. -- Now treating `Exceptions` attributes as optional. -- Now respecting naming rule for nested class names - (`EnclosingClass$InnerClass`) in obfuscation step, if `InnerClasses` - attributes or `EnclosingMethod` attributes are being kept. -- Added new inter-procedural optimizations: method inlining and - propagation of constant fields, constant arguments, and constant - return values. -- Added optimized local variable allocation. -- Added more than 250 new peephole optimizations. -- Improved making classes and class members public or protected. -- Now printing notes on suspiciously unkept classes in parameters of - specified methods. -- Now printing notes for class names that don't seem to be - fully qualified. -- Added support for uppercase filename extensions. -- Added tool tips to the GUI. -- Rewritten class file I/O code. -- Updated documentation and examples. - -Upgrade considerations: - -- Since ProGuard now treats the `Exceptions` attribute as optional, - you may have to specify `-keepattributes Exceptions`, notably when - processing code that is to be used as a library. -- ProGuard now preverifies code for Java Micro Edition, if you specify - the option `-microedition`. You then no longer need to process the - code with an external preverifier. -- You should preferably specify [`-repackageclasses`](configuration/usage.md#repackageclasses) instead of the old - option name `-defaultpackage`. - -## Version 3.11 (Dec 2007) - -- Fixed optimization of invocations of methods in same class that are - accessed through extensions. -- Fixed optimization of invocations of synchronized methods without - other side-effects. -- Updated documentation and examples. - -## Version 3.10 (Aug 2007) - -- Now handling mixed-case input class names when - `-dontusemixedcaseclassnames` is specified. -- Fixed optimization of synchronization on classes, as compiled by - Eclipse and Jikes. -- Fixed optimization of switch statements with unreachable cases. -- Avoiding merging subsequent identically named files. -- Updated documentation and examples. - -## Version 3.9 (Jun 2007) - -- Fixed processing of .class constructs in Java 6. -- Fixed repeated processing of .class constructs. -- Fixed possible division by 0 in optimization step. -- Fixed handling of variable instructions with variable indices larger - than 255. -- Updated documentation and examples. - -## Version 3.8 (Mar 2007) - -- Fixed optimization of parameters used as local variables. -- Fixed obfuscation with conflicting class member names. -- Fixed incremental obfuscation with incomplete mapping file for - library jars. -- Updated documentation and examples. - -## Version 3.7 (Dec 2006) - -- Now accepting Java 6 class files. -- Fixed shrinking of partially used annotations. -- Improved incremental obfuscation, with new option - `-useuniqueclassmembernames`. -- Printing more information in case of conflicting configuration - and input. -- Fixed optimization of repeated array length instruction. -- Fixed optimization of subsequent try/catch/finally blocks with - return statements. -- Fixed optimization of complex stack operations. -- Fixed optimization of simple infinite loops. -- Fixed optimization of expressions with constant doubles. -- Tuned optimization to improve size reduction after preverification. -- Fixed overflows of offsets in long code blocks. -- Now allowing class names containing dashes. -- Updated documentation and examples. - -## Version 3.6 (May 2006) - -- No longer automatically keeping classes in parameters of specified - methods from obfuscation and optimization (introduced in - version 3.4). -- Fixed inlining of interfaces that are used in .class constructs. -- Fixed removal of busy-waiting loops reading volatile fields. -- Fixed optimization of comparisons of known integers. -- Fixed optimization of known branches. -- Fixed optimization of method calls on arrays of interfaces. -- Fixed optimization of method calls without side-effects. -- Fixed optimization of nested try/catch/finally blocks with - return statements. -- Fixed initialization of library classes that only appear - in descriptors. -- Fixed matching of primitive type wildcards in configuration. -- Fixed the boilerplate specification for enumerations in the GUI. -- Updated documentation and examples. - -## Version 3.5 (Jan 2006) - -- Fixed obfuscation of class members with complex visibility. -- Fixed optimization bugs causing stack verification errors. -- Fixed optimization bug causing overridden methods to be finalized. -- Fixed optimization bug causing abstract method errors for - retro-fitted library methods. -- Fixed optimization bug evaluating code with constant long values. -- Fixed bug in updating of optional local variable table attributes - and local variable type table attributes after optimization. -- Fixed interpretation of comma-separated class names - without wildcards. -- Updated documentation and examples. - -## Version 3.4 (Oct 2005) - -- Extended optimizations: removing duplicate code within methods. -- Extended regular expressions for class names to - comma-separated lists. -- Now automatically keeping classes in descriptors of kept - class members. -- Added verbose statistics for optimizations. -- Added boilerplate Number optimizations in GUI. -- Fixed `Class.forName` detection. -- Fixed incremental obfuscation bug. -- Fixed optimization bug causing stack verification errors. -- Fixed optimization bugs related to removal of unused parameters. -- Fixed exception when optimizing code with many local variables. -- Fixed exception when saving configuration with initializers in GUI. -- Updated documentation and examples. - -## Version 3.3 (Jun 2005) - -- Extended optimizations: making methods private and static when - possible, making classes static when possible, removing - unused parameters. -- Made file names relative to the configuration files in which they - are specified. Added `-basedirectory` option. -- Added [`-whyareyoukeeping`](configuration/usage.md#whyareyoukeeping) option to get details on why given classes - and class members are being kept. -- Added warnings for misplaced class files. -- Improved printing of notes for `Class.forName` constructs. -- Implemented '`assumenosideeffects`' nested element in Ant task. -- Improved processing of annotations. -- Fixed reading and writing of parameter annotations. -- Fixed various optimization bugs. -- Fixed wildcards not matching '-' character. -- Fixed wildcard bug and checkbox bugs in GUI. -- Setting file chooser defaults in GUI. -- Leaving room for growBox in GUI on Mac OS X. -- Properly closing configuration files. -- Updated documentation and examples. - -## Version 3.2 (Dec 2004) - -- Fixed JDK5.0 processing bugs. -- Fixed optimization bugs. -- Fixed relative paths in Ant task. -- Improved speed of shrinking step. -- Updated documentation and examples. - -## Version 3.1 (Nov 2004) - -- Improved obfuscation and shrinking of private class members. -- Added inlining of interfaces with single implementations. -- Added option to specify obfuscation dictionary. -- Added option to read package visible library class members. -- Extended support for JDK5.0 attributes. -- Fixed various optimization bugs. -- Modified Ant task to accept paths instead of filesets. -- Fixed two Ant task bugs. -- Updated documentation and examples. - -## Version 3.0 (Aug 2004) - -- Added bytecode optimization step, between shrinking step and - obfuscation step. -- Generalized filtered recursive reading and writing of jars, wars, - ears, zips, and directories. -- Added support for grouping input and output jars, wars, ears, zips, - and directories. -- Added support for applying mapping files to library classes. -- Removed `-resourcejars` option. Resources should now be read using - regular `-injars` options, using filters if necessary. -- Rewrote Ant task. Input and output modification dates are not - checked at the moment. Minor changes in XML schema: - - Filters now specified using attributes. - - '`outjars`' now nested element instead of attribute. - - '`type`' attribute of `` element no longer defaults to - '`void`'. - - `<` and `>` characters now have to be encoded in - embedded configurations. - - `` task no longer accepts attributes. -- Updated J2ME WTK plugin, now customizable through - configuration file. -- Updated GUI. -- Fixed various processing bugs. -- Fixed ReTrace parsing bugs. -- Improved jar compression. -- Updated documentation and examples. - -## Version 2.1 (Mar 2004) - -- Added support for JDK1.5 classes. -- Added additional wildcard for matching primitive types. -- Added possibility to switch off notes about duplicate - class definitions. -- Fixed use of multiple filters on output jars. -- Fixed option to keep all attributes. -- Fixed various Ant task bugs. -- Updated documentation and examples. - -## Version 2.0 (Dec 2003) - -- Added a graphical user interface for ProGuard and ReTrace. -- Added [`-applymapping`](configuration/usage.md#applymapping) option for incremental obfuscation. -- Added support for filtering input and output files. -- Added support for the J++ `SourceDir` attribute. -- Improved detection of `.class` constructs. -- Improved handling of misplaced manifest files. -- Improved implementation of ReTrace. -- Worked around String UTF-8 encoding bug affecting - foreign characters. -- Fixed exception when ignoring warnings. -- Fixed various Ant task bugs. -- Updated documentation and examples. - -## Version 1.7 (Aug 2003) - -- Fixed various Ant task bugs. -- Fixed ClassCastException due to explicitly used abstract classes - with implicitly used interfaces targeted at JRE1.2 (the default - in JDK1.4). -- Fixed `-defaultpackage` bug for protected classes and class members. -- Fixed ReTrace bug when retracing without line number tables. -- Worked around zip package problems with duplicate out entries and - rogue manifest files. -- Added work-around for handling malformed legacy interface - class files. -- Updated documentation and examples. - -## Version 1.6 (May 2003) - -- Added support for Ant. -- Added support for the J2ME Wireless Toolkit. -- Added support for reading and writing directory hierarchies. -- Added option for specifying resource jars and directories. -- Added support for wildcards in class member specifications. -- Improved handling of the `-defaultpackage` option. -- Improved stack trace parsing in ReTrace tool. -- Fixed processing of libraries containing public as well as - non-public extensions of non-public classes. -- Fixed examples for processing libraries, midlets, and - serializable code. -- Updated documentation and examples. - -## Version 1.5 (Jan 2003) - -- Fixed processing of retrofitted library interfaces. -- Fixed processing of `.class` constructs in internal classes targeted - at JRE1.2 (the default in JDK1.4). -- Fixed [`-dump`](configuration/usage.md#dump) option when `-outjar` option is not present. -- Updated documentation and examples. - -## Version 1.4 (Nov 2002) - -- Now copying resource files over from the input jars to the - output jar. -- Added option to obfuscate using lower-case class names only. -- Added better option for obfuscating native methods. -- Added option not to ignore non-public library classes. -- Added automatic `.class` detection for classes compiled with Jikes. -- Updated documentation and examples. - -## Version 1.3 (Sep 2002) - -- Added support for wildcards in class names. -- Added tool to de-obfuscate stack traces. -- Added options to print processing information to files. -- Added option to rename source file attributes. -- Fixed processing of implicitly used interfaces targeted at JRE1.2 - (the default in JDK1.4) -- Fixed processing of configurations with negated access modifiers. -- Fixed duplicate class entry bug. -- Updated documentation and examples. - -## Version 1.2 (Aug 2002) - -- Improved speed. -- Fixed processing of classes targeted at JRE1.2 (the default in - JDK1.4) with references to their own subclasses. -- Fixed processing of static initializers in J2ME MIDP applications. -- Fixed processing of retrofitted interfaces (again). -- Added more flexible handling of white space in configuration. -- Updated documentation. - -## Version 1.1 (Jul 2002) - -- Added automatic detection of `Class.forName("MyClass")`, - `MyClass.class`, and - `(MyClass)Class.forName(variable).newInstance()` constructs. This - greatly simplifies configuration. -- Added options to keep class names and class member names without - affecting any shrinking. They are mostly useful for native methods - and serializable classes. -- Fixed processing of retrofitted interfaces. -- Added handling of missing/invalid manifest file in input jar. -- Updated documentation and examples. - -## Version 1.0 (Jun 2002) - -- First public release, based on class parsing code from Mark Welsh's - **RetroGuard**. diff --git a/proguard/docs/manual/setup/ant.md b/proguard/docs/manual/setup/ant.md deleted file mode 100644 index 8f2b628..0000000 --- a/proguard/docs/manual/setup/ant.md +++ /dev/null @@ -1,454 +0,0 @@ -**ProGuard** can be run as a task in the Java-based build tool Ant -(version 1.8 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: - - - -Please make sure the class path is set correctly for your system. - -There are three ways to configure the ProGuard task: - -1. using an external configuration file, -2. using embedded ProGuard configuration options, or -3. 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`**](#configuration_attribute) attribute of your `proguard` -task. Your ant build file will then look like this: -```xml - - -``` - -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: - - - - -injars in.jar - -outjars out.jar - -libraryjars ${java.home}/lib/rt.jar - - -keepclasseswithmembers public class * { - public static void main(java.lang.String[]); - } - - -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 **``. 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 can be specified with the -usual Ant style **`${...}`**, instead of the ProGuard style `<...>`. Other -occurrences of **`<`** and `>` have to be encoded as `<` and `>` -respectively. - -## 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](../configuration/usage.md) section. You can find some sample -configuration files in the **`examples/ant`** directory of the ProGuard -distribution. - -### Task Attributes and Nested Elements {: #attributes} - -The **``** task and the `` task can have -the following attributes (only for **``**) and nested elements: - -`configuration`{: #configuration} = "*filename*" -: Read and merge options from the given ProGuard-style configuration file. - Note: for reading multiple configuration files or XML-style configurations, - use the [**`configuration`**](#configuration_element) *element*. - -[**`skipnonpubliclibraryclasses`**](../configuration/usage.md#skipnonpubliclibraryclasses) = "*boolean*" (default = false) -: Ignore non-public library classes. - -[**`skipnonpubliclibraryclassmembers`**](../configuration/usage.md#dontskipnonpubliclibraryclassmembers) = "*boolean*" (default = true) -: Ignore package visible library class members. - -[**`target`**](../configuration/usage.md#target) = "*version*" (default = none) -: Set the given version number in the processed classes. - -[**`forceprocessing`**](../configuration/usage.md#forceprocessing) = "*boolean*" (default = false) -: Process the input, even if the output seems up to date. - -[**`printseeds`**](../configuration/usage.md#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`**](../configuration/usage.md#dontshrink) = "*boolean*" (default = true) -: Shrink the input class files. - -[**`printusage`**](../configuration/usage.md#printusage) = "*boolean or filename*" (default = false) -: List dead code of the input class files, to the standard output or to the - given file. - -[**`optimize`**](../configuration/usage.md#dontoptimize) = "*boolean*" (default = true) -: Optimize the input class files. - -[**`optimizationpasses`**](../configuration/usage.md#optimizationpasses) = "*n*" (default = 1) -: The number of optimization passes to be performed. - -[**`allowaccessmodification`**](../configuration/usage.md#allowaccessmodification) = "*boolean*" (default = false) -: Allow the access modifiers of classes and class members to be modified, - while optimizing. - -[**`mergeinterfacesaggressively`**](../configuration/usage.md#mergeinterfacesaggressively) = "*boolean*" (default = false) -: Allow any interfaces to be merged, while optimizing. - -[**`obfuscate`**](../configuration/usage.md#dontobfuscate) = "*boolean*" (default = true) -: Obfuscate the input class files. - -[**`printmapping`**](../configuration/usage.md#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`**](../configuration/usage.md#applymapping) = "*filename*" (default = none) -: Reuse the given mapping, for incremental obfuscation. - -[**`obfuscationdictionary`**](../configuration/usage.md#obfuscationdictionary) = "*filename*" (default = none) -: Use the words in the given text file as obfuscated field names and method - names. - -[**`classobfuscationdictionary`**](../configuration/usage.md#classobfuscationdictionary) = "*filename*" (default = none) -: Use the words in the given text file as obfuscated class names. - -[**`packageobfuscationdictionary`**](../configuration/usage.md#packageobfuscationdictionary) = "*filename*" (default = none) -: Use the words in the given text file as obfuscated package names. - -[**`overloadaggressively`**](../configuration/usage.md#overloadaggressively) = "*boolean*" (default = false) -: Apply aggressive overloading while obfuscating. - -[**`useuniqueclassmembernames`**](../configuration/usage.md#useuniqueclassmembernames) = "*boolean*" (default = false) -: Ensure uniform obfuscated class member names for subsequent incremental - obfuscation. - -[**`usemixedcaseclassnames`**](../configuration/usage.md#dontusemixedcaseclassnames) = "*boolean*" (default = true) -: Generate mixed-case class names while obfuscating. - -[**`flattenpackagehierarchy`**](../configuration/usage.md#flattenpackagehierarchy) = "*package\_name*" (default = none) -: Repackage all packages that are renamed into the single given parent - package. - -[**`repackageclasses`**](../configuration/usage.md#repackageclasses) = "*package\_name*" (default = none) -: Repackage all class files that are renamed into the single given package. - -[**`keepparameternames`**](../configuration/usage.md#keepparameternames) = "*boolean*" (default = false) -: Keep the parameter names and types of methods that are kept. - -[**`renamesourcefileattribute`**](../configuration/usage.md#renamesourcefileattribute) = "*string*" (default = none) -: Put the given constant string in the **`SourceFile`** attributes. - -[**`preverify`**](../configuration/usage.md#dontpreverify) = "*boolean*" (default = true) -: Preverify the processed class files if they are targeted at Java Micro - Edition or at Java 6 or higher. - -[**`microedition`**](../configuration/usage.md#microedition) = "*boolean*" (default = false) -: Target the processed class files at Java Micro Edition. - -[**`android`**](../configuration/usage.md#android) = "*boolean*" (default = false) -: Target the processed class files at Android. - -[**`verbose`**](../configuration/usage.md#verbose) = "*boolean*" (default = false) -: Write out some more information during processing. - -[**`note`**](../configuration/usage.md#dontnote) = "*boolean*" (default = true) -: Print notes about potential mistakes or omissions in the configuration. - Use the nested element [dontnote](#dontnote) for more fine-grained control. - -[**`warn`**](../configuration/usage.md#dontwarn) = "*boolean*" (default = true) -: Print warnings about unresolved references. Use the nested element - [dontwarn](#dontwarn) for more fine-grained control. *Only use this option - if you know what you're doing!* - -[**`ignorewarnings`**](../configuration/usage.md#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`**](../configuration/usage.md#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`**](../configuration/usage.md#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. - -[**`addconfigurationdebugging`**](../configuration/usage.md#addconfigurationdebugging) = "*boolean*" (default = false) -: Adds debugging information to the code, to print out ProGuard - configuration suggestions at runtime. *Do not use this option in release - versions.* - -[**`` -: Specifies the program jars (or apks, aabs, aars, wars, ears, jmods, zips, or - directories). - -[**`` -: Specifies the names of the output jars (or apks, aabs, aars, wars, ears, - jmods, zips, or directories). - -[**`` -: Specifies the library jars (or apks, aabs, aars, wars, ears, jmods, zips, or - directories). - -[**``
[`` -: Keep the specified directories in the output jars (or apks, aabs, aars, wars, - ears, jmods, zips, or directories). - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the specified classes *and* class members. - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the specified class members, if their classes are preserved as - well. - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the specified classes *and* class members, if all of the - specified class members are present. - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the names of the specified classes *and* class members (if they - aren't removed in the shrinking step). - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the names of the specified class members (if they aren't removed - in the shrinking step). - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Preserve the names of the specified classes *and* class members, if all of - the specified class members are present (after the shrinking step). - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Print details on why the given classes and class members are being kept in - the shrinking step. - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Assume that the specified methods don't have any side effects, while - optimizing. *Only use this option if you know what you're doing!* - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Assume that the specified methods don't have any external side effects, - while optimizing. *Only use this option if you know what you're doing!* - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Assume that the specified methods don't let any reference parameters - escape to the heap, while optimizing. *Only use this option if you know what - you're doing!* - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Assume that the specified methods don't return any external reference - values, while optimizing. *Only use this option if you know what you're - doing!* - -[**`` [*class\_member\_specifications*](#classmemberspecification) `` -: Assume fixed values or ranges of values for primitive fields and methods, - while optimizing. *Only use this option if you know what you're doing!* - -[**``
[`` -: Perform only the specified optimizations. - -[**``
[`` -: Keep the specified package names from being obfuscated. If no name is - given, all package names are preserved. - -[**``
[`` -: Preserve the specified optional Java bytecode attributes, with optional - wildcards. If no name is given, all attributes are preserved. - -[**`` -: Adapt string constants in the specified classes, based on the obfuscated - names of any corresponding classes. - -[**`` -: Rename the specified resource files, based on the obfuscated names of the - corresponding class files. - -[**`` -: Update the contents of the specified resource files, based on the - obfuscated names of the processed classes. - -[**`` -: Don't print notes about classes matching the specified class name filter. - -[**`` -: Don't print warnings about classes matching the specified class name - filter. *Only use this option if you know what you're doing!* - -``
`` -: The first form includes the XML-style configuration specified in a - **``** task (or `` task) with attribute - **`id`** = "*ref\_id*". Only the nested elements of this configuration are - considered, not the attributes. The second form includes the ProGuard-style - configuration from the specified file. The element is actually a - **`fileset`** element and supports all of its attributes and nested - elements, including multiple files. - -## Class Path Attributes and Nested Elements {: #classpath} - -The jar elements are **`path`** elements, so they can have any of the -standard **`path`** attributes and nested elements. The most common -attributes are: - -`path` = "*path*" -: The names of the jars (or apks, aabs, aars, wars, ears, jmods, 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 apk, aab, aar, war, ear, jmod, - 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 elements can have ProGuard-style filter attributes: - -`filter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all class file names and resource file names that - are encountered. - -`apkfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all apk names that are encountered. - -`aabfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all aab names that are encountered. - -`jarfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all jar names that are encountered. - -`aarfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all aar names that are encountered. - -`warfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all war names that are encountered. - -`earfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all ear names that are encountered. - -`jmodfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all jmod names that are encountered. - -`zipfilter` = "[*file\_filter*](../configuration/usage.md#filefilters)" -: An optional filter for all zip names that are encountered. - -## Keep Modifier Attributes {: #keepmodifier} - -The keep tags can have the following *modifier* attributes: - -[**`includedescriptorclasses`**](../configuration/usage.md#includedescriptorclasses) = "*boolean*" (default = false) -: Specifies whether the classes of the fields and methods specified in the - keep tag must be kept as well. - -[**`allowshrinking`**](../configuration/usage.md#allowshrinking) = "*boolean*" (default = false) -: Specifies whether the entry points specified in the keep tag may be - shrunk. - -[**`allowoptimization`**](../configuration/usage.md#allowoptimization) = "*boolean*" (default = false) -: Specifies whether the entry points specified in the keep tag may be - optimized. - -[**`allowobfuscation`**](../configuration/usage.md#allowobfuscation) = "*boolean*" (default = false) -: Specifies whether the entry points specified in the keep tag may be - obfuscated. - -## Class Specification Attributes and Nested Elements {: #classspecification} - -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. - -`` -: Specifies a field. - -`` -: Specifies a method. - -`` -: Specifies a constructor. - -## Class Member Specification Attributes {: #classmemberspecification} - -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. - -`values` = "*values*" -: The optional fixed value or range of values for a primitive field - or method. diff --git a/proguard/docs/manual/setup/gradle.md b/proguard/docs/manual/setup/gradle.md deleted file mode 100644 index c5815c8..0000000 --- a/proguard/docs/manual/setup/gradle.md +++ /dev/null @@ -1,470 +0,0 @@ -**ProGuard** can be run as a task in the Java-based build tool Gradle -(version 2.1 or higher). - -!!! android "Android projects" - If you have an Android project, you can find instructions [here](gradleplugin.md). - - -Before you can use the **`proguard`** task, you have to make sure Gradle can -find it in its class path at build time. One way is to add the following -line to your **`build.gradle`** file: -```Groovy -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.1.0' - } -} -``` - -Please make sure the class path is set correctly for your system. - -You can then define a task: -```Groovy -task myProguardTask(type: proguard.gradle.ProGuardTask) { - ..... -} -``` - -The embedded configuration is much like a standard ProGuard -configuration. Notable similarities and differences: - -- Like in ProGuard configurations, we're using all lower-case - names for the settings. -- The options don't have a dash as prefix. -- Arguments typically have quotes. -- Some settings are specified as named arguments. - -You can find some sample build files in the **`examples/gradle`** directory -of the ProGuard distribution. - -If you prefer a more verbose configuration derived from the Ant task, -you can import the Ant task as a [Gradle task](#anttask). - -## Settings {: #proguard} - -The ProGuard task supports the following settings in its closure: - -`configuration` [*files*](#file) -: Read and merge options from the given ProGuard configuration files. - The files are resolved and parsed lazily, during the execution phase. - -[**`injars`**](../configuration/usage.md#injars) [*class\_path*](#classpath) -: Specifies the program jars (or apks, aabs, aars, wars, ears, jmods, zips, or - directories). The files are resolved and read lazily, during the execution - phase. - -[**`outjars`**](../configuration/usage.md#outjars) [*class\_path*](#classpath) -: Specifies the names of the output jars (or apks, aabs, aars, wars, ears, - jmods, zips, or directories). The files are resolved and written lazily, - during the execution phase. - -[**`libraryjars`**](../configuration/usage.md#libraryjars) [*class\_path*](#classpath) -: Specifies the names of the output jars (or apks, aabs, aars, wars, ears, - jmods, zips, or directories). The files are resolved and written lazily, - during the execution phase. - -[**`skipnonpubliclibraryclasses`**](../configuration/usage.md#skipnonpubliclibraryclasses) -: Ignore non-public library classes. - -[**`dontskipnonpubliclibraryclassmembers`**](../configuration/usage.md#dontskipnonpubliclibraryclassmembers) -: Don't ignore package visible library class members. - -[**`keepdirectories`**](../configuration/usage.md#keepdirectories) \['[*directory\_filter*](../configuration/usage.md#filefilters)'\] -: Keep the specified directories in the output jars (or apks, aabs, aars, wars, - ears, jmods, zips, or directories). - -[**`target`**](../configuration/usage.md#target) '*version*' -: Set the given version number in the processed classes. - -[**`forceprocessing`**](../configuration/usage.md#forceprocessing) -: Process the input, even if the output seems up to date. - -[**`keep`**](../configuration/usage.md#keep) \[[*modifier*,...](#keepmodifier)\] [*class\_specification*](#classspecification) -: Preserve the specified classes *and* class members. - -[**`keepclassmembers`**](../configuration/usage.md#keepclassmembers) \[[*modifier*,...](#keepmodifier)\] [*class\_specification*](#classspecification) -: Preserve the specified class members, if their classes are preserved as - well. - -[**`keepclasseswithmembers`**](../configuration/usage.md#keepclasseswithmembers) \[[*modifier*,...](#keepmodifier)\] [*class\_specification*](#classspecification) -: Preserve the specified classes *and* class members, if all of the - specified class members are present. - -[**`keepnames`**](../configuration/usage.md#keepnames) [*class\_specification*](#classspecification) -: Preserve the names of the specified classes *and* class members (if they - aren't removed in the shrinking step). - -[**`keepclassmembernames`**](../configuration/usage.md#keepclassmembernames) [*class\_specification*](#classspecification) -: Preserve the names of the specified class members (if they aren't removed - in the shrinking step). - -[**`keepclasseswithmembernames`**](../configuration/usage.md#keepclasseswithmembernames) [*class\_specification*](#classspecification) -: Preserve the names of the specified classes *and* class members, if all of - the specified class members are present (after the shrinking step). - -[**`printseeds`**](../configuration/usage.md#printseeds) \[[*file*](#file)\] -: List classes and class members matched by the various **`keep`** commands, - to the standard output or to the given file. - -[**`dontshrink`**](../configuration/usage.md#dontshrink) -: Don't shrink the input class files. - -[**`printusage`**](../configuration/usage.md#printusage) \[[*file*](#file)\] -: List dead code of the input class files, to the standard output or to the - given file. - -[**`whyareyoukeeping`**](../configuration/usage.md#whyareyoukeeping) [*class\_specification*](#classspecification) -: Print details on why the given classes and class members are being kept in - the shrinking step. - -[**`dontoptimize`**](../configuration/usage.md#dontoptimize) -: Don't optimize the input class files. - -[**`optimizations`**](../configuration/usage.md#optimizations) '[*optimization\_filter*](../configuration/optimizations.md)' -: Perform only the specified optimizations. - -[**`optimizationpasses`**](../configuration/usage.md#optimizationpasses) *n* -: The number of optimization passes to be performed. - -[**`assumenosideeffects`**](../configuration/usage.md#assumenosideeffects) [*class\_specification*](#classspecification) -: Assume that the specified methods don't have any side effects, while - optimizing. *Only use this option if you know what you're doing!* - -[**`assumenoexternalsideeffects`**](../configuration/usage.md#assumenoexternalsideeffects) [*class\_specification*](#classspecification) -: Assume that the specified methods don't have any external side effects, - while optimizing. *Only use this option if you know what you're doing!* - -[**`assumenoescapingparameters`**](../configuration/usage.md#assumenoescapingparameters) [*class\_specification*](#classspecification) -: Assume that the specified methods don't let any reference parameters - escape to the heap, while optimizing. *Only use this option if you know what - you're doing!* - -[**`assumenoexternalreturnvalues`**](../configuration/usage.md#assumenoexternalreturnvalues) [*class\_specification*](#classspecification) -: Assume that the specified methods don't return any external reference - values, while optimizing. *Only use this option if you know what you're - doing!* - -[**`assumevalues`**](../configuration/usage.md#assumevalues) [*class\_specification*](#classspecification) -: Assume fixed values or ranges of values for primitive fields and methods, - while optimizing. *Only use this option if you know what you're doing!* - -[**`allowaccessmodification`**](../configuration/usage.md#allowaccessmodification) -: Allow the access modifiers of classes and class members to be modified, - while optimizing. - -[**`mergeinterfacesaggressively`**](../configuration/usage.md#mergeinterfacesaggressively) -: Allow any interfaces to be merged, while optimizing. - -[**`dontobfuscate`**](../configuration/usage.md#dontobfuscate) -: Don't obfuscate the input class files. - -[**`printmapping`**](../configuration/usage.md#printmapping) \[[*file*](#file)\] -: 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`**](../configuration/usage.md#applymapping) [*file*](#file) -: Reuse the given mapping, for incremental obfuscation. - -[**`obfuscationdictionary`**](../configuration/usage.md#obfuscationdictionary) [*file*](#file) -: Use the words in the given text file as obfuscated field names and method - names. - -[**`classobfuscationdictionary`**](../configuration/usage.md#classobfuscationdictionary) [*file*](#file) -: Use the words in the given text file as obfuscated class names. - -[**`packageobfuscationdictionary`**](../configuration/usage.md#packageobfuscationdictionary) [*file*](#file) -: Use the words in the given text file as obfuscated package names. - -[**`overloadaggressively`**](../configuration/usage.md#overloadaggressively) -: Apply aggressive overloading while obfuscating. - -[**`useuniqueclassmembernames`**](../configuration/usage.md#useuniqueclassmembernames) -: Ensure uniform obfuscated class member names for subsequent incremental - obfuscation. - -[**`dontusemixedcaseclassnames`**](../configuration/usage.md#dontusemixedcaseclassnames) -: Don't generate mixed-case class names while obfuscating. - -[**`keeppackagenames`**](../configuration/usage.md#keeppackagenames) \['[*package\_filter*](../configuration/usage.md#filters)'\] -: Keep the specified package names from being obfuscated. If no name is - given, all package names are preserved. - -[**`flattenpackagehierarchy`**](../configuration/usage.md#flattenpackagehierarchy) '*package\_name*' -: Repackage all packages that are renamed into the single given parent - package. - -[**`repackageclasses`**](../configuration/usage.md#repackageclasses) \['*package\_name*'\] -: Repackage all class files that are renamed into the single given package. - -[**`keepattributes`**](../configuration/usage.md#keepattributes) \['[*attribute\_filter*](../configuration/usage.md#filters)'\] -: Preserve the specified optional Java bytecode attributes, with optional - wildcards. If no name is given, all attributes are preserved. - -[**`keepparameternames`**](../configuration/usage.md#keepparameternames) -: Keep the parameter names and types of methods that are kept. - -[**`renamesourcefileattribute`**](../configuration/usage.md#renamesourcefileattribute) \['*string*'\] -: Put the given constant string in the **`SourceFile`** attributes. - -[**`adaptclassstrings`**](../configuration/usage.md#adaptclassstrings) \['[*class\_filter*](../configuration/usage.md#filters)'\] -: Adapt string constants in the specified classes, based on the obfuscated - names of any corresponding classes. - -[**`adaptresourcefilenames`**](../configuration/usage.md#adaptresourcefilenames) \['[*file\_filter*](../configuration/usage.md#filefilters)'\] -: Rename the specified resource files, based on the obfuscated names of the - corresponding class files. - -[**`adaptresourcefilecontents`**](../configuration/usage.md#adaptresourcefilecontents) \['[*file\_filter*](../configuration/usage.md#filefilters)'\] -: Update the contents of the specified resource files, based on the - obfuscated names of the processed classes. - -[**`dontpreverify`**](../configuration/usage.md#dontpreverify) -: Don't preverify the processed class files if they are targeted at Java - Micro Edition or at Java 6 or higher. - -[**`microedition`**](../configuration/usage.md#microedition) -: Target the processed class files at Java Micro Edition. - -[**`android`**](../configuration/usage.md#android) -: Target the processed class files at Android. - -[**`verbose`**](../configuration/usage.md#verbose) -: Write out some more information during processing. - -[**`dontnote`**](../configuration/usage.md#dontnote) '[*class\_filter*](../configuration/usage.md#filters)' -: Don't print notes about classes matching the specified class name filter. - -[**`dontwarn`**](../configuration/usage.md#dontwarn) '[*class\_filter*](../configuration/usage.md#filters)' -: Don't print warnings about classes matching the specified class name - filter. *Only use this option if you know what you're doing!* - -[**`ignorewarnings`**](../configuration/usage.md#ignorewarnings) -: Print warnings about unresolved references, but continue processing - anyhow. *Only use this option if you know what you're doing!* - -[**`printconfiguration`**](../configuration/usage.md#printconfiguration) \[[*file*](#file)\] -: 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`**](../configuration/usage.md#dump) \[[*file*](#file)\] -: Write out the internal structure of the processed class files, to the - standard output or to the given file. - -[**`addconfigurationdebugging`**](../configuration/usage.md#addconfigurationdebugging) -: Adds debugging information to the code, to print out ProGuard - configuration suggestions at runtime. *Do not use this option in release - versions.* - -## Class Paths {: #classpath} - -Class paths are specified as Gradle file collections, which means they -can be specified as simple strings, with **`files(Object)`**, etc. - -In addition, they can have ProGuard filters, specified as -comma-separated named arguments after the file: - -`filter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all class file names and resource file names that - are encountered. - -`apkfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all apk names that are encountered. - -`jarfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all jar names that are encountered. - -`aarfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all aar names that are encountered. - -`warfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all war names that are encountered. - -`earfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all ear names that are encountered. - -`zipfilter:` '[*file\_filter*](../configuration/usage.md#filefilters)' -: An optional filter for all zip names that are encountered. - -## Files {: #file} - -Files are specified as Gradle files, which means they can be specified -as simple strings, as File instances, with `file(Object)`, etc. - -In Gradle, file names (any strings really) in double quotes can contain -properties or code inside `${...}`. These are automatically expanded. - -For example, `"${System.getProperty('java.home')}/lib/rt.jar"` is -expanded to something like `'/usr/local/java/jdk/jre/lib/rt.jar'`. -Similarly, `System.getProperty('user.home')` is expanded to the user's -home directory, and `System.getProperty('user.dir')` is expanded to the -current working directory. - -## Keep Modifiers {: #keepmodifier} - -The keep settings can have the following named arguments that modify -their behaviors: - -[**`if:`**](../configuration/usage.md#if) [*class\_specification*](#classspecification) -: Specifies classes and class members that must be present to activate the - keep option. - -[**`includedescriptorclasses:`**](../configuration/usage.md#includedescriptorclasses) *boolean* (default = false) -: Specifies whether the classes of the fields and methods specified in the - keep tag must be kept as well. - -[**`allowshrinking:`**](../configuration/usage.md#allowshrinking) *boolean* (default = false) -: Specifies whether the entry points specified in the keep tag may be - shrunk. - -[**`allowoptimization:`**](../configuration/usage.md#allowoptimization) *boolean* (default = false) -: Specifies whether the entry points specified in the keep tag may be - optimized. - -[**`allowobfuscation:`**](../configuration/usage.md#allowobfuscation) *boolean* (default = false) -: Specifies whether the entry points specified in the keep tag may be - obfuscated. - -Names arguments are comma-separated, as usual. - -## Class Specifications {: #classspecification} - -A class specification is a template of classes and class members (fields -and methods). There are two alternative ways to specify such a template: - -1. As a string containing a ProGuard class specification. This is - the most compact and most readable way. The specification looks like - a Java declaration of a class with fields and methods. For example: - ```Groovy - keep 'public class com.example.MyMainClass { \ - public static void main(java.lang.String[]); \ - }' - ``` - -2. As a Gradle-style setting: a method call with named arguments and - a closure. This is more verbose, but it might be useful for - programmatic specifications. For example: - ```Groovy - keep access: 'public', - name: 'com.example.MyMainClass', { - method access: 'public static', - type: 'void', - name: 'main', - parameters: 'java.lang.String[]' - } - ``` - -The [ProGuard class specification](../configuration/usage.md#classspecification) -is described on the traditional Usage page. - -A Gradle-style class specification can have the following named -arguments: - -`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. - -The named arguments are optional. Without any arguments, there are no -constraints, so the settings match all classes. - -## Gradle-style Class Member Specifications {: #classmemberspecification} - -The closure of a Gradle-style class specification can specify class -members with these settings: - -`field` *field\_constraints* -: Specifies a field. - -`method` *method\_constraints* -: Specifies a method. - -`constructor` *constructor\_constraints* -: Specifies a constructor. - -A class member setting can have the following named arguments to express -constraints: - -`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`** argument 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`** argument is - specified. - -The named arguments are optional. Without any arguments, there are no -constraints, so the settings match all constructors, fields, or methods. - -A class member setting doesn't have a closure. - -## Alternative: imported Ant task {: #anttask} - -Instead of using the Gradle task, you could also integrate the Ant task -in your Gradle build file: -```proguard -ant.project.basedir = '../..' - -ant.taskdef(resource: 'proguard/ant/task.properties', - classpath: '/usr/local/java/proguard/lib/proguard.jar') -``` - -Gradle automatically converts the elements and attributes to Groovy -methods, so converting the configuration is essentially mechanical. The -one-on-one mapping can be useful, but the resulting configuration is -more verbose. For instance: -```proguard -task proguard << { - ant.proguard(printmapping: 'proguard.map', - overloadaggressively: 'on', - repackageclasses: '', - renamesourcefileattribute: 'SourceFile') { - - injar(file: 'application.jar') - injar(file: 'gui.jar', filter: '!META-INF/**') - - ..... - } -} -``` diff --git a/proguard/docs/manual/setup/gradleplugin.md b/proguard/docs/manual/setup/gradleplugin.md deleted file mode 100644 index af0ea97..0000000 --- a/proguard/docs/manual/setup/gradleplugin.md +++ /dev/null @@ -1,250 +0,0 @@ - -This page will guide you through to the basic steps of processing your Android application or library with ProGuard. - -!!! tip "Java / Kotlin desktop or server projects" - If you have a Java / Kotlin desktop or server project, you can find instructions [here](gradle.md). - -## ProGuard Gradle Plugin (AGP version 4.x - AGP 7.x) - -You can add the ProGuard plugin to your project by -including the following in your root level `build.gradle(.kts)` file: - -=== "Groovy" - ```Groovy - buildscript { - repositories { - google() // For the Android Gradle plugin. - mavenCentral() // For the ProGuard Gradle Plugin and anything else. - } - dependencies { - classpath 'com.android.tools.build:gradle:x.y.z' // The Android Gradle plugin. - classpath 'com.guardsquare:proguard-gradle:7.1.0' // The ProGuard Gradle plugin. - } - } - ``` -=== "Kotlin" - ```kotlin - buildscript { - repositories { - google() // For the Android Gradle plugin. - mavenCentral() // For the ProGuard Gradle Plugin and anything else. - } - dependencies { - classpath("com.android.tools.build:gradle:x.y.z") // The Android Gradle plugin. - classpath("com.guardsquare:proguard-gradle:7.1.0") // The ProGuard Gradle plugin. - } - } - ``` - -To actually apply the plugin to your project, -just add the line to your module level `build.gradle(.kts)` file after applying the Android Gradle plugin as shown below. - -=== "Groovy" - ```Groovy - apply plugin: 'com.android.application' - apply plugin: 'com.guardsquare.proguard' - ``` -=== "Kotlin" - ```kotlin - plugins { - id("com.android.application") - id("proguard") - } - ``` - -ProGuard expects unobfuscated class files as input. Therefore, other obfuscators such as R8 have to be disabled. - -=== "Groovy" - ```Groovy - android { - ... - buildTypes { - release { - // Deactivate R8. - minifyEnabled false - } - } - } - ``` -=== "Kotlin" - ```kotlin - android { - ... - buildTypes { - getByName("release") { - // Deactivate R8. - isMinifyEnabled = false - } - } - } - ``` - -ProGuard can be executed automatically whenever you build any of the configured variants. -You can configure a variant using the `proguard` block in your module level `build.gradle(.kts)` files. -This is a top-level block and should be placed outside the `android` block. - -For example, in the snippet below, ProGuard is configured to only process the release variant of the application, -using a configuration provided by the user (`proguard-project.txt`) and a [default configuration](#default-configurations) (`proguard-android-optimize.txt`). - -=== "Groovy" - ```Groovy - android { - ... - } - - proguard { - configurations { - release { - defaultConfiguration 'proguard-android-optimize.txt' - configuration 'proguard-project.txt' - } - } - } - ``` -=== "Kotlin" - ```kotlin - android { - ... - } - - proguard { - configurations { - register("release") { - defaultConfiguration("proguard-android-optimize.txt") - configuration("proguard-project.txt") - } - } - } - ``` - -You can then build your application as usual: - -=== "Linux/macOS" - ```sh - ./gradlew assembleRelease - ``` -=== "Windows" - ``` - gradlew assembleRelease - ``` - -### Default configurations - -There are three default configurations available: - -| Default configuration | Description | -|-----------------------|-------------| -| `proguard-android.txt` | ProGuard will obfuscate and shrink your application | -| `proguard-android-optimize.txt` | ProGuard will obfuscate, shrink and optimize your application | -| `proguard-android-debug.txt` | ProGuard will process the application without any obfuscation,
optimization or shrinking | - -### Consumer rules - -ProGuard will apply the consumer rules provided by library dependencies. If you need to exclude these rules, -you can use the `consumerRuleFilter`. - -#### consumerRuleFilter - -The `consumerRuleFilter` option allows you to specify a list of maven group and -module name pairs to filter out the ProGuard consumer rules of the dependencies -that match the specified group and module pairs. - -A group and module name pair is very similar to the maven coordinates you write -when specifying the dependencies in the `dependencies` block, but without the -version part. - -=== "Groovy" - ```Groovy - proguard { - configurations { - release { - consumerRuleFilter 'groupName:moduleName', 'anotherGroupName:anotherModuleName' - } - } - } - ``` -=== "Kotlin" - ```Kotlin - proguard { - configurations { - register("release") { - consumerRuleFilter("groupName:moduleName", "anotherGroupName:anotherModuleName") - } - } - } - ``` - -### Example - -The example [`android-plugin`](https://github.com/Guardsquare/proguard/tree/master/examples/android-plugin) -has a small working Android project using the ProGuard Gradle Plugin. - -## AGP Integrated ProGuard (AGP version <7) - -ProGuard is integrated with older versions of the Android Gradle plugin. -If you have an Android Gradle project that uses such an AGP version, -you can enable ProGuard instead of the default `R8` obfuscator as follows: - -1. Disable R8 in your `gradle.properties`: -```ini -android.enableR8=false -android.enableR8.libraries=false -``` - -2. Override the default version of ProGuard with the most recent one in your - main `build.gradle`: -```Groovy -buildscript { - ... - configurations.all { - resolutionStrategy { - dependencySubstitution { - substitute module('net.sf.proguard:proguard-gradle') with module('com.guardsquare:proguard-gradle:7.1.0') - } - } - } -} -``` - -3. Enable minification as usual in your `build.gradle`: -```Groovy -android { - ... - buildTypes { - release { - minifyEnabled true - shrinkResources true - proguardFile getDefaultProguardFile('proguard-android-optimize.txt') - proguardFile 'proguard-project.txt' - } - } -} -``` - - There are two default configurations available when using the integrated ProGuard: - - | Default configuration | Description | - |-----------------------|-------------| - | `proguard-android.txt` | ProGuard will obfuscate and shrink your application | - | `proguard-android-optimize.txt` | ProGuard will obfuscate, shrink and optimize your application | - -4. Add any necessary configuration to your `proguard-project.txt`. - -You can then build your application as usual: - -=== "Linux/macOS" - ```sh - ./gradlew assembleRelease - ``` -=== "Windows" - ``` - gradlew assembleRelease - ``` - -### Example - -The example [`android-agp3-agp4`](https://github.com/Guardsquare/proguard/tree/master/examples/android-agp3-agp4) -has a small working Android project for AGP < 7. - - - diff --git a/proguard/docs/manual/setup/standalone.md b/proguard/docs/manual/setup/standalone.md deleted file mode 100644 index c42abfa..0000000 --- a/proguard/docs/manual/setup/standalone.md +++ /dev/null @@ -1,54 +0,0 @@ -To run ProGuard, just type: - -=== "Linux/macOS" - ```bash - bin/proguard.sh - ``` - -=== "Windows" - ``` - bin\proguard - ``` - -Typically, you'll put most options in a configuration file (say, -`myconfig.pro`), and just call: - -=== "Linux/macOS" - ```bash - bin/proguard.sh @myconfig.pro - ``` - -=== "Windows" - ```bash - bin\proguard @myconfig.pro - ``` - -You can combine command line options and options from configuration -files. For instance: - -=== "Linux/macOS" - ```bash - bin/proguard.sh @myconfig.pro -verbose - ``` - -=== "Windows" - ``` - bin\proguard @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. - -All available options are described in the [Configuration section](../configuration/usage.md). diff --git a/proguard/docs/manual/tools/appsweep.md b/proguard/docs/manual/tools/appsweep.md deleted file mode 100644 index ea22ebb..0000000 --- a/proguard/docs/manual/tools/appsweep.md +++ /dev/null @@ -1,8 +0,0 @@ -# AppSweep - -[AppSweep](https://appsweep.guardsquare.com/) is a free online app security testing tool that allows you to find and fix security -issues in your Android app's code and dependencies. - -
-![](appsweep.png) -
diff --git a/proguard/docs/manual/tools/playground.md b/proguard/docs/manual/tools/playground.md deleted file mode 100644 index 2ffbcdc..0000000 --- a/proguard/docs/manual/tools/playground.md +++ /dev/null @@ -1,7 +0,0 @@ -# ProGuard Playground - -[ProGuard Playground](https://playground.proguard.com/) is an online rule visualizer tool compatible with ProGuard, R8 and DexGuard -keep rules. It allows you to write keep rules and in real-time see which entities in your app -will be matched by those rules. - - diff --git a/proguard/docs/manual/tools/retrace.md b/proguard/docs/manual/tools/retrace.md deleted file mode 100644 index 8f46928..0000000 --- a/proguard/docs/manual/tools/retrace.md +++ /dev/null @@ -1,382 +0,0 @@ -# ReTrace - -**ReTrace** is a companion tool for ProGuard and DexGuard 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. - -ReTrace deobfuscation workflow - -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 an obfuscator (like ProGuard, DexGuard or R8) can write out while obfuscating. The mapping -file links the original class names and class member names to their -obfuscated names. - -## 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*\] - -Alternatively, the `bin` directory contains some short Linux and Windows -scripts containing this command. These are the arguments: - -*mapping\_file* -: Specifies the name of the mapping file. - -*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. The - stack trace must be encoded with UTF-8 encoding. Blank lines and - unrecognized lines are ignored. - -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. A relatively - simple expression like this works for basic stack trace formats: - - (?:.*? at %c\.%m\(%s(?::%l)?\))|(?:(?:.*?[:"] +)?%c(?::.*)?) - - It for instance matches the following lines: - - Exception in thread "main" myapplication.MyException: Some message - at com.example.MyClass.myMethod(MyClass.java:123) - - The regular expression is a Java regular expression (cfr. the - documentation of `java.util.regex.Pattern`), with a few additional - wildcards: - - | Wildcard | Description | Example - |----------|--------------------------------------------|------------------------------------------- - | `%c` | matches a class name | `com.example.MyClass` - | `%C` | matches a class name with slashes | `com/example/MyClass` - | `%t` | matches a field type or method return type | `com.example.MyClass[]` - | `%f` | matches a field name | `myField` - | `%m` | matches a method name | `myMethod` - | `%a` | matches a list of method arguments | `boolean,int` - | `%s` | matches a source file name | `MyClass.java` - | `%l` | matches a line number inside a method | `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: `(?:`...`)` - - You can print out the default regular expression by running ReTrace without - arguments. It also matches more complex stack traces. - -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: - -- If all line numbers have been preserved while obfuscating the - application, ReTrace will be able to restore the stack - trace completely. -- If the line numbers have been removed, mapping obfuscated method - names back to their original names has become ambiguous. Retrace - will list all possible original method names for each line in the - stack trace. The user can then try to deduce the actual stack trace - manually, based on the logic of the program. - -Source file names are currently restored based on the names of the -outer-most classes. If you prefer to keep the obfuscated name, you can -replace `%s` in the default regular expression by `.*` - -Unobfuscated elements and obfuscated elements for which no mapping is -available will be left unchanged. - - -## Examples {: #examples } - -### Restoring a stack trace with line numbers {: #with} - -Assume for instance an application has been obfuscated using the -following extra options: - - -printmapping mapping.txt - - -renamesourcefileattribute MyApplication - -keepattributes SourceFile,LineNumberTable - -Now assume the processed application throws an exception: - - java.io.IOException: Can't read [dummy.jar] (No such file or directory) - at proguard.y.a(MyApplication:188) - at proguard.y.a(MyApplication:158) - at proguard.y.a(MyApplication:136) - at proguard.y.a(MyApplication:66) - at proguard.ProGuard.c(MyApplication:218) - at proguard.ProGuard.a(MyApplication:82) - at proguard.ProGuard.main(MyApplication:538) - Caused by: java.io.IOException: No such file or directory - at proguard.d.q.a(MyApplication:50) - at proguard.y.a(MyApplication:184) - ... 6 more - -If we have saved the stack trace in a file `stacktrace.txt`, we can use -the following command to recover the stack trace: - - retrace mapping.txt stacktrace.txt - -The output will correspond to the original stack trace: - - java.io.IOException: Can't read [dummy.jar] (No such file or directory) - at proguard.InputReader.readInput(InputReader.java:188) - at proguard.InputReader.readInput(InputReader.java:158) - at proguard.InputReader.readInput(InputReader.java:136) - at proguard.InputReader.execute(InputReader.java:66) - at proguard.ProGuard.readInput(ProGuard.java:218) - at proguard.ProGuard.execute(ProGuard.java:82) - at proguard.ProGuard.main(ProGuard.java:538) - Caused by: java.io.IOException: No such file or directory - at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:50) - at proguard.InputReader.readInput(InputReader.java:184) - ... 6 more - -### Restoring a stack trace with line numbers (verbose) {: #withverbose} - -In the previous example, we could also use the verbose flag: - - java -jar retrace.jar -verbose mapping.txt stacktrace.txt - -The output will then look as follows: - - java.io.IOException: Can't read [dummy.jar] (No such file or directory) - at proguard.InputReader.void readInput(java.lang.String,proguard.ClassPathEntry,proguard.io.DataEntryReader)(InputReader.java:188) - at proguard.InputReader.void readInput(java.lang.String,proguard.ClassPath,int,int,proguard.io.DataEntryReader)(InputReader.java:158) - at proguard.InputReader.void readInput(java.lang.String,proguard.ClassPath,proguard.io.DataEntryReader)(InputReader.java:136) - at proguard.InputReader.void execute(proguard.classfile.ClassPool,proguard.classfile.ClassPool)(InputReader.java:66) - at proguard.ProGuard.void readInput()(ProGuard.java:218) - at proguard.ProGuard.void execute()(ProGuard.java:82) - at proguard.ProGuard.void main(java.lang.String[])(ProGuard.java:538) - Caused by: java.io.IOException: No such file or directory - at proguard.io.DirectoryPump.void pumpDataEntries(proguard.io.DataEntryReader)(DirectoryPump.java:50) - at proguard.InputReader.void readInput(java.lang.String,proguard.ClassPathEntry,proguard.io.DataEntryReader)(InputReader.java:184) - ... 6 more - -### Restoring a stack trace without line numbers {: #without} - -Assume for instance the application has been obfuscated using -the following extra options, this time without preserving the line -number tables: - - -printmapping mapping.txt - -A stack trace `stacktrace.txt` will then lack line number information, -showing "Unknown source" instead: - - java.io.IOException: Can't read [dummy.jar] (No such file or directory) - at proguard.y.a(Unknown Source) - at proguard.y.a(Unknown Source) - at proguard.y.a(Unknown Source) - at proguard.y.a(Unknown Source) - at proguard.ProGuard.c(Unknown Source) - at proguard.ProGuard.a(Unknown Source) - at proguard.ProGuard.main(Unknown Source) - Caused by: java.io.IOException: No such file or directory - at proguard.d.q.a(Unknown Source) - ... 7 more - -We can still use the same command to recover the stack trace: - - java -jar retrace.jar mapping.txt stacktrace.txt - -The output will now list all alternative original method names for each -ambiguous obfuscated method name: - - java.io.IOException: Can't read [dummy.jar] (No such file or directory) - at proguard.InputReader.execute(InputReader.java) - readInput(InputReader.java) - at proguard.InputReader.execute(InputReader.java) - readInput(InputReader.java) - at proguard.InputReader.execute(InputReader.java) - readInput(InputReader.java) - at proguard.InputReader.execute(InputReader.java) - readInput(InputReader.java) - at proguard.ProGuard.readInput(ProGuard.java) - at proguard.ProGuard.execute(ProGuard.java) - optimize(ProGuard.java) - createPrintStream(ProGuard.java) - closePrintStream(ProGuard.java) - fileName(ProGuard.java) - at proguard.ProGuard.main(ProGuard.java) - Caused by: java.io.IOException: No such file or directory - at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java) - readFiles(DirectoryPump.java) - -For instance, ReTrace can't tell if the method `a` corresponds to -`execute` or to `readInput`, so it lists both. You need to figure it out -based on your knowledge of the application. Having line numbers and -unambiguous names clearly is a lot easier, so you should consider -[preserving the line numbers](../configuration/examples.md#stacktrace) when you -obfuscate your application. - - -## Specifications {: #specifications } - -A mapping file contains the original names and the obfuscated names of -classes, fields, and methods. ProGuard can write out such a file while -obfuscating an application or a library, with the option -[`-printmapping`](../configuration/usage.md#printmapping). ReTrace requires the mapping file -to restore obfuscated stack traces to more readable versions. It is a readable -file with UTF-8 encoding, so you can also look up names in an ordinary text -viewer. The format is pretty self-explanatory, but we describe its details -here. - -A mapping file contains a sequence of records of the following form: - - classline - fieldline * - methodline * - -A `classline`, with a trailing colon, specifies a class and its obfuscated -name: - - originalclassname -> obfuscatedclassname: - -A `fieldline`, with 4 leading spaces, specifies a field and its obfuscated -name: - - originalfieldtype originalfieldname -> obfuscatedfieldname - -A `methodline`, with 4 leading spaces, specifies a method and its obfuscated -name: - - [startline:endline:]originalreturntype [originalclassname.]originalmethodname(originalargumenttype,...)[:originalstartline[:originalendline]] -> obfuscatedmethodname - -- An asterisk "*" means the line may occur any number of times. -- Square brackets "\[\]" mean that their contents are optional. -- Ellipsis dots "..." mean that any number of the preceding items may be specified. -- The colon ":", the separator ".", and the arrow "->" are literal tokens. - -### Example - -The following snippet gives an impression of the structure of a mapping file: - - com example.application.ArgumentWordReader -> com.example.a.a: - java.lang.String[] arguments -> a - int index -> a - 36:57:void (java.lang.String[],java.io.File) -> - 64:64:java.lang.String nextLine() -> a - 72:72:java.lang.String lineLocationDescription() -> b - com.example.application.Main -> com.example.application.Main: - com.example.application.Configuration configuration -> a - 50:66:void (com.example.application.Configuration) -> - 74:228:void execute() -> a - 2039:2056:void com.example.application.GPL.check():39:56 -> a - 2039:2056:void execute():76 -> a - 2236:2252:void printConfiguration():236:252 -> a - 2236:2252:void execute():80 -> a - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - 3040:3042:void printConfiguration():243 -> a - 3040:3042:void execute():80 -> a - 3260:3268:void readInput():260:268 -> a - 3260:3268:void execute():97 -> a - - -You can see the names of classes and their fields and methods: - -- The fields and methods are listed in ProGuard configuration format (javap - format), with descriptors that have return types and argument types but no - argument names. In the above example: - - void (java.lang.String[],java.io.File) - - refers to a constructor with a `String` array argument and a `File` - argument. - -- A method may have a leading line number range, if it is known from the - original source code (see [Producing useful obfuscated stack - traces](../configuration/examples.md#stacktrace) in the Examples section). Unlike method - names, line numbers are unique within a class, so ReTrace can resolve lines - in a stack trace without ambiguities. For example: - - 74:228:void execute() - - refers to a method `execute`, defined on lines 74 to 228. - -- The obfuscated method name follows the arrow. For example: - - 74:228:void execute() -> a - - shows that method `execute` has been renamed to `a`. Multiple fields and - methods can get the same obfuscated names, as long as their descriptors - are different. - -### Inlined methods - -The mapping file accounts for the added complexity of inlined methods (as of -ProGuard/ReTrace version 5.2). The optimization step may inline methods -into other methods — recursively even. A single line in an obfuscated -stack trace can then correspond to multiple lines in the original stack trace: -the line that throws the exception followed by one or more nested method -calls. In such cases, the mapping file repeats the leading line number range -on subsequent lines. For example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - 3040:3042:void printConfiguration():243 -> a - 3040:3042:void execute():80 -> a - -- The subsequent lines correspond to the subsequent lines of the original - stack trace. For example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - 3040:3042:void printConfiguration():243 -> a - 3040:3042:void execute():80 -> a - - refers to method `createPrintWriterOut` called from and inlined in - `printConfiguration`, in turn called from and inlined in method `execute`. - -- An original method name may have a preceding class name, if the method - originates from a different class. For example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - - shows that method `createPrintWriterOut` was originally defined in class - `PrintWriterUtil`. - -- A single trailing line number corresponds to an inlined method call. For - example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - 3040:3042:void printConfiguration():243 -> a - 3040:3042:void execute():80 -> a - - specifies that method `execute` called `printConfiguration` on line 80, - and `printconfiguration` called `createPrintWriterOut` on line 243. - -- A traling line number range corresponds to the final inlined method body. - For example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - - shows that method `createPrintWriterOut` covered lines 40 to 42. - -- The leading line number range is synthetic, to avoid ambiguities with other - code in the same class. ProGuard makes up the range, but tries to make it - similar-looking to the original code (by adding offsets that are multiples - of 1000), for convenience. For example: - - 3040:3042:java.io.PrintWriter com.example.application.util.PrintWriterUtil.createPrintWriterOut(java.io.File):40:42 -> a - - created synthetic range 3040:3042 in the bytecode of class `Main` to be - unique but still resemble source code range 40:42 in class - `PrintWriterUtil`. - -Tools that don't account for these repeated line number ranges, like older -versions of ReTrace, may still degrade gracefully by outputting the subsequent -lines without interpreting them. diff --git a/proguard/docs/manual/troubleshooting/limitations.md b/proguard/docs/manual/troubleshooting/limitations.md deleted file mode 100644 index a8762e4..0000000 --- a/proguard/docs/manual/troubleshooting/limitations.md +++ /dev/null @@ -1,18 +0,0 @@ -When using ProGuard, you should be aware of a few technical issues, all of -which are easily avoided or resolved: - -- For best results, ProGuard's optimization algorithms assume that the - processed code never **intentionally throws NullPointerExceptions** or - ArrayIndexOutOfBoundsExceptions, or even OutOfMemoryErrors or - StackOverflowErrors, in order to achieve something useful. For instance, it - may remove a method call `myObject.myMethod()` if that call wouldn't have - any effect. It ignores the possibility that `myObject` might be null, - causing a NullPointerException. In some way this is a good thing: optimized - code may throw fewer exceptions. Should this entire assumption be false, - you'll have to switch off optimization using the `-dontoptimize` option. - -- ProGuard's optimization algorithms currently also assume that the processed - code never creates **busy-waiting loops** without at least testing on a - volatile field. Again, it may remove such loops. Should this assumption be - false, you'll have to switch off optimization using the `-dontoptimize` - option. diff --git a/proguard/docs/manual/troubleshooting/troubleshooting.md b/proguard/docs/manual/troubleshooting/troubleshooting.md deleted file mode 100644 index 6e859d1..0000000 --- a/proguard/docs/manual/troubleshooting/troubleshooting.md +++ /dev/null @@ -1,628 +0,0 @@ -While preparing a configuration for processing your code, you may bump -into a few problems. The following sections discuss some common issues -and solutions: - -!!! tip - Whenever you don't find the solution for your issue on this page, the [***Guardsquare Community***](https://community.guardsquare.com/) might be the place to check for an answer or post a question. - - - -## Problems while processing {: #processing} - -ProGuard may print out some notes and non-fatal warnings: - -**Note: can't find dynamically referenced class ...** {: #dynamicalclass} -: ProGuard can't find a class or interface that your code is accessing by - means of introspection. You should consider adding the jar that contains - this class. - -**Note: ... calls '(...)Class.forName(variable).newInstance()'** {: #dynamicalclasscast} -: Your code uses reflection to dynamically create class instances, with a - construct 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`](../configuration/usage.md#dontnote) option. - -**Note: ... accesses a field/method '...' dynamically** {: #dynamicalclassmember} -: Your code uses reflection to find a fields or a method, with a construct - 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`](../configuration/usage.md#dontnote) option. - -**Note: ... calls 'Class.get...'**, **'Field.get...'**, or **'Method.get...'** {: #attributes} -: Your code uses reflection to access metadata from the code, with an - invocation like "`class.getAnnotations()`". You then generally need to - preserve optional [class file attributes](../configuration/attributes.md), which ProGuard - removes by default. The attributes contain information about annotations, - enclosing classes, enclosing methods, etc. In a summary in the log, ProGuard - provides a suggested configuration, like [`-keepattributes - *Annotation*`](../configuration/usage.md#keepattributes). If you're sure the attributes are - not necessary, you can switch off these notes by specifying the - [`-dontnote`](../configuration/usage.md#dontnote) option. - -**Note: the configuration refers to the unknown class '...'** {: #unknownclass} -: Your configuration refers to the name of a class that is not present in - the program jars or library jars. You should check whether the name is - correct. Notably, you should make sure that you always specify - fully-qualified names, not forgetting the package names. - -**Note: the configuration keeps the entry point '...', but not the descriptor class '...'** {: #descriptorclass} -: Your configuration contains a [`-keep`](../configuration/usage.md#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 - automatically keep such descriptor classes with the `-keep` option modifier - [`includedescriptorclasses`](../configuration/usage.md#includedescriptorclasses) - (`-keep,includedescriptorclasses` ...). You can switch off these notes by - specifying the [`-dontnote`](../configuration/usage.md#dontnote) option. - -**Note: the configuration explicitly specifies '...' to keep library class '...'** {: #libraryclass} -: Your configuration contains a [`-keep`](../configuration/usage.md#keep) option to preserve - the given library class. However, you don't need to keep any library - classes. ProGuard always leaves underlying libraries unchanged. You can - switch off these notes by specifying the [`-dontnote`](../configuration/usage.md#dontnote) - option. - -**Note: the configuration doesn't specify which class members to keep for class '...'** {: #classmembers} -: Your configuration contains a - [`-keepclassmembers`](../configuration/usage.md#keepclassmembers)/[`-keepclasseswithmembers`](../configuration/usage.md#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 should also consider if you just need the more common - [`-keep`](../configuration/usage.md#keep) option, which preserves all specified classes *and* - class members. The [overview of all `keep` options](../configuration/usage.md#keepoverview) - can help. You can switch off these notes by specifying the - [`-dontnote`](../configuration/usage.md#dontnote) option. - -**Note: the configuration specifies that none of the methods of class '...' have any side effects** {: #nosideeffects} -: Your configuration contains an option - [`-assumenosideeffects`](../configuration/usage.md#assumenosideeffects) to indicate that the - specified methods don't have any side effects. However, the configuration - tries to match *all* methods, by using a wildcard like "`*;`". This includes - methods from `java.lang.Object`, such as `wait()` and `notify()`. Removing - invocations of those methods will most likely break your application. You - should list the methods without side effects more conservatively. You can - switch off these notes by specifying the [`-dontnote`](../configuration/usage.md#dontnote) - option. - -**Note: duplicate definition of program/library class** {: #duplicateclass} -: 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`](../configuration/usage.md#dontnote) option. - -**Warning: can't write resource ... Duplicate zip entry** {: #duplicatezipentry} -: 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** {: #unresolvedclass} -: A class in one of your program jars or library jars is referring to a - class or interface that is missing from the input. The warning lists both - the referencing class(es) and the missing referenced class(es). There can be - a few reasons, with their own solutions: - - 1. If the missing class is referenced from your own code, you may - have forgotten to specify an essential library. Just like when - compiling all code from scratch, you must specify all libraries - that the code is referencing, directly or indirectly. If the - library should be processed and included in the output, you - should specify it with [`-injars`](../configuration/usage.md#injars), otherwise - you should specify it with [`-libraryjars`](../configuration/usage.md#libraryjars). - For example, if ProGuard complains that it can't find a - `java.lang` class, you have to make sure that you are specifying - the run-time library of your platform. For JSE, these are - typically packaged in `lib/rt.jar` (`vm.jar` for IBM's JVM, and - `classes.jar` in MacOS X) or as of Java 9, `jmods/java.base.jmod`. - - 2. If the missing class is referenced from a pre-compiled - third-party library, and your original code runs fine without - it, then the missing dependency doesn't seem to hurt. The - cleanest solution is to [filter out](../configuration/usage.md#filters) the - *referencing* class or classes from the input, with a filter - like - "`-injars myapplication.jar(!somepackage/SomeUnusedReferencingClass.class)`". - DexGuard will then skip this class entirely in the input, and it - will not bump into the problem of its missing reference. - However, you may then have to filter out other classes that are - in turn referencing the removed class. In practice, this works - best if you can filter out entire unused packages at once, with - a wildcard filter like - "`-libraryjars mylibrary.jar(!someunusedpackage/**)`". - - 3. If you don't feel like filtering out the problematic classes, - you can try your luck with the - [`-ignorewarnings`](../configuration/usage.md#ignorewarnings) option, or even - the [`-dontwarn`](../configuration/usage.md#dontwarn) option. Only use these - options if you really know what you're doing though. - -**Error: Can't find any super classes of ... (not even immediate super class ...)** -**Error: Can't find common super class of ... and ...** {: #superclass} -: It seems like you tried to avoid the warnings from the previous paragraph - by specifying [`-ignorewarnings`](../configuration/usage.md#ignorewarnings) or - [`-dontwarn`](../configuration/usage.md#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`](../configuration/usage.md#injars) option: "`-injars - myapplication.jar(!somepackage/SomeUnusedClass.class)`". As a final - solution, you could switch off optimization - ([`-dontoptimize`](../configuration/usage.md#dontoptimize)) and preverification - ([`-dontpreverify`](../configuration/usage.md#dontpreverify)). - -**Warning: can't find referenced field/method '...' in program class ...** {: #unresolvedprogramclassmember} -: A program class is referring to a field or a method that is missing from - another program class. The warning lists both the referencing class and the - missing referenced class member. Your compiled 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 compiled class files and rebuilding your project. - -**Warning: can't find referenced field/method '...' in library class ...** {: #unresolvedlibraryclassmember} -: A program class is referring to a field or a method that is missing from a - library class. The warning lists both the referencing class and the missing - referenced class member. Your compiled class files are inconsistent with the - libraries. You may need to recompile the class files, or otherwise upgrade - the libraries to consistent versions. - - 1. If there are unresolved references to class members in *program - classes*, your compiled 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 compiled class files and - rebuilding your project. - - 2. If there are unresolved references to class members in *library - classes*, your compiled class files are inconsistent with - the libraries. You may need to recompile the class files, or - otherwise upgrade the libraries to consistent versions. - - Alternatively, you may get away with ignoring the inconsistency - with the options [`-ignorewarnings`](../configuration/usage.md#ignorewarnings) - or even [`-dontwarn`](../configuration/usage.md#dontwarn). - -**Warning: can't find enclosing class/method** {: #unresolvedenclosingmethod} -: If there are unresolved references to classes that are defined inside - methods in your input, once more, your compiled 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 compiled class files and rebuilding your project. - -**Warning: library class ... depends on program class ...** {: #dependency} -: 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`](../configuration/usage.md#injars)) and library code - (specified with [`-libraryjars`](../configuration/usage.md#libraryjars)), and try again. - -**Warning: class file ... unexpectedly contains class ...** {: #unexpectedclass} -: 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`](../configuration/usage.md#ignorewarnings) option, or even the - [`-dontwarn`](../configuration/usage.md#dontwarn) option. - -**Warning: ... is not being kept as ..., but remapped to ...** {: #mappingconflict1} -: There is a conflict between a [`-keep`](../configuration/usage.md#keep) option and the - mapping file specified with an [`-applymapping`](../configuration/usage.md#applymapping) - option, 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`](../configuration/usage.md#ignorewarnings) option, or even the - [`-dontwarn`](../configuration/usage.md#dontwarn) option. - -**Warning: field/method ... can't be mapped to ...** {: #mappingconflict2} -: There is a conflict between some new program code and the mapping file - specified with an [`-applymapping`](../configuration/usage.md#applymapping) option, 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`](../configuration/usage.md#ignorewarnings) option, or even the - [`-dontwarn`](../configuration/usage.md#dontwarn) option. Note that you should always use the - [`-useuniqueclassmembernames`](../configuration/usage.md#useuniqueclassmembernames) option in - the initial obfuscation step, in order to reduce the risk of conflicts. - -**Error: Unsupported class version number** {: #unsupportedclassversion} -: 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 - on-line](https://github.com/Guardsquare/proguard/releases) if there is a more - recent release. - -**Error: You have to specify [`-keep`](../configuration/usage.md#keep) options** -: You either forgot to specify [`-keep`](../configuration/usage.md#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](../configuration/usage.md#filename). 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, 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 `/lib/rt.jar` by `/../Classes/classes.jar`. - - As of Java 9, the runtime classes are packaged in - `/jmods/java.base.jmod` and other modules next to it. - -**Error: Can't read ...** {: #cantread} -: ProGuard can't read the specified file or directory. Double-check that the - name is correct in your configuration, that the file is readable, and that - it is not corrupt. An additional message "Unexpected end of ZLIB input - stream" suggests that the file is truncated. You should then make sure that - the file is complete on disk when ProGuard starts (asynchronous copying? - unflushed buffer or cache?), and that it is not somehow overwritten by - ProGuard's own output. - -**Error: Can't write ...** {: #cantwrite} -: ProGuard can't write the specified file or directory. Double-check that - the name is correct in your configuration and that the file is writable. - -**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](http://bugs.sun.com/view_bug.do?bug_id=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** {: #outofmemoryerror} -: You can try increasing the heap size of the Java virtual machine, with the - usual `-Xmx` option: - - - In Java, specify the option as an argument to the JVM: `java -Xmx1024m` - - In Ant, set the environment variable `ANT_OPTS=-Xmx1024m` - - In Gradle, set the environment variable `GRADLE_OPTS=-Xmx1024m` - - In Maven, set the environment variable `MAVEN_OPTS=-Xmx1024m` - - In Eclipse, add the line `-Xmx1024m` to the file `eclipse.ini` inside - your Eclipse install. - - 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. - -**StackOverflowError** {: #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](http://bugs.sun.com/view_bug.do?bug_id=4362291). As a result, - this solution will only work when running ProGuard in a different thread, - e.g. from its GUI. - -**Unexpected error** {: #unexpectederror} -: 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`](../configuration/usage.md#dontoptimize) option. In any case, - please report the problem, preferably with the simplest example that causes - ProGuard to crash. - -**Otherwise...** {: #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 {: #afterprocessing} - -If ProGuard seems to run fine, but your processed code doesn't look -right, there might be a couple of reasons: - -**Disappearing classes** {: #disappearingclasses} -: 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`](../configuration/usage.md#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** {: #notkept} -: 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`](../configuration/usage.md#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 should package the annotation classes as a - library, or explicitly keep them in your program code with an option - like "`-keep @interface *`". - -**Class names not being obfuscated** {: #classnamesnotobfuscated} -: If the names of some classes in your obfuscated code aren't obfuscated, you - should first check all your configuration files. Chances are that some - `-keep` option is preserving the original names. These options may be hiding - in your own configuration files or in configuration files from libraries. - -**Field names not being obfuscated** {: #fieldnamesnotobfuscated} -: If the names of some fields in your obfuscated code aren't obfuscated, this - may be due to `-keep` options preserving the original names, for the sake of - libraries like GSON. Such libraries perform reflection on the fields. If the - names were obfuscated, the resulting JSON strings would come out obfuscated - as well, which generally breaks persistence of the data or communication - with servers. - -**Method names not being obfuscated** {: #methodnamesnotobfuscated} -: If the names of some methods in your obfuscated code aren't obfuscated, this - is most likely because they extend or implement method names in the - underlying runtime libraries. Since the runtime libraries are not obfuscated, - any corresponding names in the application code can't be obfuscated either, - since they must remain consistent. - -**Variable names not being obfuscated** {: #variablenamesnotobfuscated} -: 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 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`](../configuration/usage.md#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`](../configuration/usage.md#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`](../configuration/usage.md#microedition) option, ProGuard will -preverify the class files for Java Micro Edition. - -## Problems at run-time {: #runtime} - -If ProGuard runs fine, but your processed application doesn't work, -there might be several reasons: - -**Stack traces without class names or line numbers** {: #stacktraces} -: 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** {: #noclassdeffounderror} -: Your class path is probably incorrect. It should at least contain all - library jars and, of course, your processed program jar. - -**ClassNotFoundException** {: #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("com.example.MyClass")`. For variable name arguments - like `Class.forName(someClass)`, you have to keep all possible classes using - the appropriate [`-keep`](../configuration/usage.md#keep) option, e.g. "`-keep class - com.example.MyClass`" or "`-keep class * implements - com.example.MyInterface`". While setting up your configuration, you can - specify the option - [`-addconfigurationdebugging`](../configuration/usage.md#addconfigurationdebugging) to help - track down these cases at run-time and let the instrumented code suggest - settings for them. - -**NoSuchFieldException** {: #nosuchfieldexception} -: Your code is probably calling something like `myClass.getField`, trying to - find some field dynamically. Since ProGuard can't always detect this - automatically, you have to keep the missing field using the appropriate - [`-keep`](../configuration/usage.md#keep) option, e.g. "`-keepclassmembers class - com.example.MyClass { int myField; }`". While setting up your configuration, - you can specify the option - [`-addconfigurationdebugging`](../configuration/usage.md#addconfigurationdebugging) to help - track down these cases at run-time and let the instrumented code suggest - settings for them. - -**NoSuchMethodException** {: #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 using the appropriate - [`-keep`](../configuration/usage.md#keep) option, e.g. "`-keepclassmembers class - com.example.MyClass { void myMethod(); }`". While setting up your - configuration, you can specify the option - [`-addconfigurationdebugging`](../configuration/usage.md#addconfigurationdebugging) to help - track down these cases at run-time and let the instrumented code suggest - settings for them. More specifically, if the method reported as missing is - `values` or `valueOf`, you probably have to keep some methods related to - [enumerations](../configuration/examples.md#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`](../configuration/usage.md#adaptresourcefilenames) and/or - [`-adaptresourcefilecontents`](../configuration/usage.md#adaptresourcefilecontents). - Furthermore, directory entries in jar files aren't copied, unless you - specify the option [`-keepdirectories`](../configuration/usage.md#keepdirectories). Note that - Sun advises against calling `Class.getResource()` for directories (Sun Bug - \#4761949](http://bugs.sun.com/view_bug.do?bug_id=4761949)). - -**Disappearing annotations** {: #disappearingannotations} -: 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** {: #invalidjarfile} -: 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** {: #invalidjarindexexception} -: 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`](../configuration/usage.md#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`](../configuration/usage.md#overloadaggressively). - -**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`](../configuration/usage.md#useuniqueclassmembernames) option. - It avoids overloading class member names, which triggers a bug in their java - virtual machine. You might also try using the - [`-dontusemixedcaseclassnames`](../configuration/usage.md#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** {: #disappearingloops} -: 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`](../configuration/usage.md#dontoptimize) option. - -**SecurityException: SHA1 digest error** {: #securityexception} -: You may have forgotten to sign your program jar *after* having processed - it with ProGuard. - -**ClassCastException: class not an enum**
**IllegalArgumentException: class not an enum type** {: #classcastexception} -: 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](../configuration/examples.md#enumerations). - -**ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy** {: #arraystoreexception} -: 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. - -**IllegalArgumentException: methods with same signature but incompatible return types** {: #illegalargumentexception} -: You are probably running some code that has been obfuscated with the - [`-overloadaggressively`](../configuration/usage.md#overloadaggressively) option. The class - `java.lang.reflect.Proxy` can't handle classes that contain methods with the - same names and signatures, but different return types. Its method - `newProxyInstance` then throws this exception. You can avoid the problem by - not using the option. - -**CompilerError: duplicate addition** {: #compilererror} -: You are probably compiling or running some code that has been obfuscated - with the [`-overloadaggressively`](../configuration/usage.md#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** {: #classformaterror1} -: You are probably processing some code that has been obfuscated before with - the [`-overloadaggressively`](../configuration/usage.md#overloadaggressively) option. You - should then use the same option again in the second processing round. - -**ClassFormatError: Invalid index in LocalVariableTable in class file** {: #classformaterror2} -: 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. - -**NullPointerException: create returned null** (Dagger)
**IllegalStateException: Module adapter for class ... could not be loaded. Please ensure that code generation was run for this module.**
**IllegalStateException: Could not load class ... needed for binding members/...** {:#dagger} -: Dagger 1 relies on reflection to combine annotated base classes and their - corresponding generated classes. DexGuard's default configuration already - preserves the generated classes, but you still preserve the annotated base - classes in your project-specific configuration. This is explained in some - more detail in the [Dagger example](../configuration/examples.md#dagger). - -**NoSuchMethodError** or **AbstractMethodError** {: #nosuchmethoderror} -: 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](#disappearingclasses) 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** {: #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`](../configuration/usage.md#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. diff --git a/proguard/docs/results.md b/proguard/docs/results.md deleted file mode 100644 index 1797173..0000000 --- a/proguard/docs/results.md +++ /dev/null @@ -1,43 +0,0 @@ -**ProGuard** successfully processes any Java bytecode, ranging from small - applications 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 Program | Original size | After shrinking | After optim. | After obfusc. | Total reduction | Time | Memory usage -|-----------------------------------------------------------------------------------------------------------------|---------------|-----------------|--------------|---------------|-----------------|--------|-------------- -| [Worm](http://www.oracle.com/technetwork/java/javame/index.html), a sample midlet from Oracle's JME | 10.3 K | 9.8 K | 9.6 K | 8.5 K | 18 % | 2 s | 19 M -| [Javadocking](http://www.javadocking.com/), a docking library | 290 K | 281 K | 270 K | 201 K | 30 % | 12 s | 32 M -| **ProGuard** itself | 648 K | 579 K | 557 K | 348 K | 46 % | 28 s | 66 M -| [JDepend](http://www.clarkware.com/software/JDepend.html), a Java quality metrics tool | 57 K | 36 K | 33 K | 28 K | 51 % | 6 s | 24 M -| [the run-time classes](http://www.oracle.com/technetwork/java/javase/overview/index.html) from Oracle's Java 6 | 53 M | 23 M | 22 M | 18 M | 66 % | 16 min | 270 M -| [Tomcat](http://tomcat.apache.org/), the Apache servlet container | 1.1 M | 466 K | 426 K | 295 K | 74 % | 17 s | 44 M -| [JavaNCSS](http://javancss.codehaus.org/), a Java source metrics tool | 632 K | 242 K | 212 K | 152 K | 75 % | 20 s | 36 M -| [Ant](http://ant.apache.org/), the Apache build tool | 2.4 M | 401 K | 325 K | 242 K | 90 % | 23 s | 61 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. diff --git a/proguard/examples/android-agp3-agp4/AndroidManifest.xml b/proguard/examples/android-agp3-agp4/AndroidManifest.xml deleted file mode 100644 index e96cfac..0000000 --- a/proguard/examples/android-agp3-agp4/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/proguard/examples/android-agp3-agp4/build.gradle b/proguard/examples/android-agp3-agp4/build.gradle deleted file mode 100644 index 27a9090..0000000 --- a/proguard/examples/android-agp3-agp4/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -// This build file illustrates how to apply ProGuard in the Android build -// process with AGP < 7, by swapping the built-in version of ProGuard for a newer version. - -// This process relies on setting `android.enableR8=false` in `gradle.properties`, -// which is deprecated. For AGP7, please see the `android-plugin` example. - -buildscript { - repositories { - mavenLocal() // For local testing - google() // For the Android plugin. - mavenCentral() // For anything else. - } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - } - configurations.all { - resolutionStrategy { - // Override the default version of ProGuard with the most recent one. - dependencySubstitution { - substitute module('net.sf.proguard:proguard-gradle') with module('com.guardsquare:proguard-gradle:7.3.0') - } - } - } -} - -apply plugin: 'com.android.application' - -android { - compileSdkVersion 28 - - signingConfigs { - debug { - storeFile file('debug.keystore') - storePassword 'android' - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - - defaultConfig { - minSdkVersion 11 - targetSdkVersion 28 - signingConfig signingConfigs.debug - } - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - resources.srcDirs = ['src'] - aidl.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] - } - } - - buildTypes { - debug { - minifyEnabled false - shrinkResources false - } - release { - minifyEnabled true - shrinkResources true - proguardFile getDefaultProguardFile('proguard-android-optimize.txt') - proguardFile 'proguard-project.txt' - } - } -} - -repositories { - google() // For the Android plugin. - mavenCentral() // For anything else. -} diff --git a/proguard/examples/android-agp3-agp4/debug.keystore b/proguard/examples/android-agp3-agp4/debug.keystore deleted file mode 100644 index 7e28347..0000000 Binary files a/proguard/examples/android-agp3-agp4/debug.keystore and /dev/null differ diff --git a/proguard/examples/android-agp3-agp4/gradle.properties b/proguard/examples/android-agp3-agp4/gradle.properties deleted file mode 100644 index c857374..0000000 --- a/proguard/examples/android-agp3-agp4/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -# Make sure that we use ProGuard instead of R8. - -android.enableR8=false -android.enableR8.libraries=false diff --git a/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index f3d88b1..0000000 Binary files a/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2a56324..0000000 --- a/proguard/examples/android-agp3-agp4/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/proguard/examples/android-agp3-agp4/gradlew b/proguard/examples/android-agp3-agp4/gradlew deleted file mode 100644 index 2fe81a7..0000000 --- a/proguard/examples/android-agp3-agp4/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/android-agp3-agp4/gradlew.bat b/proguard/examples/android-agp3-agp4/gradlew.bat deleted file mode 100644 index 9618d8d..0000000 --- a/proguard/examples/android-agp3-agp4/gradlew.bat +++ /dev/null @@ -1,100 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/android-agp3-agp4/proguard-project.txt b/proguard/examples/android-agp3-agp4/proguard-project.txt deleted file mode 100644 index 5a89ed5..0000000 --- a/proguard/examples/android-agp3-agp4/proguard-project.txt +++ /dev/null @@ -1,127 +0,0 @@ -############################################################################### -# General settings. -############################################################################### - --verbose - -# We can debug the ProGuard configuration by instrumenting the code and -# checking the log for feedback. Disable the option again for actual releases! - -#-addconfigurationdebugging - -# We can also disable the individual processing steps. - -#-dontshrink -#-dontoptimize -#-dontobfuscate - -# Specifically target Android. - --android - - -############################################################################### -# Settings to handle reflection in the code. -############################################################################### - -# Preserve annotated and generated classes for Dagger. - --keepclassmembers,allowobfuscation class * { - @dagger.** *; -} - --keep class **$$ModuleAdapter --keep class **$$InjectAdapter --keep class **$$StaticInjection - --if class **$$ModuleAdapter --keep class <1> - --if class **$$InjectAdapter --keep class <1> - --if class **$$StaticInjection --keep class <1> - --keepnames class dagger.Lazy - -# Preserve annotated and generated classes for Butterknife. - --keep class **$$ViewBinder { - public static void bind(...); - public static void unbind(...); -} - --if class **$$ViewBinder --keep class <1> - --keep class **_ViewBinding { - (<1>, android.view.View); -} - --if class **_ViewBinding --keep class <1> - -# Preserve fields that are serialized with GSON. - -#-keepclassmembers class com.example.SerializedClass1, -# com.example.SerializedClass2 { -# ; -#} - --keepclassmembers,allowobfuscation class * { - @com.google.gson.annotations.SerializedName ; -} - --keep,allowobfuscation @interface com.google.gson.annotations.** - - -############################################################################### -# Further optimizations. -############################################################################### - -# If you wish, you can let the optimization step remove Android logging calls. - -#-assumenosideeffects class android.util.Log { -# public static boolean isLoggable(java.lang.String, int); -# public static int v(...); -# public static int i(...); -# public static int w(...); -# public static int d(...); -# public static int e(...); -#} - -# In that case, it's especially useful to also clean up any corresponding -# string concatenation calls. - --assumenoexternalsideeffects class java.lang.StringBuilder { - public java.lang.StringBuilder(); - public java.lang.StringBuilder(int); - public java.lang.StringBuilder(java.lang.String); - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); - public java.lang.String toString(); -} - --assumenoexternalreturnvalues class java.lang.StringBuilder { - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); -} diff --git a/proguard/examples/android-agp3-agp4/res/drawable/ic_launcher.png b/proguard/examples/android-agp3-agp4/res/drawable/ic_launcher.png deleted file mode 100644 index d098d4c..0000000 Binary files a/proguard/examples/android-agp3-agp4/res/drawable/ic_launcher.png and /dev/null differ diff --git a/proguard/examples/android-agp3-agp4/res/values/colors.xml b/proguard/examples/android-agp3-agp4/res/values/colors.xml deleted file mode 100644 index a5109aa..0000000 --- a/proguard/examples/android-agp3-agp4/res/values/colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - #4B7FCE - #4B7FCE - #7BAFCE - #4B7FCE - diff --git a/proguard/examples/android-agp3-agp4/res/values/strings.xml b/proguard/examples/android-agp3-agp4/res/values/strings.xml deleted file mode 100644 index 2bca769..0000000 --- a/proguard/examples/android-agp3-agp4/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - HelloWorld Sample - diff --git a/proguard/examples/android-agp3-agp4/res/values/styles.xml b/proguard/examples/android-agp3-agp4/res/values/styles.xml deleted file mode 100644 index 59baa69..0000000 --- a/proguard/examples/android-agp3-agp4/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/proguard/examples/android-agp3-agp4/settings.gradle b/proguard/examples/android-agp3-agp4/settings.gradle deleted file mode 100644 index e69de29..0000000 diff --git a/proguard/examples/android-agp3-agp4/src/com/example/HelloWorldActivity.java b/proguard/examples/android-agp3-agp4/src/com/example/HelloWorldActivity.java deleted file mode 100644 index 6907d1a..0000000 --- a/proguard/examples/android-agp3-agp4/src/com/example/HelloWorldActivity.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Sample application to illustrate processing with ProGuard. - * - * Copyright (c) 2012-2020 Guardsquare NV - */ -package com.example; - -import android.app.Activity; -import android.os.Bundle; -import android.view.Gravity; -import android.widget.TextView; - -/** - * Sample activity that displays "Hello world!". - */ -public class HelloWorldActivity extends Activity -{ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - // Display the message. - TextView view = new TextView(this); - view.setText("Hello World"); - view.setGravity(Gravity.CENTER); - setContentView(view); - } -} diff --git a/proguard/examples/android-plugin/AndroidManifest.xml b/proguard/examples/android-plugin/AndroidManifest.xml deleted file mode 100644 index e96cfac..0000000 --- a/proguard/examples/android-plugin/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/proguard/examples/android-plugin/build.gradle b/proguard/examples/android-plugin/build.gradle deleted file mode 100644 index 57d4b0d..0000000 --- a/proguard/examples/android-plugin/build.gradle +++ /dev/null @@ -1,73 +0,0 @@ -// This build file illustrates how to apply ProGuard in the Android build -// process, with ProGuard's own plugin instead of the built-in minification -// support of the Android Gradle plugin. -buildscript { - repositories { - mavenLocal() // For local testing - google() // For the Android Gradle plugin. - mavenCentral() // For the ProGuard Gradle Plugin and anything else. - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.3.0' - classpath 'com.android.tools.build:gradle:7.0.0' - } -} - -apply plugin: 'com.android.application' -apply plugin: 'com.guardsquare.proguard' - -repositories { - google() // For the Android plugin. - mavenCentral() // For anything else. -} - -android { - compileSdkVersion 28 - - signingConfigs { - debug { - storeFile file('debug.keystore') - storePassword 'android' - keyAlias 'androiddebugkey' - keyPassword 'android' - } - } - - defaultConfig { - minSdkVersion 11 - targetSdkVersion 29 - signingConfig signingConfigs.debug - } - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - resources.srcDirs = ['src'] - aidl.srcDirs = ['src'] - renderscript.srcDirs = ['src'] - res.srcDirs = ['res'] - assets.srcDirs = ['assets'] - } - } - - buildTypes { - debug { - // Disable the built-in minification - minifyEnabled false - } - release { - // Disable the built-in minification - minifyEnabled false - } - } -} - -proguard { - configurations { - release { - defaultConfiguration 'proguard-android-optimize.txt' - configuration 'proguard-project.txt' - } - } -} diff --git a/proguard/examples/android-plugin/debug.keystore b/proguard/examples/android-plugin/debug.keystore deleted file mode 100644 index 7e28347..0000000 Binary files a/proguard/examples/android-plugin/debug.keystore and /dev/null differ diff --git a/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c..0000000 Binary files a/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 41dfb87..0000000 --- a/proguard/examples/android-plugin/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/proguard/examples/android-plugin/gradlew b/proguard/examples/android-plugin/gradlew deleted file mode 100644 index b0d6d0a..0000000 --- a/proguard/examples/android-plugin/gradlew +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/android-plugin/gradlew.bat b/proguard/examples/android-plugin/gradlew.bat deleted file mode 100644 index 9991c50..0000000 --- a/proguard/examples/android-plugin/gradlew.bat +++ /dev/null @@ -1,100 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/android-plugin/proguard-project.txt b/proguard/examples/android-plugin/proguard-project.txt deleted file mode 100644 index 5a89ed5..0000000 --- a/proguard/examples/android-plugin/proguard-project.txt +++ /dev/null @@ -1,127 +0,0 @@ -############################################################################### -# General settings. -############################################################################### - --verbose - -# We can debug the ProGuard configuration by instrumenting the code and -# checking the log for feedback. Disable the option again for actual releases! - -#-addconfigurationdebugging - -# We can also disable the individual processing steps. - -#-dontshrink -#-dontoptimize -#-dontobfuscate - -# Specifically target Android. - --android - - -############################################################################### -# Settings to handle reflection in the code. -############################################################################### - -# Preserve annotated and generated classes for Dagger. - --keepclassmembers,allowobfuscation class * { - @dagger.** *; -} - --keep class **$$ModuleAdapter --keep class **$$InjectAdapter --keep class **$$StaticInjection - --if class **$$ModuleAdapter --keep class <1> - --if class **$$InjectAdapter --keep class <1> - --if class **$$StaticInjection --keep class <1> - --keepnames class dagger.Lazy - -# Preserve annotated and generated classes for Butterknife. - --keep class **$$ViewBinder { - public static void bind(...); - public static void unbind(...); -} - --if class **$$ViewBinder --keep class <1> - --keep class **_ViewBinding { - (<1>, android.view.View); -} - --if class **_ViewBinding --keep class <1> - -# Preserve fields that are serialized with GSON. - -#-keepclassmembers class com.example.SerializedClass1, -# com.example.SerializedClass2 { -# ; -#} - --keepclassmembers,allowobfuscation class * { - @com.google.gson.annotations.SerializedName ; -} - --keep,allowobfuscation @interface com.google.gson.annotations.** - - -############################################################################### -# Further optimizations. -############################################################################### - -# If you wish, you can let the optimization step remove Android logging calls. - -#-assumenosideeffects class android.util.Log { -# public static boolean isLoggable(java.lang.String, int); -# public static int v(...); -# public static int i(...); -# public static int w(...); -# public static int d(...); -# public static int e(...); -#} - -# In that case, it's especially useful to also clean up any corresponding -# string concatenation calls. - --assumenoexternalsideeffects class java.lang.StringBuilder { - public java.lang.StringBuilder(); - public java.lang.StringBuilder(int); - public java.lang.StringBuilder(java.lang.String); - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); - public java.lang.String toString(); -} - --assumenoexternalreturnvalues class java.lang.StringBuilder { - public java.lang.StringBuilder append(java.lang.Object); - public java.lang.StringBuilder append(java.lang.String); - public java.lang.StringBuilder append(java.lang.StringBuffer); - public java.lang.StringBuilder append(char[]); - public java.lang.StringBuilder append(char[], int, int); - public java.lang.StringBuilder append(boolean); - public java.lang.StringBuilder append(char); - public java.lang.StringBuilder append(int); - public java.lang.StringBuilder append(long); - public java.lang.StringBuilder append(float); - public java.lang.StringBuilder append(double); -} diff --git a/proguard/examples/android-plugin/res/drawable/ic_launcher.png b/proguard/examples/android-plugin/res/drawable/ic_launcher.png deleted file mode 100644 index d098d4c..0000000 Binary files a/proguard/examples/android-plugin/res/drawable/ic_launcher.png and /dev/null differ diff --git a/proguard/examples/android-plugin/res/values/colors.xml b/proguard/examples/android-plugin/res/values/colors.xml deleted file mode 100644 index a5109aa..0000000 --- a/proguard/examples/android-plugin/res/values/colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - #4B7FCE - #4B7FCE - #7BAFCE - #4B7FCE - diff --git a/proguard/examples/android-plugin/res/values/strings.xml b/proguard/examples/android-plugin/res/values/strings.xml deleted file mode 100644 index 2bca769..0000000 --- a/proguard/examples/android-plugin/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - HelloWorld Sample - diff --git a/proguard/examples/android-plugin/res/values/styles.xml b/proguard/examples/android-plugin/res/values/styles.xml deleted file mode 100644 index 59baa69..0000000 --- a/proguard/examples/android-plugin/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/proguard/examples/android-plugin/settings.gradle b/proguard/examples/android-plugin/settings.gradle deleted file mode 100644 index e69de29..0000000 diff --git a/proguard/examples/android-plugin/src/com/example/HelloWorldActivity.java b/proguard/examples/android-plugin/src/com/example/HelloWorldActivity.java deleted file mode 100644 index 6907d1a..0000000 --- a/proguard/examples/android-plugin/src/com/example/HelloWorldActivity.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Sample application to illustrate processing with ProGuard. - * - * Copyright (c) 2012-2020 Guardsquare NV - */ -package com.example; - -import android.app.Activity; -import android.os.Bundle; -import android.view.Gravity; -import android.widget.TextView; - -/** - * Sample activity that displays "Hello world!". - */ -public class HelloWorldActivity extends Activity -{ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - // Display the message. - TextView view = new TextView(this); - view.setText("Hello World"); - view.setGravity(Gravity.CENTER); - setContentView(view); - } -} diff --git a/proguard/examples/annotations/examples.pro b/proguard/examples/annotations/examples.pro deleted file mode 100644 index 7c9cf95..0000000 --- a/proguard/examples/annotations/examples.pro +++ /dev/null @@ -1,65 +0,0 @@ -# -# This ProGuard configuration file illustrates how to use annotations for -# specifying which classes and class members should be kept. -# Usage: -# java -jar proguard.jar @examples.pro -# - -# Specify the input, output, and library jars. -# This is assuming the code has been compiled in the examples directory. - --injars examples(*.class) --outjars out - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -# Some important configuration is based on the annotations in the code. -# We have to specify what the annotations mean to ProGuard. - --include lib/annotations.pro - -# -# We can then still add any other options that might be useful. -# - -# Print out a list of what we're preserving. - --printseeds - -# Preserve all annotations themselves. - --keepattributes *Annotation* - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your application doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} diff --git a/proguard/examples/annotations/examples/Applet.java b/proguard/examples/annotations/examples/Applet.java deleted file mode 100644 index e5b7acc..0000000 --- a/proguard/examples/annotations/examples/Applet.java +++ /dev/null @@ -1,23 +0,0 @@ -import proguard.annotation.*; - -/** - * This applet illustrates the use of annotations for configuring ProGuard. - * - * You can compile it with: - * javac -classpath ../lib/annotations.jar Applet.java - * You can then process it with: - * java -jar ../../../lib/proguard.jar @ ../examples.pro - * - * The annotation will preserve the class and its essential methods, - * as a result of the specifications in lib/annotations.pro. - */ -@Keep -public class Applet extends java.applet.Applet -{ - // Implementations for Applet. - - public void init() - { - // ... - } -} diff --git a/proguard/examples/annotations/examples/Application.java b/proguard/examples/annotations/examples/Application.java deleted file mode 100644 index 777d286..0000000 --- a/proguard/examples/annotations/examples/Application.java +++ /dev/null @@ -1,21 +0,0 @@ -import proguard.annotation.KeepApplication; - -/** - * This application illustrates the use of annotations for configuring ProGuard. - * - * You can compile it with: - * javac -classpath ../lib/annotations.jar Application.java - * You can then process it with: - * java -jar ../../../lib/proguard.jar @ ../examples.pro - * - * The annotation will preserve the class and its main method, - * as a result of the specifications in lib/annotations.pro. - */ -@KeepApplication -public class Application -{ - public static void main(String[] args) - { - System.out.println("The answer is 42"); - } -} diff --git a/proguard/examples/annotations/examples/Bean.java b/proguard/examples/annotations/examples/Bean.java deleted file mode 100644 index aacb501..0000000 --- a/proguard/examples/annotations/examples/Bean.java +++ /dev/null @@ -1,57 +0,0 @@ -import proguard.annotation.*; - -/** - * This bean illustrates the use of annotations for configuring ProGuard. - * - * You can compile it with: - * javac -classpath ../lib/annotations.jar Bean.java - * You can then process it with: - * java -jar ../../../lib/proguard.jar @ ../examples.pro - * - * The annotations will preserve the class and its public getters and setters, - * as a result of the specifications in lib/annotations.pro. - */ -@Keep -@KeepPublicGettersSetters -public class Bean -{ - public boolean booleanProperty; - public int intProperty; - public String stringProperty; - - - public boolean isBooleanProperty() - { - return booleanProperty; - } - - - public void setBooleanProperty(boolean booleanProperty) - { - this.booleanProperty = booleanProperty; - } - - - public int getIntProperty() - { - return intProperty; - } - - - public void setIntProperty(int intProperty) - { - this.intProperty = intProperty; - } - - - public String getStringProperty() - { - return stringProperty; - } - - - public void setStringProperty(String stringProperty) - { - this.stringProperty = stringProperty; - } -} diff --git a/proguard/examples/annotations/examples/NativeCallBack.java b/proguard/examples/annotations/examples/NativeCallBack.java deleted file mode 100644 index a4e5583..0000000 --- a/proguard/examples/annotations/examples/NativeCallBack.java +++ /dev/null @@ -1,52 +0,0 @@ -import proguard.annotation.*; - -/** - * This application illustrates the use of annotations for configuring ProGuard. - * - * You can compile it with: - * javac -classpath ../lib/annotations.jar NativeCallBack.java - * You can then process it with: - * java -jar ../../../lib/proguard.jar @ ../examples.pro - * - * The annotation will preserve the class and its main method, - * as a result of the specifications in lib/annotations.pro. - */ -@KeepApplication -public class NativeCallBack -{ - /** - * Suppose this is a native method that computes an answer. - * - * The -keep option for native methods in the regular ProGuard - * configuration will make sure it is not removed or renamed when - * processing this code. - */ - public native int computeAnswer(); - - - /** - * Suppose this method is called back from the above native method. - * - * ProGuard would remove it, because it is not referenced from java. - * The annotation will make sure it is preserved anyhow. - */ - @Keep - public int getAnswer() - { - return 42; - } - - - /** - * The main entry point of the application. - * - * The @KeepApplication annotation of this class will make sure it is not - * removed or renamed when processing this code. - */ - public static void main(String[] args) - { - int answer = new NativeCallBack().computeAnswer(); - - System.out.println("The answer is " + answer); - } -} diff --git a/proguard/examples/ant/applets.xml b/proguard/examples/ant/applets.xml deleted file mode 100644 index 474abbc..0000000 --- a/proguard/examples/ant/applets.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/ant/applications1.xml b/proguard/examples/ant/applications1.xml deleted file mode 100644 index 6df5789..0000000 --- a/proguard/examples/ant/applications1.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/proguard/examples/ant/applications2.xml b/proguard/examples/ant/applications2.xml deleted file mode 100644 index fa9f78c..0000000 --- a/proguard/examples/ant/applications2.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - -verbose - - - - -injars in.jar - -outjars out.jar - - -libraryjars ${java.home}/lib/rt.jar - - - - - - - - -printmapping out.map - -renamesourcefileattribute SourceFile - -keepattributes SourceFile,LineNumberTable - - - - -keepattributes *Annotation* - - - - -keepclasseswithmembers public class * { - public static void main(java.lang.String[]); - } - - - - -keepclasseswithmembernames class * { - native <methods>; - } - - - - -keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); - } - - - - -keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); - } - - - - - - - diff --git a/proguard/examples/ant/applications3.xml b/proguard/examples/ant/applications3.xml deleted file mode 100644 index 331a999..0000000 --- a/proguard/examples/ant/applications3.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/ant/library.xml b/proguard/examples/ant/library.xml deleted file mode 100644 index ce68ab4..0000000 --- a/proguard/examples/ant/library.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/ant/midlets.xml b/proguard/examples/ant/midlets.xml deleted file mode 100644 index 065c3a7..0000000 --- a/proguard/examples/ant/midlets.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/ant/proguard.xml b/proguard/examples/ant/proguard.xml deleted file mode 100644 index 8d2751c..0000000 --- a/proguard/examples/ant/proguard.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/ant/servlets.xml b/proguard/examples/ant/servlets.xml deleted file mode 100644 index ea13981..0000000 --- a/proguard/examples/ant/servlets.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proguard/examples/application-kotlin/.idea/compiler.xml b/proguard/examples/application-kotlin/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/proguard/examples/application-kotlin/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/gradle.xml b/proguard/examples/application-kotlin/.idea/gradle.xml deleted file mode 100644 index f6244b9..0000000 --- a/proguard/examples/application-kotlin/.idea/gradle.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/inspectionProfiles/Project_Default.xml b/proguard/examples/application-kotlin/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index df543e3..0000000 --- a/proguard/examples/application-kotlin/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/jarRepositories.xml b/proguard/examples/application-kotlin/.idea/jarRepositories.xml deleted file mode 100644 index fdc392f..0000000 --- a/proguard/examples/application-kotlin/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/kotlinc.xml b/proguard/examples/application-kotlin/.idea/kotlinc.xml deleted file mode 100644 index 0e65cea..0000000 --- a/proguard/examples/application-kotlin/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/misc.xml b/proguard/examples/application-kotlin/.idea/misc.xml deleted file mode 100644 index 62269df..0000000 --- a/proguard/examples/application-kotlin/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/vcs.xml b/proguard/examples/application-kotlin/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/proguard/examples/application-kotlin/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/.idea/workspace.xml b/proguard/examples/application-kotlin/.idea/workspace.xml deleted file mode 100644 index 6e1c95d..0000000 --- a/proguard/examples/application-kotlin/.idea/workspace.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1673606278294 - - - 1673610276662 - - - - - - \ No newline at end of file diff --git a/proguard/examples/application-kotlin/build.gradle b/proguard/examples/application-kotlin/build.gradle deleted file mode 100644 index d5344e3..0000000 --- a/proguard/examples/application-kotlin/build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -import proguard.gradle.ProGuardTask - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.3.1' - } -} - -plugins { - id 'org.jetbrains.kotlin.jvm' version '1.8.0' - id 'application' -} - -group = 'org.example' -version = '1.0-SNAPSHOT' - -repositories { - mavenCentral() -} - -dependencies { - testImplementation 'org.jetbrains.kotlin:kotlin-test' -} - -test { - useJUnitPlatform() -} - -compileKotlin { - kotlinOptions.jvmTarget = '1.8' -} - -compileTestKotlin { - kotlinOptions.jvmTarget = '1.8' -} - -application { - mainClassName = 'AppKt' -} - -ext.baseCoordinates = "${project.name}-${project.version}" - -tasks.register('proguard', ProGuardTask) { - configuration file('proguard.pro') - - injars(tasks.named('jar', Jar).flatMap { it.archiveFile }) - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // This will include the Kotlin library jars - libraryjars sourceSets.main.compileClasspath - - verbose - - outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar")) -} diff --git a/proguard/examples/application-kotlin/gradle.properties b/proguard/examples/application-kotlin/gradle.properties deleted file mode 100644 index 7fc6f1f..0000000 --- a/proguard/examples/application-kotlin/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -kotlin.code.style=official diff --git a/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e583..0000000 Binary files a/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 60c76b3..0000000 --- a/proguard/examples/application-kotlin/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file diff --git a/proguard/examples/application-kotlin/gradlew b/proguard/examples/application-kotlin/gradlew deleted file mode 100644 index 1b6c787..0000000 --- a/proguard/examples/application-kotlin/gradlew +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/application-kotlin/gradlew.bat b/proguard/examples/application-kotlin/gradlew.bat deleted file mode 100644 index 107acd3..0000000 --- a/proguard/examples/application-kotlin/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/application-kotlin/proguard.pro b/proguard/examples/application-kotlin/proguard.pro deleted file mode 100644 index 51c8c00..0000000 --- a/proguard/examples/application-kotlin/proguard.pro +++ /dev/null @@ -1,8 +0,0 @@ --verbose - --keepattributes *Annotation* - --keep class kotlin.Metadata { *; } - -# Entry point to the app. --keep class com.example.AppKt { *; } diff --git a/proguard/examples/application-kotlin/settings.gradle b/proguard/examples/application-kotlin/settings.gradle deleted file mode 100644 index c105b77..0000000 --- a/proguard/examples/application-kotlin/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ - -rootProject.name = 'application-kotlin' - diff --git a/proguard/examples/application-kotlin/src/main/kotlin/App.kt b/proguard/examples/application-kotlin/src/main/kotlin/App.kt deleted file mode 100644 index ca1f043..0000000 --- a/proguard/examples/application-kotlin/src/main/kotlin/App.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.example - -fun main(args: Array) { - println("Hello World!") - - // Try adding program arguments via Run/Debug configuration. - // Learn more about running applications: https://www.jetbrains.com/help/idea/running-applications.html. - println("Program arguments: ${args.joinToString()}") -} diff --git a/proguard/examples/application/.idea/gradle.xml b/proguard/examples/application/.idea/gradle.xml deleted file mode 100644 index 90ea013..0000000 --- a/proguard/examples/application/.idea/gradle.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/application/.idea/misc.xml b/proguard/examples/application/.idea/misc.xml deleted file mode 100644 index 6ed36dd..0000000 --- a/proguard/examples/application/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/proguard/examples/application/.idea/vcs.xml b/proguard/examples/application/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/proguard/examples/application/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/application/.idea/workspace.xml b/proguard/examples/application/.idea/workspace.xml deleted file mode 100644 index 66742cc..0000000 --- a/proguard/examples/application/.idea/workspace.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - 1673606300818 - - - - - - - - file://$PROJECT_DIR$/build.gradle - 34 - - - - - \ No newline at end of file diff --git a/proguard/examples/application/build.gradle b/proguard/examples/application/build.gradle deleted file mode 100644 index 791b932..0000000 --- a/proguard/examples/application/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -import proguard.gradle.ProGuardTask - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.3.0' - } -} - -plugins { - id 'application' - id 'java' -} - -group = 'com.example' -version = '0.0.1' - -application { - mainClass.set('com.example.App') -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'com.google.guava:guava:30.1.1-jre' -} - -ext.baseCoordinates = "${project.name}-${project.version}" - -tasks.register('proguard', ProGuardTask) { - configuration file('proguard.pro') - - injars(tasks.named('jar', Jar).flatMap { it.archiveFile }) - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - verbose - - outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar")) -} diff --git a/proguard/examples/application/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/application/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c..0000000 Binary files a/proguard/examples/application/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/application/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/application/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2a56324..0000000 --- a/proguard/examples/application/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/proguard/examples/application/gradlew b/proguard/examples/application/gradlew deleted file mode 100644 index 4f906e0..0000000 --- a/proguard/examples/application/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/application/gradlew.bat b/proguard/examples/application/gradlew.bat deleted file mode 100644 index 107acd3..0000000 --- a/proguard/examples/application/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/application/proguard.pro b/proguard/examples/application/proguard.pro deleted file mode 100644 index 5524d9e..0000000 --- a/proguard/examples/application/proguard.pro +++ /dev/null @@ -1,6 +0,0 @@ -# We only want minification, not obfuscation. --dontobfuscate --verbose - -# Entry point to the app. --keep class com.example.App { *; } diff --git a/proguard/examples/application/settings.gradle b/proguard/examples/application/settings.gradle deleted file mode 100644 index 0a383dd..0000000 --- a/proguard/examples/application/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'demo' diff --git a/proguard/examples/application/src/main/java/com/example/App.java b/proguard/examples/application/src/main/java/com/example/App.java deleted file mode 100644 index e584f56..0000000 --- a/proguard/examples/application/src/main/java/com/example/App.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.example; - -public class App { - public static void main(String... args) { - System.out.println("Hello, world!"); - } -} diff --git a/proguard/examples/dictionaries/compact.txt b/proguard/examples/dictionaries/compact.txt deleted file mode 100644 index 5636a3e..0000000 --- a/proguard/examples/dictionaries/compact.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -# This obfuscation dictionary contains strings that are already present -# in many class files. Since these strings can be shared, the resulting -# obfuscated class files will generally be a little bit more compact. -# Usage: -# java -jar proguard.jar ..... -obfuscationdictionary compact.txt -# - -Code -V -I -Z -B -C -S -F -D -L diff --git a/proguard/examples/dictionaries/keywords.txt b/proguard/examples/dictionaries/keywords.txt deleted file mode 100644 index 76f5a7b..0000000 --- a/proguard/examples/dictionaries/keywords.txt +++ /dev/null @@ -1,58 +0,0 @@ -# -# This obfuscation dictionary contains reserved Java keywords. They can't -# be used in Java source files, but they can be used in compiled class files. -# Note that this hardly improves the obfuscation. Decent decompilers can -# automatically replace reserved keywords, and the effect can fairly simply be -# undone by obfuscating again with simpler names. -# Usage: -# java -jar proguard.jar ..... -obfuscationdictionary keywords.txt -# - -do -if -for -int -new -try -byte -case -char -else -goto -long -this -void -break -catch -class -const -final -float -short -super -throw -while -double -import -native -public -return -static -switch -throws -boolean -default -extends -finally -package -private -abstract -continue -strictfp -volatile -interface -protected -transient -implements -instanceof -synchronized diff --git a/proguard/examples/dictionaries/shakespeare.txt b/proguard/examples/dictionaries/shakespeare.txt deleted file mode 100644 index 28b1cd8..0000000 --- a/proguard/examples/dictionaries/shakespeare.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# This obfuscation dictionary contains quotes from plays by Shakespeare. -# It illustrates that any text can be used, for whatever flippant reasons -# one may have. -# Usage: -# java -jar proguard.jar ..... -obfuscationdictionary shakespeare.txt -# - - -"This thing of darkness I acknowledge mine." - - --From The Tempest (V, i, 275-276) - - -"Though this be madness, yet there is method in 't." - - --From Hamlet (II, ii, 206) - - -"What's in a name? That which we call a rose - By any other word would smell as sweet." - - --From Romeo and Juliet (II, ii, 1-2) diff --git a/proguard/examples/dictionaries/windows.txt b/proguard/examples/dictionaries/windows.txt deleted file mode 100644 index fd65dc9..0000000 --- a/proguard/examples/dictionaries/windows.txt +++ /dev/null @@ -1,209 +0,0 @@ -# -# This obfuscation dictionary contains names that are not allowed as file names -# in Windows, not even with extensions like .class or .java. They can however -# be used without problems in jar archives, which just begs to apply them as -# obfuscated class names. Trying to unpack the obfuscated archives in Windows -# will probably generate some sparks. -# Usage: -# java -jar proguard.jar ..... -classobfuscationdictionary windows.txt -# -packageobfuscationdictionary windows.txt -# - -aux -Aux -aUx -AUx -auX -AuX -aUX -AUX -AUX -con -Con -cOn -COn -coN -CoN -cON -CON -CON -nul -Nul -nUl -NUl -nuL -NuL -nUL -NUL -NUL -prn -Prn -pRn -PRn -prN -PrN -pRN -PRN -PRN -com1 -Com1 -cOm1 -COm1 -coM1 -CoM1 -cOM1 -COM1 -COM1 -com2 -Com2 -cOm2 -COm2 -coM2 -CoM2 -cOM2 -COM2 -COM2 -com3 -Com3 -cOm3 -COm3 -coM3 -CoM3 -cOM3 -COM3 -COM3 -com4 -Com4 -cOm4 -COm4 -coM4 -CoM4 -cOM4 -COM4 -COM4 -com5 -Com5 -cOm5 -COm5 -coM5 -CoM5 -cOM5 -COM5 -COM5 -com6 -Com6 -cOm6 -COm6 -coM6 -CoM6 -cOM6 -COM6 -COM6 -com7 -Com7 -cOm7 -COm7 -coM7 -CoM7 -cOM7 -COM7 -COM7 -com8 -Com8 -cOm8 -COm8 -coM8 -CoM8 -cOM8 -COM8 -COM8 -com9 -Com9 -cOm9 -COm9 -coM9 -CoM9 -cOM9 -COM9 -COM9 -lpt1 -Lpt1 -lPt1 -LPt1 -lpT1 -LpT1 -lPT1 -LPT1 -LPT1 -lpt2 -Lpt2 -lPt2 -LPt2 -lpT2 -LpT2 -lPT2 -LPT2 -LPT2 -lpt3 -Lpt3 -lPt3 -LPt3 -lpT3 -LpT3 -lPT3 -LPT3 -LPT3 -lpt4 -Lpt4 -lPt4 -LPt4 -lpT4 -LpT4 -lPT4 -LPT4 -LPT4 -lpt5 -Lpt5 -lPt5 -LPt5 -lpT5 -LpT5 -lPT5 -LPT5 -LPT5 -lpt6 -Lpt6 -lPt6 -LPt6 -lpT6 -LpT6 -lPT6 -LPT6 -LPT6 -lpt7 -Lpt7 -lPt7 -LPt7 -lpT7 -LpT7 -lPT7 -LPT7 -LPT7 -lpt8 -Lpt8 -lPt8 -LPt8 -lpT8 -LpT8 -lPT8 -LPT8 -LPT8 -lpt9 -Lpt9 -lPt9 -LPt9 -lpT9 -LpT9 -lPT9 -LPT9 -LPT9 diff --git a/proguard/examples/gradle-kotlin-dsl/build.gradle.kts b/proguard/examples/gradle-kotlin-dsl/build.gradle.kts deleted file mode 100644 index 356f72c..0000000 --- a/proguard/examples/gradle-kotlin-dsl/build.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath("com.guardsquare:proguard-gradle:7.3.0") - } -} - -plugins { - java - application -} - -repositories { - mavenCentral() -} - -dependencies { - testImplementation("junit:junit:4.12") -} - -application { - mainClassName = "gradlekotlindsl.App" -} - - -tasks.withType { - manifest { - attributes["Main-Class"] = application.mainClassName - } -} - -tasks.register("proguard") { - verbose() - - // Alternatively put your config in a separate file - // configuration("config.pro") - - // Use the jar task output as a input jar. This will automatically add the necessary task dependency. - injars(tasks.named("jar")) - - outjars("build/proguard-obfuscated.jar") - - val javaHome = System.getProperty("java.home") - // Automatically handle the Java version of this build. - if (System.getProperty("java.version").startsWith("1.")) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars("$javaHome/lib/rt.jar") - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars( - // filters must be specified first, as a map - mapOf("jarfilter" to "!**.jar", - "filter" to "!module-info.class"), - "$javaHome/jmods/java.base.jmod" - ) - } - - allowaccessmodification() - - repackageclasses("") - - printmapping("build/proguard-mapping.txt") - - keep("""class gradlekotlindsl.App { - public static void main(java.lang.String[]); - } - """) -} - diff --git a/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c..0000000 Binary files a/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2a56324..0000000 --- a/proguard/examples/gradle-kotlin-dsl/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/proguard/examples/gradle-kotlin-dsl/gradlew b/proguard/examples/gradle-kotlin-dsl/gradlew deleted file mode 100644 index 4f906e0..0000000 --- a/proguard/examples/gradle-kotlin-dsl/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/gradle-kotlin-dsl/gradlew.bat b/proguard/examples/gradle-kotlin-dsl/gradlew.bat deleted file mode 100644 index 107acd3..0000000 --- a/proguard/examples/gradle-kotlin-dsl/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/gradle-kotlin-dsl/settings.gradle.kts b/proguard/examples/gradle-kotlin-dsl/settings.gradle.kts deleted file mode 100644 index b1c3ed8..0000000 --- a/proguard/examples/gradle-kotlin-dsl/settings.gradle.kts +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "gradle-kotlin-dsl" diff --git a/proguard/examples/gradle-kotlin-dsl/src/main/java/gradlekotlindsl/App.java b/proguard/examples/gradle-kotlin-dsl/src/main/java/gradlekotlindsl/App.java deleted file mode 100644 index 5ebb996..0000000 --- a/proguard/examples/gradle-kotlin-dsl/src/main/java/gradlekotlindsl/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ -package gradlekotlindsl; - -public class App { - public String getGreeting() { - return "Hello world."; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/proguard/examples/gradle-kotlin-dsl/src/test/java/gradlekotlindsl/AppTest.java b/proguard/examples/gradle-kotlin-dsl/src/test/java/gradlekotlindsl/AppTest.java deleted file mode 100644 index a0bb7e6..0000000 --- a/proguard/examples/gradle-kotlin-dsl/src/test/java/gradlekotlindsl/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ -package gradlekotlindsl; - -import org.junit.Test; -import static org.junit.Assert.*; - -public class AppTest { - @Test public void testAppHasAGreeting() { - App classUnderTest = new App(); - assertNotNull("app should have a greeting", classUnderTest.getGreeting()); - } -} diff --git a/proguard/examples/gradle/android.gradle b/proguard/examples/gradle/android.gradle deleted file mode 100644 index 3c98005..0000000 --- a/proguard/examples/gradle/android.gradle +++ /dev/null @@ -1,281 +0,0 @@ -// -// This Gradle build file illustrates how to process Android -// applications. -// -// If you're using the Android SDK, the provided build systems with Gradle, -// Android Studio, Eclipse, and Ant already take care of the proper settings. -// You only need to enable ProGuard as explained in the Android documentation. -// You can still add project-specific configuration in proguard-project.txt. -// -// This configuration file is for custom, stand-alone builds. -// Usage: -// gradle -b android.gradle proguard - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - - //############################################################################## - // Input and output. - //############################################################################## - - // Specify the input jars, output jars, and library jars. - // Note that ProGuard works with Java bytecode (.class), - // before the dex compiler converts it into Dalvik code (.dex). - - injars 'classes' - injars 'libs' - outjars 'classes-processed.jar' - - libraryjars '/usr/local/android-sdk/platforms/android-27/android.jar' - //libraryjars '/usr/local/java/android-sdk/extras/android/support/v4/android-support-v4.jar' - //libraryjars '/usr/local/java/android-sdk/add-ons/addon-google_apis-google-21/libs/maps.jar' - // ... - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. - - printmapping 'bin/classes-processed.map' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'bin/classes-processed.seeds' - - - //############################################################################## - // General settings. - //############################################################################## - - verbose - - // We can debug the ProGuard configuration by instrumenting the code and - // checking the log for feedback. Disable the option again for actual releases! - - //addconfigurationdebugging - - // We can also disable the individual processing steps. - - //dontshrink - //dontoptimize - //dontobfuscate - - // Specifically target Android. - - android - - // The dex compiler ignores preverification information. - - dontpreverify - - // Reduce the size of the output some more. - - repackageclasses '' - allowaccessmodification - - // Switch off some optimizations that trip older versions of the Dalvik VM. - - optimizations '!code/simplification/arithmetic' - - // Keep a fixed source file attribute and all line number tables to get line - // numbers in the stack traces. - - renamesourcefileattribute 'SourceFile' - keepattributes 'SourceFile,LineNumberTable' - - - //############################################################################## - // Settings to handle reflection in the code. - //############################################################################## - - // RemoteViews might need annotations. - - keepattributes '*Annotation*' - - // Preserve all fundamental application classes. - - 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' - - // Preserve all View implementations, their special context constructors, and - // their setters. - - keep 'public class * extends android.view.View { \ - public (android.content.Context); \ - public (android.content.Context, android.util.AttributeSet); \ - public (android.content.Context, android.util.AttributeSet, int); \ - public void set*(...); \ - }' - - // Preserve all classes that have special context constructors, and the - // constructors themselves. - - keepclasseswithmembers 'class * { \ - public (android.content.Context, android.util.AttributeSet); \ - }' - - // Preserve all classes that have special context constructors, and the - // constructors themselves. - - keepclasseswithmembers 'class * { \ - public (android.content.Context, android.util.AttributeSet, int); \ - }' - - // Preserve all possible onClick handlers. - - keepclassmembers 'class * extends android.content.Context { \ - public void *(android.view.View); \ - public void *(android.view.MenuItem); \ - }' - - // Preserve the special fields of all Parcelable implementations. - - keepclassmembers 'class * implements android.os.Parcelable { \ - static android.os.Parcelable$Creator CREATOR; \ - }' - - // Preserve static fields of inner classes of R classes that might be accessed - // through introspection. - - keepclassmembers 'class **.R$* { \ - public static ; \ - }' - - // Preserve annotated Javascript interface methods. - - keepclassmembers 'class * { \ - @android.webkit.JavascriptInterface ; \ - }' - - // Preserve annotated and generated classes for Dagger. - - keepclassmembers allowobfuscation: true, 'class * { \ - @dagger.** *; \ - }' - - keep 'class **$$ModuleAdapter' - keep 'class **$$InjectAdapter' - keep 'class **$$StaticInjection' - - keep if: 'class **$$ModuleAdapter', 'class <1>' - - keep if: 'class **$$InjectAdapter', 'class <1>' - - keep if: 'class **$$StaticInjection', 'class <1>' - - keepnames 'class dagger.Lazy' - - // Preserve annotated and generated classes for Butterknife. - - keep 'class **$$ViewBinder { \ - public static void bind(...); \ - public static void unbind(...); \ - }' - - keep if: 'class **$$ViewBinder', 'class <1>' - - keep 'class **_ViewBinding { \ - (<1>, android.view.View); \ - }' - - keep if: 'class **_ViewBinding', 'class <1>' - - // Preserve fields that are serialized with GSON. - - //keepclassmembers 'class com.example.SerializedClass1,' - // com.example.SerializedClass2 { - // ; - //}' - - keepclassmembers allowobfuscation: true, 'class * { \ - @com.google.gson.annotations.SerializedName ; \ - }' - - keep allowobfuscation: true, '@interface com.google.gson.annotations.**' - - - // Preserve the required interface from the License Verification Library - // (but don't nag the developer if the library is not used at all). - - keep 'public interface com.android.vending.licensing.ILicensingService' - - dontnote 'com.android.vending.licensing.ILicensingService' - - // The Android Compatibility library references some classes that may not be - // present in all versions of the API, but we know that's ok. - - dontwarn 'android.support.**' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your application doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your application may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' - - - //############################################################################## - // Further optimizations. - //############################################################################## - - // If you wish, you can let the optimization step remove Android logging calls. - - assumenosideeffects 'class android.util.Log { \ - public static boolean isLoggable(java.lang.String, int); \ - public static int v(...); \ - public static int i(...); \ - public static int w(...); \ - public static int d(...); \ - public static int e(...); \ - }' -} diff --git a/proguard/examples/gradle/applets.gradle b/proguard/examples/gradle/applets.gradle deleted file mode 100644 index c36137c..0000000 --- a/proguard/examples/gradle/applets.gradle +++ /dev/null @@ -1,102 +0,0 @@ -// -// This Gradle build file illustrates how to process applets. -// Usage: -// gradle -b applets.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - injars 'in.jar' - outjars 'out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod ", jarfilter: '!**.jar', filter: '!module-info.class' - libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - } - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. Keep a fixed source file attribute and all line number - // tables to get line numbers in the stack traces. - // You can comment this out if you're not interested in stack traces. - - printmapping 'out.map' - renamesourcefileattribute 'SourceFile' - keepattributes 'SourceFile,LineNumberTable' - - // Preserve all annotations. - - keepattributes '*Annotation*' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'out.seeds' - - // Preserve all public applets. - - keep 'public class * extends java.applet.Applet' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames,includedescriptorclasses 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your library doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your application may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' -} diff --git a/proguard/examples/gradle/applications.gradle b/proguard/examples/gradle/applications.gradle deleted file mode 100644 index dba978b..0000000 --- a/proguard/examples/gradle/applications.gradle +++ /dev/null @@ -1,109 +0,0 @@ -// -// This Gradle build file illustrates how to process applications. -// Usage: -// gradle -b applications.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - injars 'in.jar' - outjars 'out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - //libraryjars 'junit.jar' - //libraryjars 'servlet.jar' - //libraryjars 'jai_core.jar' - //... - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. Keep a fixed source file attribute and all line number - // tables to get line numbers in the stack traces. - // You can comment this out if you're not interested in stack traces. - - printmapping 'out.map' - renamesourcefileattribute 'SourceFile' - keepattributes 'SourceFile,LineNumberTable' - - // Preserve all annotations. - - keepattributes '*Annotation*' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'out.seeds' - - // Preserve all public applications. - - keepclasseswithmembers 'public class * { \ - public static void main(java.lang.String[]); \ - }' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your application doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your application may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' -} diff --git a/proguard/examples/gradle/library.gradle b/proguard/examples/gradle/library.gradle deleted file mode 100644 index 6258102..0000000 --- a/proguard/examples/gradle/library.gradle +++ /dev/null @@ -1,111 +0,0 @@ -// -// This Gradle build file illustrates how to process a program -// library, such that it remains usable as a library. -// Usage: -// gradle -b library.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - // In this case, the input jar is the program library that we want to process. - - injars 'in.jar' - outjars 'out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // Save the obfuscation mapping to a file, so we can de-obfuscate any stack - // traces later on. Keep a fixed source file attribute and all line number - // tables to get line numbers in the stack traces. - // You can comment this out if you're not interested in stack traces. - - printmapping 'out.map' - keepparameternames - renamesourcefileattribute 'SourceFile' - keepattributes 'Signature,Exceptions,InnerClasses,PermittedSubclasses,EnclosingMethod,Deprecated,SourceFile,LineNumberTable' - - // Preserve all annotations. - - keepattributes '*Annotation*' - - // Preserve all public classes, and their public and protected fields and - // methods. - - keep 'public class * { \ - public protected *; \ - }' - - // Preserve all .class method names. - - keepclassmembernames 'class * { \ - java.lang.Class class$(java.lang.String); \ - java.lang.Class class$(java.lang.String, boolean); \ - }' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your library doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your library may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' -} diff --git a/proguard/examples/gradle/midlets.gradle b/proguard/examples/gradle/midlets.gradle deleted file mode 100644 index 9097fc2..0000000 --- a/proguard/examples/gradle/midlets.gradle +++ /dev/null @@ -1,92 +0,0 @@ -// -// This Gradle build file illustrates how to process J2ME midlets. -// Usage: -// gradle -b midlets.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - 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' - - // Preverify the code suitably for Java Micro Edition. - - microedition - - // Allow methods with the same signature, except for the return type, - // to get the same obfuscation name. - - overloadaggressively - - // Put all obfuscated classes into the nameless root package. - - repackageclasses '' - - // Allow classes and class members to be made public. - - allowaccessmodification - - // On Windows, you can't use mixed case class names, - // should you still want to use the preverify tool. - // - // dontusemixedcaseclassnames - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. - - printmapping 'out.map' - - // You can keep a fixed source file attribute and all line number tables to - // get stack traces with line numbers. - - //renamesourcefileattribute 'SourceFile' - //keepattributes 'SourceFile,LineNumberTable' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'out.seeds' - - // Preserve all public midlets. - - keep 'public class * extends javax.microedition.midlet.MIDlet' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Your midlet may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' -} diff --git a/proguard/examples/gradle/proguard.gradle b/proguard/examples/gradle/proguard.gradle deleted file mode 100644 index e17c572..0000000 --- a/proguard/examples/gradle/proguard.gradle +++ /dev/null @@ -1,121 +0,0 @@ -// -// This Gradle build file illustrates how to process ProGuard itself. -// Configuration files for typical applications will be very similar. -// Usage: -// gradle -b proguard.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - injars '../../lib/proguard.jar' - outjars 'proguard_out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // Write out an obfuscation mapping file, for de-obfuscating any stack traces - // later on, or for incremental obfuscation of extensions. - - printmapping 'proguard.map' - - // Don't print notes about reflection in GSON code, the Kotlin runtime, and - // our own optionally injected code. - - dontnote 'kotlin.**' - dontnote 'kotlinx.**' - dontnote 'com.google.gson.**' - dontnote 'proguard.configuration.ConfigurationLogger' - - // Preserve injected GSON utility classes and their members. - - keep allowobfuscation: true, 'class proguard.optimize.gson._*' - keepclassmembers 'class proguard.optimize.gson._* { \ - *; \ - }' - - // Obfuscate class strings of injected GSON utility classes. - - adaptclassstrings 'proguard.optimize.gson.**' - - // Allow methods with the same signature, except for the return type, - // to get the same obfuscation name. - - overloadaggressively - - // Put all obfuscated classes into the nameless root package. - - repackageclasses '' - - // Allow classes and class members to be made public. - - allowaccessmodification - - // The entry point: ProGuard and its main method. - - keep 'public class proguard.ProGuard { \ - public static void main(java.lang.String[]); \ - }' - - // If you want to preserve the Ant task as well, you'll have to specify the - // main ant.jar. - - //libraryjars '/usr/local/java/ant/lib/ant.jar' - //adaptresourcefilecontents 'proguard/ant/task.properties' - // - //keep allowobfuscation: true, 'class proguard.ant.*' - //keepclassmembers 'public class proguard.ant.* { \ - // (org.apache.tools.ant.Project); \ - // public void set*(***); \ - // public void add*(***); \ - //}' - - // If you want to preserve the Gradle task, you'll have to specify the Gradle - // jars. - - //libraryjars '/usr/local/java/gradle-4.2.1/lib/plugins/gradle-plugins-4.2.1.jar' - //libraryjars '/usr/local/java/gradle-4.2.1/lib/gradle-base-services-4.2.1.jar' - //libraryjars '/usr/local/java/gradle-4.2.1/lib/gradle-core-4.2.1.jar' - //libraryjars '/usr/local/java/gradle-4.2.1/lib/groovy-all-2.4.12.jar' - - //keep 'public class proguard.gradle.* { \ - // public *; \ - //}' - - // If you want to preserve the WTK obfuscation plug-in, you'll have to specify - // the kenv.zip file. - - //libraryjars '/usr/local/java/wtk2.5.2/wtklib/kenv.zip' - //keep 'public class proguard.wtk.ProGuardObfuscator' -} diff --git a/proguard/examples/gradle/proguardgui.gradle b/proguard/examples/gradle/proguardgui.gradle deleted file mode 100644 index 631399e..0000000 --- a/proguard/examples/gradle/proguardgui.gradle +++ /dev/null @@ -1,95 +0,0 @@ -// -// This Gradle build file illustrates how to process the ProGuard GUI. -// Configuration files for typical applications will be very similar. -// Usage: -// gradle -b proguardgui.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - // The input jars will be merged in a single output jar. - - injars '../../lib/proguardgui.jar' - outjars 'proguardgui_out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // Write out an obfuscation mapping file, for de-obfuscating any stack traces - // later on, or for incremental obfuscation of extensions. - - printmapping 'proguardgui.map' - - // If we wanted to reuse the previously obfuscated proguard_out.jar, we could - // perform incremental obfuscation based on its mapping file, and only keep the - // additional GUI files instead of all files. - - //applymapping 'proguard.map' - //injars '../../lib/proguardgui.jar' - //outjars 'proguardgui_out.jar' - //libraryjars '../../lib/proguard.jar', filter: '!proguard/ant/**,!proguard/wtk/**' - //libraryjars '../../lib/retrace.jar' - //libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/java.desktop.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - - // Don't print notes about reflection in GSON code, the Kotlin runtime, and - // our own optionally injected code. - - dontnote 'kotlin.**' - dontnote 'kotlinx.**' - dontnote 'com.google.gson.**' - dontnote 'proguard.configuration.ConfigurationLogger' - - // Allow methods with the same signature, except for the return type, - // to get the same obfuscation name. - - overloadaggressively - - // Put all obfuscated classes into the nameless root package. - - repackageclasses '' - - // Adapt the names of resource files, based on the corresponding obfuscated - // class names. Notably, in this case, the GUI resource properties file will - // have to be renamed. - - adaptresourcefilenames '**.properties,**.gif,**.jpg' - - // The entry point: ProGuardGUI and its main method. - - keep 'public class proguard.gui.ProGuardGUI { \ - public static void main(java.lang.String[]); \ - }' -} diff --git a/proguard/examples/gradle/retrace.gradle b/proguard/examples/gradle/retrace.gradle deleted file mode 100644 index 7642903..0000000 --- a/proguard/examples/gradle/retrace.gradle +++ /dev/null @@ -1,87 +0,0 @@ -// -// This Gradle build file illustrates how to process the ReTrace tool. -// Configuration files for typical applications will be very similar. -// Usage: -// gradle -b retrace.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - // The input jars will be merged in a single output jar. - - injars '../../lib/retrace.jar' - outjars 'retrace_out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - libraryjars "${System.getProperty('java.home')}/jmods/java.sql.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // Write out an obfuscation mapping file, for de-obfuscating any stack traces - // later on, or for incremental obfuscation of extensions. - - printmapping 'retrace.map' - - // If we wanted to reuse the previously obfuscated proguard_out.jar, we could - // perform incremental obfuscation based on its mapping file, and only keep the - // additional ReTrace files instead of all files. - - //applymapping 'proguard.map' - //outjars 'retrace_out.jar', filter: 'proguard/retrace/**' - - // Don't print notes about reflection in GSON code, the Kotlin runtime, and - // our own optionally injected code. - - dontnote 'kotlin.**' - dontnote 'kotlinx.**' - dontnote 'com.google.gson.**' - dontnote 'proguard.configuration.ConfigurationLogger' - - // Allow methods with the same signature, except for the return type, - // to get the same obfuscation name. - - overloadaggressively - - // Put all obfuscated classes into the nameless root package. - - repackageclasses '' - - // Allow classes and class members to be made public. - - allowaccessmodification - - // The entry point: ReTrace and its main method. - - keep 'public class proguard.retrace.ReTrace { \ - public static void main(java.lang.String[]); \ - }' -} diff --git a/proguard/examples/gradle/scala.gradle b/proguard/examples/gradle/scala.gradle deleted file mode 100644 index 14ad83c..0000000 --- a/proguard/examples/gradle/scala.gradle +++ /dev/null @@ -1,166 +0,0 @@ -// -// This Gradle build file illustrates how to process Scala -// applications, including the Scala runtime. -// Usage: -// gradle -b scala.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - injars 'in.jar' - injars '/usr/local/java/scala-2.9.1/lib/scala-library.jar' - //injars '/usr/local/java/scala-2.9.1/lib/scala-compiler.jar', filter: '!META-INF/MANIFEST.MF' - //injars '/usr/local/java/scala-2.9.1/lib/jline.jar', filter: '!META-INF/MANIFEST.MF' - outjars 'out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - //libraryjars '/usr/local/java/ant/lib/ant.jar' - //... - - // Ignore some compiler artefacts. - - dontwarn 'scala.**' - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. Keep a fixed source file attribute and all line number - // tables to get line numbers in the stack traces. - // You can comment this out if you're not interested in stack traces. - - printmapping 'out.map' - renamesourcefileattribute 'SourceFile' - keepattributes 'SourceFile,LineNumberTable' - - // Preserve all annotations. - - keepattributes '*Annotation*' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'out.seeds' - - // Preserve all public applications. - - keepclasseswithmembers 'public class * { \ - public static void main(java.lang.String[]); \ - }' - - // Preserve some classes and class members that are accessed by means of - // introspection. - - 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; \ - }' - - // Preserve some classes and class members that are accessed by means of - // introspection in the Scala compiler library, if it is processed as well. - - //keep 'class * implements jline.Completor' - //keep 'class * implements jline.Terminal' - - //keep 'class scala.tools.nsc.Global' - - //keepclasseswithmembers 'class * { \ - // (scala.tools.nsc.Global); \ - //}' - - //keepclassmembers 'class * { \ - // *** scala_repl_value(); \ - // *** scala_repl_result(); \ - //}' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your application doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your application may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' - -} diff --git a/proguard/examples/gradle/servlets.gradle b/proguard/examples/gradle/servlets.gradle deleted file mode 100644 index ed9c7f1..0000000 --- a/proguard/examples/gradle/servlets.gradle +++ /dev/null @@ -1,103 +0,0 @@ -// -// This Gradle build file illustrates how to process servlets. -// Usage: -// gradle -b servlets.gradle proguard -// - -// Tell Gradle where to find the ProGuard task. - -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.0.1' - } -} - -// Define a ProGuard task. - -task ('proguard', type: proguard.gradle.ProGuardTask) { - - // You should probably import a more compact ProGuard-style configuration - // file for all static settings, but we're specifying them all here, for - // the sake of the example. - //configuration 'configuration.pro' - - verbose - - // Specify the input jars, output jars, and library jars. - - injars 'in.jar' - outjars 'out.jar' - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - } - - libraryjars '/usr/local/java/servlet/servlet.jar' - - // Save the obfuscation mapping to a file, so you can de-obfuscate any stack - // traces later on. Keep a fixed source file attribute and all line number - // tables to get line numbers in the stack traces. - // You can comment this out if you're not interested in stack traces. - - printmapping 'out.map' - renamesourcefileattribute 'SourceFile' - keepattributes 'SourceFile,LineNumberTable' - - // Preserve all annotations. - - keepattributes '*Annotation*' - - // You can print out the seeds that are matching the keep options below. - - //printseeds 'out.seeds' - - // Preserve all public servlets. - - keep 'public class * implements javax.servlet.Servlet' - - // Preserve all native method names and the names of their classes. - - keepclasseswithmembernames includedescriptorclasses: true, 'class * { \ - native ; \ - }' - - // Preserve the special static methods that are required in all enumeration - // classes. - - keepclassmembers allowoptimization: true, 'enum * { \ - public static **[] values(); \ - public static ** valueOf(java.lang.String); \ - }' - - // Explicitly preserve all serialization members. The Serializable interface - // is only a marker interface, so it wouldn't save them. - // You can comment this out if your library doesn't use serialization. - // If your code contains serializable classes that have to be backward - // compatible, please refer to the manual. - - keepclassmembers 'class * implements java.io.Serializable { \ - static final long serialVersionUID; \ - 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(); \ - }' - - // Your application may contain more items that need to be preserved; - // typically classes that are dynamically created using Class.forName: - - // keep 'public class com.example.MyClass' - // keep 'public interface com.example.MyInterface' - // keep 'public class * implements com.example.MyInterface' -} diff --git a/proguard/examples/gradle/settings.gradle b/proguard/examples/gradle/settings.gradle deleted file mode 100644 index c6ef6eb..0000000 --- a/proguard/examples/gradle/settings.gradle +++ /dev/null @@ -1,6 +0,0 @@ -// -// Gradle Settings file, required to test any of the example gradle build files in this directory. -// Invoke Gradle with the `-b` argument to point at a particular build file -// - -rootProject.name = "proguard-gradle-examples" diff --git a/proguard/examples/spring-boot/.idea/gradle.xml b/proguard/examples/spring-boot/.idea/gradle.xml deleted file mode 100644 index 90ea013..0000000 --- a/proguard/examples/spring-boot/.idea/gradle.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/spring-boot/.idea/misc.xml b/proguard/examples/spring-boot/.idea/misc.xml deleted file mode 100644 index 6ed36dd..0000000 --- a/proguard/examples/spring-boot/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/proguard/examples/spring-boot/.idea/vcs.xml b/proguard/examples/spring-boot/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/proguard/examples/spring-boot/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/proguard/examples/spring-boot/.idea/workspace.xml b/proguard/examples/spring-boot/.idea/workspace.xml deleted file mode 100644 index ae4ee1f..0000000 --- a/proguard/examples/spring-boot/.idea/workspace.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1673608674514 - - - - \ No newline at end of file diff --git a/proguard/examples/spring-boot/README.md b/proguard/examples/spring-boot/README.md deleted file mode 100644 index 85ef699..0000000 --- a/proguard/examples/spring-boot/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Demo Application demonstrating ProGuard applied to a Spring Boot application - -## Building - -``` -./gradlew clean proguard --info -``` - -Spring Boot applications contain a BOOT-INF folder which contains the application class files and library jars. -We must first extract the program classes, then apply ProGuard to them and finally repackage the application. - -## Executing - -The unobfuscated application will be located at `build/libs/demo-0.0.1.jar` and the -obfuscated application will be located at `build/libs/demo-0.0.1-obfuscated.jar`. - -They can be executed as follows: - -``` -java -jar build/libs/demo-0.0.1.jar -``` - -or - -``` -java -jar build/libs/demo-0.0.1-obfuscated.jar -``` - diff --git a/proguard/examples/spring-boot/build.gradle b/proguard/examples/spring-boot/build.gradle deleted file mode 100644 index 910f573..0000000 --- a/proguard/examples/spring-boot/build.gradle +++ /dev/null @@ -1,111 +0,0 @@ -import proguard.gradle.ProGuardTask - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.guardsquare:proguard-gradle:7.3.0' - } -} - -plugins { - id 'org.springframework.boot' version '2.3.5.RELEASE' - id 'io.spring.dependency-management' version '1.0.10.RELEASE' - id 'java' -} - -group = 'com.example' -version = '0.0.1' -sourceCompatibility = '1.8' - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter' -} - -task extractJar(type: Copy) { - dependsOn tasks.assemble - - def zipFile = file("${buildDir}/libs/demo-${version}.jar") - def outputDir = file("${buildDir}/extracted/") - - from zipTree(zipFile) - into outputDir -} - -task deleteClasses(type: Delete) { - delete "${buildDir}/extracted/BOOT-INF/classes/" -} - -task copyObfuscatedClasses(type: Copy) { - dependsOn tasks.deleteClasses - - from zipTree("${buildDir}/obfuscatedClasses.jar") - into "${buildDir}/extracted/BOOT-INF/classes/" -} - -task deleteObfuscated(type: Delete) { - delete 'build/obfuscatedClasses.jar' -} - -task repackage(type: Zip) { - dependsOn tasks.deleteClasses - dependsOn tasks.copyObfuscatedClasses - dependsOn tasks.deleteObfuscated - - from "${buildDir}/extracted" - entryCompression ZipEntryCompression.STORED - archiveFileName= "demo-${archiveVersion.get()}-obfuscated.jar" - destinationDirectory = file("${buildDir}/libs") -} - -task proguard(type: ProGuardTask) { - dependsOn tasks.extractJar - - verbose - - injars "${buildDir}/extracted/BOOT-INF/classes" - outjars "${buildDir}/obfuscatedClasses.jar" - - // Automatically handle the Java version of this build. - if (System.getProperty('java.version').startsWith('1.')) { - // Before Java 9, the runtime classes were packaged in a single jar file. - libraryjars "${System.getProperty('java.home')}/lib/rt.jar" - } else { - // As of Java 9, the runtime classes are packaged in modular jmod files. - libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class' - //libraryjars "${System.getProperty('java.home')}/jmods/....." - } - - // This will contain the Spring dependencies. - libraryjars sourceSets.main.compileClasspath - - keepdirectories - - // Keep the main class entry point. - keep 'public class com.example.demo.DemoApplication { \ - public static void main(java.lang.String[]); \ - }' - - keepattributes '*Annotation*' - - // This simple example requires classes with @Component annotation classes - // to be kept, since otherwise components could end up with clashing names, - // if they do not set the name explicitly. - keep 'public @org.springframework.stereotype.Component class *' - - // You may need to keep classes or members based on other annotations such as: - keepclassmembers 'public class * { \ - @org.springframework.beans.factory.annotation.Autowired *; \ - @org.springframework.beans.factory.annotation.Value *; \ - }' - - // After ProGuard has executed, repackage the app. - finalizedBy tasks.repackage -} - diff --git a/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.jar b/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c..0000000 Binary files a/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties b/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2a56324..0000000 --- a/proguard/examples/spring-boot/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/proguard/examples/spring-boot/gradlew b/proguard/examples/spring-boot/gradlew deleted file mode 100644 index 4f906e0..0000000 --- a/proguard/examples/spring-boot/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/proguard/examples/spring-boot/gradlew.bat b/proguard/examples/spring-boot/gradlew.bat deleted file mode 100644 index 107acd3..0000000 --- a/proguard/examples/spring-boot/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/proguard/examples/spring-boot/settings.gradle b/proguard/examples/spring-boot/settings.gradle deleted file mode 100644 index 0a383dd..0000000 --- a/proguard/examples/spring-boot/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'demo' diff --git a/proguard/examples/spring-boot/src/main/java/com/example/demo/DemoApplication.java b/proguard/examples/spring-boot/src/main/java/com/example/demo/DemoApplication.java deleted file mode 100644 index 2731bb0..0000000 --- a/proguard/examples/spring-boot/src/main/java/com/example/demo/DemoApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.example.demo; - -import com.example.demo.sub.TestComponent2; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -@SpringBootApplication -public class DemoApplication { - - public static void main(String[] args) { - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); - context.scan("com.example.demo"); - context.refresh(); - - TestComponent ms = context.getBean(TestComponent.class); - TestComponent2 ms2 = context.getBean(TestComponent2.class); - - System.out.println("The answer is " + ms.getAnswer() + " " + ms2.getMessage()); - - context.close(); - } - -} diff --git a/proguard/examples/spring-boot/src/main/java/com/example/demo/TestComponent.java b/proguard/examples/spring-boot/src/main/java/com/example/demo/TestComponent.java deleted file mode 100644 index d859030..0000000 --- a/proguard/examples/spring-boot/src/main/java/com/example/demo/TestComponent.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.demo; - -import org.springframework.stereotype.Component; - -/** - * The component name will be "TestComponent" since it is - * not set explicitly like @Component("MyComponent"). - */ -@Component -public class TestComponent -{ - public int getAnswer() { return 42; } -} diff --git a/proguard/examples/spring-boot/src/main/java/com/example/demo/sub/TestComponent2.java b/proguard/examples/spring-boot/src/main/java/com/example/demo/sub/TestComponent2.java deleted file mode 100644 index 067246b..0000000 --- a/proguard/examples/spring-boot/src/main/java/com/example/demo/sub/TestComponent2.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.demo.sub; - -import org.springframework.stereotype.Component; - -/** - * The component name will be "TestComponent2" since it is - * not set explicitly like @Component("MyComponent2"). - */ -@Component -public class TestComponent2 -{ - public String getMessage() { return "hello"; } -} diff --git a/proguard/examples/spring-boot/src/main/resources/application.properties b/proguard/examples/spring-boot/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/proguard/examples/spring-boot/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/proguard/examples/standalone/android.pro b/proguard/examples/standalone/android.pro deleted file mode 100644 index 472974a..0000000 --- a/proguard/examples/standalone/android.pro +++ /dev/null @@ -1,263 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process Android -# applications. -# -# If you're using the Android SDK, the provided build systems with Gradle, -# Android Studio, Eclipse, and Ant already take care of the proper settings. -# You only need to enable ProGuard as explained in the Android documentation. -# You can still add project-specific configuration in proguard-project.txt. -# -# This configuration file is for custom, stand-alone builds. -# Usage: -# java -jar proguard.jar @android.pro - - -############################################################################### -# Input and output. -############################################################################### - -# Specify the input jars, output jars, and library jars. -# Note that ProGuard works with Java bytecode (.class), -# before the dex compiler converts it into Dalvik code (.dex). - --injars bin/classes --injars libs --outjars bin/classes-processed.jar - --libraryjars /usr/local/android-sdk/platforms/android-27/android.jar -#-libraryjars /usr/local/java/android-sdk/extras/android/support/v4/android-support-v4.jar -#-libraryjars /usr/local/java/android-sdk/add-ons/addon-google_apis-google-21/libs/maps.jar -# ... - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. - --printmapping bin/classes-processed.map - -# You can print out the seeds that are matching the keep options below. - -#-printseeds bin/classes-processed.seeds - - -############################################################################### -# General settings. -############################################################################### - --verbose - -# We can debug the ProGuard configuration by instrumenting the code and -# checking the log for feedback. Disable the option again for actual releases! - -#-addconfigurationdebugging - -# We can also disable the individual processing steps. - -#-dontshrink -#-dontoptimize -#-dontobfuscate - -# Specifically target Android. - --android - -# The dex compiler ignores preverification information. - --dontpreverify - -# Reduce the size of the output some more. - --repackageclasses '' --allowaccessmodification - -# Switch off some optimizations that trip older versions of the Dalvik VM. - --optimizations !code/simplification/arithmetic - -# Keep a fixed source file attribute and all line number tables to get line -# numbers in the stack traces. - --renamesourcefileattribute SourceFile --keepattributes SourceFile,LineNumberTable - - -############################################################################### -# Settings to handle reflection in the code. -############################################################################### - -# RemoteViews might need annotations. - --keepattributes *Annotation* - -# Preserve all fundamental application classes. - --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 - -# Preserve all View implementations, their special context constructors, and -# their setters. - --keep public class * extends android.view.View { - public (android.content.Context); - public (android.content.Context, android.util.AttributeSet); - public (android.content.Context, android.util.AttributeSet, int); - public void set*(...); -} - -# Preserve all classes that have special context constructors, and the -# constructors themselves. - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - -# Preserve all classes that have special context constructors, and the -# constructors themselves. - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - -# Preserve all possible onClick handlers. - --keepclassmembers class * extends android.content.Context { - public void *(android.view.View); - public void *(android.view.MenuItem); -} - -# Preserve the special fields of all Parcelable implementations. - --keepclassmembers class * implements android.os.Parcelable { - static android.os.Parcelable$Creator CREATOR; -} - -# Preserve static fields of inner classes of R classes that might be accessed -# through introspection. - --keepclassmembers class **.R$* { - public static ; -} - -# Preserve annotated Javascript interface methods. - --keepclassmembers class * { - @android.webkit.JavascriptInterface ; -} - -# Preserve annotated and generated classes for Dagger. - --keepclassmembers,allowobfuscation class * { - @dagger.** *; -} - --keep class **$$ModuleAdapter --keep class **$$InjectAdapter --keep class **$$StaticInjection - --if class **$$ModuleAdapter --keep class <1> - --if class **$$InjectAdapter --keep class <1> - --if class **$$StaticInjection --keep class <1> - --keepnames class dagger.Lazy - -# Preserve annotated and generated classes for Butterknife. - --keep class **$$ViewBinder { - public static void bind(...); - public static void unbind(...); -} - --if class **$$ViewBinder --keep class <1> - --keep class **_ViewBinding { - (<1>, android.view.View); -} - --if class **_ViewBinding --keep class <1> - -# Preserve fields that are serialized with GSON. - -#-keepclassmembers class com.example.SerializedClass1, -# com.example.SerializedClass2 { -# ; -#} - --keepclassmembers,allowobfuscation class * { - @com.google.gson.annotations.SerializedName ; -} - --keep,allowobfuscation @interface com.google.gson.annotations.** - - -# Preserve the required interface from the License Verification Library -# (but don't nag the developer if the library is not used at all). - --keep public interface com.android.vending.licensing.ILicensingService - --dontnote com.android.vending.licensing.ILicensingService - -# The Android Compatibility library references some classes that may not be -# present in all versions of the API, but we know that's ok. - --dontwarn android.support.** - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your application doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your application may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface - - -############################################################################### -# Further optimizations. -############################################################################### - -# If you wish, you can let the optimization step remove Android logging calls. - -#-assumenosideeffects class android.util.Log { -# public static boolean isLoggable(java.lang.String, int); -# public static int v(...); -# public static int i(...); -# public static int w(...); -# public static int d(...); -# public static int e(...); -#} diff --git a/proguard/examples/standalone/applets.pro b/proguard/examples/standalone/applets.pro deleted file mode 100644 index 0dc4628..0000000 --- a/proguard/examples/standalone/applets.pro +++ /dev/null @@ -1,76 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process applets. -# Usage: -# java -jar proguard.jar @applets.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --injars in.jar --outjars out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod (!**.jar;!module-info.class) --libraryjars /jmods/java.desktop.jmod(!**.jar;!module-info.class) - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. Keep a fixed source file attribute and all line number -# tables to get line numbers in the stack traces. -# You can comment this out if you're not interested in stack traces. - --printmapping out.map --renamesourcefileattribute SourceFile --keepattributes SourceFile,LineNumberTable - -# Preserve all annotations. - --keepattributes *Annotation* - -# You can print out the seeds that are matching the keep options below. - -#-printseeds out.seeds - -# Preserve all public applets. - --keep public class * extends java.applet.Applet - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your library doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your application may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface diff --git a/proguard/examples/standalone/applications.pro b/proguard/examples/standalone/applications.pro deleted file mode 100644 index 734377d..0000000 --- a/proguard/examples/standalone/applications.pro +++ /dev/null @@ -1,83 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process applications. -# Usage: -# java -jar proguard.jar @applications.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --injars in.jar --outjars out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -#-libraryjars junit.jar -#-libraryjars servlet.jar -#-libraryjars jai_core.jar -#... - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. Keep a fixed source file attribute and all line number -# tables to get line numbers in the stack traces. -# You can comment this out if you're not interested in stack traces. - --printmapping out.map --renamesourcefileattribute SourceFile --keepattributes SourceFile,LineNumberTable - -# Preserve all annotations. - --keepattributes *Annotation* - -# You can print out the seeds that are matching the keep options below. - -#-printseeds out.seeds - -# Preserve all public applications. - --keepclasseswithmembers public class * { - public static void main(java.lang.String[]); -} - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your application doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your application may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface diff --git a/proguard/examples/standalone/library.pro b/proguard/examples/standalone/library.pro deleted file mode 100644 index 5c9ae0e..0000000 --- a/proguard/examples/standalone/library.pro +++ /dev/null @@ -1,87 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process a program -# library, such that it remains usable as a library. -# Usage: -# java -jar proguard.jar @library.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. -# In this case, the input jar is the program library that we want to process. - --injars in.jar --outjars out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -# Save the obfuscation mapping to a file, so we can de-obfuscate any stack -# traces later on. Keep a fixed source file attribute and all line number -# tables to get line numbers in the stack traces. -# You can comment this out if you're not interested in stack traces. - --printmapping out.map --keepparameternames --renamesourcefileattribute SourceFile --keepattributes Signature,Exceptions, - InnerClasses,PermittedSubclasses,EnclosingMethod, - Deprecated,SourceFile,LineNumberTable - -# Preserve all annotations. - --keepattributes *Annotation* - -# Preserve all public classes, and their public and protected fields and -# methods. - --keep public class * { - public protected *; -} - -# Preserve all .class method names. - --keepclassmembernames class * { - java.lang.Class class$(java.lang.String); - java.lang.Class class$(java.lang.String, boolean); -} - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your library doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your library may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface diff --git a/proguard/examples/standalone/midlets.pro b/proguard/examples/standalone/midlets.pro deleted file mode 100644 index 8561cdc..0000000 --- a/proguard/examples/standalone/midlets.pro +++ /dev/null @@ -1,69 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process J2ME midlets. -# Usage: -# java -jar proguard.jar @midlets.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --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 - -# Preverify the code suitably for Java Micro Edition. - --microedition - -# Allow methods with the same signature, except for the return type, -# to get the same obfuscation name. - --overloadaggressively - -# Put all obfuscated classes into the nameless root package. - --repackageclasses '' - -# Allow classes and class members to be made public. - --allowaccessmodification - -# On Windows, you can't use mixed case class names, -# should you still want to use the preverify tool. -# -# -dontusemixedcaseclassnames - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. - --printmapping out.map - -# You can keep a fixed source file attribute and all line number tables to -# get stack traces with line numbers. - -#-renamesourcefileattribute SourceFile -#-keepattributes SourceFile,LineNumberTable - -# You can print out the seeds that are matching the keep options below. - -#-printseeds out.seeds - -# Preserve all public midlets. - --keep public class * extends javax.microedition.midlet.MIDlet - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Your midlet may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface diff --git a/proguard/examples/standalone/proguard.pro b/proguard/examples/standalone/proguard.pro deleted file mode 100644 index cf89845..0000000 --- a/proguard/examples/standalone/proguard.pro +++ /dev/null @@ -1,95 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process ProGuard itself. -# Configuration files for typical applications will be very similar. -# Usage: -# java -jar proguard.jar @proguard.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --injars ../../lib/proguard.jar --outjars proguard_out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --libraryjars /jmods/java.sql.jmod (!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -# Write out an obfuscation mapping file, for de-obfuscating any stack traces -# later on, or for incremental obfuscation of extensions. - --printmapping proguard.map - -# Don't print notes about reflection in GSON code, the Kotlin runtime, and -# our own optionally injected code. - --dontnote kotlin.** --dontnote kotlinx.** --dontnote com.google.gson.** --dontnote proguard.configuration.ConfigurationLogger - -# Preserve injected GSON utility classes and their members. - --keep,allowobfuscation class proguard.optimize.gson._* --keepclassmembers class proguard.optimize.gson._* { - *; -} - -# Obfuscate class strings of injected GSON utility classes. - --adaptclassstrings proguard.optimize.gson.** - -# Allow methods with the same signature, except for the return type, -# to get the same obfuscation name. - --overloadaggressively - -# Put all obfuscated classes into the nameless root package. - --repackageclasses '' - -# Allow classes and class members to be made public. - --allowaccessmodification - -# The entry point: ProGuard and its main method. - --keep public class proguard.ProGuard { - public static void main(java.lang.String[]); -} - -# If you want to preserve the Ant task as well, you'll have to specify the -# main ant.jar. - -#-libraryjars /usr/local/java/ant/lib/ant.jar -#-adaptresourcefilecontents proguard/ant/task.properties -# -#-keep,allowobfuscation class proguard.ant.* -#-keepclassmembers public class proguard.ant.* { -# (org.apache.tools.ant.Project); -# public void set*(***); -# public void add*(***); -#} - -# If you want to preserve the Gradle task, you'll have to specify the Gradle -# jars. - -#-libraryjars /usr/local/java/gradle-4.2.1/lib/plugins/gradle-plugins-4.2.1.jar -#-libraryjars /usr/local/java/gradle-4.2.1/lib/gradle-base-services-4.2.1.jar -#-libraryjars /usr/local/java/gradle-4.2.1/lib/gradle-core-4.2.1.jar -#-libraryjars /usr/local/java/gradle-4.2.1/lib/groovy-all-2.4.12.jar - -#-keep public class proguard.gradle.* { -# public *; -#} - -# If you want to preserve the WTK obfuscation plug-in, you'll have to specify -# the kenv.zip file. - -#-libraryjars /usr/local/java/wtk2.5.2/wtklib/kenv.zip -#-keep public class proguard.wtk.ProGuardObfuscator diff --git a/proguard/examples/standalone/proguardgui.pro b/proguard/examples/standalone/proguardgui.pro deleted file mode 100644 index dc5ea6f..0000000 --- a/proguard/examples/standalone/proguardgui.pro +++ /dev/null @@ -1,80 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process the ProGuard GUI. -# Configuration files for typical applications will be very similar. -# Usage: -# java -jar proguard.jar @proguardgui.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. -# The input jars will be merged in a single output jar. - --injars ../../lib/proguardgui.jar --outjars proguardgui_out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod (!**.jar;!module-info.class) --libraryjars /jmods/java.sql.jmod (!**.jar;!module-info.class) --libraryjars /jmods/java.desktop.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -# Write out an obfuscation mapping file, for de-obfuscating any stack traces -# later on, or for incremental obfuscation of extensions. - --printmapping proguardgui.map - -# If we wanted to reuse the previously obfuscated proguard_out.jar, we could -# perform incremental obfuscation based on its mapping file, and only keep the -# additional GUI files instead of all files. - -#-applymapping proguard.map -#-injars ../../lib/proguardgui.jar -#-outjars proguardgui_out.jar -#-libraryjars ../../lib/proguard.jar(!proguard/ant/**,!proguard/wtk/**) -#-libraryjars ../../lib/retrace.jar -#-libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/java.desktop.jmod(!**.jar;!module-info.class) - -# Don't print notes about reflection in GSON code, the Kotlin runtime, and -# our own optionally injected code. - --dontnote kotlin.** --dontnote kotlinx.** --dontnote com.google.gson.** --dontnote proguard.configuration.ConfigurationLogger - -# Preserve injected GSON utility classes and their members. - --keep,allowobfuscation class proguard.optimize.gson._* --keepclassmembers class proguard.optimize.gson._* { - *; -} - -# Obfuscate class strings of injected GSON utility classes. - --adaptclassstrings proguard.optimize.gson.** - -# Allow methods with the same signature, except for the return type, -# to get the same obfuscation name. - --overloadaggressively - -# Put all obfuscated classes into the nameless root package. - --repackageclasses '' - -# Adapt the names of resource files, based on the corresponding obfuscated -# class names. Notably, in this case, the GUI resource properties file will -# have to be renamed. - --adaptresourcefilenames **.properties,**.gif,**.jpg - -# The entry point: ProGuardGUI and its main method. - --keep public class proguard.gui.ProGuardGUI { - public static void main(java.lang.String[]); -} diff --git a/proguard/examples/standalone/retrace.pro b/proguard/examples/standalone/retrace.pro deleted file mode 100644 index adf18d0..0000000 --- a/proguard/examples/standalone/retrace.pro +++ /dev/null @@ -1,61 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process the ReTrace tool. -# Configuration files for typical applications will be very similar. -# Usage: -# java -jar proguard.jar @retrace.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. -# The input jars will be merged in a single output jar. - --injars ../../lib/retrace.jar --outjars retrace_out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) --libraryjars /jmods/java.sql.jmod (!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -# Write out an obfuscation mapping file, for de-obfuscating any stack traces -# later on, or for incremental obfuscation of extensions. - --printmapping retrace.map - -# If we wanted to reuse the previously obfuscated proguard_out.jar, we could -# perform incremental obfuscation based on its mapping file, and only keep the -# additional ReTrace files instead of all files. - -#-applymapping proguard.map -#-outjars retrace_out.jar(proguard/retrace/**) - -# Don't print notes about reflection in GSON code, the Kotlin runtime, and -# our own optionally injected code. - --dontnote kotlin.** --dontnote kotlinx.** --dontnote com.google.gson.** --dontnote proguard.configuration.ConfigurationLogger - -# Allow methods with the same signature, except for the return type, -# to get the same obfuscation name. - --overloadaggressively - -# Put all obfuscated classes into the nameless root package. - --repackageclasses '' - -# Allow classes and class members to be made public. - --allowaccessmodification - -# The entry point: ReTrace and its main method. - --keep public class proguard.retrace.ReTrace { - public static void main(java.lang.String[]); -} diff --git a/proguard/examples/standalone/scala.pro b/proguard/examples/standalone/scala.pro deleted file mode 100644 index 279a674..0000000 --- a/proguard/examples/standalone/scala.pro +++ /dev/null @@ -1,140 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process Scala -# applications, including the Scala runtime. -# Usage: -# java -jar proguard.jar @scala.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --injars in.jar --injars /usr/local/java/scala-2.9.1/lib/scala-library.jar -#-injars /usr/local/java/scala-2.9.1/lib/scala-compiler.jar(!META-INF/MANIFEST.MF) -#-injars /usr/local/java/scala-2.9.1/lib/jline.jar(!META-INF/MANIFEST.MF) --outjars out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) -#-libraryjars /jmods/..... - -#-libraryjars /usr/local/java/ant/lib/ant.jar -#... - -# Ignore some compiler artefacts. - --dontwarn scala.** - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. Keep a fixed source file attribute and all line number -# tables to get line numbers in the stack traces. -# You can comment this out if you're not interested in stack traces. - --printmapping out.map --renamesourcefileattribute SourceFile --keepattributes SourceFile,LineNumberTable - -# Preserve all annotations. - --keepattributes *Annotation* - -# You can print out the seeds that are matching the keep options below. - -#-printseeds out.seeds - -# Preserve all public applications. - --keepclasseswithmembers public class * { - public static void main(java.lang.String[]); -} - -# Preserve some classes and class members that are accessed by means of -# introspection. - --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; -} - -# Preserve some classes and class members that are accessed by means of -# introspection in the Scala compiler library, if it is processed as well. - -#-keep class * implements jline.Completor -#-keep class * implements jline.Terminal - -#-keep class scala.tools.nsc.Global - -#-keepclasseswithmembers class * { -# (scala.tools.nsc.Global); -#} - -#-keepclassmembers class * { -# *** scala_repl_value(); -# *** scala_repl_result(); -#} - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your application doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your application may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface - diff --git a/proguard/examples/standalone/servlets.pro b/proguard/examples/standalone/servlets.pro deleted file mode 100644 index 5d74fc9..0000000 --- a/proguard/examples/standalone/servlets.pro +++ /dev/null @@ -1,77 +0,0 @@ -# -# This ProGuard configuration file illustrates how to process servlets. -# Usage: -# java -jar proguard.jar @servlets.pro -# - --verbose - -# Specify the input jars, output jars, and library jars. - --injars in.jar --outjars out.jar - -# Before Java 9, the runtime classes were packaged in a single jar file. -#-libraryjars /lib/rt.jar - -# As of Java 9, the runtime classes are packaged in modular jmod files. --libraryjars /jmods/java.base.jmod(!**.jar;!module-info.class) - --libraryjars /usr/local/java/servlet/servlet.jar - -# Save the obfuscation mapping to a file, so you can de-obfuscate any stack -# traces later on. Keep a fixed source file attribute and all line number -# tables to get line numbers in the stack traces. -# You can comment this out if you're not interested in stack traces. - --printmapping out.map --renamesourcefileattribute SourceFile --keepattributes SourceFile,LineNumberTable - -# Preserve all annotations. - --keepattributes *Annotation* - -# You can print out the seeds that are matching the keep options below. - -#-printseeds out.seeds - -# Preserve all public servlets. - --keep public class * implements javax.servlet.Servlet - -# Preserve all native method names and the names of their classes. - --keepclasseswithmembernames,includedescriptorclasses class * { - native ; -} - -# Preserve the special static methods that are required in all enumeration -# classes. - --keepclassmembers,allowoptimization enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - -# Explicitly preserve all serialization members. The Serializable interface -# is only a marker interface, so it wouldn't save them. -# You can comment this out if your library doesn't use serialization. -# If your code contains serializable classes that have to be backward -# compatible, please refer to the manual. - --keepclassmembers class * implements java.io.Serializable { - static final long serialVersionUID; - 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(); -} - -# Your application may contain more items that need to be preserved; -# typically classes that are dynamically created using Class.forName: - -# -keep public class com.example.MyClass -# -keep public interface com.example.MyInterface -# -keep public class * implements com.example.MyInterface diff --git a/proguard/lib/proguard-ant.jar b/proguard/lib/proguard-ant.jar deleted file mode 100644 index 2a2bd5f..0000000 Binary files a/proguard/lib/proguard-ant.jar and /dev/null differ diff --git a/proguard/lib/proguard.jar b/proguard/lib/proguard.jar deleted file mode 100644 index ed7d772..0000000 Binary files a/proguard/lib/proguard.jar and /dev/null differ diff --git a/proguard/lib/proguardgui.jar b/proguard/lib/proguardgui.jar deleted file mode 100644 index be54aa2..0000000 Binary files a/proguard/lib/proguardgui.jar and /dev/null differ diff --git a/proguard/lib/retrace.jar b/proguard/lib/retrace.jar deleted file mode 100644 index e8a7220..0000000 Binary files a/proguard/lib/retrace.jar and /dev/null differ