Android许可证测试响应 - 永远不会有效 [英] Android License Test Response - Never works

查看:375
本文介绍了Android许可证测试响应 - 永远不会有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研发已发布到Google Play的Android应用。对于下一次更新(versionCode = 3),我的客户希望包含LVL许可方案。

I've been working on an Android App that has already been published to Google Play. For the next update (versionCode = 3) my client wants to include the LVL licensing scheme.

我做的第一件事是从许可服务器设置静态测试响应。我将测试响应设置为 LICENSED 。在文档中阅读后:

The first thing I did was set up a static test response from the licensing server. I set the test response to LICENSED. After reading this in the documentation:


此许可证测试响应将使用[我的电子邮件地址]
或您上传到Google Play的应用程序的上述测试帐户。 >此外,此帐户(但不是测试帐户)将收到>尚未上传到Google Play的应用程序的回复。

This License Test Response will be sent to devices using [my email address] or the Test Accounts listed above for applications you have uploaded to Google Play. >Additionally, this account (but not the Test Accounts) will receive this response for >applications that have not yet been uploaded to Google Play.



<我想,不是问题,因为我的开发者帐户电子邮件与我的测试设备上的Google Play帐户电子邮件相同。因此,我应该在调试应用程序时收到测试响应。

I thought, not a problem, since my developer account email is the same as my Google Play account email on my testing devices. So I should receive the test response when debugging the App.

之后,我会阅读所有其他许可文档和示例代码并将其集成到应用程序中。我使用了 ServerManagedPolicy 和正确的base64公钥以及20个随机生成的字节作为盐。

After that, I read through all the other licensing documentation and sample code and integrated it into the App. I used a ServerManagedPolicy with the correct base64 public key and 20 random generated bytes as the salt.

一旦一切看起来都很好我将其上传到了设备来测试它,但我没有接收到我预期的 LICENSED 响应,而是总是接收 NOT_LICENSED 响应。我回去确认:

Once everything looked good I uploaded it to the device to test it, but instead of receiving the LICENSED response that I expected, I am always receiving a NOT_LICENSED response. I went back and made sure that:


  1. 我已连接到互联网。

  2. 我当时在Google Play上登录我的开发者帐户。

  3. LicenseChecker使用了正确的公钥。

  4. 清除我的Google Play缓存。

  1. I was connected to the internet.
  2. I was signed in to my developer account on Google Play.
  3. The LicenseChecker was using the correct public key.
  4. Clearing my Google Play cache.

起初,我认为它可能与缓存有关,所以我尝试使用 StrictPolicy 。相同的回应。由于我没有从商店购买应用程序,我的印象是许可服务器正常响应而不是发送静态测试响应。以下是我尝试的其他一些事项:

At first, I thought maybe it had something to do with the caching, so I tried using a StrictPolicy instead. Same response. Since I haven't purchased the App from the store, I'm under the impression that the licensing server is responding normally instead of sending the static test response. Here are some other things I have tried:


  1. 等待24小时再试一次。

  2. 试过使用android调试密钥以及当前的分发密钥构建应用程序。

  3. 在Google Play上设置和使用其他测试用户帐户。我确保将此电子邮件帐户添加到开发者控制台中的测试帐户部分。

  4. 将APK上传到Google Play,但不发布。

  5. 将versionCode从2增加到3. 这很有趣,因为它不是响应 NOT_LICENSED 而是返回'应用程序错误代码' ERROR_NOT_MARKET_MANAGED

  1. Waiting 24 hours and trying again.
  2. Tried building the App with the android debug key, as well as the current distribution key.
  3. Setting up and using a different test user account on Google Play. I made sure to add this email account to the 'Test accounts' section in the developer console.
  4. Uploading the APK to Google Play, but not publishing it.
  5. Incrementing the versionCode from 2 to 3. This is interesting, because instead of responding NOT_LICENSED it returns the 'application error code' ERROR_NOT_MARKET_MANAGED.

这让我相信许可证服务器总是正常响应,而不是发送我设置的静态测试响应我的开发人员帐户我有一种感觉,可能是因为该应用程序已经发布,但我不能冒险发布调试版本只是为了测试它是否有效。

This leads me to believe that the license server is always responding normally, instead of sending the static test response I set up to my developer account. I have a feeling it may be because the App is already published, but I cannot risk publishing a debug build just to test wether or not it is working.

有没有人在这种情况之前?非常感谢任何帮助。

Has anyone been in this situation before? Any help is greatly appreciated.

推荐答案

我花了几个小时甚至几天同样的问题,这里和其他地方都有记载,预发布的许可证测试是命中和错过,而且比我发现的更多的错过。

I've spent hours and even days with the same problem, it is documented here and elsewhere, that pre-published license test is hit and miss, and more miss than hit from what I discovered.

我发现使其工作的唯一方法更多可靠地(但仍然不完全可靠)是将硬件设备重置为出厂默认设置,然后将其设置为与您的应用程序上传以进行测试的开发帐户相同的主用户。

The only way I've found to make it work "more reliably" (but still not totally reliable) is to have a hardware device that is a reset to factory defaults, then set it's PRIMARY google user as the same one as your dev account that has the app uploaded to test with.

特殊的AVD也不太可靠。

The special AVDs are also not very reliable.

这篇关于Android许可证测试响应 - 永远不会有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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