gpt4 book ai didi

java - 安卓许可证 "LICENSED RESPONSE"错误

转载 作者:行者123 更新时间:2023-11-30 04:46:40 27 4
gpt4 key购买 nike

我在测试 LVL 的“许可”响应时遇到问题。我已经在市场网站的编辑配置文件中更改了仪表板中的测试许可证响应。

当我设置为“NOT LICENSED”时,它会提示购买或退出,但如果我设置为LICENSE,在等待“CHECKING LICENSE”进度条后,它不会加载我的主 Activity 页面,检查许可证循环无限,我需要强制关闭这个过程。我已经在 list 中添加了许可检查 Java 文件名并包含了 Intent 部分。

以下是我在 logcat 中捕获的内容。任何人都知道发生了什么事?如何修复我的代码?

I/LICENSE (  312): checkLicense
I/LicenseChecker( 312): Binding to licensing service.
I/ActivityManager( 59): Start proc com.android.vending for service com.android.vending/.licensing.LicensingService: pid=320 uid=10019 gids
={3003}
I/LicenseChecker( 312): Calling checkLicense on service for com.test.apps1
I/ActivityManager( 59): Displayed activity com.test.apps1/.MActivity: 3586 ms (total 3586 ms)
I/LicenseChecker( 312): Start monitoring timeout.
I/ARMAssembler( 59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x305798:0x305854] in 914005 ns
D/GoogleLoginService( 170): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLogin
Service }
I/LicenseChecker( 312): Received response.
I/LicenseChecker( 312): Clearing timeout.
E/LicenseValidator( 312): CORI APP LICENSED!
W/ServerManagedPolicy( 312): License validity timestamp (VT) missing, caching for a minute
W/ServerManagedPolicy( 312): License retry timestamp (GT) missing, grace period disabled
W/ServerManagedPolicy( 312): Licence retry count (GR) missing, grace period disabled
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
D/dalvikvm( 312): GC_FOR_MALLOC freed 3870 objects / 267592 bytes in 92ms
I/LicenseChecker( 312): Using cached license response
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
I/LicenseChecker( 312): Using cached license response
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
I/LicenseChecker( 312): Using cached license response
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
I/LicenseChecker( 312): Using cached license response
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
I/LicenseChecker( 312): Using cached license response
D/LicenseChecker( 312): Allow
I/ActivityManager( 59): Starting activity: Intent { cmp=com.test.apps1/.MActivity }
I/LICENSE ( 312): checkLicense
W/ActivityManager( 59): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 59): Activity idle timeout for HistoryRecord{44003148 com.test.apps1/.MActivity}
public void allow() 
{
Log.d("LicenseChecker","Allow");
//Log.i("LICENSE", "allow");
if (isFinishing())
{
// Don't update UI if Activity is finishing.
return;
}
// Should allow user access.
displayResult(getString(R.string.allow));

// Should allow user access.
startMainActivity();
}

这与缓存响应时间戳有关吗?如果是,我该如何更改和修改?

W/ServerManagedPolicy(  312): License validity timestamp (VT) missing, caching for a minute
W/ServerManagedPolicy( 312): License retry timestamp (GT) missing, grace period disabled
W/ServerManagedPolicy( 312): Licence retry count (GR) missing, grace period disabled

是否需要修改ServerManagedPolicy?

public boolean allowAccess() {
long ts = System.currentTimeMillis();
if (mLastResponse == LicenseResponse.LICENSED) {
// Check if the LICENSED response occurred within the validity timeout.
if (ts <= mValidityTimestamp) {
// Cached LICENSED response is still valid.
return true;
}
} else if (mLastResponse == LicenseResponse.RETRY &&
ts < mLastResponseTime + MILLIS_PER_MINUTE) {
// Only allow access if we are within the retry period or we haven't used up our
// max retries.
return (ts <= mRetryUntil || mRetryCount <= mMaxRetries);
}
return false;
}

另外,我怎样才能做到以下几点?

  1. 当没有license时(Google服务器没有license或者没有缓存license),则提示disallow并去market。

  2. 当有缓存许可证时,允许用户运行应用程序(无论是否没有网络或没有网络连接)。

  3. 当 Google 服务器(网络模式)中有许可证但没有缓存许可证时,允许用户运行应用。

最佳答案

当您将测试响应设置为“正常响应”以外的任何内容时,有关缺少 VT、GT 和 GR 的消息是正常的。您的代码中可能存在逻辑问题。如果您可以发布 startMainActivity() 的代码以及您的 onCreate() 方法(以及它们调用的任何相关方法),这可能会有所帮助。

关于java - 安卓许可证 "LICENSED RESPONSE"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4726033/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com