Obfuscating Jar files with other Jar files embedded

与世无争的帅哥 提交于 2019-12-10 09:37:51

问题


So figure we have a Jar file with our Java application, and it has inside of it the Jar files for the libraries it depends of, a the jdbc or any other third party jar.

How do you proceed to obfuscate it with free software? I mean, obfuscate your code and leave the Jars untouched.

I tried with Proguard, to no avail. Even the author told me at the sourceforge forums it wasn't possible.

But you can do it manually with an ugly hack involving the renaming of the jar to zip and mangling with the inner data, so, why wouldn't a software be able to do it?


回答1:


You can create a single jar from multiple jars using Jar Jar Links. Then you process the result with ProGuard.




回答2:


Presumably, you have some sort of build script in place to compile your source, package it with the other jars (One-Jar/Fat Jar/etc.), and build your jar.

You should be able to insert the obfuscation task between the compilation and packaging.

If your obfuscation tool of choice will only take a jar input, you should be able to compile, jar, and obfuscate your code independently. After that, have your script unjar the obfuscated file and do your packaging.




回答3:


Don't waste your time. Anyone can decompile your obfuscated code, the only thing you're going to do is frustrate your legitimate users who want to debug problems with your software.

Obfuscation is a technical solution (and a poor one at that) to a legal problem.



来源:https://stackoverflow.com/questions/820261/obfuscating-jar-files-with-other-jar-files-embedded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!