diff --git a/src/keepass2android-app/PasswordActivity.cs b/src/keepass2android-app/PasswordActivity.cs
index c157e43e..9cd6d54b 100644
--- a/src/keepass2android-app/PasswordActivity.cs
+++ b/src/keepass2android-app/PasswordActivity.cs
@@ -1423,6 +1423,8 @@ namespace keepass2android
if (cbQuickUnlock == null)
throw new NullPointerException("cpQuickUnlock");
App.Kp2a.SetQuickUnlockEnabled(cbQuickUnlock.Checked);
+ App.Kp2a.ScreenLockWasEnabledWhenOpeningDatabase =
+ (((KeyguardManager)GetSystemService(Context.KeyguardService)!)!).IsDeviceSecure;
if ((_loadDbFileTask != null) && (App.Kp2a.OfflineMode != _loadDbTaskOffline))
{
diff --git a/src/keepass2android-app/QuickUnlock.cs b/src/keepass2android-app/QuickUnlock.cs
index 4dd2176a..4a8b35fa 100644
--- a/src/keepass2android-app/QuickUnlock.cs
+++ b/src/keepass2android-app/QuickUnlock.cs
@@ -25,6 +25,7 @@ using Android.Widget;
using Android.Content.PM;
using KeePassLib.Keys;
using Android.Preferences;
+using Android.Provider;
using Android.Runtime;
using Android.Views.InputMethods;
@@ -162,6 +163,29 @@ namespace keepass2android
if (bundle != null)
numFailedAttempts = bundle.GetInt(NumFailedAttemptsKey, 0);
+ FindViewById(Resource.Id.QuickUnlock_buttonEnableLock).Click += (object sender, EventArgs e) =>
+ {
+ Intent intent = new Intent(Settings.ActionSecuritySettings);
+ StartActivity(intent);
+
+ };
+
+ FindViewById(Resource.Id.QuickUnlock_buttonCloseDb).Click += (object sender, EventArgs e) =>
+ {
+ App.Kp2a.Lock(false);
+ };
+
+ if (App.Kp2a.ScreenLockWasEnabledWhenOpeningDatabase == false)
+ {
+ FindViewById(Resource.Id.QuickUnlockForm).Visibility = ViewStates.Gone;
+ FindViewById(Resource.Id.QuickUnlockBlocked).Visibility = ViewStates.Visible;
+ }
+ else
+ {
+ FindViewById(Resource.Id.QuickUnlockForm).Visibility = ViewStates.Visible;
+ FindViewById(Resource.Id.QuickUnlockBlocked).Visibility = ViewStates.Gone;
+ }
+
}
diff --git a/src/keepass2android-app/Resources/layout/QuickUnlock.xml b/src/keepass2android-app/Resources/layout/QuickUnlock.xml
index c3b8fdfb..0c4da5c4 100644
--- a/src/keepass2android-app/Resources/layout/QuickUnlock.xml
+++ b/src/keepass2android-app/Resources/layout/QuickUnlock.xml
@@ -78,20 +78,21 @@ android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
-
-
+ android:orientation="horizontal"
+ android:id="@+id/QuickUnlockForm">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Disable Biometric Unlock
Enable full Biometric Unlock
Enable Biometric Unlock for QuickUnlock
+ Password-based QuickUnlock not available
+ QuickUnlock using a part of your password is blocked because screen lock is not activated on your device. This behavior is to protect you in case somebody watched you entering your QuickUnlock key.
Biometric Unlock failed. Decryption key was invalidated by Android OS. This usually happens if a biometric authentication or security settings were changed.
Unlocking the database failed: Invalid composite key. Biometric Unlock was disabled because apparently the stored master password is no longer valid.
Please re-enable Biometric Unlock for the new master password.
@@ -319,6 +321,7 @@
Enter QuickUnlock code:
QuickUnlock!
Close database
+ Enable screen lock
Enable QuickUnlock by default
Defines whether QuickUnlock is enabled by default or not.
Protect database display
diff --git a/src/keepass2android-app/app/App.cs b/src/keepass2android-app/app/App.cs
index 9bb54877..b052c59f 100644
--- a/src/keepass2android-app/app/App.cs
+++ b/src/keepass2android-app/app/App.cs
@@ -351,7 +351,10 @@ namespace keepass2android
QuickUnlockEnabled = enabled;
}
- public bool QuickUnlockEnabled { get; private set; }
+ public bool ScreenLockWasEnabledWhenOpeningDatabase { get; set; }
+
+
+ public bool QuickUnlockEnabled { get; private set; }
public int QuickUnlockKeyLength { get; private set; }
@@ -833,8 +836,8 @@ namespace keepass2android
new AndroidContentStorage(LocaleManager.LocalizedAppContext),
#if !EXCLUDE_JAVAFILESTORAGE
#if !NoNet
- new DropboxFileStorage(LocaleManager.LocalizedAppContext, this),
- new DropboxAppFolderFileStorage(LocaleManager.LocalizedAppContext, this),
+ /*TODO new DropboxFileStorage(LocaleManager.LocalizedAppContext, this),
+ new DropboxAppFolderFileStorage(LocaleManager.LocalizedAppContext, this),*/
GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveFileStorage(LocaleManager.LocalizedAppContext, this) : null,
GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveAppDataFileStorage(LocaleManager.LocalizedAppContext, this) : null,
new OneDriveFileStorage(this),