简体   繁体   English

如何在Windows中通过命令行取消签名APK

[英]How to unsign an APK via command line in Windows

I work in a QA department that receives APKs signed with development keys. 我在QA部门工作,接收使用开发密钥签名的APK。 When we want to sign one of these builds for purchase testing, I typically use 7zip to open the APK and delete the META-INF folder, and then I run a script that assists me with re-signing the APK. 当我们想要签署其中一个版本进行购买测试时,我通常使用7zip打开APK并删除META-INF文件夹,然后我运行一个脚本来帮助我重新签名APK。 I would like to include un-signing the APK as part of the script, but I can't figure out a way to un-sign an APK in windows via command line. 我想包括取消签名APK作为脚本的一部分,但我无法想办法通过命令行在Windows中取消签名APK。

Doing this on a Mac is easy. 在Mac上执行此操作非常简单。 All you need is 所有你需要的是

zip -d yourapp.apk "META-INF*"

but windows doesn't have a native zip process that I can access via command line. 但是Windows没有我可以通过命令行访问的本机zip进程。

I tried using 7zip and winRar and attempted 我尝试使用7zip和winRar并尝试使用

Rar d yourapp.apk "META-INF*" 

and

7z d yourapp.apk "META-INF*" 

But all I get is errors such as "bad archive" or "is not supported archive type" 但我得到的只是“错误存档”或“不支持存档类型”等错误

Neither of these programs have an issue opening APKs via GUI, so I'm not sure why this isn't working via command line. 这些程序都没有通过GUI打开APK的问题,所以我不确定为什么这不通过命令行工作。

Is anyone else able to unsign an APK on Windows via command line somehow? 是否有人能够以某种方式通过命令行在Windows上取消APK?

如果您使用7-Zip,您只需告诉它正在阅读的文件类型:

7z d -tzip yourapp.apk "META-INF*"

You can download zip for windows from this site: www.info-zip.org 您可以从以下网站下载适用于Windows的zip: www.info-zip.org

Direct link to Zip 3.0 for Windows 直接链接到Zip 3.0 for Windows

just make sure to put it in a folder which is in the PATH variable 只需确保将其放在PATH变量中的文件夹中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM