Question

Using yguard I am obfuscating a project and I would like to know IF it is possible to include files outside the building to receive only the libraries and functions new naming schema ?

For example, I am obfuscating the class com.MyClass.MyInternalClasses and outside my project I have the file mysql.java and inside mysql.java I make use of some class from MyInternetClasses but since I obfuscated it, the name has been changed to something else let's say com.A.B

So what it would do is read that java file and replace the names of all obfuscated name changed on it.

Or what would be the best approch to it ?

Was it helpful?

Solution

Commonly the approach is to obfuscate the main bulk of your code, but leave the public interfaces unobfuscated - you specify them using the keep element. That way the user of the code need not be aware of the obfuscation. If you find that your public interfaces contain code you wish to obfuscate, then a small redesign (use a bit of delegation, or create a minimal facade that is public) should enable you to separate the public from the 'secret'.

An alternative is to use the map element to manually specify the renaming for the interfaces you wish to use externally, then you can alter the calling code to use these names. The renames applied by yGUARD are logged, so you could extract the names from there - but that's starting to get messy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top