Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple way to rename all java classes, fields and methods?

I need to send part of our code for one of our tool vendors, and I want to remove all references to our project from our classes.

There are dozens of obfuscators available for java, but I don't want to scramble the code, just do as simple and consistent as possible renaming. (Maybe this is configurable in some of the obfuscators?) Best option would be to have something like classes A, B, C, methods a1, a2, a3...

It would also be great if the tool was somehow integrated with Eclipse's refactor/rename option, but this is not necessary.

like image 446
tputkonen Avatar asked Jan 25 '26 22:01

tputkonen


1 Answers

ProGuard can be used to obfuscate using a predefined mapping with the -applymapping filename option. In combination with the -dontshrink and -dontoptimize options it may do what you want. I am not awair of a general eclipse plugin, but if you are building with ant, there is an task included in the distribution.

like image 86
Reuben Peeris Avatar answered Jan 28 '26 10:01

Reuben Peeris