简体   繁体   English

混淆了嵌入了其他Jar文件的Jar文件

[英]Obfuscating Jar files with other Jar files embedded

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. 因此,我们在Java应用程序中有一个Jar文件,它内部包含它所依赖的库的jar文件,jdbc或任何其他第三方jar。

How do you proceed to obfuscate it with free software? 你如何使用免费软件进行模糊处理? I mean, obfuscate your code and leave the Jars untouched. 我的意思是,混淆你的代码并保持Jars不变。

I tried with Proguard , to no avail. 我试过Proguard ,但没有用。 Even the author told me at the sourceforge forums it wasn't possible. 即便是作者在sourceforge论坛上告诉我也不可能。

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? 但你可以手动完成一个丑陋的黑客攻击,将jar重命名为zip并对内部数据进行修改,那么,为什么软件无法做到呢?

You can create a single jar from multiple jars using Jar Jar Links . 您可以使用Jar Jar Links从多个罐子中创建一个罐子。 Then you process the result with ProGuard . 然后使用ProGuard处理结果。

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. 据推测,您可以使用某种构建脚本来编译源代码,将其与其他jar(One-Jar / Fat Jar /等)打包,并构建您的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. 如果您选择的混淆工具只接受jar输入,那么您应该能够独立编译,jar和混淆代码。 After that, have your script unjar the obfuscated file and do your packaging. 之后,让您的脚本解开混淆的文件并进行打包。

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. 混淆是一种法律问题的技术解决方案(而且很差)。

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

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