如何取消我的 APK 的 Jarsign?

发布于 2024-07-15 04:16:54 字数 192 浏览 4 评论 0原文

如果我有一个 JAR(Android APK),并且我像这样签署了它:

jarsigner -keystore my.keystore someApk.apk myAlias

如何取消签名? 因为如果我将其作为 zip 文件打开并尝试提取 AndroidManifest.xml,它们就会变得混乱。

If I have a JAR (Android APK), and I signed it like this:

jarsigner -keystore my.keystore someApk.apk myAlias

How do I un-sign it? Because if I open it as a zip file and try to extract the AndroidManifest.xml, they are all messed up.

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

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

发布评论

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

评论(2

屌丝范 2024-07-22 04:16:54

如果您不关心清单和其他元信息(您可能不关心,因为您只想提取资源),您可以使用 jar -xvf myjar.jar 提取文件,删除META-INF 目录,并创建一个新的(未签名的 jar)。

如果您确实关心元信息,请查看了解签名和验证以了解签名的作用。 您应该能够通过编辑清单并删除 jar 的 META-INF 目录中的签名文件来取消对 jar 的签名。

上面的内容可能会回答您的问题,但它们可能无法解决您的问题,因为我不确定签名的 jar 会如何导致资源“混乱”。 资源本身不受签名过程的影响。 如果你只是通过jar命令本身提取资源(如上面第二段),你还有问题吗?

If you don't care about the manifest and other meta information (which you probably don't since you just want to extract resources) you can just extract the files with jar -xvf myjar.jar, delete the META-INF directory, and create a new (unsigned jar).

If you do care about the meta information, take a look at Understanding Signing and Verification for a description of what signing does. You should be able to un-sign the jar by editing the manifest and deleting the signature file in the jar's META-INF directory.

The above might answer your question, but they might not solve your problem, because I am not sure how having a signed jar would result in resources' being "messed up". The resources themselves are unaffected by the signing process. If you just extract resources via the jar command itself (as in the second paragraph above), do you still have problems?

本宫微胖 2024-07-22 04:16:54

事实证明,问题与签名根本无关 - 这是因为 XML 文件已编译。 要查看此文件的内容,您必须使用 aapt 工具。

It turns out that the problem is not related to the signing at all - it's because the XML file is compiled. To look at the contents of this file you must use the aapt tool.

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