混淆 Struts2 Web 应用程序
我想混淆使用 Struts2 框架的 J2EE 应用程序,我尝试使用 Proguard 但它更改的包和类名没有反映到 stuts.xml 文件中,是否不可能混淆 struts2 Web 应用程序?或者还有其他方式吗?
I want to obfuscate J2EE application which uses Struts2 framework, I tried using Proguard but its changing package and class names which does not get reflected stuts.xml file, Is it impossible to obfuscate struts2 web application ? Or any other way ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实上,一旦源代码被混淆,ProGuard 就会生成一个日志文件,可用于以类似 grep 的方式替换 xml 文件中的类名。否则,也可以排除扩展 proGuard 中特定类或接口的类。这样,您的 struts 操作就不会被混淆(这是一种较弱的混淆策略),但应用程序的其余部分将会被混淆。
In fact, once the sources has been obfuscated, ProGuard generates a log file that can be used to replace class names in xml file, in a grep-like way. Otherwise, it is also possible to exclude classes extending a specific class or interface in proGuard. This way, your struts actions won't be ofbuscated (which is a lamer obfuscation strategy) but the rest of your application will be.
一般来说,在依赖反射的动态框架(无论是 OSGi 还是 Web 容器)之上运行的应用程序中混淆名称是一个坏主意。您永远不知道框架想要加载或按名称查询哪些实体,以及混淆是否会扰乱众多第三方组件...
阅读有关此内容以及混淆的三种替代方案的更多信息 通过混淆器及其他方式保护您的 Java 代码
In general, it is a bad idea to obfuscate names in an application running on top of a dynamic framework that relies on reflection, being it OSGi or a Web container. You never know what entities the framework would want to load or query by name, and whether obfuscation might upset the numerous third-party components...
Read more about this and about the three alternatives to obfuscation in Protect Your Java Code - Through Obfuscators And Beyond