π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix privacy screen colors (#411)
Vishnu Mohandas66bd48990410
diff --git a/analysis_options.yaml b/analysis_options.yamlindex 369fb565c0..59ff504e8a 100644--- a/analysis_options.yaml+++ b/analysis_options.yaml@@ -41,8 +41,8 @@ analyzer:use_rethrow_when_possible: inforequire_trailing_commas: error- prefer_const_constructors: error # too many warnings- prefer_const_declarations: error # too many warnings+ prefer_const_constructors: warning+ prefer_const_declarations: warningprefer_const_constructors_in_immutables: ignore # too many warningsavoid_renaming_method_parameters: ignore # incorrect warnings for `equals` overridesdiff --git a/ios/Podfile.lock b/ios/Podfile.lockindex 10ec7c6839..dc7d8d0436 100644--- a/ios/Podfile.lock+++ b/ios/Podfile.lock@@ -216,12 +216,12 @@ SPEC CHECKSUMS:fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b- flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721+ flutter_inappwebview: acd4fc0f012cefd09015000c241137d82f01ba62flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56efflutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49beflutter_sodium: c84426b4de738514b5b66cfdeb8a06634e72fe0b- fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c+ fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82alocal_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d@@ -247,4 +247,4 @@ SPEC CHECKSUMS:PODFILE CHECKSUM: b4e3a7eabb03395b66e81fc061789f61526ee6bb-COCOAPODS: 1.12.1+COCOAPODS: 1.14.3diff --git a/lib/main.dart b/lib/main.dartindex e5c81304a7..1dc7ff688d 100644--- a/lib/main.dart+++ b/lib/main.dart@@ -21,6 +21,7 @@ import 'package:ente_auth/ui/utils/icon_utils.dart';import 'package:ente_auth/utils/crypto_util.dart';import 'package:flutter/foundation.dart';import "package:flutter/material.dart";+import 'package:flutter/scheduler.dart';import 'package:flutter_displaymode/flutter_displaymode.dart';import 'package:logging/logging.dart';import 'package:path_provider/path_provider.dart';@@ -30,28 +31,13 @@ final _logger = Logger("main");void main() async {WidgetsFlutterBinding.ensureInitialized();- final savedThemeMode = await AdaptiveTheme.getThemeMode();- await _runInForeground(savedThemeMode);- await PrivacyScreen.instance.enable(- iosOptions: const PrivacyIosOptions(- enablePrivacy: true,- privacyImageName: "LaunchImage",- lockTrigger: IosLockTrigger.didEnterBackground,- ),- androidOptions: const PrivacyAndroidOptions(- enableSecure: true,- ),- backgroundColor: savedThemeMode == AdaptiveThemeMode.dark- ? Colors.black- : Colors.white,- blurEffect: savedThemeMode == AdaptiveThemeMode.dark- ? PrivacyBlurEffect.dark- : PrivacyBlurEffect.extraLight,- );+ await _runInForeground();+ await _setupPrivacyScreen();FlutterDisplayMode.setHighRefreshRate();}-Future<void> _runInForeground(AdaptiveThemeMode? savedThemeMode) async {+Future<void> _runInForeground() async {+ final savedThemeMode = _themeMode(await AdaptiveTheme.getThemeMode());return await _runWithLogs(() async {_logger.info("Starting app in foreground");await _init(false, via: 'mainMethod');@@ -65,7 +51,7 @@ Future<void> _runInForeground(AdaptiveThemeMode? savedThemeMode) async {locale: locale,lightTheme: lightThemeData,darkTheme: darkThemeData,- savedThemeMode: _themeMode(savedThemeMode),+ savedThemeMode: savedThemeMode,),);});@@ -107,3 +93,22 @@ Future<void> _init(bool bool, {String? via}) async {await UpdateService.instance.init();await IconUtils.instance.init();}++Future<void> _setupPrivacyScreen() async {+ final brightness =+ SchedulerBinding.instance.platformDispatcher.platformBrightness;+ bool isInDarkMode = brightness == Brightness.dark;+ await PrivacyScreen.instance.enable(+ iosOptions: const PrivacyIosOptions(+ enablePrivacy: true,+ privacyImageName: "LaunchImage",+ lockTrigger: IosLockTrigger.didEnterBackground,+ ),+ androidOptions: const PrivacyAndroidOptions(+ enableSecure: true,+ ),+ backgroundColor: isInDarkMode ? Colors.black : Colors.white,+ blurEffect:+ isInDarkMode ? PrivacyBlurEffect.dark : PrivacyBlurEffect.extraLight,+ );+}diff --git a/pubspec.yaml b/pubspec.yamlindex 5f4484f43a..85769897e6 100644--- a/pubspec.yaml+++ b/pubspec.yaml@@ -1,6 +1,6 @@name: ente_authdescription: ente two-factor authenticator-version: 2.0.30+230+version: 2.0.31+231publish_to: noneenvironment: