LVL의 "LICENSED"응답 테스트에 문제가 있습니다. 시장 웹 사이트의 편집 프로필에서 대시 보드의 테스트 라이센스 응답을 이미 변경했습니다.Android 라이선스 "LICENSED RESPONSE"오류
"라이센스가 없음"으로 설정하면 구매 또는 종료하라는 메시지가 나타납니다. 그러나 라이센스로 설정하면 "라이센스 확인 중"진행률 표시 줄을 기다린 후 내 기본 활동 페이지 인 수표 라이센스 무한 루프, 그리고 프로세스를 강제 종료해야합니다. 이미 매니페스트에 licensecheck Java 파일 이름을 추가하고 의도 부분을 포함 시켰습니다.
다음은 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;
}
어떻게하면됩니까?
라이센스가 없으면 (Google 서버에 라이센스가 없거나 캐시 된 라이센스가 없음) 프롬프트되지 않으면 시장에 나오십시오.
캐시 된 라이센스가있는 경우 네트워크에 연결되어 있거나 네트워크에 연결되어 있지 않아도 사용자가 앱을 실행할 수 있습니다.
Google 서버 (네트워크 모드)에는 라이선스가 있지만 캐시 된 라이선스가없는 경우 사용자가 앱을 실행할 수 있도록 허용합니다.
안녕하세요. Ted, 결국 문제가 무엇인지 알아 냈습니다. 응답이 LICENSED로 설정되면 앱을 실행할 수 있습니다. 하지만 지금 또 다른 문제가 있습니다. 네가 내게 힌트를 줄 수 있는지 여부를 모르겠다. 에뮬레이터에서 테스트했을 때 네트워크 연결을 해제하거나 활성화해도 문제가없는 것으로 보입니다. 라이센스 확인 후 실행할 수 있습니다. 하지만 안드로이드 폰으로 테스트했을 때 처음으로 네트워크 연결을 설정하면 라이선스가 성공적으로 확인되고 앱을 실행 한 다음 네트워크 연결을 사용 중지 한 다음 캐시 된 라이센스를 찾을 수없고 disallow() 코드를 실행할 수없는 것처럼 보입니다. –
휴대 전화에서 테스트 계정을 사용하고 개발자 콘솔에서 특정 응답을 지정한 경우 응답이 캐시되지 않습니다. 테스트 응답을 기본 응답으로 설정하면 어떤 일이 발생하는지 실험 해 보았습니까? 그러면 유효한 VT, GT 및 GR 데이터가 캐싱됩니다. –