Is there a java obfuscator which obfuscates the method body but retains the method name as it is?
What I want is to 开发者_Go百科obfuscate my java file but want to keep the class name and method name as it is. Is there any java obfuscator which provides such functionality?
I have tried pro guard gui obfuscator but can't get what I want.
ProGuard can do what you describe. If you don't want it to rename classes and methods:
-keep,allowshrinking,allowoptimization class * { <methods>; }
If you don't want it to rename, remove, or optimize any entry points at all (e.g. merge classes, inline short methods, inline constant fields, remove unused parameters, etc.):
-keep class * { *; }
At that point, there won't be much room left to optimize or obfuscate the method bodies, so you may want to evaluate if this is really what you want.
See Allatori. It allows you to specify which names you don't want renamed.
To expand, you would specify the names you want to keep using a configuration file.
<keep-names>
<class access="private+"/>
<field access="private+"/>
<method access="private+"/>
</keep-names>
The above snippet shows how you can omit name obfuscation. This particular example ignores class, field and method types that have private access or above (i.e. all class, field and method types).
Take a look at Zelix KlassMaster.
See our Java Obfuscator. You can tell it which identifiers must be preserved in the obfuscated program.
The company I work for has long produced a java obfuscator called dashO that can do just this. So add that to the list of evals to try out if you're so inclined :)
精彩评论