Skip to content

armgit / ente

Public Imported from GitHub
0

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

Revert "Analyze qr code image (#336)" (#354)

Neeraj Gupta5d372607a437
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 06dd43543f..fdf729fd93 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,7 +1,7 @@
{
- "workbench.colorCustomizations": {
- "activityBar.background": "#44116A",
- "titleBar.activeBackground": "#5F1895",
- "titleBar.activeForeground": "#FDFBFE"
- }
-}
+ "workbench.colorCustomizations": {
+ "activityBar.background": "#44116A",
+ "titleBar.activeBackground": "#5F1895",
+ "titleBar.activeForeground": "#FDFBFE"
+ }
+}
\ No newline at end of file
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 59549acb11..f2f1146ec2 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -53,14 +53,12 @@
</queries>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
- android:name="android.permission.READ_MEDIA_IMAGES" />
+ android:name="android.permission.READ_EXTERNAL_STORAGE"
+ android:maxSdkVersion="32"/>
<uses-permission
- android:name="android.permission.READ_EXTERNAL_STORAGE"
- android:maxSdkVersion="32" />
- <uses-permission
- android:name="android.permission.WRITE_EXTERNAL_STORAGE"
- android:maxSdkVersion="29"
- tools:ignore="ScopedStorage" />
+ android:name="android.permission.WRITE_EXTERNAL_STORAGE"
+ android:maxSdkVersion="29"
+ tools:ignore="ScopedStorage"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
</manifest>
diff --git a/assets/scanner-icons/icons/cross.svg b/assets/scanner-icons/icons/cross.svg
deleted file mode 100644
index 69bda0e94c..0000000000
--- a/assets/scanner-icons/icons/cross.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M9.16998 14.8299L14.83 9.16992" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
-<path d="M14.83 14.8299L9.16998 9.16992" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/assets/scanner-icons/icons/flash_off.svg b/assets/scanner-icons/icons/flash_off.svg
deleted file mode 100644
index fb6ad16737..0000000000
--- a/assets/scanner-icons/icons/flash_off.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-<svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_884_3193)">
-<rect x="15" y="14" width="32" height="32" rx="15" fill="white"/>
-</g>
-<path d="M40.7558 20.2363C40.4408 19.9212 39.9262 19.9212 39.6112 20.2363L20.2363 39.6217C19.9212 39.9367 19.9212 40.4513 20.2363 40.7663C20.3938 40.9133 20.5933 40.9973 20.8033 40.9973C21.0134 40.9973 21.2129 40.9133 21.3704 40.7558L40.7558 21.3704C41.0814 21.0554 41.0814 20.5513 40.7558 20.2363Z" fill="#292D32"/>
-<path d="M33.4575 21.5971V27.5408L27.5347 33.4636V31.8464H24.2898C22.8196 31.8464 22.4101 30.9433 23.3867 29.8407L30.4961 21.7546L31.3362 20.799C32.5018 19.4759 33.4575 19.8329 33.4575 21.5971Z" fill="#292D32"/>
-<path d="M37.6039 31.1619L30.4946 39.2479L29.6545 40.2035C28.4888 41.5267 27.5332 41.1696 27.5332 39.4054V36.6121L34.9891 29.1562H36.7008C38.171 29.1562 38.5806 30.0593 37.6039 31.1619Z" fill="#292D32"/>
-<defs>
-<filter id="filter0_d_884_3193" x="0" y="0" width="62" height="62" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feMorphology radius="5" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_884_3193"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="5"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.17 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_884_3193"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_884_3193" result="shape"/>
-</filter>
-</defs>
-</svg>
diff --git a/assets/scanner-icons/icons/flash_on.svg b/assets/scanner-icons/icons/flash_on.svg
deleted file mode 100644
index 59ed777442..0000000000
--- a/assets/scanner-icons/icons/flash_on.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-<svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_5498_6943)">
-<rect x="15" y="14" width="32" height="32" rx="15" fill="white"/>
-</g>
-<path d="M36.844 29.1561H33.5997V21.5968C33.5997 19.8329 32.6443 19.476 31.4789 20.7988L30.639 21.7543L23.5311 29.8386C22.5547 30.941 22.9642 31.8439 24.4341 31.8439H27.6783V39.4032C27.6783 41.1671 28.6337 41.524 29.7991 40.2012L30.639 39.2457L37.7469 31.1615C38.7233 30.0591 38.3138 29.1561 36.844 29.1561Z" fill="#292D32"/>
-<defs>
-<filter id="filter0_d_5498_6943" x="0" y="0" width="62" height="62" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feMorphology radius="5" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_5498_6943"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="5"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.17 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5498_6943"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5498_6943" result="shape"/>
-</filter>
-</defs>
-</svg>
diff --git a/assets/scanner-icons/icons/gallery.svg b/assets/scanner-icons/icons/gallery.svg
deleted file mode 100644
index ad92ee488d..0000000000
--- a/assets/scanner-icons/icons/gallery.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-<svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_884_3200)">
-<rect x="15" y="14" width="32" height="32" rx="15" fill="white"/>
-</g>
-<path d="M35.19 20H26.81C23.17 20 21 22.17 21 25.81V34.19C21 35.28 21.19 36.23 21.56 37.03C22.42 38.93 24.26 40 26.81 40H35.19C38.83 40 41 37.83 41 34.19V31.9V25.81C41 22.17 38.83 20 35.19 20ZM39.37 30.5C38.59 29.83 37.33 29.83 36.55 30.5L32.39 34.07C31.61 34.74 30.35 34.74 29.57 34.07L29.23 33.79C28.52 33.17 27.39 33.11 26.59 33.65L22.85 36.16C22.63 35.6 22.5 34.95 22.5 34.19V25.81C22.5 22.99 23.99 21.5 26.81 21.5H35.19C38.01 21.5 39.5 22.99 39.5 25.81V30.61L39.37 30.5Z" fill="#292D32"/>
-<defs>
-<filter id="filter0_d_884_3200" x="0" y="0" width="62" height="62" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feMorphology radius="5" operator="dilate" in="SourceAlpha" result="effect1_dropShadow_884_3200"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="5"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.17 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_884_3200"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_884_3200" result="shape"/>
-</filter>
-</defs>
-</svg>
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 06b1a50353..5d9195f804 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -66,11 +66,67 @@ 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)
@@ -79,6 +135,10 @@ 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
@@ -107,6 +167,9 @@ PODS:
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
+ - video_player_avfoundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
DEPENDENCIES:
- connectivity (from `.symlinks/plugins/connectivity/ios`)
@@ -123,10 +186,12 @@ 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`)
@@ -134,14 +199,27 @@ 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
@@ -178,6 +256,8 @@ 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:
@@ -186,6 +266,8 @@ 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:
@@ -200,6 +282,8 @@ 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
@@ -218,13 +302,27 @@ 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
@@ -238,6 +336,7 @@ SPEC CHECKSUMS:
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
+ video_player_avfoundation: 8563f13d8fc8b2c29dc2d09e60b660e4e8128837
PODFILE CHECKSUM: b4e3a7eabb03395b66e81fc061789f61526ee6bb
diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb
index 595aca1b67..7d516c5b42 100644
--- a/lib/l10n/arb/app_en.arb
+++ b/lib/l10n/arb/app_en.arb
@@ -340,13 +340,6 @@
"showQRAuthMessage": "Authenticate to show QR code",
"confirmAccountDeleteTitle": "Confirm account deletion",
"confirmAccountDeleteMessage": "This account is linked to other ente apps, if you use any.\n\nYour uploaded data, across all ente apps, will be scheduled for deletion, and your account will be permanently deleted.",
- "reminderText": "Reminder",
- "reminderPopupBody": "Please delete the screenshot before resuming any photo cloud sync",
- "invalidQrCodeText": "Invalid QR code",
- "googleAuthImagePopupBody": "Please turn off all photo cloud sync from all apps, including iCloud, Google Photo, OneDrive, etc. \nAlso if you have a second smartphone, it is safer to import by scanning QR code.",
- "importGoogleAuthImageButtonText": "Import from image",
- "unableToRecognizeQrCodeText": "Unable to recognize a valid code from the uploaded image",
- "qrCodeImageNotSelectedText": "Qr code image not selected",
"androidBiometricHint": "Verify identity",
"@androidBiometricHint": {
"description": "Hint message advising the user how to authenticate with biometrics. It is used on Android side. Maximum 60 characters."
@@ -398,6 +391,5 @@
"iOSOkButton": "OK",
"@iOSOkButton": {
"description": "Message showed on a button that the user can click to leave the current dialog. It is used on iOS side. Maximum 30 characters."
- },
- "parsingErrorText": "Error while parsing Google Auth QR code"
+ }
}
diff --git a/lib/ui/settings/data/import/analyze_qr_code.dart b/lib/ui/settings/data/import/analyze_qr_code.dart
deleted file mode 100644
index 481356fdc0..0000000000
--- a/lib/ui/settings/data/import/analyze_qr_code.dart
+++ /dev/null
@@ -1,268 +0,0 @@
-import 'dart:io';
-
-import 'package:ente_auth/l10n/l10n.dart';
-import 'package:ente_auth/models/code.dart';
-import 'package:ente_auth/ui/components/buttons/button_widget.dart';
-import 'package:ente_auth/ui/components/dialog_widget.dart';
-import 'package:ente_auth/ui/components/models/button_type.dart';
-import 'package:ente_auth/ui/settings/data/import/google_auth_import.dart';
-import 'package:ente_auth/ui/settings/data/import/qr_scanner_overlay.dart';
-import 'package:ente_auth/utils/toast_util.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:flutter_svg/svg.dart';
-import 'package:logging/logging.dart';
-import 'package:mobile_scanner/mobile_scanner.dart';
-import 'package:wechat_assets_picker/wechat_assets_picker.dart';
-
-class QrScanner extends StatefulWidget {
- const QrScanner({super.key});
-
- @override
- State<QrScanner> createState() => _QrScannerState();
-}
-
-class _QrScannerState extends State<QrScanner> {
- bool isNavigationPerformed = false;
- bool isScannedByImage = false;
-
- MobileScannerController scannerController = MobileScannerController(
- detectionSpeed: DetectionSpeed.normal,
- facing: CameraFacing.back,
- );
-
- @override
- void dispose() {
- scannerController.dispose();
- super.dispose();
- }
-
- @override
- Widget build(BuildContext context) {
- final l10n = context.l10n;
- return SafeArea(
- child: Scaffold(
- backgroundColor: Colors.black,
- body: Stack(
- alignment: Alignment.topLeft,
- children: [
- Stack(
- children: [
- MobileScanner(
- controller: scannerController,
- onDetect: (capture) async {
- if (!isNavigationPerformed) {
- isNavigationPerformed = true;
- if (capture.barcodes[0].rawValue!
- .startsWith(kGoogleAuthExportPrefix)) {
- if (isScannedByImage) {
- final result = await showDialogWidget(
- context: context,
- title: l10n.reminderText,
- body: l10n.reminderPopupBody,
- buttons: [
- ButtonWidget(
- buttonType: ButtonType.primary,
- labelText: l10n.ok,
- isInAlert: true,
- buttonSize: ButtonSize.large,
- buttonAction: ButtonAction.first,
- ),
- ],
- );
- if (result?.action != null &&
- result!.action == ButtonAction.first) {
- isScannedByImage = false;
- }
- }
- HapticFeedback.vibrate();
- try {
- List<Code> codes =
- parseGoogleAuth(capture.barcodes[0].rawValue!);
- scannerController.dispose();
- Navigator.of(context).pop(codes);
- } catch (e) {
- showToast(context, l10n.parsingErrorText);
- Logger("Code parsing error").severe(
- "Error while parsing Google Auth QR code",
- e,
- );
- throw Exception(
- 'Failed to parse Google Auth QR code \n ${e.toString()}',
- );
- }
- } else {
- showToast(context, l10n.invalidQrCodeText);
- isNavigationPerformed = false;
- }
- }
- },
- ),
- const QRScannerOverlay(),
- Positioned(
- top: 150,
- left: 0,
- right: 0,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- // Torch button
- IconButton(
- icon: ValueListenableBuilder(
- valueListenable: scannerController.torchState,
- builder: (context, state, child) {
- switch (state) {
- case TorchState.on:
- return SvgPicture.asset(
- 'assets/scanner-icons/icons/flash_on.svg',
- );
- case TorchState.off:
- return SvgPicture.asset(
- 'assets/scanner-icons/icons/flash_off.svg',
- );
- }
- },
- ),
- iconSize: 60,
- onPressed: () => scannerController.toggleTorch(),
- ),
- IconButton(
- icon: SvgPicture.asset(
- 'assets/scanner-icons/icons/gallery.svg',
- ),
- iconSize: 60,
- onPressed: () async {
- final result = await showDialogWidget(
- context: context,
- title: l10n.importFromApp(
- "Google Authenticator (saved image)",
- ),
- body: l10n.googleAuthImagePopupBody,
- buttons: [
- ButtonWidget(
- buttonType: ButtonType.primary,
- labelText: l10n.importGoogleAuthImageButtonText,
- isInAlert: true,
- buttonSize: ButtonSize.large,
- buttonAction: ButtonAction.first,
- ),
- ButtonWidget(
- buttonType: ButtonType.secondary,
- labelText: l10n.cancel,
- buttonSize: ButtonSize.large,
- isInAlert: true,
- buttonAction: ButtonAction.second,
- ),
- ],
- );
- if (result?.action != null &&
- result!.action != ButtonAction.cancel) {
- if (result.action == ButtonAction.first) {
- List<AssetEntity>? assets =
- await AssetPicker.pickAssets(
- context,
- pickerConfig: const AssetPickerConfig(
- maxAssets: 1,
- requestType: RequestType.image,
- ),
- );
-
- if (assets != null && assets.isNotEmpty) {
- AssetEntity asset = assets.first;
- File? file = await asset.file;
- String path = file!.path;
-
- if (await scannerController
- .analyzeImage(path)) {
- isScannedByImage = true;
- if (!mounted) return;
- } else {
- if (!mounted) return;
- isScannedByImage = false;
- showToast(
- context,
- l10n.unableToRecognizeQrCodeText,
- );
- }
- } else {
- if (!mounted) return;
- showToast(
- context,
- l10n.qrCodeImageNotSelectedText,
- );
- }
- }
- }
- },
- ),
- ],
- ),
- ),
- Positioned(
- bottom: 0,
- left: 0,
- right: 0,
- child: Container(
- decoration: const BoxDecoration(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(30),
- topRight: Radius.circular(30),
- ),
- color: Colors.white,
- ),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(
- 40,
- 15,
- 40,
- 18,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- height: 5,
- width: 40,
- decoration: BoxDecoration(
- color: Colors.black,
- borderRadius: BorderRadius.circular(50),
- ),
- ),
- const SizedBox(
- height: 25,
- ),
- Text(
- l10n.scanACode,
- textAlign: TextAlign.center,
- style: const TextStyle(
- color: Colors.black,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
- ),
- Positioned(
- left: 25,
- top: 25,
- child: GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: SvgPicture.asset(
- 'assets/scanner-icons/icons/cross.svg',
- colorFilter:
- const ColorFilter.mode(Colors.white, BlendMode.srcATop),
- height: 30,
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/ui/settings/data/import/google_auth_import.dart b/lib/ui/settings/data/import/google_auth_import.dart
index 1fa60b5250..d883f365c5 100644
--- a/lib/ui/settings/data/import/google_auth_import.dart
+++ b/lib/ui/settings/data/import/google_auth_import.dart
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
-
import 'package:base32/base32.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/code.dart';
@@ -11,7 +10,7 @@ import 'package:ente_auth/store/code_store.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/ui/components/dialog_widget.dart';
import 'package:ente_auth/ui/components/models/button_type.dart';
-import 'package:ente_auth/ui/settings/data/import/analyze_qr_code.dart';
+import 'package:ente_auth/ui/scanner_gauth_page.dart';
import 'package:ente_auth/ui/settings/data/import/import_success.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
@@ -46,7 +45,7 @@ Future<void> showGoogleAuthInstruction(BuildContext context) async {
final List<Code>? codes = await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
- return const QrScanner();
+ return const ScannerGoogleAuthPage();
},
),
);
diff --git a/lib/ui/settings/data/import/import_service.dart b/lib/ui/settings/data/import/import_service.dart
index 34ded0c65a..0be1f572e3 100644
--- a/lib/ui/settings/data/import/import_service.dart
+++ b/lib/ui/settings/data/import/import_service.dart
@@ -5,7 +5,7 @@ import 'package:ente_auth/ui/settings/data/import/google_auth_import.dart';
import 'package:ente_auth/ui/settings/data/import/plain_text_import.dart';
import 'package:ente_auth/ui/settings/data/import/raivo_plain_text_import.dart';
import 'package:ente_auth/ui/settings/data/import_page.dart';
-import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
class ImportService {
static final ImportService _instance = ImportService._internal();
diff --git a/lib/ui/settings/data/import/qr_scanner_overlay.dart b/lib/ui/settings/data/import/qr_scanner_overlay.dart
deleted file mode 100644
index 8dd1341555..0000000000
--- a/lib/ui/settings/data/import/qr_scanner_overlay.dart
+++ /dev/null
@@ -1,152 +0,0 @@
-import 'package:flutter/material.dart';
-
-class QRScannerOverlay extends StatelessWidget {
- const QRScannerOverlay({
- Key? key,
- }) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- double scanArea = (MediaQuery.of(context).size.width < 400 ||
- MediaQuery.of(context).size.height < 400)
- ? 200.0
- : 330.0;
- return Stack(
- children: [
- ColorFiltered(
- colorFilter:
- ColorFilter.mode(Colors.black.withOpacity(0.9), BlendMode.srcOut),
- child: Stack(
- children: [
- Container(
- decoration: const BoxDecoration(
- color: Colors.red,
- backgroundBlendMode: BlendMode.dstOut,
- ),
- ),
- Align(
- alignment: Alignment.center,
- child: Container(
- height: scanArea,
- width: scanArea,
- decoration: BoxDecoration(
- color: Colors.red,
- borderRadius: BorderRadius.circular(20),
- ),
- ),
- ),
- ],
- ),
- ),
- Align(
- alignment: Alignment.center,
- child: CustomPaint(
- foregroundPainter: BorderPainter(),
- child: SizedBox(
- width: scanArea + 25,
- height: scanArea + 25,
- ),
- ),
- ),
- ],
- );
- }
-}
-
-// Creates the white borders
-class BorderPainter extends CustomPainter {
- @override
- void paint(Canvas canvas, Size size) {
- const width = 4.0;
- const radius = 20.0;
- const tRadius = 3 * radius;
- final rect = Rect.fromLTWH(
- width,
- width,
- size.width - 2 * width,
- size.height - 2 * width,
- );
- final rrect = RRect.fromRectAndRadius(rect, const Radius.circular(radius));
- const clippingRect0 = Rect.fromLTWH(
- 0,
- 0,
- tRadius,
- tRadius,
- );
- final clippingRect1 = Rect.fromLTWH(
- size.width - tRadius,
- 0,
- tRadius,
- tRadius,
- );
- final clippingRect2 = Rect.fromLTWH(
- 0,
- size.height - tRadius,
- tRadius,
- tRadius,
- );
- final clippingRect3 = Rect.fromLTWH(
- size.width - tRadius,
- size.height - tRadius,
- tRadius,
- tRadius,
- );
-
- final path = Path()
- ..addRect(clippingRect0)
- ..addRect(clippingRect1)
- ..addRect(clippingRect2)
- ..addRect(clippingRect3);
-
- canvas.clipPath(path);
- canvas.drawRRect(
- rrect,
- Paint()
- ..color = Colors.blueAccent
- ..style = PaintingStyle.stroke
- ..strokeWidth = width,
- );
- }
-
- @override
- bool shouldRepaint(CustomPainter oldDelegate) {
- return false;
- }
-}
-
-class BarReaderSize {
- static double width = 200;
- static double height = 200;
-}
-
-class OverlayWithHolePainter extends CustomPainter {
- @override
- void paint(Canvas canvas, Size size) {
- final paint = Paint()..color = Colors.black54;
- canvas.drawPath(
- Path.combine(
- PathOperation.difference,
- Path()..addRect(Rect.fromLTWH(0, 0, size.width, size.height)),
- Path()
- ..addOval(
- Rect.fromCircle(
- center: Offset(size.width - 44, size.height - 44),
- radius: 40,
- ),
- )
- ..close(),
- ),
- paint,
- );
- }
-
- @override
- bool shouldRepaint(CustomPainter oldDelegate) {
- return false;
- }
-}
-
-@override
-bool shouldRepaint(CustomPainter oldDelegate) {
- return false;
-}
diff --git a/lib/ui/settings/data/import_page.dart b/lib/ui/settings/data/import_page.dart
index 396a899ce6..fb8c55d1ce 100644
--- a/lib/ui/settings/data/import_page.dart
+++ b/lib/ui/settings/data/import_page.dart
@@ -34,7 +34,6 @@ class ImportCodePage extends StatelessWidget {
switch (type) {
case ImportType.plainText:
return context.l10n.importTypePlainText;
-
case ImportType.encrypted:
return context.l10n.importTypeEnteEncrypted;
case ImportType.ravio:
@@ -67,7 +66,7 @@ class ImportCodePage extends StatelessWidget {
iconButtonType: IconButtonType.secondary,
onTap: () {
Navigator.pop(context);
- if (Navigator.canPop(context)) {
+ if(Navigator.canPop(context)) {
Navigator.pop(context);
}
},
diff --git a/lib/ui/tools/lock_screen.dart b/lib/ui/tools/lock_screen.dart
index 202a8291e2..0262de56a8 100644
--- a/lib/ui/tools/lock_screen.dart
+++ b/lib/ui/tools/lock_screen.dart
@@ -74,9 +74,7 @@ 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
}
diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift
index 30a155446c..6b18cc3813 100644
--- a/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -10,16 +10,13 @@ import device_info_plus
import file_saver
import flutter_local_notifications
import flutter_secure_storage_macos
-import mobile_scanner
import package_info_plus
import path_provider_foundation
-import photo_manager
import sentry_flutter
import share_plus
import shared_preferences_foundation
import sqflite
import url_launcher_macos
-import video_player_avfoundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
@@ -27,14 +24,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSaverPlugin.register(with: registry.registrar(forPlugin: "FileSaverPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
- MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
- PhotoManagerPlugin.register(with: registry.registrar(forPlugin: "PhotoManagerPlugin"))
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
- FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
}
diff --git a/pubspec.lock b/pubspec.lock
index 9dd3376236..be8b19c1dc 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -386,22 +386,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
- extended_image:
- dependency: transitive
- description:
- name: extended_image
- sha256: b4d72a27851751cfadaf048936d42939db7cd66c08fdcfe651eeaa1179714ee6
- url: "https://pub.dev"
- source: hosted
- version: "8.1.1"
- extended_image_library:
- dependency: transitive
- description:
- name: extended_image_library
- sha256: "8bf87c0b14dcb59200c923a9a3952304e4732a0901e40811428834ef39018ee1"
- url: "https://pub.dev"
- source: hosted
- version: "3.6.0"
fake_async:
dependency: transitive
description:
@@ -703,14 +687,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
- http_client_helper:
- dependency: transitive
- description:
- name: http_client_helper
- sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1"
- url: "https://pub.dev"
- source: hosted
- version: "3.0.0"
http_multi_server:
dependency: transitive
description:
@@ -863,14 +839,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
- mobile_scanner:
- dependency: "direct main"
- description:
- name: mobile_scanner
- sha256: cf978740676ba5b0c17399baf117984b31190bb7a6eaa43e51229ed46abc42ee
- url: "https://pub.dev"
- source: hosted
- version: "3.5.2"
mocktail:
dependency: "direct dev"
description:
@@ -1039,14 +1007,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
- photo_manager:
- dependency: transitive
- description:
- name: photo_manager
- sha256: c1f21882f22c97cc85a8a67b08d7b979a03c9b7f18f940c10c6860b3a49581d3
- url: "https://pub.dev"
- source: hosted
- version: "2.8.0"
pinput:
dependency: "direct main"
description:
@@ -1588,46 +1548,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
- video_player:
- dependency: transitive
- description:
- name: video_player
- sha256: e16f0a83601a78d165dabc17e4dac50997604eb9e4cc76e10fa219046b70cef3
- url: "https://pub.dev"
- source: hosted
- version: "2.8.1"
- video_player_android:
- dependency: transitive
- description:
- name: video_player_android
- sha256: "3fe89ab07fdbce786e7eb25b58532d6eaf189ceddc091cb66cba712f8d9e8e55"
- url: "https://pub.dev"
- source: hosted
- version: "2.4.10"
- video_player_avfoundation:
- dependency: transitive
- description:
- name: video_player_avfoundation
- sha256: fe73d636f82286a3739f5e644f95f09442cacdc436ebbe5436521dc915f3ecac
- url: "https://pub.dev"
- source: hosted
- version: "2.5.1"
- video_player_platform_interface:
- dependency: transitive
- description:
- name: video_player_platform_interface
- sha256: be72301bf2c0150ab35a8c34d66e5a99de525f6de1e8d27c0672b836fe48f73a
- url: "https://pub.dev"
- source: hosted
- version: "6.2.1"
- video_player_web:
- dependency: transitive
- description:
- name: video_player_web
- sha256: ab7a462b07d9ca80bed579e30fb3bce372468f1b78642e0911b10600f2c5cb5b
- url: "https://pub.dev"
- source: hosted
- version: "2.1.2"
vm_service:
dependency: transitive
description:
@@ -1668,14 +1588,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
- wechat_assets_picker:
- dependency: "direct main"
- description:
- name: wechat_assets_picker
- sha256: "00c93a04421013040b555cdcccdb8e90f142a171d6c0d968c2b5042a76013601"
- url: "https://pub.dev"
- source: hosted
- version: "8.7.1"
win32:
dependency: transitive
description:
@@ -1717,5 +1629,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
- dart: ">=3.1.0 <4.0.0"
- flutter: ">=3.13.0"
+ dart: ">=3.1.0-185.0.dev <4.0.0"
+ flutter: ">=3.10.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 47ff6a641f..ba1f99a483 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
-version: 2.0.18+218
+version: 2.0.19+219
publish_to: none
environment:
@@ -58,7 +58,6 @@ dependencies:
local_auth_android: ^1.0.31
local_auth_ios: ^1.1.3
logging: ^1.0.1
- mobile_scanner: ^3.5.2
modal_bottom_sheet: ^3.0.0-pre
move_to_background: ^1.0.2
open_filex: ^4.3.2
@@ -82,7 +81,6 @@ dependencies:
uni_links: ^0.5.1
url_launcher: ^6.1.5
uuid: ^3.0.4
- wechat_assets_picker: ^8.6.3
dev_dependencies:
bloc_test: ^9.0.3
@@ -105,7 +103,6 @@ flutter:
- assets/simple-icons/_data/
- assets/custom-icons/icons/
- assets/custom-icons/_data/
- - assets/scanner-icons/icons/
fonts:
- family: Inter