Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:44:44+00:00 2026-05-31T22:44:44+00:00

Everything before was perfect… but… Today something happened to my License checker (without touching

  • 0

Everything before was perfect… but…
Today something happened to my License checker (without touching a line) and that made my app crash. So I saw there was an update available on the Package Manager for that library and updated (I’ve updated Eclipse too).
I’ve also updated the methods in order to make them work with the new update.
It worked for a couple of hours.
After some Eclipse open/close cycle that stop working again (it compiles but crashes):

This is the LicenseCheck.java:

package it.android.smartscreenoffpro;

/*
 * @author Nick Eubanks
 * 
 * Copyright (C) 2010 Android Infinity (http://www.androidinfinity.com)
 *
 */
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.google.android.vending.licensing.AESObfuscator;
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;

/*
 * NOTES ON USING THIS LICENSE FILE IN YOUR APPLICATION: 
 * 1. Define the package
 * of you application above 
 * 2. Be sure your public key is set properly  @BASE64_PUBLIC_KEY
 * 3. Change your SALT using random digits 
 * 4. Under AllowAccess, Add your previously used MainActivity 
 * 5. Add this activity to
 * your manifest and set intent filters to MAIN and LAUNCHER 
 * 6. Remove Intent Filters from previous main activity
 */
public class LicenseCheck extends Activity {
    private class MyLicenseCheckerCallback implements LicenseCheckerCallback {

        public void allow(int reason) {
            if (isFinishing()) {
                // Don't update UI if Activity is finishing.
                return;
            }
            // Should allow user access.
            startMainActivity();

        }


        public void applicationError(int 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);
            startMainActivity();

        }

        public void dontAllow(int reason) {
            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 = "It is probably better not to post your key in a place like this.";

    private static final byte[] SALT = new byte[] {-90, 65, 70, -128, -103, -57, 74, -64, 51, 99,
        -95, -5, 100, 97, -35, -113, -14, 32, -64, 89};
    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. Make sure you are connected to Internet. Please purchase it from Android Market")
                .setPositiveButton("Buy App",
                        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, ActivityPrincipale.class));  //REPLACE MainActivity.class WITH YOUR APPS ORIGINAL LAUNCH ACTIVITY
        finish();
    }

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

This is the runtime error:

03-16 16:53:59.198: E/AndroidRuntime(29719): FATAL EXCEPTION: main
03-16 16:53:59.198: E/AndroidRuntime(29719): java.lang.NoClassDefFoundError: it.android.smartscreenoffpro.LicenseCheck$MyLicenseCheckerCallback
03-16 16:53:59.198: E/AndroidRuntime(29719):    at it.android.smartscreenoffpro.LicenseCheck.onCreate(LicenseCheck.java:101)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.Activity.performCreate(Activity.java:4465)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.os.Looper.loop(Looper.java:137)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at android.app.ActivityThread.main(ActivityThread.java:4424)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at java.lang.reflect.Method.invokeNative(Native Method)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at java.lang.reflect.Method.invoke(Method.java:511)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-16 16:53:59.198: E/AndroidRuntime(29719):    at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:44:46+00:00Added an answer on May 31, 2026 at 10:44 pm

    Started worked automatically .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

...before everything, I'm doing this out of curiosity only. Nothing real-world application here, but
I use NAudio. Before everything was good. But yesterday there was an error: All
So say I would write something like <break> and it would show everything before
I have switched all html (and php) pages to utf-8. Before that everything looked
I want to delete everything before the last tab (or comma). For example, in
I have a simple xml file and I want to remove everything before the
I just installed PC Tools Anti-Virus and my ASP.NET website recompiles everything before every
I have a string 2500 - SomeValue. How can I remove everything before the
before everything, ty for helping and sorry for the noob question. I have problem
If you read this thread before - forget everything I wrote , I must

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.