Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 4817330

Browse files
committed
Fix fingerprint not restored permanently (closes #26)
1 parent 21c3e8f commit 4817330

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/src/main/java/de/codebucket/mkkm/MobileKKM.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ public String getFingerprint() {
9393
return UUID.nameUUIDFromBytes(deviceId.getBytes()).toString().replaceAll("-", "");
9494
}
9595

96+
public void updateFingerprint(String fingerprint) {
97+
preferences.edit().putString("fingerprint", fingerprint).apply();
98+
loginHelper.updateFingerprint(fingerprint);
99+
}
100+
96101
public boolean isNetworkConnectivity() {
97102
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
98103
if (cm != null) {

app/src/main/java/de/codebucket/mkkm/activity/BackupActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void doRestore(Uri uri) {
166166

167167
// Check if associated account is currently logged in
168168
if (AccountUtils.getPassengerId(AccountUtils.getAccount()).equals(account)) {
169-
MobileKKM.getLoginHelper().updateFingerprint(fingerprint);
169+
MobileKKM.getInstance().updateFingerprint(fingerprint);
170170
Toast.makeText(this, R.string.backup_import_success, Toast.LENGTH_SHORT).show();
171171
} else {
172172
Toast.makeText(this, R.string.backup_wrong_account, Toast.LENGTH_SHORT).show();
@@ -246,7 +246,7 @@ public void onClick(DialogInterface dialog, int which) {
246246
return;
247247
}
248248

249-
MobileKKM.getLoginHelper().updateFingerprint(fingerprint);
249+
MobileKKM.getInstance().updateFingerprint(fingerprint);
250250
Toast.makeText(BackupActivity.this, R.string.backup_import_success, Toast.LENGTH_SHORT).show();
251251
}
252252
})

0 commit comments

Comments
 (0)