更改第三方JAR的安全权限?
我在我的小程序中使用第三方库,打包在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以去除数字签名。
.zip
并在 Zip 工具中打开它,该工具将允许您删除META-INF
目录。然后将其重命名回.jar
。丑陋的黑客,可能有副作用。它正在做的某些事情可能需要信任,但并不是立即显而易见的。如果是这样,Java 控制台应该会有所帮助。在 Oracle JRE 上,您可以拒绝安全提示来检查此项,代码将在沙盒中加载。这不适用于 Iced Tea JRE,如果用户拒绝信任对话框,它根本不会加载小程序。
There are a number of ways to strip the digital signatures.
.zip
and open it in a Zip tool that will allow you to delete theMETA-INF
directory. Then rename it back to.jar
. Ugly hack, might have side effects.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.