Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unsign an APK via command line in Windows

I work in a QA department that receives APKs signed with development keys. 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. 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.

Doing this on a Mac is easy. 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.

I tried using 7zip and winRar and attempted

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.

Is anyone else able to unsign an APK on Windows via command line somehow?

like image 815
jpelletier Avatar asked Jun 13 '13 15:06

jpelletier


2 Answers

If you use 7-Zip, you just have to tell it what kind of file it is reading:

7z d -tzip yourapp.apk "META-INF*"
like image 147
Tim Avatar answered Sep 30 '22 12:09

Tim


You can download zip for windows from this site: www.info-zip.org

Direct link to Zip 3.0 for Windows

just make sure to put it in a folder which is in the PATH variable

like image 39
cwin Avatar answered Sep 30 '22 12:09

cwin