ProGuard
ProGuard, Java optimizer and obfuscator
...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. 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. 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.