π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Lockscreen Fixes
Aman Raj Singh Mouryaa0980a963859
diff --git a/mobile/lib/services/local_authentication_service.dart b/mobile/lib/services/local_authentication_service.dartindex a989da5124..6167fca67f 100644--- a/mobile/lib/services/local_authentication_service.dart+++ b/mobile/lib/services/local_authentication_service.dart@@ -21,7 +21,11 @@ class LocalAuthenticationService {) async {if (await _isLocalAuthSupportedOnDevice()) {AppLock.of(context)!.setEnabled(false);- final result = await requestAuthentication(context, infoMessage);+ final result = await requestAuthentication(+ context,+ infoMessage,+ isAuthenticatingForInAppChange: true,+ );AppLock.of(context)!.setEnabled(await Configuration.instance.shouldShowLockScreen(),);@@ -40,6 +44,7 @@ class LocalAuthenticationService {String? savedPin,String? savedPassword, {bool isOnOpeningApp = false,+ bool isAuthenticatingForInAppChange = false,}) async {if (savedPassword != null) {final result = await Navigator.of(context).push(@@ -47,6 +52,7 @@ class LocalAuthenticationService {builder: (BuildContext context) {return LockScreenPassword(isAuthenticating: true,+ isAuthenticatingForInAppChange: isAuthenticatingForInAppChange,isOnOpeningApp: isOnOpeningApp,authPass: savedPassword,);@@ -63,6 +69,7 @@ class LocalAuthenticationService {builder: (BuildContext context) {return LockScreenPin(isAuthenticating: true,+ isAuthenticatingForInAppChange: isAuthenticatingForInAppChange,isOnOpeningApp: isOnOpeningApp,authPin: savedPin,);diff --git a/mobile/lib/ui/settings/lock_screen/lock_screen_password.dart b/mobile/lib/ui/settings/lock_screen/lock_screen_password.dartindex 24d0f7575a..4cf7f965e0 100644--- a/mobile/lib/ui/settings/lock_screen/lock_screen_password.dart+++ b/mobile/lib/ui/settings/lock_screen/lock_screen_password.dart@@ -18,12 +18,14 @@ class LockScreenPassword extends StatefulWidget {super.key,this.isAuthenticating = false,this.isOnOpeningApp = false,+ this.isAuthenticatingForInAppChange = false,this.authPass,});//Is false when setting a new passwordfinal bool isAuthenticating;final bool isOnOpeningApp;+ final bool isAuthenticatingForInAppChange;final String? authPass;@overrideState<LockScreenPassword> createState() => _LockScreenPasswordState();@@ -201,7 +203,7 @@ class _LockScreenPasswordState extends State<LockScreenPassword> {if (widget.authPass == base64Encode(hash)) {await _lockscreenSetting.setInvalidAttemptCount(0);- widget.isOnOpeningApp+ widget.isOnOpeningApp || widget.isAuthenticatingForInAppChange? Navigator.of(context).pop(true): Navigator.of(context).pushReplacement(MaterialPageRoute(diff --git a/mobile/lib/ui/settings/lock_screen/lock_screen_pin.dart b/mobile/lib/ui/settings/lock_screen/lock_screen_pin.dartindex 622078706f..bc0eb91cde 100644--- a/mobile/lib/ui/settings/lock_screen/lock_screen_pin.dart+++ b/mobile/lib/ui/settings/lock_screen/lock_screen_pin.dart@@ -20,12 +20,14 @@ class LockScreenPin extends StatefulWidget {super.key,this.isAuthenticating = false,this.isOnOpeningApp = false,+ this.isAuthenticatingForInAppChange = false,this.authPin,});//Is false when setting a new passwordfinal bool isAuthenticating;final bool isOnOpeningApp;+ final bool isAuthenticatingForInAppChange;final String? authPin;@overrideState<LockScreenPin> createState() => _LockScreenPinState();@@ -62,7 +64,7 @@ class _LockScreenPinState extends State<LockScreenPin> {if (widget.authPin == base64Encode(hash)) {invalidAttemptsCount = 0;await _lockscreenSetting.setInvalidAttemptCount(0);- widget.isOnOpeningApp+ widget.isOnOpeningApp || widget.isAuthenticatingForInAppChange? Navigator.of(context).pop(true): Navigator.of(context).pushReplacement(MaterialPageRoute(diff --git a/mobile/lib/utils/auth_util.dart b/mobile/lib/utils/auth_util.dartindex 9c4e161fbf..6db836594c 100644--- a/mobile/lib/utils/auth_util.dart+++ b/mobile/lib/utils/auth_util.dart@@ -11,6 +11,7 @@ Future<bool> requestAuthentication(BuildContext context,String reason, {bool isOpeningApp = false,+ bool isAuthenticatingForInAppChange = false,}) async {Logger("AuthUtil").info("Requesting authentication");await LocalAuthentication().stopAuthentication();@@ -24,6 +25,7 @@ Future<bool> requestAuthentication(savedPin,savedPassword,isOnOpeningApp: isOpeningApp,+ isAuthenticatingForInAppChange: isAuthenticatingForInAppChange,);} else {return await LocalAuthentication().authenticate(