聚合国内IT技术精华文章,分享IT技术精华,帮助IT从业人士成长

I;P : Debug the app with Google Play Service SDK in Eclipse

2014-04-22 07:45 浏览: 1828358 次 我要评论(0 条) 字号:

快捷链接

    下载地址

    相关随笔

正文

    就如前篇随笔写到的, 在Google Play Console中, "应用"和"游戏服务"是两个单独模块, 一个"Play Service"项可以"关联"多个"App". App通过Play Service项的ID来访问指定的成就和排行榜信息, 而Play Service项则是通过'OAUTH'来对App进行授权, 并通过App所使用的"签名"(KeyStore)的SHA1进行校验. 这意味着, 如果App的签名跟授权时不一致, 那么App是无法正常访问或者连接到指定的Play Service项上的. 这也是前篇随笔中"悲剧"的缘由.

 

    而我们知道, 在使用Eclipse调试时, 会使用默认的KeyStroe来对App"签名", 但当要在Eclipse中直接调试Google Play Service相关的代码时, 这种默认签名方式跟Play Service的"签名验证"就冲突了. 那么有两种方法可以试试:

    一, 每次都签名导出App, 在通过adb安装; 优点是简单易操作, 缺点嘛, 只能用Log()输出调试了;

    二, 更改Eclipse的默认签名KeyStore; 优点是一次搞定万无忧, 缺点嘛, 折腾..

 

    好, 来折腾... 由于Eclipse的默认签名有缺省alias和passwd要求, 那么需要做的就是更改当前所使用签名的alias和passwd即可. 如下流程:

 

    1. 更改指定别名xxxxxx到缺省别名androiddebugkey;

    2. 更改androiddebugkey密码为android;

    3. 更改签名文件KeyStore密码为android;

 

D:Studiorelease>keytool -changealias -keystore codejie.keystore -alias xxxxxx -destalias androiddebugkey
Enter keystore password: xxxxxxxxxxxx

 

D:Studiorelease>keytool -keypasswd -keystore codejie.keystore -alias androiddebugkey
Enter keystore password: xxxxxxxxxxxx
New key password for <androiddebugkey>: android
Re-enter new key password for <androiddebugkey>: android

 

D:Studiorelease>keytool -storepasswd -keystore codejie.keystore
Enter keystore password: xxxxxxxxxxxx
New keystore password: android
Re-enter new keystore password: android

 

    最后, 在Eclipse的Preferences->Android->Custom debug keystore指定codejie.keystore即可.

 

    最最后, 记得备份你的keystore, 别再发生跟我一样的悲剧...

 

<---- 伤心的分割线 ---->

    刚刚在Google Play上正式关闭了I;P最早的下载jie.android.ip包, 同时也就丢失了所有的下载记录, 统计信息等等~所以说, 备份keystore真的很重要...

 

<---- 随手说明的分割线 ---->   

    另, 懒得再开个贴子了, 这里更新下I;P的进展 --

    1. 昨天凌晨到家, 加上今晚, 新增了10+个成就, 非常有成就感~

    2. 感谢I;P群中各位的 -- 无私的支持, 无数的错误, 以及无尽的需求; 至此I;P功能越来越强大, 关卡越来越丰富 -- 终于感到离收工不远了~~

    3. 争取明晚再添加Leo提供的几个关卡后, 就更新!



codejie 2014-04-21 23:55 发表评论


网友评论已有0条评论, 我也要评论

发表评论

*

* (保密)

Ctrl+Enter 快捷回复