proguard is a free, open source build & deployment project written in Java and released under GPL-2.0. It has 3,662 GitHub stars, 485 forks and 176 open issues, and was last pushed 24 days ago. On this registry it ranks #38 of 59 tracked projects in Build & Deployment, with 5 head-to-head comparisons available. It gained 1 stars over the last 3 tracked days.

What is proguard?

What it is

ProGuard is a free Java bytecode tool that shrinks, optimizes, obfuscates, and preverifies compiled Java applications and libraries. It lives in the Java and Android build ecosystem as a post-compiler step, not as a source compiler or runtime dependency. The problem it solves is that Java bytecode often contains classes, fields, methods, attributes, and instructions that a specific application does not need. ProGuard removes unused parts, renames remaining program elements with short meaningless names, and applies optimizations such as method inlining, constant propagation, unused parameter removal, and identifier shortening. It can also remove logging code without source code changes.

Key capabilities

  • It detects and removes unused classes, fields, methods, and attributes from Java bytecode.
  • It optimizes bytecode by removing unused instructions, merging classes, inlining methods, propagating constants, and removing unused parameters.
  • It obfuscates remaining classes, fields, and methods with short meaningless names.
  • It can remove logging code from applications and libraries without source code changes.
  • It typically reduces application size by 20% to 90%, depending mostly on removable external libraries.
  • It may improve performance by up to 20%, though server and desktop JVM gains are often not noticeable.
  • It runs as a command-line tool or as a Gradle task.

Who uses it and how

  • Java developers use it to shrink and obfuscate applications and libraries before distribution.
  • Android developers use it as a build-tool step to reduce packaged bytecode size and rename program elements.
  • Teams integrate it into Gradle builds with a ProGuardTask that sets input jars, library jars, and output jars.
  • Users run it from the command line with a configuration file on Linux, macOS, or Windows.
  • Contributors build it from source with a Java 8 JDK and run the generated scripts from the bin directory.

Getting started

Download the latest release from GitHub releases, then run bin/proguard.sh on Linux or macOS or bin/proguard.bat on Windows with a configuration file such as myconfig.pro. For Gradle builds, add com.guardsquare:proguard-gradle:7.10.0 to the buildscript classpath and define a ProGuardTask with configuration, input jars, library jars, and output jars.

When to use it — and when not to

Use ProGuard when a Java or Android build needs bytecode-level shrinking, obfuscation, optimization, or preverification without changing source code. It fits projects that can add a configuration file or Gradle task to the build pipeline. It is less suitable when source-level minification, runtime-only debugging, or a permissive license is required, because ProGuard is licensed under GPL-2.0. Performance gains are often not noticeable on server and desktop JVMs, and size reduction depends mostly on removable external library code.

project readme (upstream, from github) — read inline



ProGuard


Quick StartFeaturesContributingLicense


ProGuard is a free shrinker, optimizer, obfuscator, and preverifier for Java bytecode:

  • 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.

The resulting applications and libraries are smaller and faster.

❓ Getting Help

Please use the issue tracker to report actual bugs 🐛, crashes, etc.

🚀 Quick Start

Command line

First, download the latest release from GitHub releases.

To run ProGuard, on Linux/MacOS, just type:

bin/proguard.sh <options...>

or on Windows:

bin\proguard.bat <options...>

Typically, you'll put most options in a configuration file (say, myconfig.pro), and just call

bin/proguard.sh @myconfig.pro

or on Windows:

bin\proguard.bat @myconfig.pro

All available options are described in the configuration section of the manual.

Gradle Task

ProGuard can be run as a task in Gradle. Before you can use the proguard task, you have to make sure Gradle can find it in its class path at build time. One way is to add the following line to your build.gradle file which will download ProGuard from Maven Central:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.guardsquare:proguard-gradle:7.10.0'
    }
}

You can then define a task with configuration:

tasks.register('proguard', ProGuardTask) {
    configuration file('proguard.pro')

    injars(tasks.named('jar', Jar).flatMap { it.archiveFile })

    // Automatically handle the Java version of this build.
    if (System.getProperty('java.version').startsWith('1.')) {
        // Before Java 9, the runtime classes were packaged in a single jar file.
        libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
    } else {
        // As of Java 9, the runtime classes are packaged in modular jmod files.
        libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
        //libraryjars "${System.getProperty('java.home')}/jmods/....."
    }

    verbose

    outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar"))
}

The embedded configuration is much like a standard ProGuard configuration. You can find more details on the Gradle setup page.

✨ Features

ProGuard works like an advanced optimizing compiler, removing unused classes, fields, methods, and attributes, shortening identifiers, merging classes, inlining methods, propagating constants, removing unused parameters, etc.

  • The optimizations typically reduce the size of an application by anything between 20% and 90%. The reduction mostly depends on the size of external libraries that ProGuard can remove in whole or in part.

  • The optimizations may also improve the performance of the application, by up to 20%. For Java virtual machines on servers and desktops, the difference generally isn't noticeable.

  • ProGuard can also remove logging code, from applications and their libraries, without needing to change the source code — in fact, without needing the source code at all!

The manual pages (markdown, html) cover the features and usage of ProGuard in detail.

💻 Building ProGuard

Building ProGuard is easy - you'll just need a Java 8 JDK installed. To build from source, clone a copy of the ProGuard repository and run the following command:

./gradlew assemble

The artifacts will be generated in the lib directory. You can then execute ProGuard using the scripts in bin, for example:

bin/proguard.sh

You can publish the artifacts to your local Maven repository using:

./gradlew publishToMavenLocal

🤝 Contributing

Contributions, issues and feature requests are welcome in both projects. Feel free to check the issues page and the contributing guide if you would like to contribute.

📝 License

Copyright (c) 2002-2025 Guardsquare NV. ProGuard is released under the GNU General Public License, version 2, with exceptions granted to a number of projects.

Frequently asked questions

Is proguard free to use?

proguard is open source under the GPL-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does proguard do?

ProGuard, Java optimizer and obfuscator

What is proguard written in?

proguard is primarily written in Java. Its source is publicly available at https://github.com/Guardsquare/proguard, and it has 3,662 GitHub stars.