Products
Products
Open-source Technology
Solutions
Resources
Company
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:
You can also build ProGuard from source by following the build instructions.
Firstly, download a ProGuard release or build ProGuard from source. ProGuard can then be executed directly from the command line by calling a script found in the bin
directory:
bin/proguard.sh -injars path/to/my-application.jar \
-outjars path/to/obfuscated-application.jar \
-libraryjars path/to/java/home/lib/rt.jar
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.
The ProGuard artifacts are hosted at Maven Central.
When working on your Android application (apk, aab) or library (aar), you can include ProGuard in your Gradle build by:
build.gradle
file (AGP 4.x - 7.x).gradle.properties
(only applicable for AGP < 7).For more detailed information see Android Gradle.
Your non-mobile Java or Kotlin applications can execute ProGuard's Gradle task:
task myProguardTask(type: proguard.gradle.ProGuardTask) {
.....
}
For more detailed information see Java/Kotlin Gradle.
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:
<taskdef resource="proguard/ant/task.properties"
classpath="/usr/local/java/proguard/lib/proguard.jar" />
For more detailed information see Ant.
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: