From e136fdad9132922737679cf01e2210299135a585 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Sun, 24 Sep 2023 16:27:44 +0200 Subject: [PATCH] Fix OTP editing, Update dependencies --- app/build.gradle | 6 +++--- .../cringe_authenticator/fragment/GroupFragment.java | 1 + .../cringe_authenticator/util/DialogUtil.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2945485..6f767bd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,13 +73,13 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.lifecycle:lifecycle-livedata:2.6.2' implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.2' - implementation 'androidx.navigation:navigation-fragment:2.7.2' - implementation 'androidx.navigation:navigation-ui:2.7.2' + implementation 'androidx.navigation:navigation-fragment:2.7.3' + implementation 'androidx.navigation:navigation-ui:2.7.3' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' implementation "androidx.biometric:biometric:1.1.0" - implementation 'com.cringe_studios:CringeAuthenticatorLibrary:1.5' + implementation 'com.cringe_studios:CringeAuthenticatorLibrary:1.6' implementation 'com.google.mlkit:barcode-scanning:17.2.0' implementation 'com.google.code.gson:gson:2.10.1' implementation 'androidx.activity:activity:1.7.2' diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java index f0f68a2..c16cfb6 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/fragment/GroupFragment.java @@ -191,6 +191,7 @@ public class GroupFragment extends NamedFragment { } saveOTPs(); + finishEditing(); }) .setNegativeButton(R.string.no, (d, w) -> {}) .show(); diff --git a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/DialogUtil.java b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/DialogUtil.java index 4bc238c..77f6a0a 100644 --- a/app/src/main/java/com/cringe_studios/cringe_authenticator/util/DialogUtil.java +++ b/app/src/main/java/com/cringe_studios/cringe_authenticator/util/DialogUtil.java @@ -172,7 +172,7 @@ public class DialogUtil { int counter = Integer.parseInt(binding.inputCounter.getText().toString()); boolean checksum = binding.inputChecksum.isChecked(); - OTPData data = new OTPData(name, issuer, OTPType.TOTP, secret, algorithm, digits, 0, counter, checksum); + OTPData data = new OTPData(name, issuer, OTPType.HOTP, secret, algorithm, digits, 0, counter, checksum); String errorMessage = data.validate(); if(errorMessage != null) {