Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix lockscreen issue on iPAD (#358)

Neeraj Gupta1f0c2d2aa661
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 5d9195f804..06b1a50353 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -66,67 +66,11 @@ PODS:
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- - GoogleDataTransport (9.2.5):
- - GoogleUtilities/Environment (~> 7.7)
- - nanopb (< 2.30910.0, >= 2.30908.0)
- - PromisesObjC (< 3.0, >= 1.2)
- - GoogleMLKit/BarcodeScanning (4.0.0):
- - GoogleMLKit/MLKitCore
- - MLKitBarcodeScanning (~> 3.0.0)
- - GoogleMLKit/MLKitCore (4.0.0):
- - MLKitCommon (~> 9.0.0)
- - GoogleToolboxForMac/DebugUtils (2.3.2):
- - GoogleToolboxForMac/Defines (= 2.3.2)
- - GoogleToolboxForMac/Defines (2.3.2)
- - GoogleToolboxForMac/Logger (2.3.2):
- - GoogleToolboxForMac/Defines (= 2.3.2)
- - "GoogleToolboxForMac/NSData+zlib (2.3.2)":
- - GoogleToolboxForMac/Defines (= 2.3.2)
- - "GoogleToolboxForMac/NSDictionary+URLArguments (2.3.2)":
- - GoogleToolboxForMac/DebugUtils (= 2.3.2)
- - GoogleToolboxForMac/Defines (= 2.3.2)
- - "GoogleToolboxForMac/NSString+URLArguments (= 2.3.2)"
- - "GoogleToolboxForMac/NSString+URLArguments (2.3.2)"
- - GoogleUtilities/Environment (7.11.5):
- - PromisesObjC (< 3.0, >= 1.2)
- - GoogleUtilities/Logger (7.11.5):
- - GoogleUtilities/Environment
- - GoogleUtilities/UserDefaults (7.11.5):
- - GoogleUtilities/Logger
- - GoogleUtilitiesComponents (1.1.0):
- - GoogleUtilities/Logger
- - GTMSessionFetcher/Core (2.3.0)
- local_auth_ios (0.0.1):
- Flutter
- - MLImage (1.0.0-beta4)
- - MLKitBarcodeScanning (3.0.0):
- - MLKitCommon (~> 9.0)
- - MLKitVision (~> 5.0)
- - MLKitCommon (9.0.0):
- - GoogleDataTransport (~> 9.0)
- - GoogleToolboxForMac/Logger (~> 2.1)
- - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
- - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
- - GoogleUtilities/UserDefaults (~> 7.0)
- - GoogleUtilitiesComponents (~> 1.0)
- - GTMSessionFetcher/Core (< 3.0, >= 1.1)
- - MLKitVision (5.0.0):
- - GoogleToolboxForMac/Logger (~> 2.1)
- - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
- - GTMSessionFetcher/Core (< 3.0, >= 1.1)
- - MLImage (= 1.0.0-beta4)
- - MLKitCommon (~> 9.0)
- - mobile_scanner (3.5.2):
- - Flutter
- - GoogleMLKit/BarcodeScanning (~> 4.0.0)
- move_to_background (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- - nanopb (2.30909.0):
- - nanopb/decode (= 2.30909.0)
- - nanopb/encode (= 2.30909.0)
- - nanopb/decode (2.30909.0)
- - nanopb/encode (2.30909.0)
- open_filex (0.0.2):
- Flutter
- OrderedSet (5.0.0)
@@ -135,10 +79,6 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- - photo_manager (2.0.0):
- - Flutter
- - FlutterMacOS
- - PromisesObjC (2.3.1)
- qr_code_scanner (0.2.0):
- Flutter
- MTBBarcodeScanner
@@ -167,9 +107,6 @@ PODS:
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- - video_player_avfoundation (0.0.1):
- - Flutter
- - FlutterMacOS
DEPENDENCIES:
- connectivity (from `.symlinks/plugins/connectivity/ios`)
@@ -186,12 +123,10 @@ DEPENDENCIES:
- flutter_sodium (from `.symlinks/plugins/flutter_sodium/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
- - mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- move_to_background (from `.symlinks/plugins/move_to_background/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- - photo_manager (from `.symlinks/plugins/photo_manager/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
@@ -199,27 +134,14 @@ DEPENDENCIES:
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- FMDB
- - GoogleDataTransport
- - GoogleMLKit
- - GoogleToolboxForMac
- - GoogleUtilities
- - GoogleUtilitiesComponents
- - GTMSessionFetcher
- - MLImage
- - MLKitBarcodeScanning
- - MLKitCommon
- - MLKitVision
- MTBBarcodeScanner
- - nanopb
- OrderedSet
- - PromisesObjC
- Reachability
- SDWebImage
- Sentry
@@ -256,8 +178,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"
local_auth_ios:
:path: ".symlinks/plugins/local_auth_ios/ios"
- mobile_scanner:
- :path: ".symlinks/plugins/mobile_scanner/ios"
move_to_background:
:path: ".symlinks/plugins/move_to_background/ios"
open_filex:
@@ -266,8 +186,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
- photo_manager:
- :path: ".symlinks/plugins/photo_manager/ios"
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
sentry_flutter:
@@ -282,8 +200,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
- video_player_avfoundation:
- :path: ".symlinks/plugins/video_player_avfoundation/darwin"
SPEC CHECKSUMS:
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
@@ -302,27 +218,13 @@ SPEC CHECKSUMS:
flutter_sodium: c84426b4de738514b5b66cfdeb8a06634e72fe0b
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
- GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
- GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
- GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34
- GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
- GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe
- GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
- MLImage: 7bb7c4264164ade9bf64f679b40fb29c8f33ee9b
- MLKitBarcodeScanning: 04e264482c5f3810cb89ebc134ef6b61e67db505
- MLKitCommon: c1b791c3e667091918d91bda4bba69a91011e390
- MLKitVision: 8baa5f46ee3352614169b85250574fde38c36f49
- mobile_scanner: 5090a13b7a35fc1c25b0d97e18e84f271a6eb605
move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
- nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
- photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604
- PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9
@@ -336,7 +238,6 @@ SPEC CHECKSUMS:
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
- video_player_avfoundation: 8563f13d8fc8b2c29dc2d09e60b660e4e8128837
PODFILE CHECKSUM: b4e3a7eabb03395b66e81fc061789f61526ee6bb
diff --git a/lib/ui/tools/lock_screen.dart b/lib/ui/tools/lock_screen.dart
index 0262de56a8..213e7a99a4 100644
--- a/lib/ui/tools/lock_screen.dart
+++ b/lib/ui/tools/lock_screen.dart
@@ -1,3 +1,5 @@
+import 'dart:io';
+
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/ui/tools/app_lock.dart';
@@ -21,10 +23,16 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
@override
void initState() {
- _logger.info("initState");
+ _logger.info("initiatingState");
super.initState();
- _showLockScreen(source: "initState");
WidgetsBinding.instance.addObserver(this);
+ WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
+ if (isNonMobileIOSDevice()) {
+ _logger.info('ignore init for non mobile iOS device');
+ return;
+ }
+ _showLockScreen(source: "postFrameInit");
+ });
}
@override
@@ -60,6 +68,14 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
);
}
+ bool isNonMobileIOSDevice() {
+ if (Platform.isAndroid) {
+ return false;
+ }
+ var shortestSide = MediaQuery.of(context).size.shortestSide;
+ return shortestSide > 600 ? true : false;
+ }
+
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
_logger.info(state.toString());
@@ -74,7 +90,9 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
// Show the lock screen again only if the app is resuming from the
// background, and not when the lock screen was explicitly dismissed
Future.delayed(
- Duration.zero, () => _showLockScreen(source: "lifeCycle"));
+ Duration.zero,
+ () => _showLockScreen(source: "lifeCycle"),
+ );
} else {
_hasAuthenticationFailed = false; // Reset failure state
}
@@ -91,6 +109,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
@override
void dispose() {
+ _logger.info('disposing');
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
diff --git a/pubspec.yaml b/pubspec.yaml
index ba1f99a483..92f104f10c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
-version: 2.0.19+219
+version: 2.0.20+220
publish_to: none
environment: