gpt4 book ai didi

android-studio - 无法使用 Google Play 应用签名上传证书(使用原始 keystore )更新发布 APK

转载 作者:行者123 更新时间:2023-12-03 15:59:27 46 4
gpt4 key购买 nike

我试图在 Google Play 上更新一个版本。上传我已签名的 APK 后,我在 Google Play 管理中心收到此错误消息:

You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:

[ SHA1: (SHA1 hash redacted) ]

and the certificate used to sign the APK you uploaded have fingerprint:

[ SHA1: (Mismatched SHA1 hash redacted) ]



我尝试了许多不同的方法来签署我的 APK(原始 keystore 、不同的密码组合、新的 keystore 、不同的 key 组合等),但都没有成功。

我相当确信 keystore 是原始 keystore ,因为我将其备份在外部驱动器上,并且文件的两个版本的更新日期都在原始版本之前大约 30 分钟(这是我生成第一个签名的 APK 的时间) )。

由于我使用了 Google Play 应用签名(并且预期的 SHA1 哈希与 Play 管理中心“应用签名”选项卡中的上传证书 SHA1 哈希相同),因此我认为我需要将证书导入我用来上传的 keystore 原始发布APK。

这是我的结果,我已经反复检查了一段时间,以确保它们不是由简单的错字引起的(已编辑的部分按值分组为颜色,如有必要,我可以发布其中的大部分):

Cannot update release APK using Google Play app signing upload certificate (with original keystore)

请注意 keystorePass和实际 keyPass被指定为不同的pass,所以使用 keystorePass两者都返回“无法恢复 key ”UnrecoverableKeyException,同时使用 keyPass对于 key 给出了一般异常“回复中的公钥与 keystore 不匹配。”

我的一些研究表明,如果 keystorePasskeyPass不相同,那么就会出现这个问题。建议的解决方案是使用 keytool 更改 keyPasskeystorePass 相同,但在我假设成功更改 keytool keypasswd 之后,我仍然收到异常“回复中的公钥和 keystore 不匹配”。使用旧版 keyPass返回预期的错误密码异常。这是一个屏幕截图:

Cannot update release APK using Google Play app signing upload certificate (with original keystore)

出于故障排除目的,我尝试将证书直接添加到 keystore 。使用 keystorePass 取得了成功并给了我 uploade_cert.der 的预期 SHA1 哈希值来自 Google Play 应用签名的文件:

Cannot update release APK using Google Play app signing upload certificate (with original keystore)

我还尝试创建一个新的 keystore (以及具有相同密码的原始 keystore 和新 keystore 中的新 key ),但是在成功导入 keytool 上传证书后尝试使用带有新 keystore 的 Android Studio 生成签名的 APK,我收到了此 Android Studio 错误:“受信任的证书条目不受密码保护”

我已经在我的 gradle 应用程序文件( signingConfigs{release{keyAlias, keyPassword, storeFile, storePassword}} )中使用原始和新信息尝试了所有这些步骤,但没有运气。很想更新我的应用程序,任何提示或帮助将不胜感激。

最佳答案

您必须尝试以下过程:

  • 使用用于签署第一个 APK 版本的 PEPK 工具(在您的 Google 控制台上可用)加密您的私钥 (yourKeyStore.jks)。
  • 生成一个新 key (例如 apk-upload),然后从您在 upload-key.pem 中创建的 key 中提取证书。
  • 将 upload-key.pem 上传到您的 Google 帐户。
  • 使用您的新 key (apk-upload) 签署您的发行版 APK。

  • 您将在本文中找到不同的命令和更多详细信息:

    https://medium.com/mindorks/securing-and-optimizing-your-app-with-google-play-app-signing-24a3658fd319

    编辑: (来自评论)我认为如果您已经注册了 Google App Signings,您必须联系 Google 支持,以便您能够上传新的私钥或获取旧的私钥...订阅 Google 时提供的选项App Signings,我认为如果您已经注册了 Google App Signing,则不可能以旧方式退出您的应用程序。

    (提问者的编辑:不要像使用原始 key 别名一样为您的 keystore 使用不同的密码。确保 keystorePass 和 keyPass 完全匹配。如果您已经使用不同的通行证上传了您的 keystore / key ,请按照Google 支持页面上的步骤以使用应用签名重置您的 keystore 。)

    关于android-studio - 无法使用 Google Play 应用签名上传证书(使用原始 keystore )更新发布 APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48490971/

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