gpt4 book ai didi

java - 如何使用 .key 文件对 apk 进行签名?

转载 作者:行者123 更新时间:2023-12-01 16:03:12 24 4
gpt4 key购买 nike

我创建了一个应用程序,目前在 Android 市场上。用于签署应用程序的 key 是使用 jarsigner 生成的。如何使用最初生成的 .key 文件进行签名?

最佳答案

您将需要用于签署第一个版本的原始私钥。完整信息可获取here ,但这里是听起来您需要的摘录:

Application upgrade – As you release updates to your application, you will want to continue to sign the updates with the same certificate or set of certificates, if you want users to upgrade seamlessly to the new version. When the system is installing an update to an application, it compares the certificate(s) in the new version with those in the existing version. If the certificates match exactly, including both the certificate data and order, then the system allows the update. If you sign the new version without using matching certificates, you will also need to assign a different package name to the application — in this case, the user installs the new version as a completely new application.

据我所知,.key 不是标准(传统)文件结尾。大多数时候您都在使用 .keystore 文件。 keystore 包含 key 。 keystore 和 key 都有密码和单独的安全措施以确保安全。

如果您使用 jarsigner 和列出的命令之一生成“.key”文件 here ,那么您可能创建了一个 keystore 文件并碰巧给了它结尾的“.key”如果是这种情况,那么只需将您的应用程序编译为 Release模式,使用 jarsigner 工具对应用程序进行签名,然后使用 zipalign (不确定这是什么)是为了压缩?)。

如果您没有原始 keystore 和 key 文件,那么您就完蛋了。抱歉:/可以在 Signing Your Application 上找到大量其他信息。页面

HTH,哈米

关于java - 如何使用 .key 文件对 apk 进行签名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3295871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com