更改第三方JAR的安全权限?

发布于 2024-12-29 17:58:43 字数 128 浏览 2 评论 0原文

我在我的小程序中使用第三方库,打包在 JAR 中,该库请求用户计算机的完全权限并提供安全证书。我不会将其用于任何需要许可的目的。有没有办法修改 JAR,使其在访问时不再请求此类权限?如果我从 JAR 中删除安全证书并重新压缩它,它会起作用吗?

I am using a third party library in my applet, packaged in a JAR, that is requesting for full permissions on the user's computer and presenting a security certificate. I am not using it for any purpose that would require permissions. Is there any way to modify the JAR so it no longer requests such permissions when accessed? If I remove the security certificate from the JAR and re-compress it, will it function?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他是夢罘是命 2025-01-05 17:58:43

有多种方法可以去除数字签名。

  1. 使用 Jar 工具提取 Jar,然后制作一个包含类和类的新 Jar。资源。
  2. 使用 Ant 也可以执行相同的操作。
  3. 将文件扩展名更改为 .zip 并在 Zip 工具中打开它,该工具将允许您删除 META-INF 目录。然后将其重命名回 .jar。丑陋的黑客,可能有副作用。

如果我从 JAR 中删除安全证书并重新压缩它,它会起作用吗?

它正在做的某些事情可能需要信任,但并不是立即显而易见的。如果是这样,Java 控制台应该会有所帮助。在 Oracle JRE 上,您可以拒绝安全提示来检查此项,代码将在沙盒中加载。这不适用于 Iced Tea JRE,如果用户拒绝信任对话框,它根本不会加载小程序。

There are a number of ways to strip the digital signatures.

  1. Use the Jar tool to extract the Jar, then make a new Jar of the classes & resources.
  2. Use Ant to do the same.
  3. Change the file extension to .zip and open it in a Zip tool that will allow you to delete the META-INF directory. Then rename it back to .jar. Ugly hack, might have side effects.

If I remove the security certificate from the JAR and re-compress it, will it function?

There may be things it is doing that require trust but are not immediately apparent. If so, the Java Console should be helpful. On Oracle JREs, you can refuse the security prompt to check this, the code will be loaded sand-boxed. That won't work on an Iced Tea JRE, which will not load the applet at all if the user refuses the trust dialog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文