重複の可能性:
Android マーケット ライセンス (LVL) が確実に機能しない。ほとんどの場合、RETRY を返します
Android で LVL システムを使用していますが、常に「dontallow」メソッドを実行していることが問題です。Google アカウントが関連付けられている自分の電話でテストしているため、ライセンスされた応答を受け取る必要があります (プロファイルでこの応答を構成しています)。私のコードは次のとおりです。
public void ComprobarLicencia()
{
// Construct the LicenseCheckerCallback. The library calls this when done.
mLicenseCheckerCallback = new ComprobadorLicencia();
String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
// Construct the LicenseChecker with a Policy.
mChecker = new LicenseChecker(
this,
new ServerManagedPolicy(this, new AESObfuscator(Constantes.SALT, getPackageName(), deviceId)
),
Constantes.clave_publica_licencia
);
mChecker.checkAccess(mLicenseCheckerCallback);
}
private class ComprobadorLicencia implements LicenseCheckerCallback
{
public void allow()
{
if (isFinishing())
{
// Don't update UI if Activity is finishing.
return;
}
}
public void dontAllow()
{
if (isFinishing())
{
// Don't update UI if Activity is finishing.
return;
}
showDialog(Constantes.dialog_licencia_incorrecta);
}
@Override
public void applicationError(ApplicationErrorCode errorCode)
{
if (errorCode == ApplicationErrorCode.NOT_MARKET_MANAGED)
{
showDialog(Constantes.dialog_licencia_incorrecta);
}
}
}
私は何を間違っていますか?