Usage |
---|
java -jar proguard.jar
options ...
or
java proguard.ProGuard
options ...
Typically:
java -jar proguard.jar @myconfig.pro
Options |
---|
@ filename |
Short for '-include filename'. |
-include filename |
Read configuration commands from the given file. |
-libraryjars
jarname[:...] |
Specifies the library jars. |
-injars jarname[:...] |
Specifies the program jars. |
-outjar jarname |
Specifies the name of the output jar. |
-keep class_specification |
Preserve the specified classes and class members. |
-keepclassmembers
class_specification |
Preserve the specified class members, if their classes are preserved as well. |
-keepclasseswithmembers
class_specification |
Preserve the specified classes and class members, if all of the specified class members are present. |
-keepnames
class_specification |
Preserve the names of the specified classes and class members (if they aren't removed in the shrinking step). |
-keepclassmembernames
class_specification |
Preserve the names of the specified class members (if they aren't removed in the shrinking step). |
-keepclasseswithmembernames
class_specification |
Preserve the names of the specified classes and class members, if all of the specified class members are present (after the shrinking step). |
-keepattributes
[attribute_name,...] |
Preserve the given optional attributes; typically
LineNumberTable , LocalVariableTable ,
SourceFile , Deprecated , Synthetic ,
and InnerClasses . |
-renamesourcefileattribute
[string] |
Put the given constant string in the SourceFile
attributes. |
-printseeds [filename] |
List classes and class members matched by the various -keep
commands, to the standard output or to the given file. |
-printusage [filename] |
List dead code of the input class files, to the standard output or to the given file. |
-printmapping [filename] |
Print the mapping from old names to new names for classes and class members that have been renamed, to the standard output or to the given file. |
-verbose |
Write out some more information during processing. |
-dump [filename] |
Write out the internal structure of the processed class files, to the standard output or to the given file. |
-ignorewarnings |
Print warnings about unresolved references, but continue processing anyhow. |
-dontwarn |
Don't warn about unresolved references at all. |
-dontnote |
Don't print notes about class casts of variable dynamically created objects. |
-dontshrink |
Don't shrink the input class files. |
-dontobfuscate |
Don't obfuscate the input class files. |
-dontusemixedcaseclassnames |
Don't generate mixed-case class names while obfuscating. |
-overloadaggressively |
Apply aggressive overloading while obfuscating. |
-defaultpackage [package_name] |
Repackage all class files that are renamed into the single given package. |
-dontskipnonpubliclibraryclasses |
Don't ignore non-public library classes. |
Notes:
-keep Options
|
---|
Keep | From shrinking & obfuscation | From obfuscation only |
---|---|---|
Classes and class members | -keep |
-keepnames |
Class members only | -keepclassmembers |
-keepclassmembernames |
Classes and class members, if class members present | -keepclasseswithmembers |
-keepclasseswithmembernames |
Class Specifications |
---|
[[!]public|final|abstract ...] ([!]interface)|class classname [extends|implements classname] [{ [[!]public|private|protected|static|volatile|transient ...] <fields> | (fieldtype fieldname); [[!]public|private|protected|static|synchronized|native|abstract|strictfp ...] <methods> | <init>(argumenttype,...) | classname(argumenttype,...) | (returntype methodname(argumenttype,...)); [[!]public|private|protected|static ... ] *; ... }]
Notes:
?
' for a
single character, '*
' for any number of characters
(but not the package separator), and '**
' for any
number of (any) characters.