1

LVL の「LICENSED」応答のテストに問題があります。マーケット Web サイトのプロファイルの編集で、ダッシュボードのテスト ライセンス応答を既に変更しました。

「ライセンスなし」に設定すると、購入または終了を求めるメッセージが表示されますが、ライセンスに設定すると、「ライセンスの確認」プログレス バーを待った後、メイン アクティビティ ページが読み込まれず、ライセンスの確認が無限にループし、プロセスを強制終了する必要があります。マニフェストに 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;
}

また、どうすれば次のことができますか?

  1. ライセンスがない場合 (Google サーバーにライセンスがないか、キャッシュされたライセンスがない場合)、許可を拒否して市場に出ます。

  2. キャッシュされたライセンスがある場合、ユーザーがアプリを実行できるようにします (ネットワークまたはネットワーク接続がない場合でも)。

  3. Google サーバー (ネットワーク モード) にライセンスがあり、キャッシュされたライセンスがない場合、ユーザーがアプリを実行できるようにします。

4

1 に答える 1

1

テスト応答を「正常に応答する」以外に設定した場合、VT、GT、および GR の欠落に関するメッセージは正常です。コードに論理的な問題がある可能性があります。startMainActivity() と onCreate() メソッド (およびそれらが呼び出す関連メソッド) のコードを投稿できれば役立つかもしれません。

于 2011-01-18T17:59:48.613 に答える