Back to Glossary

ProGuard

ProGuard is a Java bytecode optimizer and obfuscator that shrinks, optimizes, and protects Android app code by removing unused code and renaming classes and methods.

ProGuard is a command-line tool that processes Java bytecode to reduce APK size through dead code elimination, optimize performance through bytecode-level improvements, and obfuscate code by renaming packages, classes, and members with short meaningless names. Originally developed for general Java applications, ProGuard became the standard Android code shrinker and obfuscator for many years, integrated directly into Android’s build system through Gradle configuration. The tool analyzes code dependencies to identify unused classes, methods, and fields, removes them from the final binary, and then applies obfuscation rules to protect remaining code from reverse engineering.

ProGuard configuration requires careful rule definition to prevent unintended removal of code accessed through reflection, serialization, or native methods, making it necessary to specify keep rules for entry points, model classes, and third-party library interfaces. The tool generates mapping files that translate obfuscated names back to original names, essential for decoding production crash reports and debugging issues in released apps. While ProGuard significantly reduces app size and improves security, improper configuration can cause runtime crashes when required code gets removed or when reflection-based frameworks can’t locate renamed classes.

Android’s ecosystem has largely moved toward R8 as ProGuard’s successor, offering improved performance and better integration with Android’s build tools. However, understanding ProGuard remains valuable because many existing projects still use it, ProGuard rules remain compatible with R8, and the concepts of code shrinking and obfuscation apply across both tools.

Want to learn more about app development?

Explore our complete glossary of 182 terms covering everything from mobile development to deployment.

Browse All Terms