android许可证不起作用

android许可证不起作用,android,manifest,android-lvl,Android,Manifest,Android Lvl,我需要一点帮助。简而言之。我安装了通用许可证检查代码,但当我将我的应用程序上载到市场时,它不允许用户使用我的应用程序。它告诉他们他们没有权限有人能告诉我我错过了什么吗 package com.test.test; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface;

我需要一点帮助。简而言之。我安装了通用许可证检查代码,但当我将我的应用程序上载到市场时,它不允许用户使用我的应用程序。它告诉他们他们没有权限有人能告诉我我错过了什么吗

   package com.test.test;

   import android.app.Activity;
   import android.app.AlertDialog;
   import android.app.Dialog;
   import android.content.DialogInterface;
   import android.content.Intent;
   import android.net.Uri;
   import android.os.Bundle;
   import android.provider.Settings.Secure;
   import android.widget.Toast;

   import com.manifestxml.chakra.AESObfuscator;
   import com.manifestxml.chakra.LicenseChecker;
   import com.manifestxml.chakra.LicenseCheckerCallback;
   import com.manifestxml.chakra.ServerManagedPolicy;



   public class splash extends Activity {
    private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
        public void allow() {
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
            // Should allow user access.
            startMainActivity();

        }

        public void applicationError(ApplicationErrorCode errorCode) {
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
            // This is a polite way of saying the developer made a mistake
            // while setting up or calling the license checker library.
            // Please examine the error code and fix the error.
            toast("Error: " + errorCode.name());
            startMainActivity();

        }

        public void dontAllow() {
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }

            // Should not allow access. In most cases, the app should assume
            // the user has access unless it encounters this. If it does,
            // the app should inform the user of their unlicensed ways
            // and then either shut down the app or limit the user to a
            // restricted set of features.
            // In this example, we show a dialog that takes the user to Market.
            showDialog(0);
        }
    }
    private static final String BASE64_PUBLIC_KEY = "my key... sorry you cant see it";

    private static final byte[] SALT = new byte[] { salt numbers here };
    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 app does not appear to be valid.     
   Please purchase it from  Android Market. If this is an error, please contact the    
developer for a correction.")
   .setPositiveButton("Purchase",
                        new DialogInterface.OnClickListener() {
   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() {
                            public void onClick(DialogInterface dialog,
                                    int which) {
                                finish();
                            }
                        }).create();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mChecker.onDestroy();
    }

    private void startMainActivity() {
        startActivity(new Intent(this, ToggleButtonMain.class));  //REPLACE     
   MainActivity.class WITH YOUR 


   APPS ORIGINAL LAUNCH ACTIVITY
        finish();
    }

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

}
这是我的清单文件

   <?xml version="1.0" encoding="utf-8"?>

   <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test.name"
      android:versionName="1.6" android:versionCode="9">


<application  android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".splash" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>     


        <activity android:name = ".ToggleButtonMain">

</activity>




        <activity android:label="@string/app_name" 
                android:name=".TimerActivity"
>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:label="Preferences" android:name=".TimerPrefActivity">
            <intent-filter>
                <action android:name="android.intent.action.CATEGORY_PREFERENCE" />
            </intent-filter>
        </activity>


             <activity android:name = ".TabBarExample">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
</activity>


<activity android:name = "meditationmusic">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
</activity>


    <activity android:name=".FirstTab" />
    <activity android:name=".SecondTab" />
    <activity android:name=".thirdTab" />
    <activity android:name=".fourthTab" />
    <activity android:name=".fifthTab" />
    <activity android:name=".sixthTab" />
    <activity android:name=".seventhTab" />
    <activity android:name=".HowToOpen" />
    <activity android:name=".viztech" />
    <activity android:name=".viznotes" />
    <activity android:name=".cleanchakra" />
    <activity android:name=".breathing" />
    <activity android:name=".benefits" />




    <receiver android:name=".TimerReceiver" ></receiver>
</application>

     <uses-sdk android:minSdkVersion="3" />
       <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
</manifest> 


有人能帮忙吗?。。。我忽略了什么…提前谢谢。

你确定BASE64\u公钥与market.android.com/publish上的完全匹配(点击编辑配置文件到达那里)?

你自己重新创建了错误吗?在我上传之前,一切似乎都很好。。我想我可以再次运行这些文件。。不会痛的。但是我的代码有问题吗?我忽略了什么?是的,我从我的开发人员配置文件帐户获得了公钥。我需要弄清楚为什么会这样。任何想法…代码看起来干净吗?