Android许可错误561 - 此应用程序未获得许可。请从Android Market购买 [英] Android Licensing Error 561 -This application is not licensed. Please purchase it from Android Market

查看:494
本文介绍了Android许可错误561 - 此应用程序未获得许可。请从Android Market购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我是否正确执行LVL。

请指导我这个问题。



我遵循了一些解决方案,如清除缓存,卸载和重新运行。

仍然没有运气..



我在上传到alpha测试之前尝试了以下步骤。


  1. 我正在使用Eclipse。我使用导出签名的应用程序包选项创建了密钥库。

  2. 从密钥库中上传APK。

以下是我的代码,我从如何许可我的Android应用程序? a>

  public class Activity_LicenseCheck extends Activity {
private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
@Override
public void allow(int reason){
toast(Inside-Allow:+ reason);
if(isFinishing()){
//如果活动结束,请不要更新UI。
return;
}
startMainActivity();

}

@Override
public void dontAllow(int reason){

toast(dontAllow:+ reason);
if(isFinishing()){
//如果活动结束,请不要更新UI。
return;
}




@Override
public void applicationError(int errorCode){
if(isFinishing()) {
return;
}

toast(Errorffff:+ errorCode);
startMainActivity();

}

}
private static final String BASE64_PUBLIC_KEY =mykey;
private static final byte [] SALT = new byte [] {11,34,56,36,3,45,-87,2,67,-98,32,-14,44,-58,39 ,-26,72,-19,86,23};
私人LicenseChecker mChecker;

// UI线程上的处理程序。

私人LicenseCheckerCallback mLicenseCheckerCallback;
private void doCheck(){
mChecker.checkAccess(mLicenseCheckerCallback);
}

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);

//尝试在这里使用更多的数据。 ANDROID_ID是一个单一的攻击点。
String deviceId = Secure.getString(getContentResolver(),
Secure.ANDROID_ID);

//完成后,库调用这个。
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
//使用策略构造LicenseChecker。
mChecker = new LicenseChecker(这是新的ServerManagedPolicy(这个,
新的AESObfuscator(SALT,getPackageName(),deviceId)),
BASE64_PUBLIC_KEY);
doCheck();
}

@Override
protected对话框onCreateDialog(int id){
//我们只有一个对话框。
return new AlertDialog.Builder(this)
.setTitle(Application not Licensed)
.setCancelable(false)
.setMessage(
此应用程序不是
.setPositiveButton(Buy App,
new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,
int where){
Intent marketIntent = new Intent(
Intent.ACTION_VIEW,
Uri.parse(http://market.android.com/details?id=
+ getPackageName()));
startActivity(marketIntent);
finish();
}
})
.setNegativeButton(Exit,
new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,
int which){
完();
}
})。create();
}
@Override
protected void onDestroy(){
super.onDestroy();
mChecker.onDestroy();
}

private void startMainActivity(){
startActivity(new Intent(this,Activity_login.class));
finish();
}

public void toast(String string){
Toast.makeText(this,string,Toast.LENGTH_SHORT).show();
}
}


它的工作原理是BASE64 PUBLIC KEY的错误输入。我对于许可概念完全没有意义,谷歌应该提出简单的解决方案。



它对我来说是如何工作的。
我的第一个发布是ver 1.0,我得到错误561.(未获得许可)
的isuue是错误的BASE64 PUBLIC KEY条目,然后我替换为正确的,并将应用程序版本更改为2.0在Androidmanifest .xml和再生的密钥库,最后将apk上传到开发者控制台,禁用版本1,并在控制台中发布版本2。当从控制台下载新的apk仍然面临问题时,应用程序正在抛出从服务器检索信息[RPC:S-7:AEC-0]错误。我google了,找到解决方案,重新启动设备,它的工作


I have no clue whether am I doing a correct implementation of LVL.
Please guide me with this issue.

I followed some of the answers like clearing the cache, uninstalling and reinsatlling.
Still no luck..

I tried the following steps before uploading to alpha testing.

  1. I am using Eclipse. I created a keystore using the export signed application package option
  2. Uploaded the APK from the keystore.

Following is my code, which I took from How to license my Android application?

public class Activity_LicenseCheck extends Activity {
    private class MyLicenseCheckerCallback implements LicenseCheckerCallback{
    @Override
    public void allow(int reason) {
          toast("Inside-Allow:" + reason);
         if (isFinishing()) {
             // Don't update UI if Activity is finishing.
             return;
            }
         startMainActivity();

    }

    @Override
    public void dontAllow(int reason) {

          toast("dontAllow: " + reason);
        if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }


    }

    @Override
    public void applicationError(int errorCode) {
         if (isFinishing()) {
                return;
            }

            toast("Errorffff: " + errorCode);
            startMainActivity();

    }

    }
    private static final String BASE64_PUBLIC_KEY = "mykey";
    private static final byte[] SALT = new byte[] {11,34,56,36,3,45,-87,2,67,-98,32,-14,44,-58,39,-26,72,-19,86,23};
    private LicenseChecker mChecker;

    // A handler on the UI thread.

    private LicenseCheckerCallback mLicenseCheckerCallback;
    private void doCheck() {
            mChecker.checkAccess(mLicenseCheckerCallback);
    }

    @Override
        public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Try to use more data here. ANDROID_ID is a single point of attack.
    String deviceId = Secure.getString(getContentResolver(),
            Secure.ANDROID_ID);

    // Library calls this when it's done.
    mLicenseCheckerCallback = new MyLicenseCheckerCallback();
    // Construct the LicenseChecker with a policy.
    mChecker = new LicenseChecker(this, new ServerManagedPolicy(this,
            new AESObfuscator(SALT, getPackageName(), deviceId)),
            BASE64_PUBLIC_KEY);
            doCheck();
        }

    @Override
        protected Dialog onCreateDialog(int id) {
    // We have only one dialog.
    return new AlertDialog.Builder(this)
            .setTitle("Application Not Licensed")
            .setCancelable(false)
            .setMessage(
                    "This application is not licensed. Please purchase it from Android Market")
            .setPositiveButton("Buy App",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {
                            Intent marketIntent = new Intent(
                                    Intent.ACTION_VIEW,
                                    Uri.parse("http://market.android.com/details?id="
                                            + getPackageName()));
                            startActivity(marketIntent);
                            finish();
                        }
                    })
            .setNegativeButton("Exit",
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog,
                                int which) {
                            finish();
                        }
                    }).create();
        }
        @Override
        protected void onDestroy() {
    super.onDestroy();
    mChecker.onDestroy();
        }

      private void startMainActivity() {
        startActivity(new Intent(this, Activity_login.class));  
        finish();
        }

        public void toast(String string) {
    Toast.makeText(this, string, Toast.LENGTH_SHORT).show();
        }
}

解决方案

Finally it worked the issue was the wrong entry of BASE64 PUBLIC KEY.I was completely clueless about the licencing concept google should come up with easy solution.

How it worked for me.. My first publish was ver 1.0 and i was getting error 561.(Not licenced) the isuue was wrong BASE64 PUBLIC KEY entry then i replaced it with the correct one and changed application version to 2.0 in Androidmanifest.xml and regenerated keystore and finally uploaded apk to the developer console and disabled version 1 and published version 2 in the console. when downloaded new apk from the console still facing issue the app was throwing "Error retrieving information from server [RPC:S-7:AEC-0]" error. i googled and found the solution, rebooted the device and it worked

这篇关于Android许可错误561 - 此应用程序未获得许可。请从Android Market购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆