ProGuard

ProGuard – is an open source command-line tool that shrinks, optimizes and obfuscates Java code and makes application smaller and faster.

ProGuard first reads the input jars and writes the processed results to one or more output jars.

ProGuard steps

Each of these steps is optional.

  • Shrinking step - ProGuard detects and removes unused classes, fields, methods and attributes.
  • Optimization step - ProGuard analyzes and optimizes the bytecode of the methods.
  • Obfuscation step - ProGuard renames the remaining classes, fields, and methods using short meaningless names.
  • Preverification step - ProGuard adds preverification information to the classes, which is required for Java Micro Edition and for Java 6 and higher.

Static Gson ProGuard rules

Popular ProGuard rules