Skip to content

Commit e8260a3

Browse files
committed
Fix crash & gesture lock not working. Resolve #3
1 parent e0dec6c commit e8260a3

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "sun.bob.leela"
88
minSdkVersion 16
99
targetSdkVersion 24
10-
versionCode 1
11-
versionName "1.1"
10+
versionCode 2
11+
versionName "1.2"
1212
renderscriptSupportModeEnabled true
1313
resConfigs "en", "zh"
1414
}

app/src/main/java/sun/bob/leela/runnable/QuickPassRunnable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public QuickPassRunnable(String quickCode, String password) {
4444

4545
private void getPasswordHash() {
4646
Account account = AccountHelper.getInstance(null).getQuickAccount();
47-
if (this.passwordHash == null) {
47+
if (account == null) {
4848
UserDefault.getInstance(null).clearQuickPassword();
4949
AccountHelper.getInstance(null).clearQuickAccount();
5050
return;

app/src/main/java/sun/bob/leela/ui/activities/SettingsActivity.java

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -133,29 +133,6 @@ public void onClick(TextItem textItem) {
133133
}
134134
}));
135135

136-
// if (UserDefault.getInstance(null).hasQuickPassword()) {
137-
// selectorItem = new SelectorItem(this, UserDefault.kSettingsQuickPassByte).setAdapter(new SettingsSpinnerAdapter()).setOnItemClickListener(new AdapterView.OnItemSelectedListener() {
138-
// @Override
139-
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
140-
// getStorageInterface().save(UserDefault.kSettingsQuickPassByte, id);
141-
// }
142-
//
143-
// @Override
144-
// public void onNothingSelected(AdapterView<?> parent) {
145-
//
146-
// }
147-
// });
148-
//
149-
// if (UserDefault.getInstance(null).getQuickPassByte() == UserDefault.v4x4) {
150-
// selectorItem.setSelectedPos(1);
151-
// } else {
152-
// selectorItem.setSelectedPos(0);
153-
// }
154-
//
155-
// addItem(selectorItem);
156-
// } else {
157-
//
158-
// }
159136

160137
}
161138

@@ -190,7 +167,12 @@ public void onEventMainThread(Object event) {
190167
}
191168
return;
192169
}
193-
dialog.dismiss();
170+
if (dialog != null) {
171+
dialog.dismiss();
172+
}
173+
if (!(event instanceof DBExportEvent)) {
174+
return;
175+
}
194176
DBExportEvent dbExportEvent = (DBExportEvent) event;
195177
if (dbExportEvent.success) {
196178
new AlertDialog.Builder(this)

app/src/main/java/sun/bob/leela/utils/CryptoUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ public void onEventMainThread(CryptoEvent event) {
207207
EventBus.getDefault().unregister(this);
208208
break;
209209
case AppConstants.TYPE_SHTHPPN:
210-
dialog.dismiss();
210+
if (dialog != null) {
211+
dialog.dismiss();
212+
}
211213
break;
212214
default:
213215
if (dialog != null) {

0 commit comments

Comments
 (0)