From 22b15221926c4f5b63dee9f159d78b849b748bdc Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Wed, 8 Mar 2023 12:03:05 +0100 Subject: [PATCH] Optional password fallback --- app/src/main/java/sushi/hardcore/droidfs/VolumeOpener.kt | 2 +- app/src/main/res/drawable/icon_password.xml | 5 +++++ app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/root_preferences.xml | 7 +++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/icon_password.xml diff --git a/app/src/main/java/sushi/hardcore/droidfs/VolumeOpener.kt b/app/src/main/java/sushi/hardcore/droidfs/VolumeOpener.kt index 5944635..60c4d23 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/VolumeOpener.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/VolumeOpener.kt @@ -80,7 +80,7 @@ class VolumeOpener( } override fun onPasswordHashSaved() {} override fun onFailed(pending: Boolean) { - if (!pending) { + if (!pending && sharedPrefs.getBoolean("passwordFallback", true)) { askForPassword(volume, isVolumeSaved, callbacks) } } diff --git a/app/src/main/res/drawable/icon_password.xml b/app/src/main/res/drawable/icon_password.xml new file mode 100644 index 0000000..dd44e53 --- /dev/null +++ b/app/src/main/res/drawable/icon_password.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 649089a..c5b04a7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -258,4 +258,6 @@ Theme color Change app theme color Black theme + Fallback to password + Prompt for password when fingerprint authentication is cancelled diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 7df3298..cbf8b1f 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -74,6 +74,13 @@ android:defaultValue="false" android:icon="@drawable/icon_mod"/> + +