π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Setup common lockscreen
vishnukvmd7a91e714fe89
diff --git a/mobile/packages/lock_screen/lib/auth_util.dart b/mobile/packages/lock_screen/lib/auth_util.dartindex f4071b0712..e1574ab8db 100644--- a/mobile/packages/lock_screen/lib/auth_util.dart+++ b/mobile/packages/lock_screen/lib/auth_util.dart@@ -1,13 +1,13 @@import 'dart:io';-import 'package:ente_lock_screen/local_authentication_service.dart';-import 'package:ente_lock_screen/lock_screen_settings.dart';import 'package:ente_strings/ente_strings.dart';import 'package:flutter/cupertino.dart';import 'package:flutter_local_authentication/flutter_local_authentication.dart';import 'package:local_auth/local_auth.dart';import 'package:local_auth_android/local_auth_android.dart';import 'package:local_auth_darwin/types/auth_messages_ios.dart';+import 'package:lock_screen/local_authentication_service.dart';+import 'package:lock_screen/lock_screen_settings.dart';import 'package:logging/logging.dart';Future<bool> requestAuthentication(diff --git a/mobile/packages/lock_screen/lib/local_authentication_service.dart b/mobile/packages/lock_screen/lib/local_authentication_service.dartindex eb1a65cf05..2ff4b0b673 100644--- a/mobile/packages/lock_screen/lib/local_authentication_service.dart+++ b/mobile/packages/lock_screen/lib/local_authentication_service.dart@@ -1,10 +1,5 @@import 'dart:io';-import 'package:ente_lock_screen/auth_util.dart';-import 'package:ente_lock_screen/lock_screen_settings.dart';-import 'package:ente_lock_screen/ui/app_lock.dart';-import 'package:ente_lock_screen/ui/lock_screen_password.dart';-import 'package:ente_lock_screen/ui/lock_screen_pin.dart';import 'package:ente_ui/utils/dialog_util.dart';import 'package:ente_ui/utils/toast_util.dart';import 'package:flutter/foundation.dart';@@ -12,6 +7,11 @@ import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:flutter_local_authentication/flutter_local_authentication.dart';import 'package:local_auth/local_auth.dart';+import 'package:lock_screen/auth_util.dart';+import 'package:lock_screen/lock_screen_settings.dart';+import 'package:lock_screen/ui/app_lock.dart';+import 'package:lock_screen/ui/lock_screen_password.dart';+import 'package:lock_screen/ui/lock_screen_pin.dart';import 'package:logging/logging.dart';class LocalAuthenticationService {diff --git a/mobile/packages/lock_screen/lib/lock_screen_settings.dart b/mobile/packages/lock_screen/lib/lock_screen_settings.dartindex 2c631bc931..99a41478bf 100644--- a/mobile/packages/lock_screen/lib/lock_screen_settings.dart+++ b/mobile/packages/lock_screen/lib/lock_screen_settings.dart@@ -3,10 +3,10 @@ import "dart:io";import "dart:typed_data";import "package:ente_configuration/base_configuration.dart";-import "package:ente_crypto_dart/ente_crypto_dart.dart";+import "package:ente_utils/platform_util.dart";import "package:ente_events/event_bus.dart";import "package:ente_events/models/signed_out_event.dart";-import "package:ente_utils/platform_util.dart";+import "package:ente_crypto_dart/ente_crypto_dart.dart";import "package:flutter/material.dart";import "package:flutter_secure_storage/flutter_secure_storage.dart";import "package:privacy_screen/privacy_screen.dart";diff --git a/mobile/packages/lock_screen/lib/ui/app_lock.dart b/mobile/packages/lock_screen/lib/ui/app_lock.dartindex 9098737b7f..4e93ce5ec1 100644--- a/mobile/packages/lock_screen/lib/ui/app_lock.dart+++ b/mobile/packages/lock_screen/lib/ui/app_lock.dart@@ -1,7 +1,7 @@import 'dart:async';-import 'package:ente_lock_screen/lock_screen_settings.dart';import 'package:flutter/material.dart';+import 'package:lock_screen/lock_screen_settings.dart';/// A widget which handles app lifecycle events for showing and hiding a lock screen./// This should wrap around a `MyApp` widget (or equivalent).@@ -144,8 +144,8 @@ class _AppLockState extends State<AppLock> with WidgetsBindingObserver {Widget get _lockScreen {return PopScope(- canPop: false,child: this.widget.lockScreen,+ canPop: false,);}diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen.dart b/mobile/packages/lock_screen/lib/ui/lock_screen.dartindex 270d201eba..74cbcfc554 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen.dart@@ -3,15 +3,15 @@ import 'dart:math';import 'package:ente_accounts/ente_accounts.dart';import 'package:ente_configuration/base_configuration.dart';-import 'package:ente_lock_screen/auth_util.dart';-import 'package:ente_lock_screen/lock_screen_settings.dart';-import 'package:ente_lock_screen/ui/app_lock.dart';import 'package:ente_strings/ente_strings.dart';import 'package:ente_ui/theme/ente_theme.dart';import 'package:ente_ui/utils/dialog_util.dart';import 'package:flutter/material.dart';import 'package:flutter/scheduler.dart';import 'package:flutter_animate/flutter_animate.dart';+import 'package:lock_screen/auth_util.dart';+import 'package:lock_screen/lock_screen_settings.dart';+import 'package:lock_screen/ui/app_lock.dart';import 'package:logging/logging.dart';class LockScreen extends StatefulWidget {diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_auto_lock.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_auto_lock.dartindex 16b5f45ffe..dfdc11b8f5 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_auto_lock.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_auto_lock.dart@@ -1,4 +1,3 @@-import 'package:ente_lock_screen/lock_screen_settings.dart';import 'package:ente_strings/ente_strings.dart';import 'package:ente_ui/components/captioned_text_widget.dart';import 'package:ente_ui/components/divider_widget.dart';@@ -8,6 +7,7 @@ import 'package:ente_ui/components/title_bar_title_widget.dart';import 'package:ente_ui/components/title_bar_widget.dart';import 'package:ente_ui/theme/ente_theme.dart';import 'package:flutter/material.dart';+import 'package:lock_screen/lock_screen_settings.dart';class LockScreenAutoLock extends StatefulWidget {const LockScreenAutoLock({super.key});diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_password.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_password.dartindex eb9e8d6824..e6f8bc0ae2 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_password.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_password.dart@@ -1,4 +1,3 @@-import "package:ente_lock_screen/lock_screen_settings.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/components/buttons/dynamic_fab.dart";import "package:ente_ui/components/buttons/icon_button_widget.dart";@@ -6,6 +5,7 @@ import "package:ente_ui/components/text_input_widget.dart";import "package:ente_ui/theme/ente_theme.dart";import "package:flutter/material.dart";import "package:flutter/services.dart";+import "package:lock_screen/lock_screen_settings.dart";class LockScreenConfirmPassword extends StatefulWidget {const LockScreenConfirmPassword({diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_pin.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_pin.dartindex ecb4418968..3f97324092 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_pin.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_confirm_pin.dart@@ -1,11 +1,11 @@import "dart:io";-import "package:ente_lock_screen/lock_screen_settings.dart";-import "package:ente_lock_screen/ui/custom_pin_keypad.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/theme/ente_theme.dart";import "package:flutter/material.dart";import "package:flutter/services.dart";+import "package:lock_screen/lock_screen_settings.dart";+import "package:lock_screen/ui/custom_pin_keypad.dart";import "package:pinput/pinput.dart";class LockScreenConfirmPin extends StatefulWidget {diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dartindex 176172af95..190e4c971f 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart@@ -1,12 +1,6 @@import "dart:async";import "dart:io";-import "package:ente_lock_screen/local_authentication_service.dart";-import "package:ente_lock_screen/lock_screen_settings.dart";-import "package:ente_lock_screen/ui/app_lock.dart";-import "package:ente_lock_screen/ui/lock_screen_auto_lock.dart";-import "package:ente_lock_screen/ui/lock_screen_password.dart";-import "package:ente_lock_screen/ui/lock_screen_pin.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/components/buttons/button_widget.dart";import "package:ente_ui/components/buttons/models/button_type.dart";@@ -20,6 +14,12 @@ import "package:ente_ui/components/toggle_switch_widget.dart";import "package:ente_ui/theme/ente_theme.dart";import "package:ente_utils/platform_util.dart";import "package:flutter/material.dart";+import "package:lock_screen/local_authentication_service.dart";+import "package:lock_screen/lock_screen_settings.dart";+import "package:lock_screen/ui/app_lock.dart";+import "package:lock_screen/ui/lock_screen_auto_lock.dart";+import "package:lock_screen/ui/lock_screen_password.dart";+import "package:lock_screen/ui/lock_screen_pin.dart";class LockScreenOptions extends StatefulWidget {const LockScreenOptions({super.key});diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_password.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_password.dartindex eb5f2b94ed..a010a327e6 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_password.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_password.dart@@ -1,16 +1,16 @@import "dart:convert";-import "package:ente_crypto_dart/ente_crypto_dart.dart";-import "package:ente_lock_screen/lock_screen_settings.dart";-import "package:ente_lock_screen/ui/lock_screen_confirm_password.dart";-import "package:ente_lock_screen/ui/lock_screen_options.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/components/buttons/dynamic_fab.dart";import "package:ente_ui/components/buttons/icon_button_widget.dart";import "package:ente_ui/components/text_input_widget.dart";import "package:ente_ui/theme/ente_theme.dart";+import "package:ente_crypto_dart/ente_crypto_dart.dart";import "package:flutter/material.dart";import "package:flutter/services.dart";+import "package:lock_screen/lock_screen_settings.dart";+import "package:lock_screen/ui/lock_screen_confirm_password.dart";+import "package:lock_screen/ui/lock_screen_options.dart";/// [isChangingLockScreenSettings] Authentication required for changing lock screen settings./// Set to true when the app requires the user to authenticate before allowingdiff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_pin.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_pin.dartindex 603ebdd67d..6a2b6a858b 100644--- a/mobile/packages/lock_screen/lib/ui/lock_screen_pin.dart+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_pin.dart@@ -1,17 +1,17 @@import "dart:convert";import "dart:io";-import "package:ente_crypto_dart/ente_crypto_dart.dart";-import "package:ente_lock_screen/lock_screen_settings.dart";-import "package:ente_lock_screen/ui/custom_pin_keypad.dart";-import "package:ente_lock_screen/ui/lock_screen_confirm_pin.dart";-import "package:ente_lock_screen/ui/lock_screen_options.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/theme/colors.dart";import "package:ente_ui/theme/ente_theme.dart";import "package:ente_ui/theme/text_style.dart";+import "package:ente_crypto_dart/ente_crypto_dart.dart";import "package:flutter/material.dart";import "package:flutter/services.dart";+import "package:lock_screen/lock_screen_settings.dart";+import "package:lock_screen/ui/custom_pin_keypad.dart";+import "package:lock_screen/ui/lock_screen_confirm_pin.dart";+import "package:lock_screen/ui/lock_screen_options.dart";import 'package:pinput/pinput.dart';/// [isChangingLockScreenSettings] Authentication required for changing lock screen settings.diff --git a/mobile/packages/lock_screen/pubspec.lock b/mobile/packages/lock_screen/pubspec.lockindex adae66b006..29bd04fca3 100644--- a/mobile/packages/lock_screen/pubspec.lock+++ b/mobile/packages/lock_screen/pubspec.lock@@ -409,11 +409,10 @@ packages:flutter_local_authentication:dependency: "direct main"description:- path: "."- ref: "1ac346a04592a05fd75acccf2e01fa3c7e955d96"- resolved-ref: "1ac346a04592a05fd75acccf2e01fa3c7e955d96"- url: "https://github.com/eaceto/flutter_local_authentication"- source: git+ name: flutter_local_authentication+ sha256: eb2e471ba77fbc42b6ce8b358939dc9878dc71fcce5a482a8ddcb045563d87cd+ url: "https://pub.dev"+ source: hostedversion: "1.2.0"flutter_localizations:dependency: transitivediff --git a/mobile/packages/lock_screen/pubspec.yaml b/mobile/packages/lock_screen/pubspec.yamlindex 5f6f1529c1..cd611a61f4 100644--- a/mobile/packages/lock_screen/pubspec.yaml+++ b/mobile/packages/lock_screen/pubspec.yaml@@ -1,4 +1,4 @@-name: ente_lock_screen+name: lock_screendescription: A Flutter package containing lock screen UI components and services for Ente appsversion: 1.0.0publish_to: none@@ -8,6 +8,8 @@ environment:flutter: ">=1.17.0"dependencies:+ flutter:+ sdk: flutterente_accounts:path: ../accountsente_configuration:@@ -23,13 +25,8 @@ dependencies:path: ../uiente_utils:path: ../utils- flutter:- sdk: flutterflutter_animate: ^4.1.0- flutter_local_authentication:- git:- url: https://github.com/eaceto/flutter_local_authentication- ref: 1ac346a04592a05fd75acccf2e01fa3c7e955d96+ flutter_local_authentication: ^1.1.11flutter_secure_storage: ^9.0.0local_auth: ^2.1.8logging: ^1.1.1@@ -38,8 +35,8 @@ dependencies:shared_preferences: ^2.5.3dev_dependencies:- flutter_lints: ^5.0.0flutter_test:sdk: flutter+ flutter_lints: ^5.0.0flutter: