Android 证书会损坏吗?我无法上传新的 Play 商店应用更新

Can Android certificates get corrupted? I am unable to upload new Play Store App update

我继承了一个最初外包给外部开发人员的 android 应用程序,修复了一些东西,现在我准备将新更新发送到 Play 商店。 然后我发现我需要一个特定的签名密钥来更新应用程序,这是我们从以前的开发人员那里得到的。 所以我使用我得到的密钥生成了一个签名的发布 apk 并尝试上传。上传后,我收到一个错误弹出窗口。 see screenshot for details

我们问开发商他是否确定那是他使用的钥匙,他发誓他到处都看过,而且这是他唯一使用的钥匙。虽然,我确实认为他可能已经更改了它的密码...,不太确定。

我对应用程序进行的重大更改是更改清单中的包并创建产品口味,每个口味都有自己的包名称(其中一个必须保留来自 Play 商店的原始包名称)。

我注意到的一些事情:当我拿到应用程序时,应用程序清单有一个注释掉的包名称和一个新的包名称,其中包含我们公司的名称。原来的 "com.example.appname" 位的 "example" 是外包公司的名称,所以他们在创建发布 apk 时一定更改了包名。 我不知道这是否意味着什么,因为当我把它们全部放在一个 apk 中时,包名称是相同的……只是商店声称该应用程序是用不同的证书签名的,而以前的开发人员发誓他使用过他发给我们的也是一样的。

任何人都可以告诉我是否可以做任何事情来完成这项工作,或者我们是否完全注定要将新应用程序上传到商店?

感谢您的帮助。

更新: 因为人们在询问 packagename,所以让我澄清一下。 当我拿到这个应用程序时,清单中的所有包名都与 Playstore 中的不一样......所以我在整个应用程序范围内重构了整个包以反映 play-store 包名......然后我介绍了产品口味因为我们需要一个与原始应用程序相似的具有不同品牌的新应用程序...所以我以这样的结构结束:

defaultConfig {
    applicationId "PlayStorePackagName"
}
productFlavors {
    brand1 {
        applicationId "PlayStorePackagName" //<- for original app
    }
    new_brand{
        applicationId "NewPlayStorePackagName" //<- for new app.
    }
}

在这种情况下,清单中的包名称应该无关紧要,不是吗?

来自docs

When you're ready to make changes to your APK, make sure to update your app’s Version Code as well so that existing users will receive your update.

Use the following checklist to make sure your new APK is ready to update your existing users:

  • The Package Name of the updated APK needs to be the same as the current version.
  • The Version Code needs to be greater than that current version. Learn more about versioning your applications.
  • The updated APK needs to be signed with the same signature as the current version.

To verify that your APK is using the same certification as the previous version, you can run the following command on both APKs and compare the results:

$ jarsigner -verify -verbose -certs my_application.apk

If the results are identical, you’re using the same key and are ready to continue. If the results are different, you will need to re-sign the APK with the correct key.

你说:

Significant changes I introduced to the app is changing the package in manifest

这就是问题的根源。您需要使用相同的包名称。

您不能更改应用商店的包名和证书!如果您没有正确的证书,则无法将您的应用程序作为现有应用程序的更新提交。

证书检查

但是您可以检查存储在可用Keystore 中的信息并将其与当前商店apk 进行比较。例如:

jarsigner -verify -verbose -certs yourapp.apk

您可以通过 keytool 获得更多详细信息。有关详细信息,请参阅 this 主题。

包名

您可以在 Play 商店中浏览您的应用程序时检查您的应用程序的正确包名。

Google 的示例加上:https://play.google.com/store/apps/details?id=com.google.android.apps.plus

id=com.google.android.apps.plus 是本例中的包名。此 无法 为您的应用更改

但是这个包名是由您的应用程序中的 applicationId 定义的。您的应用程序结构可以有不同的包名称。有关详细信息,请参阅 here