1package com.cheogram.android;
2
3import android.content.Context;
4import android.os.Handler;
5import android.os.Looper;
6import android.provider.Settings.Secure;
7import android.util.Log;
8
9import com.google.android.vending.licensing.*;
10
11import eu.siacs.conversations.R;
12
13public class CheogramLicenseChecker implements LicenseCheckerCallback {
14 private final LicenseChecker mChecker;
15
16 public CheogramLicenseChecker(Context context) {
17 mChecker = new LicenseChecker(context, new StrictPolicy(), context.getResources().getString(R.string.licensePublicKey));
18 }
19
20 public void checkLicense() {
21 mChecker.checkAccess(this);
22 }
23
24 @Override
25 public void dontAllow(int reason) {
26 Log.d("CheogramLicenseChecker", "dontAllow: " + reason);
27 }
28
29 @Override
30 public void applicationError(int errorCode) {
31 Log.d("CheogramLicenseChecker", "applicationError: " + errorCode);
32 }
33
34 @Override
35 public void allow(int reason, ResponseData data, String signedData, String signature) {
36 Log.d("CheogramLicenseChecker", "" + reason + " / " + data + " / " + signedData + " / " + signature);
37 }
38}