Hmm, OK. Wenn es nur mit dem AppCenter geht, OK.
Nun stehe ich vor einer neuen Herausforderung...
Im der Google LVL habe ich einen Dialog angezeigt wenn "dontallow" aufgerufen wurde.
Das hatte auch super funktioniert.
Nachdem nun die AndroidPit LVL genutzt wird geht das nicht mehr. Erneut App-Crash.
Log-Cat:
08-07 23:30:58.095: I/AndroidPitLicenseChecker(11965): Cleaning up...
08-07 23:30:58.125: E/ActivityThread(11965): Activity de.fahrtenbuch_sync.Main has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@40f7f530 that was originally bound here
08-07 23:30:58.125: E/ActivityThread(11965): android.app.ServiceConnectionLeaked: Activity de.fahrtenbuch_sync.Main has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@40f7f530 that was originally bound here
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:936)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:830)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.ContextImpl.bindService(ContextImpl.java:1136)
08-07 23:30:58.125: E/ActivityThread(11965): at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
08-07 23:30:58.125: E/ActivityThread(11965): at android.speech.tts.TextToSpeech.connectToEngine(TextToSpeech.java:614)
08-07 23:30:58.125: E/ActivityThread(11965): at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:584)
08-07 23:30:58.125: E/ActivityThread(11965): at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:547)
08-07 23:30:58.125: E/ActivityThread(11965): at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:522)
08-07 23:30:58.125: E/ActivityThread(11965): at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:507)
08-07 23:30:58.125: E/ActivityThread(11965): at de.fahrtenbuch_sync.Main.onResume(Main.java:307)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.Activity.performResume(Activity.java:4539)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2557)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2595)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2109)
08-07 23:30:58.125: E/ActivityThread(11965): at android.app.ActivityThread.access$600(ActivityThread.java:132)
Auszug der LicenseCheckActivity:
1protected void checkLicense() {
2
3 Log.i("LICENSE", "checkLicense");
4 mHandler = new Handler();
5 // Try to use more data here. ANDROID_ID is a single point of attack.
6 String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
7
8 // Library calls this when it's done.
9 mLicenseCheckerCallback = new MyLicenseCheckerCallback();
10 // Construct the LicenseChecker with a policy.
11 mChecker = new AndroidPitLicenseChecker(
12 LicenseCheckActivity.this,
13 getPackageName(),
14 BASE64_PUBLIC_KEY_ANDROID_PIT,
15 new ServerManagedPolicy(
16 LicenseCheckActivity.this,
17 new AESObfuscator(SALT, getPackageName(), deviceId)),
18 BASE64_PUBLIC_KEY);
19
20// mChecker = new LicenseChecker(
21// this, new StrictPolicy(),
22// BASE64_PUBLIC_KEY);
23
24 doCheck();
25
26 }
27
28 protected class MyLicenseCheckerCallback<ApplicationErrorCode> implements IAndroidPitLicenseCheckerCallback {
29
30
31 public void allow() {
32 Log.i("LICENSE", "allow");
33 if (isFinishing()) {
34 // Don't update UI if Activity is finishing.
35 return;
36 }
37 // Should allow user access.
38 displayResult(getString(R.string.allow));
39 licensed = true;
40 checkingLicense = false;
41 didCheck = true;
42
43 }
44
45 public void dontAllow() {
46 Log.i("LICENSE", "dontAllow");
47 if (isFinishing()) {
48 // Don't update UI if Activity is finishing.
49 return;
50 }
51 displayResult(getString(R.string.dont_allow));
52 licensed = false;
53 // Should not allow access. In most cases, the app should assume
54 // the user has access unless it encounters this. If it does,
55 // the app should inform the user of their unlicensed ways
56 // and then either shut down the app or limit the user to a
57 // restricted set of features.
58 // In this example, we show a dialog that takes the user to Market.
59 checkingLicense = false;
60 didCheck = true;
61
62 showDialog(0);
63 }
64
65 public void applicationError(AndroidPitLicenseCheckCode errorCode) {
66 Log.i("LICENSE", "error: " + errorCode);
67 if (isFinishing()) {
68 // Don't update UI if Activity is finishing.
69 return;
70 }
71 licensed = false;
72 // This is a polite way of saying the developer made a mistake
73 // while setting up or calling the license checker library.
74 // Please examine the error code and fix the error.
75 String result = String.format(getString(R.string.application_error), errorCode);
76 checkingLicense = false;
77 didCheck = true;
78
79 //displayResult(result);
80 showDialog(0);
81 }
82
83
84 }
85
86 protected Dialog onCreateDialog(int id) {
87 // We have only one dialog.
88 return new AlertDialog.Builder(LicenseCheckActivity.this)
89 .setTitle(R.string.unlicensed_dialog_title)
90 .setMessage(R.string.unlicensed_dialog_body)
91 .setPositiveButton(R.string.buy_button, new DialogInterface.OnClickListener() {
92 public void onClick(DialogInterface dialog, int which) {
93 Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
94 "http://market.android.com/details?id=" + getPackageName()));
95 startActivity(marketIntent);
96 finish();
97 }
98 })
99 .setNegativeButton(R.string.quit_button, new DialogInterface.OnClickListener() {
100 public void onClick(DialogInterface dialog, int which) {
101 finish();
102 }
103 })
104
105 .setCancelable(false)
106 .setOnKeyListener(new DialogInterface.OnKeyListener(){
107 public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
108 Log.i("License", "Key Listener");
109 finish();
110 return true;
111 }
112 })
113 .create();
114
115 }
Jemand eine Idee?