forked from Guardsquare/proguard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ProGuard
committed
Mar 18, 2013
0 parents
commit 0dbfaec
Showing
758 changed files
with
128,741 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ProGuard, Java class file shrinker, optimizer, obfuscator, and preverifier | ||
========================================================================== | ||
|
||
This distribution contains the following directories: | ||
|
||
- bin : simple wrapper scripts to run ProGuard, its GUI, and ReTrace | ||
- lib : the main jars, compiled and ready to use with "java -jar ...." | ||
- docs : the complete documentation, licenses, etc. in html format | ||
- examples : some example configuration files | ||
- src : the source code | ||
- build : various alternative build scripts | ||
|
||
|
||
The best place to start is docs/index.html | ||
|
||
|
||
Example | ||
======= | ||
|
||
If you want to give ProGuard a spin right away, try processing the ProGuard | ||
jar itself: | ||
|
||
cd examples | ||
java -jar ../lib/proguard.jar @proguard.pro | ||
|
||
The resulting proguard_out.jar contains the same application, but it's a lot | ||
smaller. | ||
|
||
Enjoy! | ||
|
||
http://proguard.sourceforge.net/ | ||
|
||
Copyright (c) 2002-2013 Eric Lafortune ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@ECHO OFF | ||
|
||
REM Start-up script for ProGuard -- free class file shrinker, optimizer, | ||
REM obfuscator, and preverifier for Java bytecode. | ||
REM | ||
REM Note: when passing file names containing spaces to this script, | ||
REM you'll have to add escaped quotes around them, e.g. | ||
REM "\"C:/My Directory/My File.txt\"" | ||
|
||
IF EXIST "%PROGUARD_HOME%" GOTO home | ||
SET PROGUARD_HOME=.. | ||
:home | ||
|
||
java -jar "%PROGUARD_HOME%\lib\proguard.jar" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# | ||
# Start-up script for ProGuard -- free class file shrinker, optimizer, | ||
# obfuscator, and preverifier for Java bytecode. | ||
# | ||
# Note: when passing file names containing spaces to this script, | ||
# you'll have to add escaped quotes around them, e.g. | ||
# "\"/My Directory/My File.txt\"" | ||
|
||
PROGUARD_HOME=`dirname "$0"`/.. | ||
|
||
java -jar $PROGUARD_HOME/lib/proguard.jar "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@ECHO OFF | ||
|
||
REM Start-up script for the GUI of ProGuard -- free class file shrinker, | ||
REM optimizer, obfuscator, and preverifier for Java bytecode. | ||
REM | ||
REM Note: when passing file names containing spaces to this script, | ||
REM you'll have to add escaped quotes around them, e.g. | ||
REM "\"C:/My Directory/My File.txt\"" | ||
|
||
IF EXIST "%PROGUARD_HOME%" GOTO home | ||
SET PROGUARD_HOME=.. | ||
:home | ||
|
||
java -jar "%PROGUARD_HOME%\lib\proguardgui.jar" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# | ||
# Start-up script for the GUI of ProGuard -- free class file shrinker, | ||
# optimizer, obfuscator, and preverifier for Java bytecode. | ||
# | ||
# Note: when passing file names containing spaces to this script, | ||
# you'll have to add escaped quotes around them, e.g. | ||
# "\"/My Directory/My File.txt\"" | ||
|
||
PROGUARD_HOME=`dirname "$0"`/.. | ||
|
||
# On Linux, Java 1.6.0_24 and higher hang when starting the GUI: | ||
# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7027598 | ||
# We're using the -D option as a workaround. | ||
java -DsuppressSwingDropSupport=true -jar $PROGUARD_HOME/lib/proguardgui.jar "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@ECHO OFF | ||
|
||
REM Start-up script for Retrace -- companion tool for ProGuard, free class file | ||
REM shrinker, optimizer, obfuscator, and preverifier for Java bytecode. | ||
REM | ||
REM Note: when passing file names containing spaces to this script, | ||
REM you'll have to add escaped quotes around them, e.g. | ||
REM "\"C:/My Directory/My File.txt\"" | ||
|
||
IF EXIST "%PROGUARD_HOME%" GOTO home | ||
SET PROGUARD_HOME=.. | ||
:home | ||
|
||
java -jar "%PROGUARD_HOME%\lib\retrace.jar" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
# | ||
# Start-up script for Retrace -- companion tool for ProGuard, free class file | ||
# shrinker, optimizer, obfuscator, and preverifier for Java bytecode. | ||
# | ||
# Note: when passing file names containing spaces to this script, | ||
# you'll have to add escaped quotes around them, e.g. | ||
# "\"/My Directory/My File.txt\"" | ||
|
||
PROGUARD_HOME=`dirname "$0"`/.. | ||
|
||
java -jar $PROGUARD_HOME/lib/retrace.jar "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ProGuard, Java class file shrinker, optimizer, obfuscator, and preverifier | ||
========================================================================== | ||
|
||
This directory contains a number of alternative ways to build ProGuard: | ||
|
||
- build.sh : a shell script for GNU/Linux | ||
- makefile : a makefile for GNU/Linux | ||
- build.xml : an Ant build file for all platforms | ||
- maven/pom.xml : a Maven POM for building the Maven artifacts | ||
|
||
- As a final alternative, you can also easily compile the code from the | ||
command line: | ||
|
||
mkdir classes | ||
javac -sourcepath src -d classes src/proguard/ProGuard.java | ||
javac -sourcepath src -d classes src/proguard/gui/ProGuardGUI.java | ||
javac -sourcepath src -d classes src/proguard/retrace/ReTrace.java | ||
|
||
For the ProGuard Ant task: | ||
|
||
javac -sourcepath src -d classes -classpath lib/ant.jar \ | ||
src/proguard/ant/ProGuardTask.java | ||
|
||
For the ProGuard Gradle task: | ||
|
||
javac -sourcepath src -d classes -classpath ..... \ | ||
src/proguard/gradle/ProGuardTask.java | ||
|
||
For the Java Micro Edition Wireless Tool Kit (JME WTK) obfuscator plug-in: | ||
|
||
javac -sourcepath src -d classes -classpath wtklib/kenv.zip \ | ||
src/proguard/wtk/ProGuardObfuscator.java | ||
|
||
Note that you'll have to install Ant and the JME WTK yourself. | ||
|
||
Enjoy! | ||
|
||
http://proguard.sourceforge.net/ | ||
|
||
Copyright (c) 2002-2013 Eric Lafortune ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ant build properties for ProGuard. | ||
|
||
gradle.home = /usr/local/java/gradle | ||
wtk.home = /usr/local/java/wtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/bin/bash | ||
# | ||
# GNU/Linux build script for ProGuard. | ||
|
||
# | ||
# Configuration. | ||
# | ||
|
||
ANT_HOME=${ANT_HOME:-/usr/local/java/ant} | ||
GRADLE_HOME=${GRADLE_HOME:-/usr/local/java/gradle} | ||
WTK_HOME=${WTK_HOME:-/usr/local/java/wtk} | ||
|
||
if [ -z $PROGUARD_HOME ]; then | ||
PROGUARD_HOME=$(which "$0") | ||
PROGUARD_HOME=$(dirname "$0")/.. | ||
fi | ||
|
||
cd "$PROGUARD_HOME" | ||
|
||
SRC=src | ||
CLASSES=classes | ||
LIB=lib | ||
|
||
PROGUARD=proguard/ProGuard | ||
PROGUARD_GUI=proguard/gui/ProGuardGUI | ||
RETRACE=proguard/retrace/ReTrace | ||
ANT_TASK=proguard/ant/ProGuardTask | ||
GRADLE_TASK=proguard/gradle/ProGuardTask | ||
WTK_PLUGIN=proguard/wtk/ProGuardObfuscator | ||
|
||
ANT_JAR=$ANT_HOME/lib/ant.jar | ||
GRADLE_PATH=\ | ||
$GRADLE_HOME/lib/plugins/gradle-plugins-1.3.jar:\ | ||
$GRADLE_HOME/lib/gradle-base-services-1.3.jar:\ | ||
$GRADLE_HOME/lib/gradle-core-1.3.jar:\ | ||
$GRADLE_HOME/lib/groovy-all-1.8.6.jar | ||
WTK_JAR=$WTK_HOME/wtklib/kenv.zip | ||
|
||
PROGUARD_JAR=$LIB/proguard.jar | ||
PROGUARD_GUI_JAR=$LIB/proguardgui.jar | ||
RETRACE_JAR=$LIB/retrace.jar | ||
|
||
# | ||
# Function definitions. | ||
# | ||
|
||
function compile { | ||
# Compile java source files. | ||
echo "Compiling ${1//\//.} ..." | ||
javac -nowarn -Xlint:none -sourcepath "$SRC" -d "$CLASSES" \ | ||
"$SRC/$1.java" 2>&1 \ | ||
| sed -e 's|^| |' | ||
|
||
# Copy resource files. | ||
(cd "$SRC"; find $(dirname $1) -maxdepth 1 \ | ||
\( -name \*.properties -o -name \*.png -o -name \*.gif -o -name \*.pro \) \ | ||
-exec cp --parents {} "../$CLASSES" \; ) | ||
} | ||
|
||
function createjar { | ||
echo "Creating $2..." | ||
jar -cfm "$2" "$SRC/$(dirname $1)/MANIFEST.MF" -C "$CLASSES" $(dirname $1) | ||
} | ||
|
||
function updatejar { | ||
echo "Updating $PROGUARD_JAR..." | ||
jar -uf "$PROGUARD_JAR" -C "$CLASSES" $(dirname $1) | ||
} | ||
|
||
# | ||
# Main script body. | ||
# | ||
|
||
mkdir -p "$CLASSES" | ||
|
||
compile $PROGUARD | ||
createjar $PROGUARD "$PROGUARD_JAR" | ||
|
||
compile $PROGUARD_GUI | ||
createjar $PROGUARD_GUI "$PROGUARD_GUI_JAR" | ||
|
||
compile $RETRACE | ||
createjar $RETRACE "$RETRACE_JAR" | ||
|
||
if [ -f "$ANT_JAR" ]; then | ||
export CLASSPATH=$ANT_JAR | ||
compile $ANT_TASK | ||
updatejar $ANT_TASK | ||
else | ||
echo "Please make sure the environment variable ANT_HOME is set correctly," | ||
echo "if you want to compile the optional ProGuard Ant task." | ||
fi | ||
|
||
if [ -f "${GRADLE_PATH%%:*}" ]; then | ||
export CLASSPATH=$GRADLE_PATH | ||
compile $GRADLE_TASK | ||
updatejar $GRADLE_TASK | ||
else | ||
echo "Please make sure the environment variable GRADLE_HOME is set correctly," | ||
echo "if you want to compile the optional ProGuard Gradle task." | ||
fi | ||
|
||
if [ -f "$WTK_JAR" ]; then | ||
export CLASSPATH=$WTK_JAR | ||
compile $WTK_PLUGIN | ||
updatejar $WTK_PLUGIN | ||
else | ||
echo "Please make sure the environment variable WTK_HOME is set correctly," | ||
echo "if you want to compile the optional ProGuard WTK plugin." | ||
fi |
Oops, something went wrong.