如何取消我的 APK 的 Jarsign?
如果我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不关心清单和其他元信息(您可能不关心,因为您只想提取资源),您可以使用
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?
事实证明,问题与签名根本无关 - 这是因为 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.