更改GCM的Android API密钥 [英] Changing Android API Key for GCM

查看:108
本文介绍了更改GCM的Android API密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个GCM应用程序向Android手机发送消息。我们有一个可能已被入侵的Android API密钥。我只想确保我以一种不会中断正在运行的应用程序的方式进行更改。



我认为我所做的是:



  1. 在此创建一个新的Android API密钥: https://console.developers.google.com/project/my-project-name/apiui/credential

  2. 删除现有的Android API密钥


据我所知, docs,当我从生成的最后一个apk创建新的API Key时,我用来生成它的SHA1以及包名称应该匹配我已经部署的android应用。我不应该需要重新上传apk。



这是正确的吗?

谢谢!

解决方案

是,否。

是的,如果您使用的是OAuth 2.0,它仅取决于SHA1和包名;

NO ,如果你使用的API密钥,通常要求你把你的密钥放在清单文件中。


I have inherited a GCM application to send messages to android phones. We have an Android API Key set up that may have been compromised. I would just like to ensure that I change it in a way that doesn't break the apps that are currently running.

I think what I do is:

  1. Create a new Android API Key here: https://console.developers.google.com/project/my-project-name/apiui/credential
  2. Delete the existing Android API Key

As I understand it from the docs, when I create my new API Key from the last apk generated, the SHA1 I used to generate it, along with the package name, should match up to my already-deployed android apps. I should not need to re-upload an apk.

Is that correct?

Thanks!

解决方案

Yes and no.

YES, if you are using OAuth 2.0, which depends only on the SHA1 and package name;

NO, if you are using API key, which usually require you to place your key in your manifest file.

这篇关于更改GCM的Android API密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆