2017-10-12 96 views
0

尝试通过Visual Studio存档/分发过程将APK上传到Google Play时,它会因证书过期而失败。我使用keytool -list对其进行了验证,并验证它确实已过期。如何更新我现有密钥库上的证书有效性?我试图导入我现有的密钥存储在VS中的归档过程,它抱怨过期过期并且不会上传。我尝试创建一个新的密钥库并上传到我现有的应用程序,但我收到一条消息:APK已用过期的证书签名,如何更新现有android Xamarin应用程序的密钥库有效性?

“您上传的APK使用不同的证书签名到您以前的APK,您必须使用相同的证书。 APK使用带有指纹的证书进行签名:...“

我假设我需要使用keytool.exe以某种方式更新我的密钥库本身的有效性。我试图从命令行中这样的声明,希望它会更新,但它抱怨我的别名已经存在:

keytool.exe -genkey -v -keystore myapp.keystore -alias myoriginalalias -keyalg RSA -keysize 2048 -validity 20000

我尝试了新的别名,它要求输入密码,我从来没有设置密码,或者如果密码存储密码相同,我会回车。然后我得到一个keytool错误:java.io.FileNotFoundException:myapp.keystore(访问被拒绝)。

我是否需要使用密码创建别名?如果是这样如何?我已经手动完成了这一段时间。还是有另一个工具,我应该使用或另一个选项在keytool?我没有看到任何更新有效性选项。我觉得我正在接近这里,在寻找时会空虚。任何指针在这里将不胜感激。提前致谢。

基本上,更新Google Play商店中现有应用的密钥库有效性的过程是什么?可能吗?

+0

遗憾的是没有办法。您应该使用新密钥和应用程序ID来发布新应用程序。您可以在旧应用程序中添加一些逻辑,并请求旧应用程序中的用户移至新的应用程序。 –

+0

我希望这不是答案,但谢谢。不幸的是,我无法更新旧应用程序,因为这需要更新具有过期有效性的应用程序,并且无法上传。但也许我可以通过我的外部数据文件做一些消息传递。感谢您的信息和想法。 – user3810967

+0

https://stackoverflow.com/questions/20933987/android-developer-signing-key-expires –

回答

0

If you plan to support upgrades for an app, ensure that your app signing key has a validity period that exceeds the expected lifespan of that app. A validity period of 25 years or more is recommended. When your key's validity period expires, users will no longer be able to seamlessly upgrade to new versions of your app.

一旦证书过期,你可以做,唯一的事情就是重新pubish与新的应用程序ID和新证书的应用程序。

You should sign all of your APKs with the same certificate throughout the expected lifespan of your apps. There are several reasons why you should do so:

App upgrade: When the system is installing an update to an app, it compares the certificate(s) in the new version with those in the existing version. The system allows the update if the certificates match. If you sign the new version with a different certificate, you must assign a different package name to the app—in this case, the user installs the new version as a completely new app.

回复:https://developer.android.com/studio/publish/app-signing.html#considerations

相关问题