使用相同的密钥库退出我的应用程序失败

发布于 2024-11-11 18:28:09 字数 421 浏览 1 评论 0原文

大家好,

我使用 Eclipse 创建了一个适用于 android 2.2 的应用程序,并使用我创建的密钥库进行了签名,然后将其上传到市场。

我对应用程序做了一些更改,我已将应用程序版本从 1.0 tp 1.1 更改,然后我尝试签署新生成的 .apk 文件,但出现以下错误:

jarsigner: 无法签署 jar: java.lang. util.zip.ZipException:条目压缩大小无效(预期为 525,但实际为 527 字节)。

当您尝试签署签名的 .apk 文件时,会发生此错误,我已从 Eclipse 生成了未签名的 .apk 并且我的应用程序签名成功。

现在市场拒绝我新签名的应用程序,我猜第一个版本是由 Eclpise 和我的密钥库签名的,现在我不能让两者都签名的新版本。这是真实的分析吗?

我做错了什么?

Salam all,

I've created an app for android 2.2 using Eclipse and I have signed using a keystore that I have created, then I have upload it to the Market.

I have done some changes on the app, I have changed the app version from 1.0 tp 1.1, then I have tried to sign the new generated .apk file but I've got the following error:

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

This error occurs when you try to sing a signed .apk file, I have generated an unsigned .apk from Eclipse and my app signed successfuly.

Now the Market refuses my new signed app, I guess that the first version was signed by Eclpise and my keystore, now I cannot have a new version signed by both. is this true analysis?

What am I doing wrong?

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

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

发布评论

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

评论(1

娇纵 2024-11-18 18:28:09

要在 Eclipse 中获取未签名的 apk,请在 Package Explorer 窗口中右键单击应用程序名称并选择 Android Tools,然后选择“Export Unsigned Application Package...”。将包保存到新位置。
一旦你有一个未签名的 apk。运行您在未签名的 apk 文件上使用的 jarsigner 命令。

    $ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name    
    $ jarsigner -verify my_signed.apk    
    $ jarsigner -verify -verbose -certs my_application.apk      

注意:如果您看到“CN=Android Debug”,这意味着 .apk 是使用 Android SDK 生成的调试密钥进行签名的。如果您打算发布应用程序,则必须使用您的私钥而不是调试密钥对其进行签名。

    $ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk    
    $ zipalign -c -v <alignment> existing.apk     

来源:
http://forum.xda-developers.com/showthread.php?t=492822
http://developer.android.com/guide/developing/tools/zipalign.html

这解决了我的问题

To get an unsigned apk in Eclipse, right click on application name in the Package Explorer window and choose Android Tools, then choose "Export Unsigned Application Package...". Save the package to a new location.
Once you have an unsigned apk. Run the jarsigner command you were using on the unsigned apk file.

    $ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name    
    $ jarsigner -verify my_signed.apk    
    $ jarsigner -verify -verbose -certs my_application.apk      

Note: If you see "CN=Android Debug", this means the .apk was signed with the debug key generated by the Android SDK. If you intend to release your application, you must sign it with your private key instead of the debug key.

    $ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk    
    $ zipalign -c -v <alignment> existing.apk     

Source:
http://forum.xda-developers.com/showthread.php?t=492822
http://developer.android.com/guide/developing/tools/zipalign.html

This fixed my issue

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