简体   繁体   English

包括外部文件以接收库重命名吗?

[英]Include outside files to receive the libraries renaming?

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 ? 使用yguard我混淆了一个项目,我想知道是否可以在建筑物外部包含文件以仅接收库和函数的新命名模式?

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.AB 例如,我混淆了com.MyClass.MyInternalClasses类,在我的项目之外,我有mysql.java文件,而在mysql.java内部,我使用了MyInternetClasses中的某个类,但是由于混淆了它,所以名称已更改为某种名称否则说com.AB

So what it would do is read that java file and replace the names of all obfuscated name changed on it. 因此,它将读取该Java文件并替换其上更改的所有混淆名称的名称。

Or what would be the best approch to it ? 或最佳选择是什么?

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. 通常,方法是混淆代码的大部分,但不要混淆公共接口-您可以使用keep元素指定它们。 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. 一种替代方法是使用map元素手动指定要在外部使用的接口的重命名,然后可以更改调用代码以使用这些名称。 The renames applied by yGUARD are logged, so you could extract the names from there - but that's starting to get messy. yGUARD应用的重命名被记录下来,因此您可以从那里提取名称-但这开始变得混乱。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM