ProGuard vs R8
ProGuard
guardsquare.comR8
r8.googlesource.comSide by side
| Figure | ProGuard | R8 |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | — |
| macOS | Yes | — |
| Linux | Yes | Yes |
| Android | Yes | — |
| API | — | Yes |
| Plans published | 1 | 1 |
| Spec score · Code Obfuscation Software | 7.7 (#20) | 8.0 (#11) |
| Obfuscation | ProGuard renames remaining classes, fields, and methods using short meaningless names. | R8 shortens class, field, and method names to reduce DEX file size. |
| Optimization | The optimizer optimizes bytecode and removes unused instructions. | R8 removes unreachable code and can optimize execution through method inlining and class merging. |
Plans
In their own words
ProGuard
ProGuard is a free, open-source command-line tool for shrinking Java bytecode and optimizing code. It processes Java class files by removing unused classes, fields, methods, attributes, and instructions, then renaming remaining classes, fields, and methods with short meaningless names. It also preverifies code, producing smaller and faster applications and libraries. Guardsquare describes ProGuard as suitable for Java and Kotlin apps in mobile, embedded, and desktop environments. Build setup is documented for Android Gradle, Java or Kotlin Gradle, Ant, and Maven projects, and Android's default shrinker, R8, is compatible with ProGuard configuration. ProGuard Playground lets developers experiment with and share keep rules without rebuilding an app. ProGuardCORE is a separate free, open-source library for reading, writing, analyzing, and processing Java bytecode, including Kotlin metadata. Library jars or equivalent paths must be specified as inputs, and ProGuard leaves those libraries unchanged. Code called dynamically through reflection may need to be declared as an entry point in configuration. ProGuard runs on Android, Linux, macOS, and Windows.