我正在使用Xamarin和Google许可的插件端口开发一个应用程序。我无法让它工作...我设置了3个测试人员来回复开发人员控制台(包括我自己(的许可,并且在这些帐户上,我会收到Notliced回复...甚至使用我的发布者帐户登录。
他是我正在使用的插件:https://github.com/mattleibow/android.play.play.expansionlibrary
这是我正在使用的代码:
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);
}
我已经修复了第一次尝试中的所有应用程序错误消息(权限,然后是无法锁定的(,现在我被卡住了...
因此,通信正在运行,只是许可证响应不会返回,因为它应该用于许可证测试中列出的电子邮件。
so ..随着更多的测试有些奇怪...我已经将ERROR_NON_MATCHING_UID设置为测试人员的默认响应,并且确实回复了该确切的错误。...但是当我更改回许可时,我没有得到_licensed响应。。
之后,这变得很陌生...我已经使用了响应选项进行了一些游戏,这就是我从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
那么...谁能解释发生了什么?我正在使用的插件可以错误地分析代码吗?
我已经检查了插件代码,这就是我发现它正在使用这些响应代码:
Licensed = 0x0,
NotLicensed = 0x1,
LicensedOldKey = 0x2,
NotMarketManaged = 0x3,
ServerFailure = 0x4,
OverQuota = 0x5,
ErrorContactingServer = 0x101,
InvalidPackageName = 0x102,
NonMatchingUid = 0x103
任何人都可以确认这些是否是Google许可答复的正确代码?
Google Play许可库中的Java LicenseValidator.java
值,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