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

Commit

Permalink
Fix fingerprint not restored permanently (closes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
divadsn committed Oct 26, 2018
1 parent 21c3e8f commit 4817330
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/de/codebucket/mkkm/MobileKKM.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ public String getFingerprint() {
return UUID.nameUUIDFromBytes(deviceId.getBytes()).toString().replaceAll("-", "");
}

public void updateFingerprint(String fingerprint) {
preferences.edit().putString("fingerprint", fingerprint).apply();
loginHelper.updateFingerprint(fingerprint);
}

public boolean isNetworkConnectivity() {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void doRestore(Uri uri) {

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

MobileKKM.getLoginHelper().updateFingerprint(fingerprint);
MobileKKM.getInstance().updateFingerprint(fingerprint);
Toast.makeText(BackupActivity.this, R.string.backup_import_success, Toast.LENGTH_SHORT).show();
}
})
Expand Down

0 comments on commit 4817330

Please sign in to comment.