diff --git a/app/build.gradle b/app/build.gradle index e3bfca3..24f00f7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "sun.bob.leela" minSdkVersion 16 targetSdkVersion 24 - versionCode 1 - versionName "1.1" + versionCode 2 + versionName "1.2" renderscriptSupportModeEnabled true resConfigs "en", "zh" } diff --git a/app/src/main/java/sun/bob/leela/runnable/QuickPassRunnable.java b/app/src/main/java/sun/bob/leela/runnable/QuickPassRunnable.java index 044402d..aeef2ca 100644 --- a/app/src/main/java/sun/bob/leela/runnable/QuickPassRunnable.java +++ b/app/src/main/java/sun/bob/leela/runnable/QuickPassRunnable.java @@ -44,7 +44,7 @@ public QuickPassRunnable(String quickCode, String password) { private void getPasswordHash() { Account account = AccountHelper.getInstance(null).getQuickAccount(); - if (this.passwordHash == null) { + if (account == null) { UserDefault.getInstance(null).clearQuickPassword(); AccountHelper.getInstance(null).clearQuickAccount(); return; diff --git a/app/src/main/java/sun/bob/leela/ui/activities/SettingsActivity.java b/app/src/main/java/sun/bob/leela/ui/activities/SettingsActivity.java index 6126536..ed0be4a 100644 --- a/app/src/main/java/sun/bob/leela/ui/activities/SettingsActivity.java +++ b/app/src/main/java/sun/bob/leela/ui/activities/SettingsActivity.java @@ -133,29 +133,6 @@ public void onClick(TextItem textItem) { } })); -// if (UserDefault.getInstance(null).hasQuickPassword()) { -// selectorItem = new SelectorItem(this, UserDefault.kSettingsQuickPassByte).setAdapter(new SettingsSpinnerAdapter()).setOnItemClickListener(new AdapterView.OnItemSelectedListener() { -// @Override -// public void onItemSelected(AdapterView parent, View view, int position, long id) { -// getStorageInterface().save(UserDefault.kSettingsQuickPassByte, id); -// } -// -// @Override -// public void onNothingSelected(AdapterView parent) { -// -// } -// }); -// -// if (UserDefault.getInstance(null).getQuickPassByte() == UserDefault.v4x4) { -// selectorItem.setSelectedPos(1); -// } else { -// selectorItem.setSelectedPos(0); -// } -// -// addItem(selectorItem); -// } else { -// -// } } @@ -190,7 +167,12 @@ public void onEventMainThread(Object event) { } return; } - dialog.dismiss(); + if (dialog != null) { + dialog.dismiss(); + } + if (!(event instanceof DBExportEvent)) { + return; + } DBExportEvent dbExportEvent = (DBExportEvent) event; if (dbExportEvent.success) { new AlertDialog.Builder(this) diff --git a/app/src/main/java/sun/bob/leela/utils/CryptoUtil.java b/app/src/main/java/sun/bob/leela/utils/CryptoUtil.java index 0d5e769..82b8647 100644 --- a/app/src/main/java/sun/bob/leela/utils/CryptoUtil.java +++ b/app/src/main/java/sun/bob/leela/utils/CryptoUtil.java @@ -207,7 +207,9 @@ public void onEventMainThread(CryptoEvent event) { EventBus.getDefault().unregister(this); break; case AppConstants.TYPE_SHTHPPN: - dialog.dismiss(); + if (dialog != null) { + dialog.dismiss(); + } break; default: if (dialog != null) {