I have a JAR file that contains classes with sensitive names that ideally I would like to prevent customers of the software seeing. As I understand it, a JAR file is essentially just a ZIP file containing one file of JVM bytecode for each class, named appropriately, so there would be nothing to stop our customer opening the JAR file in a ZIP utility and reading the names of all the classes.
Short of renaming our source classes to “NoneOfYourBusinessClass1” etc., are there any tools available that could automatically obfuscate the contents of built JARs without requiring changes to the source code?
ProGuard is a pretty good obfuscator. You don’t need to change any of your source code, and it can also do a few other things like remove unused classes to reduce the overall size of the jar.
Google chose it for inclusion in the Android SDK to reduce the size of Android applications.