Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 14 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ This distribution contains the following directories:
- 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

It also contains the source code and builds scripts:

- core : the ProGuard core
- retrace : the ReTrace tool
- gui : the ProGuard/ReTrace GUI
- gradle : the ProGuard Gradle plugin
- ant : the ProGuard Ant plugin
- wtk : the ProGuard WTK plugin
- annotations : the optional annotations to configure ProGuard
- buildscripts : various alternative build scripts


Expand All @@ -20,14 +29,14 @@ 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
cd examples/standalone
../../bin/proguard.sh @ proguard.pro

The resulting proguard_out.jar contains the same application, but it's a lot
smaller.

Enjoy!

http://proguard.sourceforge.net/
https://www.guardsquare.com/proguard

Copyright (c) 2002-2017 Eric Lafortune @ GuardSquare
Copyright (c) 2002-2018 Eric Lafortune @ GuardSquare
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ProGuard
========
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.
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and
preverifier. It detects and removes unused classes, fields, methods, and
attributes. It optimizes bytecode and removes unused instructions. It renames
the remaining classes, fields, and methods using short meaningless names.
Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.

ProGuard is useful for making code more compact and more efficient, on the
ProGuard is useful for making code more compact and more efficient, on the
desktop, on tablets, on smartphones, and on embedded devices. It also makes code
more difficult to reverse engineer.

This is a fork of ProGuard, You can find upstream here:
This is a fork of ProGuard, You can find upstream here:
http://sourceforge.net/p/proguard/

# Contributing
Expand All @@ -20,7 +20,7 @@ focused on making ProGuard itself faster while still having identical output.

## Building

ant -f buildscripts/build.xml proguard
bash core/build.sh
Then, you can use `lib/proguard.jar` as a drop in replacement for the
`proguard.jar` shipped with the Android SDK or used by your build tool.

Expand Down
16 changes: 16 additions & 0 deletions annotations/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Gradle build script for the ProGuard annotations.

apply plugin: 'java'

sourceSets.main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
include '**/*.properties'
include '**/*.gif'
include '**/*.png'
include '**/*.pro'
}
}
12 changes: 12 additions & 0 deletions annotations/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# GNU/Linux build script for ProGuard.

cd $(dirname "$0")

source ../buildscripts/functions.sh

MAIN_CLASS=proguard.annotation.*

compile $MAIN_CLASS && \
createjar "$ANNOTATIONS_JAR" || exit 1
47 changes: 47 additions & 0 deletions annotations/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- Ant build script for the ProGuard annotations. -->

<project name = "annotations"
default = "dist">

<target name = "clean">
<delete quiet = "true">
<fileset dir = "out"/>
</delete>
</target>

<target name = "out">
<mkdir dir = "out"/>
</target>

<target name = "compile" depends = "out">
<javac nowarn = "true"
deprecation = "false"
includeantruntime = "false"
srcdir = "src"
destdir = "out"
includes = "proguard/annotation/*.java">
<compilerarg value = "-Xlint:none"/>
</javac>
</target>

<target name = "resources" depends = "out">
<copy todir = "out">
<fileset dir = "src">
<include name = "proguard/*.properties"/>
<include name = "proguard/*.png"/>
<include name = "proguard/*.gif"/>
<include name = "proguard/*.pro"/>
</fileset>
</copy>
</target>

<target name = "lib">
<mkdir dir = "../lib"/>
</target>

<target name = "dist" depends = "compile,resources,lib">
<jar jarfile = "../lib/annotations.jar"
basedir = "out"/>
</target>

</project>
7 changes: 7 additions & 0 deletions annotations/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GNU/Linux makefile for the ProGuard annotations.

MAIN_CLASS = proguard/annotation/*
CLASSPATH =
TARGET = annotations

include ../buildscripts/functions.mk
34 changes: 34 additions & 0 deletions annotations/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Maven POM file for the ProGuard annotations. -->
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
<version>6.0.3</version>
<relativePath>../buildscripts/pom.xml</relativePath>
</parent>
<artifactId>proguard-annotations</artifactId>
<name>[${project.groupId}] ${project.artifactId}</name>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
25 changes: 25 additions & 0 deletions ant/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Gradle build script for the ProGuard Ant task.

apply plugin: 'java'

repositories {
jcenter()
}

sourceSets.main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
include '**/*.properties'
include '**/*.gif'
include '**/*.png'
include '**/*.pro'
}
}

dependencies {
compile project(':core')
compile 'org.apache.ant:ant:1.9.7'
}
31 changes: 31 additions & 0 deletions ant/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# GNU/Linux build script for the ProGuard Ant task.

cd $(dirname "$0")

source ../buildscripts/functions.sh

MAIN_CLASS=proguard.ant.ProGuardTask

ANT_HOME=${ANT_HOME:-/usr/local/java/ant}

ANT_JAR=$ANT_HOME/lib/ant.jar

# Make sure the Ant jar is present.
if [ ! -f "$ANT_JAR" ]; then
echo "Please make sure the environment variable ANT_HOME is set correctly,"
echo "if you want to compile the optional ProGuard Ant task."
exit 1
fi

# Make sure the ProGuard core has been compiled.
if [ ! -d ../core/$OUT ]; then
../core/build.sh || exit 1
fi

# Compile and package.
export CLASSPATH=../core/$OUT:$ANT_JAR

compile $MAIN_CLASS && \
updatejar "$PROGUARD_JAR" || exit 1
57 changes: 57 additions & 0 deletions ant/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!-- Ant build script for the ProGuard Ant task. -->

<project name = "ant"
default = "dist">

<property file = "build.properties"/>

<target name = "clean">
<delete quiet = "true">
<fileset dir = "out"/>
</delete>
</target>

<target name = "out">
<mkdir dir = "out"/>
</target>

<target name = "core">
<ant dir = "../core"
target = "compile"
inheritAll = "false"/>
</target>

<target name = "compile" depends = "out,core">
<javac nowarn = "true"
deprecation = "false"
includeantruntime = "true"
classpath = "../core/out"
srcdir = "src"
destdir = "out"
includes = "proguard/ant/ProGuardTask.java">
<compilerarg value = "-Xlint:none"/>
</javac>
</target>

<target name = "resources" depends = "out">
<copy todir = "out">
<fileset dir = "src">
<include name = "**/*.properties"/>
<include name = "**/*.png"/>
<include name = "**/*.gif"/>
<include name = "**/*.pro"/>
</fileset>
</copy>
</target>

<target name = "lib">
<mkdir dir = "../lib"/>
</target>

<target name = "dist" depends = "compile,resources,lib">
<jar jarfile = "../lib/proguard.jar"
update = "true"
basedir = "out"/>
</target>

</project>
15 changes: 15 additions & 0 deletions ant/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GNU/Linux makefile for the ProGuard Ant task.

ifndef ANT_HOME
ANT_HOME = /usr/local/java/ant
endif

MAIN_CLASS = proguard/ant/ProGuardTask
ANT_JAR = $(ANT_HOME)/lib/ant.jar
CLASSPATH = ../core/$(OUT):$(ANT_JAR)
TARGET = proguard
UPDATE_JAR = true

include ../buildscripts/functions.mk

$(ANT_JAR): ; $(error Please make sure ANT_HOME is set correctly)
25 changes: 5 additions & 20 deletions buildscripts/maven/ant/pom.xml → ant/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Maven POM file for the ProGuard Ant task. -->
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand All @@ -7,30 +8,20 @@
<parent>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-parent</artifactId>
<version>5.3.3</version>
<relativePath>../pom.xml</relativePath>
<version>6.0.3</version>
<relativePath>../buildscripts/pom.xml</relativePath>
</parent>
<artifactId>proguard-anttask</artifactId>
<name>[${project.groupId}] ${project.artifactId}</name>

<build>
<sourceDirectory>../../../src</sourceDirectory>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<includes>
<include>proguard/ant/**</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<includes>
<include>proguard/ant/**.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -44,17 +35,11 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<subpackages>proguard.ant</subpackages>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>../../../src</directory>
<includes>
<include>proguard/ant/**</include>
</includes>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
Expand Down
1 change: 1 addition & 0 deletions ant/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
includeFlat 'core'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2017 Eric Lafortune @ GuardSquare
* Copyright (c) 2002-2018 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
Expand Down
Loading