Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][auth] Added key to check if appLock is set or not

Aman Raj Singh Mourya3a4246b82d5d
diff --git a/auth/lib/utils/lock_screen_settings.dart b/auth/lib/utils/lock_screen_settings.dart
index 6b45bc09dc..1235c95e15 100644
--- a/auth/lib/utils/lock_screen_settings.dart
+++ b/auth/lib/utils/lock_screen_settings.dart
@@ -19,6 +19,7 @@ class LockScreenSettings {
static const lastInvalidAttemptTime = "ls_last_invalid_attempt_time";
static const autoLockTime = "ls_auto_lock_time";
static const keyHideAppContent = "ls_hide_app_content";
+ static const keyAppLockSet = "ls_is_app_lock_set";
final List<Duration> autoLockDurations = const [
Duration(seconds: 0),
Duration(seconds: 5),
@@ -83,6 +84,14 @@ class LockScreenSettings {
await _preferences.setInt(keyInvalidAttempts, count);
}
+ Future<void> isAppLockSet(bool value) async {
+ await _preferences.setBool(keyAppLockSet, value);
+ }
+
+ bool getIsAppLockSet() {
+ return _preferences.getBool(keyAppLockSet) ?? false;
+ }
+
static Uint8List _generateSalt() {
return sodium.randombytes.buf(sodium.crypto.pwhash.saltBytes);
}