Optional password fallback

This commit is contained in:
Matéo Duparc 2023-03-08 12:03:05 +01:00
parent 5090a7aa03
commit 22b1522192
Signed by untrusted user: hardcoresushi
GPG Key ID: AFE384344A45E13A
4 changed files with 15 additions and 1 deletions

View File

@ -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)
}
}

View File

@ -0,0 +1,5 @@
<vector android:height="24dp"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="?attr/colorAccent" android:pathData="M2,17h20v2H2V17zM3.15,12.95L4,11.47l0.85,1.48l1.3,-0.75L5.3,10.72H7v-1.5H5.3l0.85,-1.47L4.85,7L4,8.47L3.15,7l-1.3,0.75L2.7,9.22H1v1.5h1.7L1.85,12.2L3.15,12.95zM9.85,12.2l1.3,0.75L12,11.47l0.85,1.48l1.3,-0.75l-0.85,-1.48H15v-1.5h-1.7l0.85,-1.47L12.85,7L12,8.47L11.15,7l-1.3,0.75l0.85,1.47H9v1.5h1.7L9.85,12.2zM23,9.22h-1.7l0.85,-1.47L20.85,7L20,8.47L19.15,7l-1.3,0.75l0.85,1.47H17v1.5h1.7l-0.85,1.48l1.3,0.75L20,11.47l0.85,1.48l1.3,-0.75l-0.85,-1.48H23V9.22z"/>
</vector>

View File

@ -258,4 +258,6 @@
<string name="theme_color">Theme color</string>
<string name="theme_color_summary">Change app theme color</string>
<string name="black_theme">Black theme</string>
<string name="password_fallback">Fallback to password</string>
<string name="password_fallback_summary">Prompt for password when fingerprint authentication is cancelled</string>
</resources>

View File

@ -74,6 +74,13 @@
android:defaultValue="false"
android:icon="@drawable/icon_mod"/>
<SwitchPreferenceCompat
android:title="@string/password_fallback"
android:summary="@string/password_fallback_summary"
android:key="passwordFallback"
android:defaultValue="true"
android:icon="@drawable/icon_password"/>
<SwitchPreferenceCompat
android:title="@string/pin_passwords_title"
android:summary="@string/pin_passwords_summary"