Xamarin Google许可响应不一 [英] Xamarin Google Licensing response mixed up

查看:185
本文介绍了Xamarin Google许可响应不一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用xamarin和Google Licensing的插件端口开发应用程序.而且我无法正常工作...我设置了3位测试人员来答复开发者控制台(包括我自己)中的许可,在那些帐户上我得到未许可的回复...甚至使用我的发布者帐户登录.

I'm developing a app using xamarin and a plug-in port of Google Licensing. And I can't get it to work... I set 3 testers to reply licenced in the developer console ( including myself ) and on those accounts I get NotLicenced response... Even logged in with my publisher account.

他是我正在使用的插件: https://github.com/mattleibow/Android.Play.ExpansionLibrary

his is the plugin i'm using: https://github.com/mattleibow/Android.Play.ExpansionLibrary

这是我正在使用的代码:

this is the code I'm using:

bool internet = Task.Run(CheckNET).Result;

// Construct the LicenseChecker with a policy.
var obfuscator = new AesObfuscator(Salt, this.PackageName, Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId));
var policy = new ServerManagedPolicy(this, obfuscator);
this.checker = new LicenseChecker(this, policy, "Here is my API public key");

if (internet)
{
     checker.CheckAccess(this);
}

我已在第一次尝试中修复了所有应用程序错误消息(权限,然后是NotMarketManaged),现在我陷入了NotLicensed ...

I've fixed all application error messages in within the first tries (permissions and then NotMarketManaged) and now I'm stuck getting NotLicensed...

因此,通信正常,只是许可证响应没有回来,而许可证测试中列出的电子邮件应该返回.

So the communication is working, just the License response isn't comming back as it should be for the emails listed in License Testing.

所以..经过更多测试后,它有点奇怪...我已将ERROR_NON_MATCHING_UID设置为测试人员的默认响应,它的确回答了确切的错误....但是当我改回Licensed时,我得到NOT_LICENSED响应.

So.. with more testing it a bit strange... I've set ERROR_NON_MATCHING_UID as default response for testers and it did reply that exact error.... but when I changed back to Licensed I got NOT_LICENSED response...

在那之后,它变得陌生了……我在响应选项上做了一些尝试,这就是我从Google许可服务器获得的响应:

After that it got way stranger... I've played a bit with the response options and this is what responses I got from Google Licensing server:

Google Console set to:             Server Response:
Licensed                            Not_licensed
Licensed_old_Key                    Not_Licensed
Not_Licensed                        Not_licensed
Error_server_failuere               LICENSED
Error_contacting_server             Licensed
Error_invalid_packagename           InvalidPackageName
error_nonmatching_uid               NonMatchingUid

所以...任何人都可以解释发生了什么事吗?我正在使用的插件会错误地分析代码吗?

so... can anyone explain what is going on? Could the plugin that I'm using be analysing the codes wrongly?

我已经检查了插件代码,这是我发现它正在使用以下响应代码的地方:

I've checked the plugin code and this is what I found that it is using these response codes:

Licensed = 0x0, 
NotLicensed = 0x1, 
LicensedOldKey = 0x2, 
NotMarketManaged = 0x3, 
ServerFailure = 0x4, 
OverQuota = 0x5, 
ErrorContactingServer = 0x101, 
InvalidPackageName = 0x102, 
NonMatchingUid = 0x103

任何人都可以确认这些代码是否是Google许可回复的正确代码吗?

can anyone confirm if these are the correct codes that Google Licensing replies?

推荐答案

Google Play许可库,修订版2中基于Java LicenseValidator.java的值:

The Java LicenseValidator.java based values from Google Play Licensing Library, rev 2:

// Server response codes.
private static final int LICENSED = 0x0;
private static final int NOT_LICENSED = 0x1;
private static final int LICENSED_OLD_KEY = 0x2;
private static final int ERROR_NOT_MARKET_MANAGED = 0x3;
private static final int ERROR_SERVER_FAILURE = 0x4;
private static final int ERROR_OVER_QUOTA = 0x5;

private static final int ERROR_CONTACTING_SERVER = 0x101;
private static final int ERROR_INVALID_PACKAGE_NAME = 0x102;
private static final int ERROR_NON_MATCHING_UID = 0x103;

它们与C#Android.Play.ExpansionLibrary

这篇关于Xamarin Google许可响应不一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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