首先附上官網的地址:http://proguard.sourceforge.net/
並未完全介紹,選擇其中的一部分來介紹
manual:proguard 指南 菜單項
一些基礎的命令:
運行proguard
java -jar proguard.jar
options ...
配置自己設置
java -jar proguard.jar @myconfig.pro
命令行執行配置
java
-jar proguard.jar @myconfig.pro -xxx
1 inputs/outputs
-include filename 從給定的文件名讀取配置項
-basedirectory directoryname 指定基本路徑
-injars classpath 指定該應用jar包引用路徑
-outjars classpath
-libraryjars classpath 指定類庫路徑
-skipnonpubliclibraryclasses 跳過非公共類
-dontskipnonpubliclibraryclasses
-keepdirectories [directory-filter]
-target version
-forceprocessing
2 keep options
3 shrinking options
4 optimize options
5 obfuscation options
6 preverification options
7 general options
8 class paths
- 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 zip file, containing any of the above,
- A directory (structure), containing any of the above
- 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 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.
- 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.
9 file names
- 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.