简体   繁体   English

分别对apk进行签名(eclipse或命令行)-(不直接来自eclipse项目)

[英]sign apk separately (either eclipse or command line) - (not directly from eclipse project)

I am doing my android projects in eclipse . 我正在eclipse中执行我的android项目。 I can easily sign the apps with my keystore using eclipse. 我可以使用Eclipse在我的密钥库中轻松签署应用程序。 But, if I export the unsigned APK(not project, just apk) and keystore to another computer, can he be able to sign it either using eclipse or command line . 但是,如果我将未签名的APK(不是项目,而只是apk)和密钥库导出到另一台计算机,他是否可以使用eclipse或命令行对其进行签名。 I tried using command line : 我尝试使用命令行:

   $ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name

But I'm getting some zip size errors like this: 但是我遇到了一些拉链大小错误,如下所示:

 jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 7395 but got 7498 bytes)

jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 463 but got 465 bytes) worked for me : jarsigner:无法签名jar:java.util.zip.ZipException:无效的条目压缩大小(预期为463,但得到465个字节)对我有用:

This is what you should do 这是你应该做的

Rename the .apk file to .zip Unpack the .zip file and remove the META-INF folder Zip the folder again and rename it to .apk Sign the apk: 将.apk文件重命名为.zip解压缩.zip文件并删除META-INF文件夹再次压缩该文件夹,并将其重命名为.apk。签名apk:

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

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