π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Hey Locker!
vishnukvmd777516446d78
diff --git a/mobile/apps/locker/.gitignore b/mobile/apps/locker/.gitignorenew file mode 100644index 0000000000..9e1d55375a--- /dev/null+++ b/mobile/apps/locker/.gitignore@@ -0,0 +1,54 @@+# Let folks use their custom editor settings+.vscode+.idea++# macOS+.DS_Store++# Miscellaneous+*.class+*.log+*.pyc+*.swp+.DS_Store+.atom/+.buildlog/+.history+.svn/++# Editors+.vscode/++# IntelliJ related+*.iml+*.ipr+*.iws+.idea/++# Flutter/Dart/Pub related+**/doc/api/+.dart_tool/+.flutter-plugins+.flutter-plugins-dependencies+.packages+.pub-cache/+.pub/+/build/++# Web related+lib/generated_plugin_registrant.dart++# Exceptions to above rules.+!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages++android/key.properties+android/app/.settings/*+android/.settings/+.env++fastlane/report.xml++# Android related+android/app/build/++devtools_options.yamldiff --git a/mobile/apps/locker/README.md b/mobile/apps/locker/README.mdnew file mode 100644index 0000000000..29c7d095bf--- /dev/null+++ b/mobile/apps/locker/README.md@@ -0,0 +1 @@+# soon.diff --git a/mobile/apps/locker/analysis_options.yaml b/mobile/apps/locker/analysis_options.yamlnew file mode 100644index 0000000000..1bd78bc1b0--- /dev/null+++ b/mobile/apps/locker/analysis_options.yaml@@ -0,0 +1,72 @@+# For more linters, we can check https://dart-lang.github.io/linter/lints/index.html+# or https://pub.dev/packages/lint (Effective dart)+# use "flutter analyze ." or "dart analyze ." for running lint checks++include: package:flutter_lints/flutter.yaml+linter:+ rules:+ # Ref https://github.com/flutter/packages/blob/master/packages/flutter_lints/lib/flutter.yaml+ # Ref https://dart-lang.github.io/linter/lints/+ - avoid_print+ - avoid_unnecessary_containers+ - avoid_web_libraries_in_flutter+ - no_logic_in_create_state+ - prefer_const_constructors+ - prefer_const_constructors_in_immutables+ - prefer_const_declarations+ - prefer_const_literals_to_create_immutables+ - prefer_final_locals+ - require_trailing_commas+ - sized_box_for_whitespace+ - use_full_hex_values_for_flutter_colors+ - use_key_in_widget_constructors+ - cancel_subscriptions+++ - avoid_empty_else+ - exhaustive_cases++ # just style suggestions+ - sort_pub_dependencies+ - use_rethrow_when_possible+ - prefer_double_quotes+ - directives_ordering+ - always_use_package_imports+ - sort_child_properties_last+ - unawaited_futures++analyzer:+ errors:+ avoid_empty_else: error+ exhaustive_cases: error+ curly_braces_in_flow_control_structures: error+ directives_ordering: error+ require_trailing_commas: error+ always_use_package_imports: warning+ prefer_final_fields: error+ unused_import: error+ camel_case_types: error+ prefer_is_empty: warning+ use_rethrow_when_possible: info+ unused_field: warning+ use_key_in_widget_constructors: warning+ sort_child_properties_last: warning+ sort_pub_dependencies: warning+ library_private_types_in_public_api: warning+ constant_identifier_names: ignore+ prefer_const_constructors: warning+ prefer_const_declarations: warning+ prefer_const_constructors_in_immutables: warning+ prefer_final_locals: warning+ unnecessary_const: error+ cancel_subscriptions: error+ unrelated_type_equality_checks: error+ unnecessary_cast: info+++ unawaited_futures: warning # convert to warning after fixing existing issues+ invalid_dependency: info+ use_build_context_synchronously: ignore # experimental lint, requires many changes+ prefer_interpolation_to_compose_strings: ignore # later too many warnings+ prefer_double_quotes: ignore # too many warnings+ avoid_renaming_method_parameters: ignore # incorrect warnings for `equals` overridesdiff --git a/mobile/apps/locker/android/.gitignore b/mobile/apps/locker/android/.gitignorenew file mode 100644index 0000000000..55afd919c6--- /dev/null+++ b/mobile/apps/locker/android/.gitignore@@ -0,0 +1,13 @@+gradle-wrapper.jar+/.gradle+/captures/+/gradlew+/gradlew.bat+/local.properties+GeneratedPluginRegistrant.java++# Remember to never publicly share your keystore.+# See https://flutter.dev/to/reference-keystore+key.properties+**/*.keystore+**/*.jksdiff --git a/mobile/apps/locker/android/app/build.gradle b/mobile/apps/locker/android/app/build.gradlenew file mode 100644index 0000000000..6aa7b5d563--- /dev/null+++ b/mobile/apps/locker/android/app/build.gradle@@ -0,0 +1,44 @@+plugins {+ id "com.android.application"+ id "kotlin-android"+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.+ id "dev.flutter.flutter-gradle-plugin"+}++android {+ namespace = "io.ente.locker"+ compileSdk = 35+ ndkVersion = flutter.ndkVersion++ compileOptions {+ sourceCompatibility = JavaVersion.VERSION_1_8+ targetCompatibility = JavaVersion.VERSION_1_8+ }++ kotlinOptions {+ jvmTarget = JavaVersion.VERSION_1_8+ }++ defaultConfig {+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).+ applicationId = "io.ente.locker"+ // You can update the following values to match your application needs.+ // For more information, see: https://flutter.dev/to/review-gradle-config.+ minSdk = 26+ targetSdk = flutter.targetSdkVersion+ versionCode = flutter.versionCode+ versionName = flutter.versionName+ }++ buildTypes {+ release {+ // TODO: Add your own signing config for the release build.+ // Signing with the debug keys for now, so `flutter run --release` works.+ signingConfig = signingConfigs.debug+ }+ }+}++flutter {+ source = "../.."+}diff --git a/mobile/apps/locker/android/app/src/debug/AndroidManifest.xml b/mobile/apps/locker/android/app/src/debug/AndroidManifest.xmlnew file mode 100644index 0000000000..399f6981d5--- /dev/null+++ b/mobile/apps/locker/android/app/src/debug/AndroidManifest.xml@@ -0,0 +1,7 @@+<manifest xmlns:android="http://schemas.android.com/apk/res/android">+ <!-- The INTERNET permission is required for development. Specifically,+ the Flutter tool needs it to communicate with the running application+ to allow setting breakpoints, to provide hot reload, etc.+ -->+ <uses-permission android:name="android.permission.INTERNET"/>+</manifest>diff --git a/mobile/apps/locker/android/app/src/main/AndroidManifest.xml b/mobile/apps/locker/android/app/src/main/AndroidManifest.xmlnew file mode 100644index 0000000000..97161a63ea--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/AndroidManifest.xml@@ -0,0 +1,57 @@+<manifest xmlns:android="http://schemas.android.com/apk/res/android">+ <!-- Camera permissions for document scanner -->+ <uses-permission android:name="android.permission.CAMERA" />+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>+ <uses-feature android:name="android.hardware.camera" android:required="false" />+ <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />++ <application+ android:label="Ente Locker"+ android:name="${applicationName}"+ android:icon="@mipmap/ic_launcher">+ <activity+ android:name=".MainActivity"+ android:exported="true"+ android:launchMode="singleTop"+ android:taskAffinity=""+ android:theme="@style/LaunchTheme"+ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"+ android:hardwareAccelerated="true"+ android:windowSoftInputMode="adjustResize">+ <!-- Specifies an Android theme to apply to this Activity as soon as+ the Android process has started. This theme is visible to the user+ while the Flutter UI initializes. After that, this theme continues+ to determine the Window background behind the Flutter UI. -->+ <meta-data+ android:name="io.flutter.embedding.android.NormalTheme"+ android:resource="@style/NormalTheme"+ />+ <intent-filter>+ <action android:name="android.intent.action.MAIN"/>+ <category android:name="android.intent.category.LAUNCHER"/>+ </intent-filter>++ <intent-filter>+ <action android:name="android.intent.action.SEND" />+ <category android:name="android.intent.category.DEFAULT" />+ <data android:mimeType="*/*" />+ </intent-filter>+ </activity>+ <!-- Don't delete the meta-data below.+ This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->+ <meta-data+ android:name="flutterEmbedding"+ android:value="2" />+ </application>+ <!-- Required to query activities that can process text, see:+ https://developer.android.com/training/package-visibility and+ https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.++ In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->+ <queries>+ <intent>+ <action android:name="android.intent.action.PROCESS_TEXT"/>+ <data android:mimeType="text/plain"/>+ </intent>+ </queries>+</manifest>diff --git a/mobile/apps/locker/android/app/src/main/kotlin/io/ente/locker/MainActivity.kt b/mobile/apps/locker/android/app/src/main/kotlin/io/ente/locker/MainActivity.ktnew file mode 100644index 0000000000..8cf01b258d--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/kotlin/io/ente/locker/MainActivity.kt@@ -0,0 +1,5 @@+package io.ente.locker++import io.flutter.embedding.android.FlutterActivity++class MainActivity: FlutterActivity()diff --git a/mobile/apps/locker/android/app/src/main/res/drawable-v21/launch_background.xml b/mobile/apps/locker/android/app/src/main/res/drawable-v21/launch_background.xmlnew file mode 100644index 0000000000..f74085f3f6--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/res/drawable-v21/launch_background.xml@@ -0,0 +1,12 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- Modify this file to customize your launch splash screen -->+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">+ <item android:drawable="?android:colorBackground" />++ <!-- You can insert your own image assets here -->+ <!-- <item>+ <bitmap+ android:gravity="center"+ android:src="@mipmap/launch_image" />+ </item> -->+</layer-list>diff --git a/mobile/apps/locker/android/app/src/main/res/drawable/launch_background.xml b/mobile/apps/locker/android/app/src/main/res/drawable/launch_background.xmlnew file mode 100644index 0000000000..304732f884--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/res/drawable/launch_background.xml@@ -0,0 +1,12 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- Modify this file to customize your launch splash screen -->+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">+ <item android:drawable="@android:color/white" />++ <!-- You can insert your own image assets here -->+ <!-- <item>+ <bitmap+ android:gravity="center"+ android:src="@mipmap/launch_image" />+ </item> -->+</layer-list>diff --git a/mobile/apps/locker/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/mobile/apps/locker/android/app/src/main/res/mipmap-hdpi/ic_launcher.pngnew file mode 100644index 0000000000..db77bb4b7bBinary files /dev/null and b/mobile/apps/locker/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differdiff --git a/mobile/apps/locker/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/mobile/apps/locker/android/app/src/main/res/mipmap-mdpi/ic_launcher.pngnew file mode 100644index 0000000000..17987b79bbBinary files /dev/null and b/mobile/apps/locker/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differdiff --git a/mobile/apps/locker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/mobile/apps/locker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngnew file mode 100644index 0000000000..09d4391482Binary files /dev/null and b/mobile/apps/locker/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differdiff --git a/mobile/apps/locker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/mobile/apps/locker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngnew file mode 100644index 0000000000..d5f1c8d34eBinary files /dev/null and b/mobile/apps/locker/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differdiff --git a/mobile/apps/locker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/mobile/apps/locker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngnew file mode 100644index 0000000000..4d6372eebdBinary files /dev/null and b/mobile/apps/locker/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differdiff --git a/mobile/apps/locker/android/app/src/main/res/values-night/styles.xml b/mobile/apps/locker/android/app/src/main/res/values-night/styles.xmlnew file mode 100644index 0000000000..06952be745--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/res/values-night/styles.xml@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="utf-8"?>+<resources>+ <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->+ <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">+ <!-- Show a splash screen on the activity. Automatically removed when+ the Flutter engine draws its first frame -->+ <item name="android:windowBackground">@drawable/launch_background</item>+ </style>+ <!-- Theme applied to the Android Window as soon as the process has started.+ This theme determines the color of the Android Window while your+ Flutter UI initializes, as well as behind your Flutter UI while its+ running.++ This Theme is only used starting with V2 of Flutter's Android embedding. -->+ <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">+ <item name="android:windowBackground">?android:colorBackground</item>+ </style>+</resources>diff --git a/mobile/apps/locker/android/app/src/main/res/values/styles.xml b/mobile/apps/locker/android/app/src/main/res/values/styles.xmlnew file mode 100644index 0000000000..cb1ef88056--- /dev/null+++ b/mobile/apps/locker/android/app/src/main/res/values/styles.xml@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="utf-8"?>+<resources>+ <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->+ <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">+ <!-- Show a splash screen on the activity. Automatically removed when+ the Flutter engine draws its first frame -->+ <item name="android:windowBackground">@drawable/launch_background</item>+ </style>+ <!-- Theme applied to the Android Window as soon as the process has started.+ This theme determines the color of the Android Window while your+ Flutter UI initializes, as well as behind your Flutter UI while its+ running.++ This Theme is only used starting with V2 of Flutter's Android embedding. -->+ <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">+ <item name="android:windowBackground">?android:colorBackground</item>+ </style>+</resources>diff --git a/mobile/apps/locker/android/app/src/profile/AndroidManifest.xml b/mobile/apps/locker/android/app/src/profile/AndroidManifest.xmlnew file mode 100644index 0000000000..399f6981d5--- /dev/null+++ b/mobile/apps/locker/android/app/src/profile/AndroidManifest.xml@@ -0,0 +1,7 @@+<manifest xmlns:android="http://schemas.android.com/apk/res/android">+ <!-- The INTERNET permission is required for development. Specifically,+ the Flutter tool needs it to communicate with the running application+ to allow setting breakpoints, to provide hot reload, etc.+ -->+ <uses-permission android:name="android.permission.INTERNET"/>+</manifest>diff --git a/mobile/apps/locker/android/build.gradle b/mobile/apps/locker/android/build.gradlenew file mode 100644index 0000000000..d2ffbffa4c--- /dev/null+++ b/mobile/apps/locker/android/build.gradle@@ -0,0 +1,18 @@+allprojects {+ repositories {+ google()+ mavenCentral()+ }+}++rootProject.buildDir = "../build"+subprojects {+ project.buildDir = "${rootProject.buildDir}/${project.name}"+}+subprojects {+ project.evaluationDependsOn(":app")+}++tasks.register("clean", Delete) {+ delete rootProject.buildDir+}diff --git a/mobile/apps/locker/android/gradle.properties b/mobile/apps/locker/android/gradle.propertiesnew file mode 100644index 0000000000..2597170821--- /dev/null+++ b/mobile/apps/locker/android/gradle.properties@@ -0,0 +1,3 @@+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError+android.useAndroidX=true+android.enableJetifier=truediff --git a/mobile/apps/locker/android/gradle/wrapper/gradle-wrapper.properties b/mobile/apps/locker/android/gradle/wrapper/gradle-wrapper.propertiesnew file mode 100644index 0000000000..7bb2df6ba6--- /dev/null+++ b/mobile/apps/locker/android/gradle/wrapper/gradle-wrapper.properties@@ -0,0 +1,5 @@+distributionBase=GRADLE_USER_HOME+distributionPath=wrapper/dists+zipStoreBase=GRADLE_USER_HOME+zipStorePath=wrapper/dists+distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zipdiff --git a/mobile/apps/locker/android/settings.gradle b/mobile/apps/locker/android/settings.gradlenew file mode 100644index 0000000000..b9e43bd376--- /dev/null+++ b/mobile/apps/locker/android/settings.gradle@@ -0,0 +1,25 @@+pluginManagement {+ def flutterSdkPath = {+ def properties = new Properties()+ file("local.properties").withInputStream { properties.load(it) }+ def flutterSdkPath = properties.getProperty("flutter.sdk")+ assert flutterSdkPath != null, "flutter.sdk not set in local.properties"+ return flutterSdkPath+ }()++ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")++ repositories {+ google()+ mavenCentral()+ gradlePluginPortal()+ }+}++plugins {+ id "dev.flutter.flutter-plugin-loader" version "1.0.0"+ id "com.android.application" version "8.1.0" apply false+ id "org.jetbrains.kotlin.android" version "1.8.22" apply false+}++include ":app"diff --git a/mobile/apps/locker/assets/fonts/Inter-Bold.ttf b/mobile/apps/locker/assets/fonts/Inter-Bold.ttfnew file mode 100644index 0000000000..7e1deec31eBinary files /dev/null and b/mobile/apps/locker/assets/fonts/Inter-Bold.ttf differdiff --git a/mobile/apps/locker/assets/fonts/Inter-Light.ttf b/mobile/apps/locker/assets/fonts/Inter-Light.ttfnew file mode 100644index 0000000000..ebaa005740Binary files /dev/null and b/mobile/apps/locker/assets/fonts/Inter-Light.ttf differdiff --git a/mobile/apps/locker/assets/fonts/Inter-Medium.ttf b/mobile/apps/locker/assets/fonts/Inter-Medium.ttfnew file mode 100644index 0000000000..7e573f6498Binary files /dev/null and b/mobile/apps/locker/assets/fonts/Inter-Medium.ttf differdiff --git a/mobile/apps/locker/assets/fonts/Inter-Regular.ttf b/mobile/apps/locker/assets/fonts/Inter-Regular.ttfnew file mode 100644index 0000000000..012d1b470dBinary files /dev/null and b/mobile/apps/locker/assets/fonts/Inter-Regular.ttf differdiff --git a/mobile/apps/locker/assets/fonts/Inter-SemiBold.ttf b/mobile/apps/locker/assets/fonts/Inter-SemiBold.ttfnew file mode 100644index 0000000000..4be54399d6Binary files /dev/null and b/mobile/apps/locker/assets/fonts/Inter-SemiBold.ttf differdiff --git a/mobile/apps/locker/assets/fonts/Montserrat-Bold.ttf b/mobile/apps/locker/assets/fonts/Montserrat-Bold.ttfnew file mode 100644index 0000000000..55e0b1a553Binary files /dev/null and b/mobile/apps/locker/assets/fonts/Montserrat-Bold.ttf differdiff --git a/mobile/apps/locker/assets/locker.png b/mobile/apps/locker/assets/locker.pngnew file mode 100644index 0000000000..d8174de79eBinary files /dev/null and b/mobile/apps/locker/assets/locker.png differdiff --git a/mobile/apps/locker/ios/.gitignore b/mobile/apps/locker/ios/.gitignorenew file mode 100644index 0000000000..7a7f9873ad--- /dev/null+++ b/mobile/apps/locker/ios/.gitignore@@ -0,0 +1,34 @@+**/dgph+*.mode1v3+*.mode2v3+*.moved-aside+*.pbxuser+*.perspectivev3+**/*sync/+.sconsign.dblite+.tags*+**/.vagrant/+**/DerivedData/+Icon?+**/Pods/+**/.symlinks/+profile+xcuserdata+**/.generated/+Flutter/App.framework+Flutter/Flutter.framework+Flutter/Flutter.podspec+Flutter/Generated.xcconfig+Flutter/ephemeral/+Flutter/app.flx+Flutter/app.zip+Flutter/flutter_assets/+Flutter/flutter_export_environment.sh+ServiceDefinitions.json+Runner/GeneratedPluginRegistrant.*++# Exceptions to above rules.+!default.mode1v3+!default.mode2v3+!default.pbxuser+!default.perspectivev3diff --git a/mobile/apps/locker/ios/Flutter/AppFrameworkInfo.plist b/mobile/apps/locker/ios/Flutter/AppFrameworkInfo.plistnew file mode 100644index 0000000000..7c56964006--- /dev/null+++ b/mobile/apps/locker/ios/Flutter/AppFrameworkInfo.plist@@ -0,0 +1,26 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>CFBundleDevelopmentRegion</key>+ <string>en</string>+ <key>CFBundleExecutable</key>+ <string>App</string>+ <key>CFBundleIdentifier</key>+ <string>io.flutter.flutter.app</string>+ <key>CFBundleInfoDictionaryVersion</key>+ <string>6.0</string>+ <key>CFBundleName</key>+ <string>App</string>+ <key>CFBundlePackageType</key>+ <string>FMWK</string>+ <key>CFBundleShortVersionString</key>+ <string>1.0</string>+ <key>CFBundleSignature</key>+ <string>????</string>+ <key>CFBundleVersion</key>+ <string>1.0</string>+ <key>MinimumOSVersion</key>+ <string>12.0</string>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Flutter/Debug.xcconfig b/mobile/apps/locker/ios/Flutter/Debug.xcconfignew file mode 100644index 0000000000..ec97fc6f30--- /dev/null+++ b/mobile/apps/locker/ios/Flutter/Debug.xcconfig@@ -0,0 +1,2 @@+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"+#include "Generated.xcconfig"diff --git a/mobile/apps/locker/ios/Flutter/Release.xcconfig b/mobile/apps/locker/ios/Flutter/Release.xcconfignew file mode 100644index 0000000000..c4855bfe20--- /dev/null+++ b/mobile/apps/locker/ios/Flutter/Release.xcconfig@@ -0,0 +1,2 @@+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"+#include "Generated.xcconfig"diff --git a/mobile/apps/locker/ios/Podfile b/mobile/apps/locker/ios/Podfilenew file mode 100644index 0000000000..7e99f94391--- /dev/null+++ b/mobile/apps/locker/ios/Podfile@@ -0,0 +1,59 @@+# Uncomment this line to define a global platform for your project+platform :ios, '13.0'++# CocoaPods analytics sends network stats synchronously affecting flutter build latency.+ENV['COCOAPODS_DISABLE_STATS'] = 'true'++project 'Runner', {+ 'Debug' => :debug,+ 'Profile' => :release,+ 'Release' => :release,+}++def flutter_root+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)+ unless File.exist?(generated_xcode_build_settings_path)+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"+ end++ File.foreach(generated_xcode_build_settings_path) do |line|+ matches = line.match(/FLUTTER_ROOT\=(.*)/)+ return matches[1].strip if matches+ end+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"+end++require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)++flutter_ios_podfile_setup++target 'Runner' do+ use_frameworks!+ use_modular_headers!++ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))+ target 'RunnerTests' do+ inherit! :search_paths+ end+ target 'Share Extension' do+ inherit! :search_paths+ end+end++post_install do |installer|+ installer.pods_project.targets.each do |target|+ flutter_additional_ios_build_settings(target)+ target.build_configurations.each do |config|+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'+ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [+ '$(inherited)',++ ## dart: PermissionGroup.camera+ 'PERMISSION_CAMERA=1',++ ## dart: PermissionGroup.photos+ 'PERMISSION_PHOTOS=1',+ ]+ end+ end+enddiff --git a/mobile/apps/locker/ios/Podfile.lock b/mobile/apps/locker/ios/Podfile.locknew file mode 100644index 0000000000..a6199b577f--- /dev/null+++ b/mobile/apps/locker/ios/Podfile.lock@@ -0,0 +1,225 @@+PODS:+ - app_links (0.0.2):+ - Flutter+ - cupertino_http (0.0.1):+ - Flutter+ - FlutterMacOS+ - device_info_plus (0.0.1):+ - Flutter+ - DKImagePickerController/Core (4.3.9):+ - DKImagePickerController/ImageDataManager+ - DKImagePickerController/Resource+ - DKImagePickerController/ImageDataManager (4.3.9)+ - DKImagePickerController/PhotoGallery (4.3.9):+ - DKImagePickerController/Core+ - DKPhotoGallery+ - DKImagePickerController/Resource (4.3.9)+ - DKPhotoGallery (0.0.19):+ - DKPhotoGallery/Core (= 0.0.19)+ - DKPhotoGallery/Model (= 0.0.19)+ - DKPhotoGallery/Preview (= 0.0.19)+ - DKPhotoGallery/Resource (= 0.0.19)+ - SDWebImage+ - SwiftyGif+ - DKPhotoGallery/Core (0.0.19):+ - DKPhotoGallery/Model+ - DKPhotoGallery/Preview+ - SDWebImage+ - SwiftyGif+ - DKPhotoGallery/Model (0.0.19):+ - SDWebImage+ - SwiftyGif+ - DKPhotoGallery/Preview (0.0.19):+ - DKPhotoGallery/Model+ - DKPhotoGallery/Resource+ - SDWebImage+ - SwiftyGif+ - DKPhotoGallery/Resource (0.0.19):+ - SDWebImage+ - SwiftyGif+ - file_picker (0.0.1):+ - DKImagePickerController/PhotoGallery+ - Flutter+ - file_saver (0.0.1):+ - Flutter+ - Flutter (1.0.0)+ - flutter_email_sender (0.0.1):+ - Flutter+ - flutter_inappwebview_ios (0.0.1):+ - Flutter+ - flutter_inappwebview_ios/Core (= 0.0.1)+ - OrderedSet (~> 6.0.3)+ - flutter_inappwebview_ios/Core (0.0.1):+ - Flutter+ - OrderedSet (~> 6.0.3)+ - flutter_local_authentication (1.2.0):+ - Flutter+ - flutter_secure_storage (6.0.0):+ - Flutter+ - fluttertoast (0.0.2):+ - Flutter+ - listen_sharing_intent (1.9.2):+ - Flutter+ - local_auth_darwin (0.0.1):+ - Flutter+ - FlutterMacOS+ - objective_c (0.0.1):+ - Flutter+ - open_file_ios (0.0.1):+ - Flutter+ - OrderedSet (6.0.3)+ - package_info_plus (0.4.5):+ - Flutter+ - path_provider_foundation (0.0.1):+ - Flutter+ - FlutterMacOS+ - privacy_screen (0.0.1):+ - Flutter+ - SDWebImage (5.21.0):+ - SDWebImage/Core (= 5.21.0)+ - SDWebImage/Core (5.21.0)+ - Sentry/HybridSDK (8.46.0)+ - sentry_flutter (8.14.2):+ - Flutter+ - FlutterMacOS+ - Sentry/HybridSDK (= 8.46.0)+ - share_plus (0.0.1):+ - Flutter+ - shared_preferences_foundation (0.0.1):+ - Flutter+ - FlutterMacOS+ - sodium_libs (2.2.1):+ - Flutter+ - sqflite_darwin (0.0.4):+ - Flutter+ - FlutterMacOS+ - SwiftyGif (5.4.5)+ - ua_client_hints (1.4.1):+ - Flutter+ - url_launcher_ios (0.0.1):+ - Flutter++DEPENDENCIES:+ - app_links (from `.symlinks/plugins/app_links/ios`)+ - cupertino_http (from `.symlinks/plugins/cupertino_http/darwin`)+ - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)+ - file_picker (from `.symlinks/plugins/file_picker/ios`)+ - file_saver (from `.symlinks/plugins/file_saver/ios`)+ - Flutter (from `Flutter`)+ - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)+ - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)+ - flutter_local_authentication (from `.symlinks/plugins/flutter_local_authentication/ios`)+ - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)+ - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)+ - listen_sharing_intent (from `.symlinks/plugins/listen_sharing_intent/ios`)+ - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)+ - objective_c (from `.symlinks/plugins/objective_c/ios`)+ - open_file_ios (from `.symlinks/plugins/open_file_ios/ios`)+ - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)+ - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)+ - privacy_screen (from `.symlinks/plugins/privacy_screen/ios`)+ - sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)+ - share_plus (from `.symlinks/plugins/share_plus/ios`)+ - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)+ - sodium_libs (from `.symlinks/plugins/sodium_libs/ios`)+ - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)+ - ua_client_hints (from `.symlinks/plugins/ua_client_hints/ios`)+ - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)++SPEC REPOS:+ trunk:+ - DKImagePickerController+ - DKPhotoGallery+ - OrderedSet+ - SDWebImage+ - Sentry+ - SwiftyGif++EXTERNAL SOURCES:+ app_links:+ :path: ".symlinks/plugins/app_links/ios"+ cupertino_http:+ :path: ".symlinks/plugins/cupertino_http/darwin"+ device_info_plus:+ :path: ".symlinks/plugins/device_info_plus/ios"+ file_picker:+ :path: ".symlinks/plugins/file_picker/ios"+ file_saver:+ :path: ".symlinks/plugins/file_saver/ios"+ Flutter:+ :path: Flutter+ flutter_email_sender:+ :path: ".symlinks/plugins/flutter_email_sender/ios"+ flutter_inappwebview_ios:+ :path: ".symlinks/plugins/flutter_inappwebview_ios/ios"+ flutter_local_authentication:+ :path: ".symlinks/plugins/flutter_local_authentication/ios"+ flutter_secure_storage:+ :path: ".symlinks/plugins/flutter_secure_storage/ios"+ fluttertoast:+ :path: ".symlinks/plugins/fluttertoast/ios"+ listen_sharing_intent:+ :path: ".symlinks/plugins/listen_sharing_intent/ios"+ local_auth_darwin:+ :path: ".symlinks/plugins/local_auth_darwin/darwin"+ objective_c:+ :path: ".symlinks/plugins/objective_c/ios"+ open_file_ios:+ :path: ".symlinks/plugins/open_file_ios/ios"+ package_info_plus:+ :path: ".symlinks/plugins/package_info_plus/ios"+ path_provider_foundation:+ :path: ".symlinks/plugins/path_provider_foundation/darwin"+ privacy_screen:+ :path: ".symlinks/plugins/privacy_screen/ios"+ sentry_flutter:+ :path: ".symlinks/plugins/sentry_flutter/ios"+ share_plus:+ :path: ".symlinks/plugins/share_plus/ios"+ shared_preferences_foundation:+ :path: ".symlinks/plugins/shared_preferences_foundation/darwin"+ sodium_libs:+ :path: ".symlinks/plugins/sodium_libs/ios"+ sqflite_darwin:+ :path: ".symlinks/plugins/sqflite_darwin/darwin"+ ua_client_hints:+ :path: ".symlinks/plugins/ua_client_hints/ios"+ url_launcher_ios:+ :path: ".symlinks/plugins/url_launcher_ios/ios"++SPEC CHECKSUMS:+ app_links: f3e17e4ee5e357b39d8b95290a9b2c299fca71c6+ cupertino_http: 947a233f40cfea55167a49f2facc18434ea117ba+ device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6+ DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c+ DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60+ file_picker: b159e0c068aef54932bb15dc9fd1571818edaf49+ file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808+ Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7+ flutter_email_sender: e03bdda7637bcd3539bfe718fddd980e9508efaa+ flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4+ flutter_local_authentication: 1172a4dd88f6306dadce067454e2c4caf07977bb+ flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12+ fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f+ listen_sharing_intent: 74a842adcbcf7bedf7bbc938c749da9155141b9a+ local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3+ objective_c: 77e887b5ba1827970907e10e832eec1683f3431d+ open_file_ios: 461db5853723763573e140de3193656f91990d9e+ OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94+ package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4+ path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46+ privacy_screen: 1a131c052ceb3c3659934b003b0d397c2381a24e+ SDWebImage: f84b0feeb08d2d11e6a9b843cb06d75ebf5b8868+ Sentry: da60d980b197a46db0b35ea12cb8f39af48d8854+ sentry_flutter: 2df8b0aab7e4aba81261c230cbea31c82a62dd1b+ share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f+ shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78+ sodium_libs: 1faae17af662384acbd13e41867a0008cd2e2318+ sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d+ SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4+ ua_client_hints: aeabd123262c087f0ce151ef96fa3ab77bfc8b38+ url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe++PODFILE CHECKSUM: d2d3220ea22664a259778d9e314054751db31361++COCOAPODS: 1.16.2diff --git a/mobile/apps/locker/ios/Runner.xcodeproj/project.pbxproj b/mobile/apps/locker/ios/Runner.xcodeproj/project.pbxprojnew file mode 100644index 0000000000..3bda4ae6a4--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcodeproj/project.pbxproj@@ -0,0 +1,1027 @@+// !$*UTF8*$!+{+ archiveVersion = 1;+ classes = {+ };+ objectVersion = 54;+ objects = {++/* Begin PBXBuildFile section */+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };+ 27AD87F62E16554700B24C05 /* Share Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 27AD87EC2E16554700B24C05 /* Share Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };+ 4CDDC127876941DC8FF88929 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81319B7747381DEFA0F961F7 /* Pods_Runner.framework */; };+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };+ 92402655AF53FB304C48E4BC /* Pods_Share_Extension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B5400AA6FED21CC714A5A0 /* Pods_Share_Extension.framework */; };+ 9373AE318AB19621F0BB5602 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 871674596693C14F59CB67C9 /* Pods_RunnerTests.framework */; };+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };+/* End PBXBuildFile section */++/* Begin PBXContainerItemProxy section */+ 27AD87F42E16554700B24C05 /* PBXContainerItemProxy */ = {+ isa = PBXContainerItemProxy;+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;+ proxyType = 1;+ remoteGlobalIDString = 27AD87EB2E16554700B24C05;+ remoteInfo = "Share Extension";+ };+ 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {+ isa = PBXContainerItemProxy;+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;+ proxyType = 1;+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;+ remoteInfo = Runner;+ };+/* End PBXContainerItemProxy section */++/* Begin PBXCopyFilesBuildPhase section */+ 27AD87D02E1647E900B24C05 /* Embed Foundation Extensions */ = {+ isa = PBXCopyFilesBuildPhase;+ buildActionMask = 2147483647;+ dstPath = "";+ dstSubfolderSpec = 13;+ files = (+ 27AD87F62E16554700B24C05 /* Share Extension.appex in Embed Foundation Extensions */,+ );+ name = "Embed Foundation Extensions";+ runOnlyForDeploymentPostprocessing = 0;+ };+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {+ isa = PBXCopyFilesBuildPhase;+ buildActionMask = 2147483647;+ dstPath = "";+ dstSubfolderSpec = 10;+ files = (+ );+ name = "Embed Frameworks";+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXCopyFilesBuildPhase section */++/* Begin PBXFileReference section */+ 041816B42CE5846482BE66D6 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };+ 27AD87D62E16497400B24C05 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };+ 27AD87EC2E16554700B24C05 /* Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };+ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };+ 3AEDBF29614F8677DCE69E7E /* Pods-Ente Locker.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ente Locker.release.xcconfig"; path = "Target Support Files/Pods-Ente Locker/Pods-Ente Locker.release.xcconfig"; sourceTree = "<group>"; };+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };+ 405BE3630B56B70E48B35F05 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };+ 43F401025D1F7ED737A76C71 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };+ 611BD59A807D8565F74139DC /* Pods_Ente_Locker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Ente_Locker.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };+ 81319B7747381DEFA0F961F7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ 871674596693C14F59CB67C9 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ 89AC4F9CF1F94E149746EB60 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };+ 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };+ 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };+ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };+ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };+ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };+ A1080DB69690A2BD27969FC2 /* Pods-Share Extension.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Share Extension.profile.xcconfig"; path = "Target Support Files/Pods-Share Extension/Pods-Share Extension.profile.xcconfig"; sourceTree = "<group>"; };+ A68B5D5A3F2AA255856692FC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };+ B8B5400AA6FED21CC714A5A0 /* Pods_Share_Extension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Share_Extension.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ B96B59C79D8F854FB9838CDF /* Pods-Ente Locker.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ente Locker.profile.xcconfig"; path = "Target Support Files/Pods-Ente Locker/Pods-Ente Locker.profile.xcconfig"; sourceTree = "<group>"; };+ C775876A93D19660332985CC /* Pods-Ente Locker.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Ente Locker.debug.xcconfig"; path = "Target Support Files/Pods-Ente Locker/Pods-Ente Locker.debug.xcconfig"; sourceTree = "<group>"; };+ D09D02A78DCA8C010704EF91 /* Pods-Share Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Share Extension.debug.xcconfig"; path = "Target Support Files/Pods-Share Extension/Pods-Share Extension.debug.xcconfig"; sourceTree = "<group>"; };+ E11D72536D63426171C60203 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };+ F4C835C880E118F472E3A8B3 /* Pods-Share Extension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Share Extension.release.xcconfig"; path = "Target Support Files/Pods-Share Extension/Pods-Share Extension.release.xcconfig"; sourceTree = "<group>"; };+/* End PBXFileReference section */++/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */+ 27AD87F72E16554700B24C05 /* Exceptions for "Share Extension" folder in "Share Extension" target */ = {+ isa = PBXFileSystemSynchronizedBuildFileExceptionSet;+ membershipExceptions = (+ Info.plist,+ );+ target = 27AD87EB2E16554700B24C05 /* Share Extension */;+ };+/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */++/* Begin PBXFileSystemSynchronizedRootGroup section */+ 27AD87C62E1647E900B24C05 /* Ente Locker */ = {+ isa = PBXFileSystemSynchronizedRootGroup;+ exceptions = (+ );+ explicitFileTypes = {+ };+ explicitFolders = (+ );+ path = "Ente Locker";+ sourceTree = "<group>";+ };+ 27AD87ED2E16554700B24C05 /* Share Extension */ = {+ isa = PBXFileSystemSynchronizedRootGroup;+ exceptions = (+ 27AD87F72E16554700B24C05 /* Exceptions for "Share Extension" folder in "Share Extension" target */,+ );+ explicitFileTypes = {+ };+ explicitFolders = (+ );+ path = "Share Extension";+ sourceTree = "<group>";+ };+/* End PBXFileSystemSynchronizedRootGroup section */++/* Begin PBXFrameworksBuildPhase section */+ 27AD87E92E16554700B24C05 /* Frameworks */ = {+ isa = PBXFrameworksBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 92402655AF53FB304C48E4BC /* Pods_Share_Extension.framework in Frameworks */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 97C146EB1CF9000F007C117D /* Frameworks */ = {+ isa = PBXFrameworksBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 4CDDC127876941DC8FF88929 /* Pods_Runner.framework in Frameworks */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ CF47A9397DB3A7B2B1C598E3 /* Frameworks */ = {+ isa = PBXFrameworksBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 9373AE318AB19621F0BB5602 /* Pods_RunnerTests.framework in Frameworks */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXFrameworksBuildPhase section */++/* Begin PBXGroup section */+ 331C8082294A63A400263BE5 /* RunnerTests */ = {+ isa = PBXGroup;+ children = (+ 331C807B294A618700263BE5 /* RunnerTests.swift */,+ );+ path = RunnerTests;+ sourceTree = "<group>";+ };+ 35603BA520E189E527465052 /* Pods */ = {+ isa = PBXGroup;+ children = (+ A68B5D5A3F2AA255856692FC /* Pods-Runner.debug.xcconfig */,+ 89AC4F9CF1F94E149746EB60 /* Pods-Runner.release.xcconfig */,+ 405BE3630B56B70E48B35F05 /* Pods-Runner.profile.xcconfig */,+ E11D72536D63426171C60203 /* Pods-RunnerTests.debug.xcconfig */,+ 43F401025D1F7ED737A76C71 /* Pods-RunnerTests.release.xcconfig */,+ 041816B42CE5846482BE66D6 /* Pods-RunnerTests.profile.xcconfig */,+ C775876A93D19660332985CC /* Pods-Ente Locker.debug.xcconfig */,+ 3AEDBF29614F8677DCE69E7E /* Pods-Ente Locker.release.xcconfig */,+ B96B59C79D8F854FB9838CDF /* Pods-Ente Locker.profile.xcconfig */,+ D09D02A78DCA8C010704EF91 /* Pods-Share Extension.debug.xcconfig */,+ F4C835C880E118F472E3A8B3 /* Pods-Share Extension.release.xcconfig */,+ A1080DB69690A2BD27969FC2 /* Pods-Share Extension.profile.xcconfig */,+ );+ path = Pods;+ sourceTree = "<group>";+ };+ 9740EEB11CF90186004384FC /* Flutter */ = {+ isa = PBXGroup;+ children = (+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,+ );+ name = Flutter;+ sourceTree = "<group>";+ };+ 97C146E51CF9000F007C117D = {+ isa = PBXGroup;+ children = (+ 9740EEB11CF90186004384FC /* Flutter */,+ 97C146F01CF9000F007C117D /* Runner */,+ 27AD87C62E1647E900B24C05 /* Ente Locker */,+ 27AD87ED2E16554700B24C05 /* Share Extension */,+ 97C146EF1CF9000F007C117D /* Products */,+ 331C8082294A63A400263BE5 /* RunnerTests */,+ 35603BA520E189E527465052 /* Pods */,+ DE91D11FDE3D2B3ABE02BCCD /* Frameworks */,+ );+ sourceTree = "<group>";+ };+ 97C146EF1CF9000F007C117D /* Products */ = {+ isa = PBXGroup;+ children = (+ 97C146EE1CF9000F007C117D /* Runner.app */,+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */,+ 27AD87EC2E16554700B24C05 /* Share Extension.appex */,+ );+ name = Products;+ sourceTree = "<group>";+ };+ 97C146F01CF9000F007C117D /* Runner */ = {+ isa = PBXGroup;+ children = (+ 27AD87D62E16497400B24C05 /* Runner.entitlements */,+ 97C146FA1CF9000F007C117D /* Main.storyboard */,+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,+ 97C147021CF9000F007C117D /* Info.plist */,+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,+ );+ path = Runner;+ sourceTree = "<group>";+ };+ DE91D11FDE3D2B3ABE02BCCD /* Frameworks */ = {+ isa = PBXGroup;+ children = (+ 81319B7747381DEFA0F961F7 /* Pods_Runner.framework */,+ 871674596693C14F59CB67C9 /* Pods_RunnerTests.framework */,+ 611BD59A807D8565F74139DC /* Pods_Ente_Locker.framework */,+ B8B5400AA6FED21CC714A5A0 /* Pods_Share_Extension.framework */,+ );+ name = Frameworks;+ sourceTree = "<group>";+ };+/* End PBXGroup section */++/* Begin PBXNativeTarget section */+ 27AD87EB2E16554700B24C05 /* Share Extension */ = {+ isa = PBXNativeTarget;+ buildConfigurationList = 27AD87F82E16554700B24C05 /* Build configuration list for PBXNativeTarget "Share Extension" */;+ buildPhases = (+ 1304177914FB1E5B189BACD6 /* [CP] Check Pods Manifest.lock */,+ 27AD87E82E16554700B24C05 /* Sources */,+ 27AD87E92E16554700B24C05 /* Frameworks */,+ 27AD87EA2E16554700B24C05 /* Resources */,+ );+ buildRules = (+ );+ dependencies = (+ );+ fileSystemSynchronizedGroups = (+ 27AD87ED2E16554700B24C05 /* Share Extension */,+ );+ name = "Share Extension";+ productName = "Share Extension";+ productReference = 27AD87EC2E16554700B24C05 /* Share Extension.appex */;+ productType = "com.apple.product-type.app-extension";+ };+ 331C8080294A63A400263BE5 /* RunnerTests */ = {+ isa = PBXNativeTarget;+ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;+ buildPhases = (+ AF55335C8D25422D2D282490 /* [CP] Check Pods Manifest.lock */,+ 331C807D294A63A400263BE5 /* Sources */,+ 331C807F294A63A400263BE5 /* Resources */,+ CF47A9397DB3A7B2B1C598E3 /* Frameworks */,+ );+ buildRules = (+ );+ dependencies = (+ 331C8086294A63A400263BE5 /* PBXTargetDependency */,+ );+ name = RunnerTests;+ productName = RunnerTests;+ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;+ productType = "com.apple.product-type.bundle.unit-test";+ };+ 97C146ED1CF9000F007C117D /* Runner */ = {+ isa = PBXNativeTarget;+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;+ buildPhases = (+ DA099182B8E4842D754F598F /* [CP] Check Pods Manifest.lock */,+ 9740EEB61CF901F6004384FC /* Run Script */,+ 97C146EA1CF9000F007C117D /* Sources */,+ 97C146EB1CF9000F007C117D /* Frameworks */,+ 97C146EC1CF9000F007C117D /* Resources */,+ 9705A1C41CF9048500538489 /* Embed Frameworks */,+ 27AD87D02E1647E900B24C05 /* Embed Foundation Extensions */,+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,+ 82B64A7C257381AA0C0D6B15 /* [CP] Embed Pods Frameworks */,+ );+ buildRules = (+ );+ dependencies = (+ 27AD87F52E16554700B24C05 /* PBXTargetDependency */,+ );+ name = Runner;+ productName = Runner;+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;+ productType = "com.apple.product-type.application";+ };+/* End PBXNativeTarget section */++/* Begin PBXProject section */+ 97C146E61CF9000F007C117D /* Project object */ = {+ isa = PBXProject;+ attributes = {+ BuildIndependentTargetsInParallel = YES;+ LastSwiftUpdateCheck = 1620;+ LastUpgradeCheck = 1510;+ ORGANIZATIONNAME = "";+ TargetAttributes = {+ 27AD87EB2E16554700B24C05 = {+ CreatedOnToolsVersion = 16.2;+ };+ 331C8080294A63A400263BE5 = {+ CreatedOnToolsVersion = 14.0;+ TestTargetID = 97C146ED1CF9000F007C117D;+ };+ 97C146ED1CF9000F007C117D = {+ CreatedOnToolsVersion = 7.3.1;+ LastSwiftMigration = 1100;+ };+ };+ };+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;+ compatibilityVersion = "Xcode 9.3";+ developmentRegion = en;+ hasScannedForEncodings = 0;+ knownRegions = (+ en,+ Base,+ );+ mainGroup = 97C146E51CF9000F007C117D;+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;+ projectDirPath = "";+ projectRoot = "";+ targets = (+ 97C146ED1CF9000F007C117D /* Runner */,+ 331C8080294A63A400263BE5 /* RunnerTests */,+ 27AD87EB2E16554700B24C05 /* Share Extension */,+ );+ };+/* End PBXProject section */++/* Begin PBXResourcesBuildPhase section */+ 27AD87EA2E16554700B24C05 /* Resources */ = {+ isa = PBXResourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 331C807F294A63A400263BE5 /* Resources */ = {+ isa = PBXResourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 97C146EC1CF9000F007C117D /* Resources */ = {+ isa = PBXResourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXResourcesBuildPhase section */++/* Begin PBXShellScriptBuildPhase section */+ 1304177914FB1E5B189BACD6 /* [CP] Check Pods Manifest.lock */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",+ "${PODS_ROOT}/Manifest.lock",+ );+ name = "[CP] Check Pods Manifest.lock";+ outputFileListPaths = (+ );+ outputPaths = (+ "$(DERIVED_FILE_DIR)/Pods-Share Extension-checkManifestLockResult.txt",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";+ showEnvVarsInLog = 0;+ };+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {+ isa = PBXShellScriptBuildPhase;+ alwaysOutOfDate = 1;+ buildActionMask = 2147483647;+ files = (+ );+ inputPaths = (+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",+ );+ name = "Thin Binary";+ outputPaths = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";+ };+ 82B64A7C257381AA0C0D6B15 /* [CP] Embed Pods Frameworks */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",+ );+ name = "[CP] Embed Pods Frameworks";+ outputFileListPaths = (+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";+ showEnvVarsInLog = 0;+ };+ 9740EEB61CF901F6004384FC /* Run Script */ = {+ isa = PBXShellScriptBuildPhase;+ alwaysOutOfDate = 1;+ buildActionMask = 2147483647;+ files = (+ );+ inputPaths = (+ );+ name = "Run Script";+ outputPaths = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";+ };+ AF55335C8D25422D2D282490 /* [CP] Check Pods Manifest.lock */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",+ "${PODS_ROOT}/Manifest.lock",+ );+ name = "[CP] Check Pods Manifest.lock";+ outputFileListPaths = (+ );+ outputPaths = (+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";+ showEnvVarsInLog = 0;+ };+ DA099182B8E4842D754F598F /* [CP] Check Pods Manifest.lock */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",+ "${PODS_ROOT}/Manifest.lock",+ );+ name = "[CP] Check Pods Manifest.lock";+ outputFileListPaths = (+ );+ outputPaths = (+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";+ showEnvVarsInLog = 0;+ };+/* End PBXShellScriptBuildPhase section */++/* Begin PBXSourcesBuildPhase section */+ 27AD87E82E16554700B24C05 /* Sources */ = {+ isa = PBXSourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 331C807D294A63A400263BE5 /* Sources */ = {+ isa = PBXSourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 97C146EA1CF9000F007C117D /* Sources */ = {+ isa = PBXSourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXSourcesBuildPhase section */++/* Begin PBXTargetDependency section */+ 27AD87F52E16554700B24C05 /* PBXTargetDependency */ = {+ isa = PBXTargetDependency;+ target = 27AD87EB2E16554700B24C05 /* Share Extension */;+ targetProxy = 27AD87F42E16554700B24C05 /* PBXContainerItemProxy */;+ };+ 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {+ isa = PBXTargetDependency;+ target = 97C146ED1CF9000F007C117D /* Runner */;+ targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;+ };+/* End PBXTargetDependency section */++/* Begin PBXVariantGroup section */+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {+ isa = PBXVariantGroup;+ children = (+ 97C146FB1CF9000F007C117D /* Base */,+ );+ name = Main.storyboard;+ sourceTree = "<group>";+ };+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {+ isa = PBXVariantGroup;+ children = (+ 97C147001CF9000F007C117D /* Base */,+ );+ name = LaunchScreen.storyboard;+ sourceTree = "<group>";+ };+/* End PBXVariantGroup section */++/* Begin XCBuildConfiguration section */+ 249021D3217E4FDB00AE95B9 /* Profile */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_COMMA = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_STRICT_PROTOTYPES = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CLANG_WARN_UNREACHABLE_CODE = YES;+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";+ COPY_PHASE_STRIP = NO;+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";+ ENABLE_NS_ASSERTIONS = NO;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu99;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNDECLARED_SELECTOR = YES;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;+ MTL_ENABLE_DEBUG_INFO = NO;+ SDKROOT = iphoneos;+ SUPPORTED_PLATFORMS = iphoneos;+ TARGETED_DEVICE_FAMILY = "1,2";+ VALIDATE_PRODUCT = YES;+ };+ name = Profile;+ };+ 249021D4217E4FDB00AE95B9 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_BITCODE = NO;+ INFOPLIST_FILE = Runner/Info.plist;+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ );+ NEW_SETTING = "";+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";+ SWIFT_VERSION = 5.0;+ VERSIONING_SYSTEM = "apple-generic";+ };+ name = Profile;+ };+ 27AD87F92E16554700B24C05 /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = D09D02A78DCA8C010704EF91 /* Pods-Share Extension.debug.xcconfig */;+ buildSettings = {+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";+ CLANG_ENABLE_OBJC_WEAK = YES;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;+ CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_USER_SCRIPT_SANDBOXING = YES;+ GCC_C_LANGUAGE_STANDARD = gnu17;+ GENERATE_INFOPLIST_FILE = YES;+ INFOPLIST_FILE = "Share Extension/Info.plist";+ INFOPLIST_KEY_CFBundleDisplayName = "Share Extension";+ INFOPLIST_KEY_NSHumanReadableCopyright = "";+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ "@executable_path/../../Frameworks",+ );+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;+ MARKETING_VERSION = 1.0;+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;+ MTL_FAST_MATH = YES;+ PRODUCT_BUNDLE_IDENTIFIER = "io.ente.locker.Share-Extension";+ PRODUCT_NAME = "$(TARGET_NAME)";+ SKIP_INSTALL = YES;+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";+ SWIFT_EMIT_LOC_STRINGS = YES;+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";+ SWIFT_VERSION = 5.0;+ TARGETED_DEVICE_FAMILY = "1,2";+ };+ name = Debug;+ };+ 27AD87FA2E16554700B24C05 /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = F4C835C880E118F472E3A8B3 /* Pods-Share Extension.release.xcconfig */;+ buildSettings = {+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";+ CLANG_ENABLE_OBJC_WEAK = YES;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;+ CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_USER_SCRIPT_SANDBOXING = YES;+ GCC_C_LANGUAGE_STANDARD = gnu17;+ GENERATE_INFOPLIST_FILE = YES;+ INFOPLIST_FILE = "Share Extension/Info.plist";+ INFOPLIST_KEY_CFBundleDisplayName = "Share Extension";+ INFOPLIST_KEY_NSHumanReadableCopyright = "";+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ "@executable_path/../../Frameworks",+ );+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;+ MARKETING_VERSION = 1.0;+ MTL_FAST_MATH = YES;+ PRODUCT_BUNDLE_IDENTIFIER = "io.ente.locker.Share-Extension";+ PRODUCT_NAME = "$(TARGET_NAME)";+ SKIP_INSTALL = YES;+ SWIFT_EMIT_LOC_STRINGS = YES;+ SWIFT_VERSION = 5.0;+ TARGETED_DEVICE_FAMILY = "1,2";+ };+ name = Release;+ };+ 27AD87FB2E16554700B24C05 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = A1080DB69690A2BD27969FC2 /* Pods-Share Extension.profile.xcconfig */;+ buildSettings = {+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";+ CLANG_ENABLE_OBJC_WEAK = YES;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;+ CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_USER_SCRIPT_SANDBOXING = YES;+ GCC_C_LANGUAGE_STANDARD = gnu17;+ GENERATE_INFOPLIST_FILE = YES;+ INFOPLIST_FILE = "Share Extension/Info.plist";+ INFOPLIST_KEY_CFBundleDisplayName = "Share Extension";+ INFOPLIST_KEY_NSHumanReadableCopyright = "";+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ "@executable_path/../../Frameworks",+ );+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;+ MARKETING_VERSION = 1.0;+ MTL_FAST_MATH = YES;+ PRODUCT_BUNDLE_IDENTIFIER = "io.ente.locker.Share-Extension";+ PRODUCT_NAME = "$(TARGET_NAME)";+ SKIP_INSTALL = YES;+ SWIFT_EMIT_LOC_STRINGS = YES;+ SWIFT_VERSION = 5.0;+ TARGETED_DEVICE_FAMILY = "1,2";+ };+ name = Profile;+ };+ 331C8088294A63A400263BE5 /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = E11D72536D63426171C60203 /* Pods-RunnerTests.debug.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";+ };+ name = Debug;+ };+ 331C8089294A63A400263BE5 /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 43F401025D1F7ED737A76C71 /* Pods-RunnerTests.release.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";+ };+ name = Release;+ };+ 331C808A294A63A400263BE5 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 041816B42CE5846482BE66D6 /* Pods-RunnerTests.profile.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";+ };+ name = Profile;+ };+ 97C147031CF9000F007C117D /* Debug */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_COMMA = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_STRICT_PROTOTYPES = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CLANG_WARN_UNREACHABLE_CODE = YES;+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";+ COPY_PHASE_STRIP = NO;+ DEBUG_INFORMATION_FORMAT = dwarf;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_TESTABILITY = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu99;+ GCC_DYNAMIC_NO_PIC = NO;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_OPTIMIZATION_LEVEL = 0;+ GCC_PREPROCESSOR_DEFINITIONS = (+ "DEBUG=1",+ "$(inherited)",+ );+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNDECLARED_SELECTOR = YES;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;+ MTL_ENABLE_DEBUG_INFO = YES;+ ONLY_ACTIVE_ARCH = YES;+ SDKROOT = iphoneos;+ TARGETED_DEVICE_FAMILY = "1,2";+ };+ name = Debug;+ };+ 97C147041CF9000F007C117D /* Release */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_COMMA = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_STRICT_PROTOTYPES = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CLANG_WARN_UNREACHABLE_CODE = YES;+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";+ COPY_PHASE_STRIP = NO;+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";+ ENABLE_NS_ASSERTIONS = NO;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu99;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNDECLARED_SELECTOR = YES;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;+ MTL_ENABLE_DEBUG_INFO = NO;+ SDKROOT = iphoneos;+ SUPPORTED_PLATFORMS = iphoneos;+ SWIFT_COMPILATION_MODE = wholemodule;+ SWIFT_OPTIMIZATION_LEVEL = "-O";+ TARGETED_DEVICE_FAMILY = "1,2";+ VALIDATE_PRODUCT = YES;+ };+ name = Release;+ };+ 97C147061CF9000F007C117D /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_BITCODE = NO;+ INFOPLIST_FILE = Runner/Info.plist;+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ );+ NEW_SETTING = "";+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";+ SWIFT_VERSION = 5.0;+ VERSIONING_SYSTEM = "apple-generic";+ };+ name = Debug;+ };+ 97C147071CF9000F007C117D /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";+ CUSTOM_GROUP_ID = group.io.ente.locker.share;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ ENABLE_BITCODE = NO;+ INFOPLIST_FILE = Runner/Info.plist;+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/Frameworks",+ );+ NEW_SETTING = "";+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";+ SWIFT_VERSION = 5.0;+ VERSIONING_SYSTEM = "apple-generic";+ };+ name = Release;+ };+/* End XCBuildConfiguration section */++/* Begin XCConfigurationList section */+ 27AD87F82E16554700B24C05 /* Build configuration list for PBXNativeTarget "Share Extension" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 27AD87F92E16554700B24C05 /* Debug */,+ 27AD87FA2E16554700B24C05 /* Release */,+ 27AD87FB2E16554700B24C05 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 331C8088294A63A400263BE5 /* Debug */,+ 331C8089294A63A400263BE5 /* Release */,+ 331C808A294A63A400263BE5 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 97C147031CF9000F007C117D /* Debug */,+ 97C147041CF9000F007C117D /* Release */,+ 249021D3217E4FDB00AE95B9 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 97C147061CF9000F007C117D /* Debug */,+ 97C147071CF9000F007C117D /* Release */,+ 249021D4217E4FDB00AE95B9 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+/* End XCConfigurationList section */+ };+ rootObject = 97C146E61CF9000F007C117D /* Project object */;+}diff --git a/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedatanew file mode 100644index 0000000000..919434a625--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="UTF-8"?>+<Workspace+ version = "1.0">+ <FileRef+ location = "self:">+ </FileRef>+</Workspace>diff --git a/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistnew file mode 100644index 0000000000..18d981003d--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>IDEDidComputeMac32BitWarning</key>+ <true/>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettingsnew file mode 100644index 0000000000..f9b0d7c5ea--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>PreviewsEnabled</key>+ <false/>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/mobile/apps/locker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemenew file mode 100644index 0000000000..e3773d42e2--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme@@ -0,0 +1,101 @@+<?xml version="1.0" encoding="UTF-8"?>+<Scheme+ LastUpgradeVersion = "1510"+ version = "1.3">+ <BuildAction+ parallelizeBuildables = "YES"+ buildImplicitDependencies = "YES">+ <BuildActionEntries>+ <BuildActionEntry+ buildForTesting = "YES"+ buildForRunning = "YES"+ buildForProfiling = "YES"+ buildForArchiving = "YES"+ buildForAnalyzing = "YES">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "97C146ED1CF9000F007C117D"+ BuildableName = "Runner.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildActionEntry>+ </BuildActionEntries>+ </BuildAction>+ <TestAction+ buildConfiguration = "Debug"+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"+ customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"+ shouldUseLaunchSchemeArgsEnv = "YES">+ <MacroExpansion>+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "97C146ED1CF9000F007C117D"+ BuildableName = "Runner.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </MacroExpansion>+ <Testables>+ <TestableReference+ skipped = "NO"+ parallelizable = "YES">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "331C8080294A63A400263BE5"+ BuildableName = "RunnerTests.xctest"+ BlueprintName = "RunnerTests"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </TestableReference>+ </Testables>+ </TestAction>+ <LaunchAction+ buildConfiguration = "Debug"+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"+ customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"+ launchStyle = "0"+ useCustomWorkingDirectory = "NO"+ ignoresPersistentStateOnLaunch = "NO"+ debugDocumentVersioning = "YES"+ debugServiceExtension = "internal"+ enableGPUValidationMode = "1"+ allowLocationSimulation = "YES">+ <BuildableProductRunnable+ runnableDebuggingMode = "0">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "97C146ED1CF9000F007C117D"+ BuildableName = "Runner.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildableProductRunnable>+ </LaunchAction>+ <ProfileAction+ buildConfiguration = "Profile"+ shouldUseLaunchSchemeArgsEnv = "YES"+ savedToolIdentifier = ""+ useCustomWorkingDirectory = "NO"+ debugDocumentVersioning = "YES">+ <BuildableProductRunnable+ runnableDebuggingMode = "0">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "97C146ED1CF9000F007C117D"+ BuildableName = "Runner.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildableProductRunnable>+ </ProfileAction>+ <AnalyzeAction+ buildConfiguration = "Debug">+ </AnalyzeAction>+ <ArchiveAction+ buildConfiguration = "Release"+ revealArchiveInOrganizer = "YES">+ </ArchiveAction>+</Scheme>diff --git a/mobile/apps/locker/ios/Runner.xcworkspace/contents.xcworkspacedata b/mobile/apps/locker/ios/Runner.xcworkspace/contents.xcworkspacedatanew file mode 100644index 0000000000..21a3cc14c7--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcworkspace/contents.xcworkspacedata@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="UTF-8"?>+<Workspace+ version = "1.0">+ <FileRef+ location = "group:Runner.xcodeproj">+ </FileRef>+ <FileRef+ location = "group:Pods/Pods.xcodeproj">+ </FileRef>+</Workspace>diff --git a/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistnew file mode 100644index 0000000000..18d981003d--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>IDEDidComputeMac32BitWarning</key>+ <true/>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettingsnew file mode 100644index 0000000000..f9b0d7c5ea--- /dev/null+++ b/mobile/apps/locker/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>PreviewsEnabled</key>+ <false/>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Runner/AppDelegate.swift b/mobile/apps/locker/ios/Runner/AppDelegate.swiftnew file mode 100644index 0000000000..626664468b--- /dev/null+++ b/mobile/apps/locker/ios/Runner/AppDelegate.swift@@ -0,0 +1,13 @@+import Flutter+import UIKit++@main+@objc class AppDelegate: FlutterAppDelegate {+ override func application(+ _ application: UIApplication,+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?+ ) -> Bool {+ GeneratedPluginRegistrant.register(with: self)+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)+ }+}diff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.jsonnew file mode 100644index 0000000000..d36b1fab2d--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json@@ -0,0 +1,122 @@+{+ "images" : [+ {+ "size" : "20x20",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "20x20",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "3x"+ },+ {+ "size" : "29x29",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "1x"+ },+ {+ "size" : "29x29",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "29x29",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "3x"+ },+ {+ "size" : "40x40",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "40x40",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "3x"+ },+ {+ "size" : "60x60",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "60x60",+ "idiom" : "iphone",+ "filename" : "[email protected]",+ "scale" : "3x"+ },+ {+ "size" : "20x20",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "1x"+ },+ {+ "size" : "20x20",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "29x29",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "1x"+ },+ {+ "size" : "29x29",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "40x40",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "1x"+ },+ {+ "size" : "40x40",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "76x76",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "1x"+ },+ {+ "size" : "76x76",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "83.5x83.5",+ "idiom" : "ipad",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "size" : "1024x1024",+ "idiom" : "ios-marketing",+ "filename" : "[email protected]",+ "scale" : "1x"+ }+ ],+ "info" : {+ "version" : 1,+ "author" : "xcode"+ }+}diff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..dc9ada4725Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..7353c41ecfBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..797d452e45Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..6ed2d933e1Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..4cd7b0099cBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..fe730945a0Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..321773cd85Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..797d452e45Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..502f463a9bBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..0ec3034392Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..0ec3034392Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..e9f5fea27cBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..84ac32ae7dBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..8953cba090Binary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 0000000000..0467bf12aaBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.jsonnew file mode 100644index 0000000000..0bedcf2fd4--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json@@ -0,0 +1,23 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "filename" : "LaunchImage.png",+ "scale" : "1x"+ },+ {+ "idiom" : "universal",+ "filename" : "[email protected]",+ "scale" : "2x"+ },+ {+ "idiom" : "universal",+ "filename" : "[email protected]",+ "scale" : "3x"+ }+ ],+ "info" : {+ "version" : 1,+ "author" : "xcode"+ }+}diff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.pngnew file mode 100644index 0000000000..9da19eacadBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]new file mode 100644index 0000000000..9da19eacadBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected] b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected]new file mode 100644index 0000000000..9da19eacadBinary files /dev/null and b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/[email protected] differdiff --git a/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.mdnew file mode 100644index 0000000000..89c2725b70--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md@@ -0,0 +1,5 @@+# Launch Screen Assets++You can customize the launch screen with your own desired assets by replacing the image files in this directory.++You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.\ No newline at end of filediff --git a/mobile/apps/locker/ios/Runner/Base.lproj/LaunchScreen.storyboard b/mobile/apps/locker/ios/Runner/Base.lproj/LaunchScreen.storyboardnew file mode 100644index 0000000000..f2e259c7c9--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Base.lproj/LaunchScreen.storyboard@@ -0,0 +1,37 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">+ <dependencies>+ <deployment identifier="iOS"/>+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>+ </dependencies>+ <scenes>+ <!--View Controller-->+ <scene sceneID="EHf-IW-A2E">+ <objects>+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">+ <layoutGuides>+ <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>+ <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>+ </layoutGuides>+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <subviews>+ <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">+ </imageView>+ </subviews>+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>+ <constraints>+ <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>+ <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>+ </constraints>+ </view>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>+ </objects>+ <point key="canvasLocation" x="53" y="375"/>+ </scene>+ </scenes>+ <resources>+ <image name="LaunchImage" width="168" height="185"/>+ </resources>+</document>diff --git a/mobile/apps/locker/ios/Runner/Base.lproj/Main.storyboard b/mobile/apps/locker/ios/Runner/Base.lproj/Main.storyboardnew file mode 100644index 0000000000..f3c28516fb--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Base.lproj/Main.storyboard@@ -0,0 +1,26 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">+ <dependencies>+ <deployment identifier="iOS"/>+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>+ </dependencies>+ <scenes>+ <!--Flutter View Controller-->+ <scene sceneID="tne-QT-ifu">+ <objects>+ <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">+ <layoutGuides>+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>+ </layoutGuides>+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>+ </view>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>+ </objects>+ </scene>+ </scenes>+</document>diff --git a/mobile/apps/locker/ios/Runner/Info.plist b/mobile/apps/locker/ios/Runner/Info.plistnew file mode 100644index 0000000000..836320f49d--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Info.plist@@ -0,0 +1,68 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>CFBundleDevelopmentRegion</key>+ <string>$(DEVELOPMENT_LANGUAGE)</string>+ <key>CFBundleDisplayName</key>+ <string>Ente Locker</string>+ <key>CFBundleExecutable</key>+ <string>$(EXECUTABLE_NAME)</string>+ <key>CFBundleIdentifier</key>+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>+ <key>CFBundleInfoDictionaryVersion</key>+ <string>6.0</string>+ <key>CFBundleName</key>+ <string>Ente Locker</string>+ <key>CFBundlePackageType</key>+ <string>APPL</string>+ <key>CFBundleShortVersionString</key>+ <string>$(FLUTTER_BUILD_NAME)</string>+ <key>CFBundleSignature</key>+ <string>????</string>+ <key>CFBundleVersion</key>+ <string>$(FLUTTER_BUILD_NUMBER)</string>+ <key>LSRequiresIPhoneOS</key>+ <true/>+ <key>UILaunchStoryboardName</key>+ <string>LaunchScreen</string>+ <key>UIMainStoryboardFile</key>+ <string>Main</string>+ <key>UISupportedInterfaceOrientations</key>+ <array>+ <string>UIInterfaceOrientationPortrait</string>+ <string>UIInterfaceOrientationLandscapeLeft</string>+ <string>UIInterfaceOrientationLandscapeRight</string>+ </array>+ <key>UISupportedInterfaceOrientations~ipad</key>+ <array>+ <string>UIInterfaceOrientationPortrait</string>+ <string>UIInterfaceOrientationPortraitUpsideDown</string>+ <string>UIInterfaceOrientationLandscapeLeft</string>+ <string>UIInterfaceOrientationLandscapeRight</string>+ </array>+ <key>CADisableMinimumFrameDurationOnPhone</key>+ <true/>+ <key>UIApplicationSupportsIndirectInputEvents</key>+ <true/>+ <key>NSCameraUsageDescription</key>+ <string>Please allow access to camera so that Ente can scan and backup your documents.</string>+ <key>NSPhotoLibraryUsageDescription</key>+ <string>Please allow access to your library so that Ente can encrypt and back up your documents.</string>+ <key>NSPhotoLibraryAddUsageDescription</key>+ <string>Please allow access to your library so that Ente can encrypt and back up your documents.</string>+ <key>AppGroupId</key>+ <string>$(CUSTOM_GROUP_ID)</string>+ <key>CFBundleURLTypes</key>+ <array>+ <dict>+ <key>CFBundleTypeRole</key>+ <string>Editor</string>+ <key>CFBundleURLSchemes</key>+ <array>+ <string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>+ </array>+ </dict>+ </array>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Runner/Runner-Bridging-Header.h b/mobile/apps/locker/ios/Runner/Runner-Bridging-Header.hnew file mode 100644index 0000000000..308a2a560b--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Runner-Bridging-Header.h@@ -0,0 +1 @@+#import "GeneratedPluginRegistrant.h"diff --git a/mobile/apps/locker/ios/Runner/Runner.entitlements b/mobile/apps/locker/ios/Runner/Runner.entitlementsnew file mode 100644index 0000000000..b79c362eed--- /dev/null+++ b/mobile/apps/locker/ios/Runner/Runner.entitlements@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.application-groups</key>+ <array>+ <string>group.io.ente.locker.share</string>+ </array>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/RunnerTests/RunnerTests.swift b/mobile/apps/locker/ios/RunnerTests/RunnerTests.swiftnew file mode 100644index 0000000000..86a7c3b1b6--- /dev/null+++ b/mobile/apps/locker/ios/RunnerTests/RunnerTests.swift@@ -0,0 +1,12 @@+import Flutter+import UIKit+import XCTest++class RunnerTests: XCTestCase {++ func testExample() {+ // If you add code to the Runner application, consider adding tests here.+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.+ }++}diff --git a/mobile/apps/locker/ios/Share Extension/Base.lproj/MainInterface.storyboard b/mobile/apps/locker/ios/Share Extension/Base.lproj/MainInterface.storyboardnew file mode 100644index 0000000000..286a50894d--- /dev/null+++ b/mobile/apps/locker/ios/Share Extension/Base.lproj/MainInterface.storyboard@@ -0,0 +1,24 @@+<?xml version="1.0" encoding="UTF-8"?>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="j1y-V4-xli">+ <dependencies>+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>+ </dependencies>+ <scenes>+ <!--Share View Controller-->+ <scene sceneID="ceB-am-kn3">+ <objects>+ <viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="target" sceneMemberID="viewController">+ <view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP">+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>+ <viewLayoutGuide key="safeArea" id="1Xd-am-t49"/>+ </view>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>+ </objects>+ </scene>+ </scenes>+</document>diff --git a/mobile/apps/locker/ios/Share Extension/Info.plist b/mobile/apps/locker/ios/Share Extension/Info.plistnew file mode 100644index 0000000000..1efefe2ea7--- /dev/null+++ b/mobile/apps/locker/ios/Share Extension/Info.plist@@ -0,0 +1,33 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+ <dict>+ <key>AppGroupId</key>+ <string>$(CUSTOM_GROUP_ID)</string>+ <key>CFBundleVersion</key>+ <string>$(FLUTTER_BUILD_NUMBER)</string>+ <key>NSExtension</key>+ <dict>+ <key>NSExtensionAttributes</key>+ <dict>+ <key>NSExtensionActivationRule</key>+ <string>SUBQUERY (+ extensionItems,+ $extensionItem,+ SUBQUERY (+ $extensionItem.attachments,+ $attachment,+ ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" AND+ !(ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" OR+ ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text" OR+ ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.utf8-plain-text")+ ).@count == 1+ ).@count == 1</string>+ </dict>+ <key>NSExtensionMainStoryboard</key>+ <string>MainInterface</string>+ <key>NSExtensionPointIdentifier</key>+ <string>com.apple.share-services</string>+ </dict>+ </dict>+</plist>diff --git a/mobile/apps/locker/ios/Share Extension/Share Extension.entitlements b/mobile/apps/locker/ios/Share Extension/Share Extension.entitlementsnew file mode 100644index 0000000000..b79c362eed--- /dev/null+++ b/mobile/apps/locker/ios/Share Extension/Share Extension.entitlements@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.application-groups</key>+ <array>+ <string>group.io.ente.locker.share</string>+ </array>+</dict>+</plist>diff --git a/mobile/apps/locker/ios/Share Extension/ShareViewController.swift b/mobile/apps/locker/ios/Share Extension/ShareViewController.swiftnew file mode 100644index 0000000000..f5aabe3e2a--- /dev/null+++ b/mobile/apps/locker/ios/Share Extension/ShareViewController.swift@@ -0,0 +1,10 @@+import listen_sharing_intent++class ShareViewController: RSIShareViewController {++ // Use this method to return false if you don't want to redirect to host app automatically.+ // Default is true+ override func shouldAutoRedirect() -> Bool {+ return true+ }+}diff --git a/mobile/apps/locker/l10n.yaml b/mobile/apps/locker/l10n.yamlnew file mode 100644index 0000000000..15338f2ddc--- /dev/null+++ b/mobile/apps/locker/l10n.yaml@@ -0,0 +1,3 @@+arb-dir: lib/l10n+template-arb-file: app_en.arb+output-localization-file: app_localizations.dartdiff --git a/mobile/apps/locker/lib/app.dart b/mobile/apps/locker/lib/app.dartnew file mode 100644index 0000000000..05aea2ae6d--- /dev/null+++ b/mobile/apps/locker/lib/app.dart@@ -0,0 +1,220 @@+import 'dart:async';+import 'dart:io';++import 'package:adaptive_theme/adaptive_theme.dart';+import 'package:ente_accounts/services/user_service.dart';+import 'package:ente_events/event_bus.dart';+import 'package:ente_events/models/signed_in_event.dart';+import 'package:ente_events/models/signed_out_event.dart';+import 'package:ente_strings/l10n/strings_localizations.dart';+import 'package:ente_ui/theme/colors.dart';+import 'package:ente_ui/theme/ente_theme_data.dart';+import 'package:ente_ui/utils/window_listener_service.dart';+import 'package:flutter/foundation.dart';+import "package:flutter/material.dart";+import 'package:flutter_localizations/flutter_localizations.dart';+import 'package:locker/core/locale.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/ui/pages/home_page.dart';+import 'package:locker/ui/pages/onboarding_page.dart';+import 'package:tray_manager/tray_manager.dart';+import 'package:window_manager/window_manager.dart';++class App extends StatefulWidget {+ final Locale? locale;+ const App({super.key, this.locale = const Locale("en")});++ static void setLocale(BuildContext context, Locale newLocale) {+ final _AppState state = context.findAncestorStateOfType<_AppState>()!;+ state.setLocale(newLocale);+ }++ @override+ State<App> createState() => _AppState();+}++class _AppState extends State<App>+ with WindowListener, TrayListener, WidgetsBindingObserver {+ late StreamSubscription<SignedOutEvent> _signedOutEvent;+ late StreamSubscription<SignedInEvent> _signedInEvent;+ Locale? locale;+ setLocale(Locale newLocale) {+ setState(() {+ locale = newLocale;+ });+ }++ Future<void> initWindowManager() async {+ windowManager.addListener(this);+ }++ Future<void> initTrayManager() async {+ trayManager.addListener(this);+ }++ @override+ void initState() {+ initWindowManager();+ initTrayManager();+ WidgetsBinding.instance.addObserver(this);++ _signedOutEvent = Bus.instance.on<SignedOutEvent>().listen((event) {+ if (mounted) {+ setState(() {});+ }+ });+ _signedInEvent = Bus.instance.on<SignedInEvent>().listen((event) {+ UserService.instance.getUserDetailsV2().ignore();+ if (mounted) {+ setState(() {});+ }+ });+ locale = widget.locale;+ super.initState();+ }++ @override+ void dispose() {+ super.dispose();++ windowManager.removeListener(this);+ trayManager.removeListener(this);++ _signedOutEvent.cancel();+ _signedInEvent.cancel();+ }++ @override+ Widget build(BuildContext context) {+ final schemes = ColorSchemeBuilder.fromCustomColors(+ primary700: const Color(0xFF1565C0), // Dark blue+ primary500: const Color(0xFF2196F3), // Material blue+ primary400: const Color(0xFF42A5F5), // Light blue+ primary300: const Color(0xFF90CAF9), // Very light blue+ iconButtonColor: const Color(0xFF1976D2), // Custom icon color+ gradientButtonBgColors: const [+ Color(0xFF1565C0),+ Color(0xFF2196F3),+ Color(0xFF42A5F5),+ ],+ );++ final lightTheme = createAppThemeData(+ brightness: Brightness.light,+ colorScheme: schemes.light,+ );++ final darkTheme = createAppThemeData(+ brightness: Brightness.dark,+ colorScheme: schemes.dark,+ );++ Widget buildApp() {+ if (Platform.isAndroid ||+ Platform.isWindows ||+ Platform.isLinux ||+ kDebugMode) {+ return AdaptiveTheme(+ light: lightTheme,+ dark: darkTheme,+ initial: AdaptiveThemeMode.system,+ builder: (lightTheme, dartTheme) => MaterialApp(+ title: "ente",+ themeMode: ThemeMode.system,+ theme: lightTheme,+ darkTheme: dartTheme,+ debugShowCheckedModeBanner: false,+ locale: locale,+ supportedLocales: appSupportedLocales,+ localeListResolutionCallback: localResolutionCallBack,+ localizationsDelegates: const [+ AppLocalizations.delegate,+ StringsLocalizations.delegate,+ GlobalMaterialLocalizations.delegate,+ GlobalCupertinoLocalizations.delegate,+ GlobalWidgetsLocalizations.delegate,+ ],+ routes: _getRoutes,+ ),+ );+ } else {+ return MaterialApp(+ title: "ente",+ themeMode: ThemeMode.system,+ theme: lightTheme,+ darkTheme: darkTheme,+ debugShowCheckedModeBanner: false,+ locale: locale,+ supportedLocales: appSupportedLocales,+ localeListResolutionCallback: localResolutionCallBack,+ localizationsDelegates: const [+ AppLocalizations.delegate,+ StringsLocalizations.delegate,+ GlobalMaterialLocalizations.delegate,+ GlobalCupertinoLocalizations.delegate,+ GlobalWidgetsLocalizations.delegate,+ ],+ routes: _getRoutes,+ );+ }+ }++ // Wrap the app with MediaQuery to control text scaling and ensure+ // consistent font sizes across Android and iOS+ return MediaQuery.withClampedTextScaling(+ minScaleFactor: 0.8,+ maxScaleFactor: 1.3,+ child: buildApp(),+ );+ }++ Map<String, WidgetBuilder> get _getRoutes {+ return {+ "/": (context) => Configuration.instance.hasConfiguredAccount()+ ? const HomePage()+ : const OnboardingPage(),+ };+ }++ @override+ void onWindowResize() {+ WindowListenerService.instance.onWindowResize().ignore();+ }++ @override+ void onTrayIconMouseDown() {+ if (Platform.isWindows) {+ windowManager.show();+ } else {+ trayManager.popUpContextMenu();+ }+ }++ @override+ void onTrayIconRightMouseDown() {+ if (Platform.isWindows) {+ trayManager.popUpContextMenu();+ } else {+ windowManager.show();+ }+ }++ @override+ void onTrayIconRightMouseUp() {}++ @override+ void onTrayMenuItemClick(MenuItem menuItem) {+ switch (menuItem.key) {+ case 'hide_window':+ windowManager.hide();+ break;+ case 'show_window':+ windowManager.show();+ break;+ case 'exit_app':+ windowManager.destroy();+ break;+ }+ }+}diff --git a/mobile/apps/locker/lib/core/constants.dart b/mobile/apps/locker/lib/core/constants.dartnew file mode 100644index 0000000000..b1ff31d0cb--- /dev/null+++ b/mobile/apps/locker/lib/core/constants.dart@@ -0,0 +1,45 @@+import 'package:flutter/foundation.dart';++const String kAccountsUrl = "https://accounts.ente.io";+const int microSecondsInDay = 86400000000;+const int android11SDKINT = 30;++// 256 bit key maps to 24 words+// https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic+const mnemonicKeyWordCount = 24;++const kDefaultProductionEndpoint = 'https://api.ente.io';++final tempDirCleanUpInterval = kDebugMode+ ? const Duration(hours: 1).inMicroseconds+ : const Duration(hours: 6).inMicroseconds;++const uploadTempFilePrefix = "upload_file_";++const blackThumbnailBase64 = '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEB'+ 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQ'+ 'EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARC'+ 'ACWASwDAREAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF'+ 'BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk'+ '6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztL'+ 'W2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAA'+ 'AAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVY'+ 'nLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImK'+ 'kpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oAD'+ 'AMBAAIRAxEAPwD/AD/6ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKAC'+ 'gAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA'+ 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACg'+ 'AoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKA'+ 'CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAK'+ 'ACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoA'+ 'KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAo'+ 'AKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgD/9k=';diff --git a/mobile/apps/locker/lib/core/errors.dart b/mobile/apps/locker/lib/core/errors.dartnew file mode 100644index 0000000000..6722276ad3--- /dev/null+++ b/mobile/apps/locker/lib/core/errors.dart@@ -0,0 +1,41 @@+class UnauthorizedError extends Error {}++class PassKeySessionNotVerifiedError extends Error {}++class PassKeySessionExpiredError extends Error {}++class SrpSetupNotCompleteError extends Error {}++class StorageLimitExceededError extends Error {}++class NoActiveSubscriptionError extends Error {}++// error when file size + current usage >= storage plan limit + buffer+class FileTooLargeForPlanError extends Error {}++class WiFiUnavailableError extends Error {}++class SilentlyCancelUploadsError extends Error {}++class InvalidFileError extends ArgumentError {+ final InvalidReason reason;++ InvalidFileError(String super.message, this.reason);++ @override+ String toString() {+ return 'InvalidFileError: $message (reason: $reason)';+ }+}++enum InvalidReason {+ assetDeleted,+ assetDeletedEvent,+ sourceFileMissing,+ livePhotoToImageTypeChanged,+ imageToLivePhotoTypeChanged,+ livePhotoVideoMissing,+ thumbnailMissing,+ tooLargeFile,+ unknown,+}diff --git a/mobile/apps/locker/lib/core/locale.dart b/mobile/apps/locker/lib/core/locale.dartnew file mode 100644index 0000000000..7fc71a1eda--- /dev/null+++ b/mobile/apps/locker/lib/core/locale.dart@@ -0,0 +1,74 @@+import 'package:flutter/cupertino.dart';+import 'package:shared_preferences/shared_preferences.dart';++// list of locales which are enabled for auth app.+// Add more language to the list only when at least 90% of the strings are+// translated in the corresponding language.+const List<Locale> appSupportedLocales = <Locale>[+ Locale('en'),+];++Locale? autoDetectedLocale;+// This function takes device locales and supported locales as input+// and returns the best matching locale.+// The device locales are sorted by priority, so the first one is the most preferred.+Locale localResolutionCallBack(onDeviceLocales, supportedLocales) {+ final Set<String> languageSupport = {};+ for (Locale supportedLocale in appSupportedLocales) {+ languageSupport.add(supportedLocale.languageCode);+ }+ for (Locale locale in onDeviceLocales) {+ // check if exact local is supported, if yes, return it+ if (appSupportedLocales.contains(locale)) {+ autoDetectedLocale = locale;+ return locale;+ }+ // check if language code is supported, if yes, return it+ if (languageSupport.contains(locale.languageCode)) {+ autoDetectedLocale = locale;+ return locale;+ }+ }+ // Return the first language code match or default to 'en'+ return autoDetectedLocale ?? const Locale('en');+}++Future<Locale?> getLocale({+ bool noFallback = false,+}) async {+ final String? savedValue =+ (await SharedPreferences.getInstance()).getString('locale');+ // if savedLocale is not null and is supported by the app, return it+ if (savedValue != null) {+ late Locale savedLocale;+ if (savedValue.contains('_')) {+ final List<String> parts = savedValue.split('_');+ savedLocale = Locale(parts[0], parts[1]);+ } else {+ savedLocale = Locale(savedValue);+ }+ if (appSupportedLocales.contains(savedLocale)) {+ return savedLocale;+ }+ }+ if (autoDetectedLocale != null) {+ return autoDetectedLocale!;+ }+ if (noFallback) {+ return null;+ }+ return const Locale('en');+}++Future<void> setLocale(Locale locale) async {+ if (!appSupportedLocales.contains(locale)) {+ throw Exception('Locale $locale is not supported by the app');+ }+ final StringBuffer out = StringBuffer(locale.languageCode);+ if (locale.countryCode != null && locale.countryCode!.isNotEmpty) {+ out.write('_');+ out.write(locale.countryCode);+ }+ await (await SharedPreferences.getInstance())+ .setString('locale', out.toString());+}diff --git a/mobile/apps/locker/lib/events/backup_updated_event.dart b/mobile/apps/locker/lib/events/backup_updated_event.dartnew file mode 100644index 0000000000..d4dd91e44a--- /dev/null+++ b/mobile/apps/locker/lib/events/backup_updated_event.dart@@ -0,0 +1,10 @@+import "dart:collection";++import "package:ente_events/models/event.dart";+import "package:locker/services/files/upload/models/backup_item.dart";++class BackupUpdatedEvent extends Event {+ final LinkedHashMap<String, BackupItem> items;++ BackupUpdatedEvent(this.items);+}diff --git a/mobile/apps/locker/lib/events/collections_updated_event.dart b/mobile/apps/locker/lib/events/collections_updated_event.dartnew file mode 100644index 0000000000..d35e3a15cf--- /dev/null+++ b/mobile/apps/locker/lib/events/collections_updated_event.dart@@ -0,0 +1,3 @@+import 'package:ente_events/models/event.dart';++class CollectionsUpdatedEvent extends Event {}diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arbnew file mode 100644index 0000000000..0d05f8ec45--- /dev/null+++ b/mobile/apps/locker/lib/l10n/app_en.arb@@ -0,0 +1,312 @@+{+ "onBoardingBody": "Securely backup your documents",+ "newUser": "New to Ente",+ "existingUser": "Existing User",+ "developerSettings": "Developer settings",+ "yes": "Yes",+ "developerSettingsWarning": "Are you sure that you want to modify Developer settings?",+ "serverEndpoint": "Server endpoint",+ "endpointUpdatedMessage": "Endpoint updated successfully",+ "invalidEndpoint": "Invalid endpoint",+ "invalidEndpointMessage": "Sorry, the endpoint you entered is invalid. Please enter a valid endpoint and try again.",+ "saveAction": "Save",+ "untitled": "Untitled",+ "edit": "Edit",+ "delete": "Delete",+ "noFilesFound": "No files here",+ "addFiles": "Add Files",+ "name": "Name",+ "date": "Date",+ "pleaseWait": "Please wait...",+ "downloading": "Downloading...",+ "downloadingProgress": "Downloading... {percentage}%",+ "@downloadingProgress": {+ "description": "Download progress message",+ "placeholders": {+ "percentage": {+ "type": "int",+ "example": "75"+ }+ }+ },+ "downloadFailed": "Download Failed",+ "failedToDownloadOrDecrypt": "Failed to download or decrypt file",+ "errorOpeningFile": "Error opening file",+ "errorOpeningFileMessage": "Error opening file: {error}",+ "@errorOpeningFileMessage": {+ "description": "Error message when opening a file fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "File not found"+ }+ }+ },+ "couldNotOpenFile": "Could not open file: {error}",+ "@couldNotOpenFile": {+ "description": "Error message when file cannot be opened",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Permission denied"+ }+ }+ },+ "minutesAgo": "{minutes}m ago",+ "@minutesAgo": {+ "description": "Time format for minutes ago",+ "placeholders": {+ "minutes": {+ "type": "int",+ "example": "2"+ }+ }+ },+ "hoursAgo": "{hours}h ago",+ "@hoursAgo": {+ "description": "Time format for hours ago",+ "placeholders": {+ "hours": {+ "type": "int",+ "example": "2"+ }+ }+ },+ "yesterday": "Yesterday",+ "daysAgo": "{days}d ago",+ "@daysAgo": {+ "description": "Time format for days ago",+ "placeholders": {+ "days": {+ "type": "int",+ "example": "5"+ }+ }+ },+ "collectionRenamedSuccessfully": "Collection renamed successfully",+ "failedToRenameCollection": "Failed to rename collection: {error}",+ "@failedToRenameCollection": {+ "description": "Error message when collection rename fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "collectionCannotBeDeleted": "This collection cannot be deleted",+ "deleteCollection": "Delete collection",+ "deleteCollectionConfirmation": "Are you sure you want to delete \"{collectionName}\"?",+ "@deleteCollectionConfirmation": {+ "description": "Confirmation message for deleting a collection",+ "placeholders": {+ "collectionName": {+ "type": "String",+ "example": "My Collection"+ }+ }+ },+ "cancel": "Cancel",+ "collectionDeletedSuccessfully": "Collection deleted successfully",+ "failedToDeleteCollection": "Failed to delete collection: {error}",+ "@failedToDeleteCollection": {+ "description": "Error message when collection deletion fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "collections": "Collections",+ "retry": "Retry",+ "failedToSyncTrash": "Failed to sync trash: {error}",+ "@failedToSyncTrash": {+ "description": "Error message when trash sync fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "pleaseSelectAtLeastOneCollection": "Please select at least one collection",+ "unknownItemType": "Unknown item type",+ "fileDeletedSuccessfully": "File deleted successfully",+ "failedToDeleteFile": "Failed to delete file: {error}",+ "@failedToDeleteFile": {+ "description": "Error message when file deletion fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "fileUpdatedSuccessfully": "File updated successfully!",+ "failedToUpdateFile": "Failed to update file: {error}",+ "@failedToUpdateFile": {+ "description": "Error message when file update fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "noChangesWereMade": "No changes were made",+ "noCollectionsAvailableForRestore": "No collections available for restore",+ "trashClearedSuccessfully": "Trash cleared successfully",+ "failedToClearTrash": "Failed to clear trash: {error}",+ "@failedToClearTrash": {+ "description": "Error message when clearing trash fails",+ "placeholders": {+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "trash": "Trash",+ "deletedPermanently": "Deleted \"{fileName}\" permanently",+ "@deletedPermanently": {+ "description": "Message when file is permanently deleted from trash",+ "placeholders": {+ "fileName": {+ "type": "String",+ "example": "photo.jpg"+ }+ }+ },+ "failedToRestoreFile": "Failed to restore \"{fileName}\": {error}",+ "@failedToRestoreFile": {+ "description": "Error message when file restoration fails",+ "placeholders": {+ "fileName": {+ "type": "String",+ "example": "photo.jpg"+ },+ "error": {+ "type": "String",+ "example": "Network error"+ }+ }+ },+ "createNewCollection": "Create new collection",+ "create": "Create",+ "renameCollection": "Rename collection",+ "save": "Save",+ "deleteFile": "Delete File",+ "deleteFileConfirmation": "Are you sure you want to delete \"{fileName}\"?",+ "@deleteFileConfirmation": {+ "description": "Confirmation message for file deletion",+ "placeholders": {+ "fileName": {+ "type": "String",+ "example": "photo.jpg"+ }+ }+ },+ "noCollectionsFound": "No collections found",+ "createYourFirstCollection": "Create your first collection to get started",+ "createCollection": "Create Collection",+ "nothingYet": "Nothing yet",+ "uploadYourFirstDocument": "Upload your first document to get started",+ "uploadDocument": "Upload Document",+ "items": "{count} items",+ "@items": {+ "description": "Number of items in a collection",+ "placeholders": {+ "count": {+ "type": "int",+ "example": "5"+ }+ }+ },+ "files": "{count, plural, =0{no files} =1{1 file} other{{count} files}}",+ "@files": {+ "description": "Number of files in a collection",+ "placeholders": {+ "count": {+ "type": "int",+ "example": "5"+ }+ }+ },+ "createCollectionTooltip": "Create collection",+ "uploadDocumentTooltip": "Upload document",+ "restore": "Restore",+ "restoreFile": "Restore {fileName}",+ "@restoreFile": {+ "description": "Dialog title for restoring a file from trash",+ "placeholders": {+ "fileName": {+ "type": "String",+ "example": "photo.jpg"+ }+ }+ },+ "noCollectionsAvailable": "No collections available",+ "emptyTrash": "Empty trash",+ "emptyTrashTooltip": "Empty trash",+ "emptyTrashConfirmation": "Are you sure you want to permanently delete all items in trash? This action cannot be undone.",+ "fileTitle": "File title",+ "note": "Note",+ "optionalNote": "Optional note",+ "upload": "Upload",+ "documentsHint": "Documents",+ "searchHint": "Search...",+ "noCollectionsFoundForQuery": "No collections found for \"{query}\"",+ "@noCollectionsFoundForQuery": {+ "description": "Message when no collections match the search query",+ "placeholders": {+ "query": {+ "type": "String",+ "example": "vacation"+ }+ }+ },+ "uncategorized": "Uncategorized",+ "syncingTrash": "Syncing trash...",+ "restoring": "Restoring...",+ "restoredFileToCollection": "Restored \"{fileName}\" to \"{collectionName}\"",+ "@restoredFileToCollection": {+ "description": "Success message when file is restored to a collection",+ "placeholders": {+ "fileName": {+ "type": "String",+ "example": "photo.jpg"+ },+ "collectionName": {+ "type": "String",+ "example": "Vacation Photos"+ }+ }+ },+ "clearingTrash": "Clearing trash...",+ "trashIsEmpty": "Trash is empty",+ "share": "Share",+ "shareLink": "Share link",+ "creatingShareLink": "Creating link...",+ "shareThisLink": "Anyone with this link can access your file.",+ "copyLink": "Copy link",+ "deleteLink": "Delete link",+ "close": "Close",+ "linkCopiedToClipboard": "Link copied to clipboard",+ "deleteShareLink": "Delete link",+ "deleteShareLinkDialogTitle": "Delete link?",+ "deleteShareLinkConfirmation": "People with this link will no longer be able to access the file.",+ "deletingShareLink": "Deleting link...",+ "shareLinkDeletedSuccessfully": "Link deleted successfully",+ "failedToCreateShareLink": "Failed to create link",+ "failedToDeleteShareLink": "Failed to delete link",+ "deletingFile": "Deleting file...",+ "addInformation": "Add information",+ "addInformationDialogSubtitle": "Choose the type of information you want to add",+ "physicalDocument": "Physical document",+ "physicalDocumentDescription": "Save information about documents and items in the real world.",+ "emergencyContact": "Emergency contact",+ "emergencyContactDescription": "Save information about important contacts.",+ "accountCredential": "Account credential",+ "accountCredentialDescription": "Save information about your important account credentials."+}diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dartnew file mode 100644index 0000000000..5b6d76b735--- /dev/null+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart@@ -0,0 +1,805 @@+import 'dart:async';++import 'package:flutter/foundation.dart';+import 'package:flutter/widgets.dart';+import 'package:flutter_localizations/flutter_localizations.dart';+import 'package:intl/intl.dart' as intl;++import 'app_localizations_en.dart';++// ignore_for_file: type=lint++/// Callers can lookup localized strings with an instance of AppLocalizations+/// returned by `AppLocalizations.of(context)`.+///+/// Applications need to include `AppLocalizations.delegate()` in their app's+/// `localizationDelegates` list, and the locales they support in the app's+/// `supportedLocales` list. For example:+///+/// ```dart+/// import 'l10n/app_localizations.dart';+///+/// return MaterialApp(+/// localizationsDelegates: AppLocalizations.localizationsDelegates,+/// supportedLocales: AppLocalizations.supportedLocales,+/// home: MyApplicationHome(),+/// );+/// ```+///+/// ## Update pubspec.yaml+///+/// Please make sure to update your pubspec.yaml to include the following+/// packages:+///+/// ```yaml+/// dependencies:+/// # Internationalization support.+/// flutter_localizations:+/// sdk: flutter+/// intl: any # Use the pinned version from flutter_localizations+///+/// # Rest of dependencies+/// ```+///+/// ## iOS Applications+///+/// iOS applications define key application metadata, including supported+/// locales, in an Info.plist file that is built into the application bundle.+/// To configure the locales supported by your app, youβll need to edit this+/// file.+///+/// First, open your projectβs ios/Runner.xcworkspace Xcode workspace file.+/// Then, in the Project Navigator, open the Info.plist file under the Runner+/// projectβs Runner folder.+///+/// Next, select the Information Property List item, select Add Item from the+/// Editor menu, then select Localizations from the pop-up menu.+///+/// Select and expand the newly-created Localizations item then, for each+/// locale your application supports, add a new item and select the locale+/// you wish to add from the pop-up menu in the Value field. This list should+/// be consistent with the languages listed in the AppLocalizations.supportedLocales+/// property.+abstract class AppLocalizations {+ AppLocalizations(String locale)+ : localeName = intl.Intl.canonicalizedLocale(locale.toString());++ final String localeName;++ static AppLocalizations? of(BuildContext context) {+ return Localizations.of<AppLocalizations>(context, AppLocalizations);+ }++ static const LocalizationsDelegate<AppLocalizations> delegate =+ _AppLocalizationsDelegate();++ /// A list of this localizations delegate along with the default localizations+ /// delegates.+ ///+ /// Returns a list of localizations delegates containing this delegate along with+ /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,+ /// and GlobalWidgetsLocalizations.delegate.+ ///+ /// Additional delegates can be added by appending to this list in+ /// MaterialApp. This list does not have to be used at all if a custom list+ /// of delegates is preferred or required.+ static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =+ <LocalizationsDelegate<dynamic>>[+ delegate,+ GlobalMaterialLocalizations.delegate,+ GlobalCupertinoLocalizations.delegate,+ GlobalWidgetsLocalizations.delegate,+ ];++ /// A list of this localizations delegate's supported locales.+ static const List<Locale> supportedLocales = <Locale>[Locale('en')];++ /// No description provided for @onBoardingBody.+ ///+ /// In en, this message translates to:+ /// **'Securely backup your documents'**+ String get onBoardingBody;++ /// No description provided for @newUser.+ ///+ /// In en, this message translates to:+ /// **'New to Ente'**+ String get newUser;++ /// No description provided for @existingUser.+ ///+ /// In en, this message translates to:+ /// **'Existing User'**+ String get existingUser;++ /// No description provided for @developerSettings.+ ///+ /// In en, this message translates to:+ /// **'Developer settings'**+ String get developerSettings;++ /// No description provided for @yes.+ ///+ /// In en, this message translates to:+ /// **'Yes'**+ String get yes;++ /// No description provided for @developerSettingsWarning.+ ///+ /// In en, this message translates to:+ /// **'Are you sure that you want to modify Developer settings?'**+ String get developerSettingsWarning;++ /// No description provided for @serverEndpoint.+ ///+ /// In en, this message translates to:+ /// **'Server endpoint'**+ String get serverEndpoint;++ /// No description provided for @endpointUpdatedMessage.+ ///+ /// In en, this message translates to:+ /// **'Endpoint updated successfully'**+ String get endpointUpdatedMessage;++ /// No description provided for @invalidEndpoint.+ ///+ /// In en, this message translates to:+ /// **'Invalid endpoint'**+ String get invalidEndpoint;++ /// No description provided for @invalidEndpointMessage.+ ///+ /// In en, this message translates to:+ /// **'Sorry, the endpoint you entered is invalid. Please enter a valid endpoint and try again.'**+ String get invalidEndpointMessage;++ /// No description provided for @saveAction.+ ///+ /// In en, this message translates to:+ /// **'Save'**+ String get saveAction;++ /// No description provided for @untitled.+ ///+ /// In en, this message translates to:+ /// **'Untitled'**+ String get untitled;++ /// No description provided for @edit.+ ///+ /// In en, this message translates to:+ /// **'Edit'**+ String get edit;++ /// No description provided for @delete.+ ///+ /// In en, this message translates to:+ /// **'Delete'**+ String get delete;++ /// No description provided for @noFilesFound.+ ///+ /// In en, this message translates to:+ /// **'No files here'**+ String get noFilesFound;++ /// No description provided for @addFiles.+ ///+ /// In en, this message translates to:+ /// **'Add Files'**+ String get addFiles;++ /// No description provided for @name.+ ///+ /// In en, this message translates to:+ /// **'Name'**+ String get name;++ /// No description provided for @date.+ ///+ /// In en, this message translates to:+ /// **'Date'**+ String get date;++ /// No description provided for @pleaseWait.+ ///+ /// In en, this message translates to:+ /// **'Please wait...'**+ String get pleaseWait;++ /// No description provided for @downloading.+ ///+ /// In en, this message translates to:+ /// **'Downloading...'**+ String get downloading;++ /// Download progress message+ ///+ /// In en, this message translates to:+ /// **'Downloading... {percentage}%'**+ String downloadingProgress(int percentage);++ /// No description provided for @downloadFailed.+ ///+ /// In en, this message translates to:+ /// **'Download Failed'**+ String get downloadFailed;++ /// No description provided for @failedToDownloadOrDecrypt.+ ///+ /// In en, this message translates to:+ /// **'Failed to download or decrypt file'**+ String get failedToDownloadOrDecrypt;++ /// No description provided for @errorOpeningFile.+ ///+ /// In en, this message translates to:+ /// **'Error opening file'**+ String get errorOpeningFile;++ /// Error message when opening a file fails+ ///+ /// In en, this message translates to:+ /// **'Error opening file: {error}'**+ String errorOpeningFileMessage(String error);++ /// Error message when file cannot be opened+ ///+ /// In en, this message translates to:+ /// **'Could not open file: {error}'**+ String couldNotOpenFile(String error);++ /// Time format for minutes ago+ ///+ /// In en, this message translates to:+ /// **'{minutes}m ago'**+ String minutesAgo(int minutes);++ /// Time format for hours ago+ ///+ /// In en, this message translates to:+ /// **'{hours}h ago'**+ String hoursAgo(int hours);++ /// No description provided for @yesterday.+ ///+ /// In en, this message translates to:+ /// **'Yesterday'**+ String get yesterday;++ /// Time format for days ago+ ///+ /// In en, this message translates to:+ /// **'{days}d ago'**+ String daysAgo(int days);++ /// No description provided for @collectionRenamedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'Collection renamed successfully'**+ String get collectionRenamedSuccessfully;++ /// Error message when collection rename fails+ ///+ /// In en, this message translates to:+ /// **'Failed to rename collection: {error}'**+ String failedToRenameCollection(String error);++ /// No description provided for @collectionCannotBeDeleted.+ ///+ /// In en, this message translates to:+ /// **'This collection cannot be deleted'**+ String get collectionCannotBeDeleted;++ /// No description provided for @deleteCollection.+ ///+ /// In en, this message translates to:+ /// **'Delete collection'**+ String get deleteCollection;++ /// Confirmation message for deleting a collection+ ///+ /// In en, this message translates to:+ /// **'Are you sure you want to delete \"{collectionName}\"?'**+ String deleteCollectionConfirmation(String collectionName);++ /// No description provided for @cancel.+ ///+ /// In en, this message translates to:+ /// **'Cancel'**+ String get cancel;++ /// No description provided for @collectionDeletedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'Collection deleted successfully'**+ String get collectionDeletedSuccessfully;++ /// Error message when collection deletion fails+ ///+ /// In en, this message translates to:+ /// **'Failed to delete collection: {error}'**+ String failedToDeleteCollection(String error);++ /// No description provided for @collections.+ ///+ /// In en, this message translates to:+ /// **'Collections'**+ String get collections;++ /// No description provided for @retry.+ ///+ /// In en, this message translates to:+ /// **'Retry'**+ String get retry;++ /// Error message when trash sync fails+ ///+ /// In en, this message translates to:+ /// **'Failed to sync trash: {error}'**+ String failedToSyncTrash(String error);++ /// No description provided for @pleaseSelectAtLeastOneCollection.+ ///+ /// In en, this message translates to:+ /// **'Please select at least one collection'**+ String get pleaseSelectAtLeastOneCollection;++ /// No description provided for @unknownItemType.+ ///+ /// In en, this message translates to:+ /// **'Unknown item type'**+ String get unknownItemType;++ /// No description provided for @fileDeletedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'File deleted successfully'**+ String get fileDeletedSuccessfully;++ /// Error message when file deletion fails+ ///+ /// In en, this message translates to:+ /// **'Failed to delete file: {error}'**+ String failedToDeleteFile(String error);++ /// No description provided for @fileUpdatedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'File updated successfully!'**+ String get fileUpdatedSuccessfully;++ /// Error message when file update fails+ ///+ /// In en, this message translates to:+ /// **'Failed to update file: {error}'**+ String failedToUpdateFile(String error);++ /// No description provided for @noChangesWereMade.+ ///+ /// In en, this message translates to:+ /// **'No changes were made'**+ String get noChangesWereMade;++ /// No description provided for @noCollectionsAvailableForRestore.+ ///+ /// In en, this message translates to:+ /// **'No collections available for restore'**+ String get noCollectionsAvailableForRestore;++ /// No description provided for @trashClearedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'Trash cleared successfully'**+ String get trashClearedSuccessfully;++ /// Error message when clearing trash fails+ ///+ /// In en, this message translates to:+ /// **'Failed to clear trash: {error}'**+ String failedToClearTrash(String error);++ /// No description provided for @trash.+ ///+ /// In en, this message translates to:+ /// **'Trash'**+ String get trash;++ /// Message when file is permanently deleted from trash+ ///+ /// In en, this message translates to:+ /// **'Deleted \"{fileName}\" permanently'**+ String deletedPermanently(String fileName);++ /// Error message when file restoration fails+ ///+ /// In en, this message translates to:+ /// **'Failed to restore \"{fileName}\": {error}'**+ String failedToRestoreFile(String fileName, String error);++ /// No description provided for @createNewCollection.+ ///+ /// In en, this message translates to:+ /// **'Create new collection'**+ String get createNewCollection;++ /// No description provided for @create.+ ///+ /// In en, this message translates to:+ /// **'Create'**+ String get create;++ /// No description provided for @renameCollection.+ ///+ /// In en, this message translates to:+ /// **'Rename collection'**+ String get renameCollection;++ /// No description provided for @save.+ ///+ /// In en, this message translates to:+ /// **'Save'**+ String get save;++ /// No description provided for @deleteFile.+ ///+ /// In en, this message translates to:+ /// **'Delete File'**+ String get deleteFile;++ /// Confirmation message for file deletion+ ///+ /// In en, this message translates to:+ /// **'Are you sure you want to delete \"{fileName}\"?'**+ String deleteFileConfirmation(String fileName);++ /// No description provided for @noCollectionsFound.+ ///+ /// In en, this message translates to:+ /// **'No collections found'**+ String get noCollectionsFound;++ /// No description provided for @createYourFirstCollection.+ ///+ /// In en, this message translates to:+ /// **'Create your first collection to get started'**+ String get createYourFirstCollection;++ /// No description provided for @createCollection.+ ///+ /// In en, this message translates to:+ /// **'Create Collection'**+ String get createCollection;++ /// No description provided for @nothingYet.+ ///+ /// In en, this message translates to:+ /// **'Nothing yet'**+ String get nothingYet;++ /// No description provided for @uploadYourFirstDocument.+ ///+ /// In en, this message translates to:+ /// **'Upload your first document to get started'**+ String get uploadYourFirstDocument;++ /// No description provided for @uploadDocument.+ ///+ /// In en, this message translates to:+ /// **'Upload Document'**+ String get uploadDocument;++ /// Number of items in a collection+ ///+ /// In en, this message translates to:+ /// **'{count} items'**+ String items(int count);++ /// Number of files in a collection+ ///+ /// In en, this message translates to:+ /// **'{count, plural, =0{no files} =1{1 file} other{{count} files}}'**+ String files(int count);++ /// No description provided for @createCollectionTooltip.+ ///+ /// In en, this message translates to:+ /// **'Create collection'**+ String get createCollectionTooltip;++ /// No description provided for @uploadDocumentTooltip.+ ///+ /// In en, this message translates to:+ /// **'Upload document'**+ String get uploadDocumentTooltip;++ /// No description provided for @restore.+ ///+ /// In en, this message translates to:+ /// **'Restore'**+ String get restore;++ /// Dialog title for restoring a file from trash+ ///+ /// In en, this message translates to:+ /// **'Restore {fileName}'**+ String restoreFile(String fileName);++ /// No description provided for @noCollectionsAvailable.+ ///+ /// In en, this message translates to:+ /// **'No collections available'**+ String get noCollectionsAvailable;++ /// No description provided for @emptyTrash.+ ///+ /// In en, this message translates to:+ /// **'Empty trash'**+ String get emptyTrash;++ /// No description provided for @emptyTrashTooltip.+ ///+ /// In en, this message translates to:+ /// **'Empty trash'**+ String get emptyTrashTooltip;++ /// No description provided for @emptyTrashConfirmation.+ ///+ /// In en, this message translates to:+ /// **'Are you sure you want to permanently delete all items in trash? This action cannot be undone.'**+ String get emptyTrashConfirmation;++ /// No description provided for @fileTitle.+ ///+ /// In en, this message translates to:+ /// **'File title'**+ String get fileTitle;++ /// No description provided for @note.+ ///+ /// In en, this message translates to:+ /// **'Note'**+ String get note;++ /// No description provided for @optionalNote.+ ///+ /// In en, this message translates to:+ /// **'Optional note'**+ String get optionalNote;++ /// No description provided for @upload.+ ///+ /// In en, this message translates to:+ /// **'Upload'**+ String get upload;++ /// No description provided for @documentsHint.+ ///+ /// In en, this message translates to:+ /// **'Documents'**+ String get documentsHint;++ /// No description provided for @searchHint.+ ///+ /// In en, this message translates to:+ /// **'Search...'**+ String get searchHint;++ /// Message when no collections match the search query+ ///+ /// In en, this message translates to:+ /// **'No collections found for \"{query}\"'**+ String noCollectionsFoundForQuery(String query);++ /// No description provided for @uncategorized.+ ///+ /// In en, this message translates to:+ /// **'Uncategorized'**+ String get uncategorized;++ /// No description provided for @syncingTrash.+ ///+ /// In en, this message translates to:+ /// **'Syncing trash...'**+ String get syncingTrash;++ /// No description provided for @restoring.+ ///+ /// In en, this message translates to:+ /// **'Restoring...'**+ String get restoring;++ /// Success message when file is restored to a collection+ ///+ /// In en, this message translates to:+ /// **'Restored \"{fileName}\" to \"{collectionName}\"'**+ String restoredFileToCollection(String fileName, String collectionName);++ /// No description provided for @clearingTrash.+ ///+ /// In en, this message translates to:+ /// **'Clearing trash...'**+ String get clearingTrash;++ /// No description provided for @trashIsEmpty.+ ///+ /// In en, this message translates to:+ /// **'Trash is empty'**+ String get trashIsEmpty;++ /// No description provided for @share.+ ///+ /// In en, this message translates to:+ /// **'Share'**+ String get share;++ /// No description provided for @shareLink.+ ///+ /// In en, this message translates to:+ /// **'Share link'**+ String get shareLink;++ /// No description provided for @creatingShareLink.+ ///+ /// In en, this message translates to:+ /// **'Creating link...'**+ String get creatingShareLink;++ /// No description provided for @shareThisLink.+ ///+ /// In en, this message translates to:+ /// **'Anyone with this link can access your file.'**+ String get shareThisLink;++ /// No description provided for @copyLink.+ ///+ /// In en, this message translates to:+ /// **'Copy link'**+ String get copyLink;++ /// No description provided for @deleteLink.+ ///+ /// In en, this message translates to:+ /// **'Delete link'**+ String get deleteLink;++ /// No description provided for @close.+ ///+ /// In en, this message translates to:+ /// **'Close'**+ String get close;++ /// No description provided for @linkCopiedToClipboard.+ ///+ /// In en, this message translates to:+ /// **'Link copied to clipboard'**+ String get linkCopiedToClipboard;++ /// No description provided for @deleteShareLink.+ ///+ /// In en, this message translates to:+ /// **'Delete link'**+ String get deleteShareLink;++ /// No description provided for @deleteShareLinkDialogTitle.+ ///+ /// In en, this message translates to:+ /// **'Delete link?'**+ String get deleteShareLinkDialogTitle;++ /// No description provided for @deleteShareLinkConfirmation.+ ///+ /// In en, this message translates to:+ /// **'People with this link will no longer be able to access the file.'**+ String get deleteShareLinkConfirmation;++ /// No description provided for @deletingShareLink.+ ///+ /// In en, this message translates to:+ /// **'Deleting link...'**+ String get deletingShareLink;++ /// No description provided for @shareLinkDeletedSuccessfully.+ ///+ /// In en, this message translates to:+ /// **'Link deleted successfully'**+ String get shareLinkDeletedSuccessfully;++ /// No description provided for @failedToCreateShareLink.+ ///+ /// In en, this message translates to:+ /// **'Failed to create link'**+ String get failedToCreateShareLink;++ /// No description provided for @failedToDeleteShareLink.+ ///+ /// In en, this message translates to:+ /// **'Failed to delete link'**+ String get failedToDeleteShareLink;++ /// No description provided for @deletingFile.+ ///+ /// In en, this message translates to:+ /// **'Deleting file...'**+ String get deletingFile;++ /// No description provided for @addInformation.+ ///+ /// In en, this message translates to:+ /// **'Add information'**+ String get addInformation;++ /// No description provided for @addInformationDialogSubtitle.+ ///+ /// In en, this message translates to:+ /// **'Choose the type of information you want to add'**+ String get addInformationDialogSubtitle;++ /// No description provided for @physicalDocument.+ ///+ /// In en, this message translates to:+ /// **'Physical document'**+ String get physicalDocument;++ /// No description provided for @physicalDocumentDescription.+ ///+ /// In en, this message translates to:+ /// **'Save information about documents and items in the real world.'**+ String get physicalDocumentDescription;++ /// No description provided for @emergencyContact.+ ///+ /// In en, this message translates to:+ /// **'Emergency contact'**+ String get emergencyContact;++ /// No description provided for @emergencyContactDescription.+ ///+ /// In en, this message translates to:+ /// **'Save information about important contacts.'**+ String get emergencyContactDescription;++ /// No description provided for @accountCredential.+ ///+ /// In en, this message translates to:+ /// **'Account credential'**+ String get accountCredential;++ /// No description provided for @accountCredentialDescription.+ ///+ /// In en, this message translates to:+ /// **'Save information about your important account credentials.'**+ String get accountCredentialDescription;+}++class _AppLocalizationsDelegate+ extends LocalizationsDelegate<AppLocalizations> {+ const _AppLocalizationsDelegate();++ @override+ Future<AppLocalizations> load(Locale locale) {+ return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));+ }++ @override+ bool isSupported(Locale locale) =>+ <String>['en'].contains(locale.languageCode);++ @override+ bool shouldReload(_AppLocalizationsDelegate old) => false;+}++AppLocalizations lookupAppLocalizations(Locale locale) {+ // Lookup logic when only language code is specified.+ switch (locale.languageCode) {+ case 'en':+ return AppLocalizationsEn();+ }++ throw FlutterError(+ 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '+ 'an issue with the localizations generation tool. Please file an issue '+ 'on GitHub with a reproducible sample app and the gen-l10n configuration '+ 'that was used.');+}diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dartnew file mode 100644index 0000000000..5fd46a81d3--- /dev/null+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart@@ -0,0 +1,410 @@+// ignore: unused_import+import 'package:intl/intl.dart' as intl;+import 'app_localizations.dart';++// ignore_for_file: type=lint++/// The translations for English (`en`).+class AppLocalizationsEn extends AppLocalizations {+ AppLocalizationsEn([String locale = 'en']) : super(locale);++ @override+ String get onBoardingBody => 'Securely backup your documents';++ @override+ String get newUser => 'New to Ente';++ @override+ String get existingUser => 'Existing User';++ @override+ String get developerSettings => 'Developer settings';++ @override+ String get yes => 'Yes';++ @override+ String get developerSettingsWarning =>+ 'Are you sure that you want to modify Developer settings?';++ @override+ String get serverEndpoint => 'Server endpoint';++ @override+ String get endpointUpdatedMessage => 'Endpoint updated successfully';++ @override+ String get invalidEndpoint => 'Invalid endpoint';++ @override+ String get invalidEndpointMessage =>+ 'Sorry, the endpoint you entered is invalid. Please enter a valid endpoint and try again.';++ @override+ String get saveAction => 'Save';++ @override+ String get untitled => 'Untitled';++ @override+ String get edit => 'Edit';++ @override+ String get delete => 'Delete';++ @override+ String get noFilesFound => 'No files here';++ @override+ String get addFiles => 'Add Files';++ @override+ String get name => 'Name';++ @override+ String get date => 'Date';++ @override+ String get pleaseWait => 'Please wait...';++ @override+ String get downloading => 'Downloading...';++ @override+ String downloadingProgress(int percentage) {+ return 'Downloading... $percentage%';+ }++ @override+ String get downloadFailed => 'Download Failed';++ @override+ String get failedToDownloadOrDecrypt => 'Failed to download or decrypt file';++ @override+ String get errorOpeningFile => 'Error opening file';++ @override+ String errorOpeningFileMessage(String error) {+ return 'Error opening file: $error';+ }++ @override+ String couldNotOpenFile(String error) {+ return 'Could not open file: $error';+ }++ @override+ String minutesAgo(int minutes) {+ return '${minutes}m ago';+ }++ @override+ String hoursAgo(int hours) {+ return '${hours}h ago';+ }++ @override+ String get yesterday => 'Yesterday';++ @override+ String daysAgo(int days) {+ return '${days}d ago';+ }++ @override+ String get collectionRenamedSuccessfully => 'Collection renamed successfully';++ @override+ String failedToRenameCollection(String error) {+ return 'Failed to rename collection: $error';+ }++ @override+ String get collectionCannotBeDeleted => 'This collection cannot be deleted';++ @override+ String get deleteCollection => 'Delete collection';++ @override+ String deleteCollectionConfirmation(String collectionName) {+ return 'Are you sure you want to delete \"$collectionName\"?';+ }++ @override+ String get cancel => 'Cancel';++ @override+ String get collectionDeletedSuccessfully => 'Collection deleted successfully';++ @override+ String failedToDeleteCollection(String error) {+ return 'Failed to delete collection: $error';+ }++ @override+ String get collections => 'Collections';++ @override+ String get retry => 'Retry';++ @override+ String failedToSyncTrash(String error) {+ return 'Failed to sync trash: $error';+ }++ @override+ String get pleaseSelectAtLeastOneCollection =>+ 'Please select at least one collection';++ @override+ String get unknownItemType => 'Unknown item type';++ @override+ String get fileDeletedSuccessfully => 'File deleted successfully';++ @override+ String failedToDeleteFile(String error) {+ return 'Failed to delete file: $error';+ }++ @override+ String get fileUpdatedSuccessfully => 'File updated successfully!';++ @override+ String failedToUpdateFile(String error) {+ return 'Failed to update file: $error';+ }++ @override+ String get noChangesWereMade => 'No changes were made';++ @override+ String get noCollectionsAvailableForRestore =>+ 'No collections available for restore';++ @override+ String get trashClearedSuccessfully => 'Trash cleared successfully';++ @override+ String failedToClearTrash(String error) {+ return 'Failed to clear trash: $error';+ }++ @override+ String get trash => 'Trash';++ @override+ String deletedPermanently(String fileName) {+ return 'Deleted \"$fileName\" permanently';+ }++ @override+ String failedToRestoreFile(String fileName, String error) {+ return 'Failed to restore \"$fileName\": $error';+ }++ @override+ String get createNewCollection => 'Create new collection';++ @override+ String get create => 'Create';++ @override+ String get renameCollection => 'Rename collection';++ @override+ String get save => 'Save';++ @override+ String get deleteFile => 'Delete File';++ @override+ String deleteFileConfirmation(String fileName) {+ return 'Are you sure you want to delete \"$fileName\"?';+ }++ @override+ String get noCollectionsFound => 'No collections found';++ @override+ String get createYourFirstCollection =>+ 'Create your first collection to get started';++ @override+ String get createCollection => 'Create Collection';++ @override+ String get nothingYet => 'Nothing yet';++ @override+ String get uploadYourFirstDocument =>+ 'Upload your first document to get started';++ @override+ String get uploadDocument => 'Upload Document';++ @override+ String items(int count) {+ return '$count items';+ }++ @override+ String files(int count) {+ String _temp0 = intl.Intl.pluralLogic(+ count,+ locale: localeName,+ other: '$count files',+ one: '1 file',+ zero: 'no files',+ );+ return '$_temp0';+ }++ @override+ String get createCollectionTooltip => 'Create collection';++ @override+ String get uploadDocumentTooltip => 'Upload document';++ @override+ String get restore => 'Restore';++ @override+ String restoreFile(String fileName) {+ return 'Restore $fileName';+ }++ @override+ String get noCollectionsAvailable => 'No collections available';++ @override+ String get emptyTrash => 'Empty trash';++ @override+ String get emptyTrashTooltip => 'Empty trash';++ @override+ String get emptyTrashConfirmation =>+ 'Are you sure you want to permanently delete all items in trash? This action cannot be undone.';++ @override+ String get fileTitle => 'File title';++ @override+ String get note => 'Note';++ @override+ String get optionalNote => 'Optional note';++ @override+ String get upload => 'Upload';++ @override+ String get documentsHint => 'Documents';++ @override+ String get searchHint => 'Search...';++ @override+ String noCollectionsFoundForQuery(String query) {+ return 'No collections found for \"$query\"';+ }++ @override+ String get uncategorized => 'Uncategorized';++ @override+ String get syncingTrash => 'Syncing trash...';++ @override+ String get restoring => 'Restoring...';++ @override+ String restoredFileToCollection(String fileName, String collectionName) {+ return 'Restored \"$fileName\" to \"$collectionName\"';+ }++ @override+ String get clearingTrash => 'Clearing trash...';++ @override+ String get trashIsEmpty => 'Trash is empty';++ @override+ String get share => 'Share';++ @override+ String get shareLink => 'Share link';++ @override+ String get creatingShareLink => 'Creating link...';++ @override+ String get shareThisLink => 'Anyone with this link can access your file.';++ @override+ String get copyLink => 'Copy link';++ @override+ String get deleteLink => 'Delete link';++ @override+ String get close => 'Close';++ @override+ String get linkCopiedToClipboard => 'Link copied to clipboard';++ @override+ String get deleteShareLink => 'Delete link';++ @override+ String get deleteShareLinkDialogTitle => 'Delete link?';++ @override+ String get deleteShareLinkConfirmation =>+ 'People with this link will no longer be able to access the file.';++ @override+ String get deletingShareLink => 'Deleting link...';++ @override+ String get shareLinkDeletedSuccessfully => 'Link deleted successfully';++ @override+ String get failedToCreateShareLink => 'Failed to create link';++ @override+ String get failedToDeleteShareLink => 'Failed to delete link';++ @override+ String get deletingFile => 'Deleting file...';++ @override+ String get addInformation => 'Add information';++ @override+ String get addInformationDialogSubtitle =>+ 'Choose the type of information you want to add';++ @override+ String get physicalDocument => 'Physical document';++ @override+ String get physicalDocumentDescription =>+ 'Save information about documents and items in the real world.';++ @override+ String get emergencyContact => 'Emergency contact';++ @override+ String get emergencyContactDescription =>+ 'Save information about important contacts.';++ @override+ String get accountCredential => 'Account credential';++ @override+ String get accountCredentialDescription =>+ 'Save information about your important account credentials.';+}diff --git a/mobile/apps/locker/lib/l10n/l10n.dart b/mobile/apps/locker/lib/l10n/l10n.dartnew file mode 100644index 0000000000..64aa328de9--- /dev/null+++ b/mobile/apps/locker/lib/l10n/l10n.dart@@ -0,0 +1,8 @@+import "package:flutter/widgets.dart";+import 'package:locker/l10n/app_localizations.dart';++export "app_localizations.dart";++extension AppLocalizationsX on BuildContext {+ AppLocalizations get l10n => AppLocalizations.of(this)!;+}diff --git a/mobile/apps/locker/lib/main.dart b/mobile/apps/locker/lib/main.dartnew file mode 100644index 0000000000..b0e7d68eb9--- /dev/null+++ b/mobile/apps/locker/lib/main.dart@@ -0,0 +1,163 @@+import 'dart:async';+import 'dart:io';++import 'package:adaptive_theme/adaptive_theme.dart';+import 'package:ente_accounts/services/user_service.dart';+import 'package:ente_crypto_dart/ente_crypto_dart.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.dart';+import 'package:ente_logging/logging.dart';+import 'package:ente_network/network.dart';+import 'package:ente_ui/utils/window_listener_service.dart';+import 'package:ente_utils/platform_util.dart';+import "package:flutter/material.dart";+import 'package:flutter_displaymode/flutter_displaymode.dart';+import 'package:locker/app.dart';+import 'package:locker/core/locale.dart';+import 'package:locker/l10n/app_localizations.dart';+import 'package:locker/services/collections/collections_api_client.dart';+import "package:locker/services/collections/collections_db.dart";+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/services/files/download/service_locator.dart';+import "package:locker/services/files/links/links_client.dart";+import "package:locker/services/files/links/links_service.dart";+import "package:locker/services/trash/trash_db.dart";+import 'package:locker/services/trash/trash_service.dart';+import 'package:locker/ui/pages/home_page.dart';+import 'package:package_info_plus/package_info_plus.dart';+import 'package:path_provider/path_provider.dart';+import 'package:shared_preferences/shared_preferences.dart';+import 'package:tray_manager/tray_manager.dart';+import 'package:window_manager/window_manager.dart';++final _logger = Logger("main");++void main() async {+ WidgetsFlutterBinding.ensureInitialized();++ if (PlatformUtil.isDesktop()) {+ await windowManager.ensureInitialized();+ await WindowListenerService.instance.init();+ final WindowOptions windowOptions = WindowOptions(+ size: WindowListenerService.instance.getWindowSize(),+ maximumSize: const Size(8192, 8192),+ );+ await windowManager.waitUntilReadyToShow(windowOptions, () async {+ await windowManager.show();+ await windowManager.focus();+ _initSystemTray().ignore();+ });+ }++ await _runInForeground();+ if (Platform.isAndroid) {+ FlutterDisplayMode.setHighRefreshRate().ignore();+ }+}++Future<void> _initSystemTray() async {+ if (PlatformUtil.isMobile()) return;+ final String path = Platform.isWindows+ ? 'assets/icons/locker-icon.ico'+ : 'assets/icons/locker-icon.png';+ await trayManager.setIcon(path);+ final Menu menu = Menu(+ items: [+ MenuItem(+ key: 'hide_window',+ label: 'Hide Window',+ ),+ MenuItem(+ key: 'show_window',+ label: 'Show Window',+ ),+ MenuItem.separator(),+ MenuItem(+ key: 'exit_app',+ label: 'Exit App',+ ),+ ],+ );+ await trayManager.setContextMenu(menu);+}++Future<void> _runInForeground() async {+ final savedThemeMode = _themeMode(await AdaptiveTheme.getThemeMode());+ return await _runWithLogs(() async {+ _logger.info("Starting app in foreground");+ try {+ await _init(false, via: 'mainMethod');+ } catch (e, s) {+ _logger.severe("Failed to init", e, s);+ rethrow;+ }+ final Locale? locale = await getLocale(noFallback: true);+ runApp(+ AppLock(+ builder: (args) => App(locale: locale),+ lockScreen: LockScreen(Configuration.instance),+ enabled: await LockScreenSettings.instance.shouldShowLockScreen(),+ locale: locale,+ savedThemeMode: savedThemeMode,+ supportedLocales: appSupportedLocales,+ localizationsDelegates: AppLocalizations.localizationsDelegates,+ localeListResolutionCallback: localResolutionCallBack,+ ),+ );+ });+}++ThemeMode _themeMode(AdaptiveThemeMode? savedThemeMode) {+ if (savedThemeMode == null) return ThemeMode.system;+ if (savedThemeMode.isLight) return ThemeMode.light;+ if (savedThemeMode.isDark) return ThemeMode.dark;+ return ThemeMode.system;+}++Future _runWithLogs(Function() function, {String prefix = ""}) async {+ String dir = "";+ try {+ dir = "${(await getApplicationSupportDirectory()).path}/logs";+ } catch (_) {}+ await SuperLogging.main(+ LogConfig(+ body: function,+ logDirPath: dir,+ maxLogFiles: 5,+ enableInDebugMode: true,+ prefix: prefix,+ ),+ );+}++Future<void> _init(bool bool, {String? via}) async {+ final SharedPreferences preferences = await SharedPreferences.getInstance();+ final PackageInfo packageInfo = await PackageInfo.fromPlatform();++ await CryptoUtil.init();++ await CollectionDB.instance.init();+ await TrashDB.instance.init();++ await Configuration.instance.init([+ CollectionDB.instance,+ TrashDB.instance,+ ]);++ await Network.instance.init(Configuration.instance);+ await UserService.instance.init(Configuration.instance, const HomePage());+ await LockScreenSettings.instance.init(Configuration.instance);+ await CollectionApiClient.instance.init();+ await CollectionService.instance.init();+ await LinksClient.instance.init();+ await LinksService.instance.init();+ await ServiceLocator.instance.init(+ preferences,+ Network.instance.enteDio,+ Network.instance.getDio(),+ packageInfo,+ );+ await TrashService.instance.init(preferences);+}diff --git a/mobile/apps/locker/lib/services/collections/collections_api_client.dart b/mobile/apps/locker/lib/services/collections/collections_api_client.dartnew file mode 100644index 0000000000..bb2c2003a4--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/collections_api_client.dart@@ -0,0 +1,452 @@+import 'dart:convert';+import 'dart:math';+import 'dart:typed_data';++import 'package:dio/dio.dart';+import 'package:ente_crypto_dart/ente_crypto_dart.dart';+import 'package:ente_network/network.dart';+import 'package:locker/core/errors.dart';+import "package:locker/services/collections/collections_service.dart";+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/collections/models/collection_file_item.dart';+import 'package:locker/services/collections/models/collection_magic.dart';+import 'package:locker/services/collections/models/diff.dart';+import 'package:locker/services/configuration.dart';+import "package:locker/services/files/sync/metadata_updater_service.dart";+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/files/sync/models/file_magic.dart';+import 'package:locker/services/trash/models/trash_item_request.dart';+import "package:locker/utils/crypto_helper.dart";+import 'package:logging/logging.dart';++class CollectionApiClient {+ CollectionApiClient._privateConstructor();++ static final CollectionApiClient instance =+ CollectionApiClient._privateConstructor();++ final _logger = Logger("CollectionApiClient");+ final _enteDio = Network.instance.enteDio;+ final _config = Configuration.instance;++ Future<void> init() async {}++ Future<List<Collection>> getCollections(int sinceTime) async {+ try {+ final response = await _enteDio.get(+ "/collections/v2",+ queryParameters: {+ "sinceTime": sinceTime,+ },+ );+ final List<Collection> collections = [];+ final c = response.data["collections"];+ for (final collectionData in c) {+ final Collection collection =+ await _fromRemoteCollection(collectionData);+ collections.add(collection);+ }+ return collections;+ } catch (e, s) {+ _logger.warning(e, s);+ if (e is DioException && e.response?.statusCode == 401) {+ throw UnauthorizedError();+ }+ rethrow;+ }+ }++ Future<Diff> getFiles(Collection collection, int sinceTime) async {+ _logger.info(+ "[Collection-${collection.id}] fetch diff since: $sinceTime",+ );+ bool hasMore = true;+ final List<EnteFile> updatedFiles = [];+ final List<EnteFile> deletedFiles = [];+ int latestUpdatedAtTime = 0;+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);+ while (hasMore) {+ final diff = await _getDiff(collection.id, collectionKey, sinceTime);+ updatedFiles.addAll(diff.updatedFiles);+ deletedFiles.addAll(diff.deletedFiles);+ latestUpdatedAtTime = max(latestUpdatedAtTime, diff.latestUpdatedAtTime);+ hasMore = diff.hasMore;+ }+ final finalDiff = Diff(+ updatedFiles,+ deletedFiles,+ false,+ latestUpdatedAtTime,+ );+ _logger.info("[Collection-${collection.id}] fetched");+ return finalDiff;+ }++ Future<void> addToCollection(+ Collection collection,+ List<EnteFile> files,+ ) async {+ final pendingUpload = files.any(+ (element) => element.uploadedFileID == null,+ );+ if (pendingUpload) {+ throw ArgumentError('Can only add uploaded files');+ }+ if (files.isEmpty) {+ _logger.info("nothing to add to the collection");+ return;+ }+ final params = <String, dynamic>{};+ params["collectionID"] = collection.id;+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);+ params["files"] = [];+ for (final file in files) {+ final int uploadedFileID = file.uploadedFileID!;+ final fileKey = await CollectionService.instance.getFileKey(file);+ final encryptedKeyData = CryptoUtil.encryptSync(fileKey, collectionKey);+ final String encryptedKey =+ CryptoUtil.bin2base64(encryptedKeyData.encryptedData!);+ final String keyDecryptionNonce =+ CryptoUtil.bin2base64(encryptedKeyData.nonce!);+ params["files"].add(+ CollectionFileItem(uploadedFileID, encryptedKey, keyDecryptionNonce)+ .toMap(),+ );+ }+ try {+ await _enteDio.post(+ "/collections/add-files",+ data: params,+ );+ } catch (e) {+ _logger.warning('failed to add files to collection', e);+ rethrow;+ }+ }++ Future<void> trash(List<TrashRequest> requests) async {+ final requestData = <String, dynamic>{};+ requestData["items"] = [];+ for (final request in requests) {+ requestData["items"].add(request.toJson());+ }+ final response = await _enteDio.post(+ "/files/trash",+ data: requestData,+ );+ if (response.statusCode != 200) {+ throw Exception("Failed to remove files from collection");+ }+ }++ Future<void> rename(Collection collection, String newName) async {+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);+ final encryptedName = CryptoUtil.encryptSync(+ utf8.encode(newName),+ collectionKey,+ );+ final params = <String, dynamic>{};+ params["collectionID"] = collection.id;+ params["encryptedName"] =+ CryptoUtil.bin2base64(encryptedName.encryptedData!);+ params["nameDecryptionNonce"] = CryptoUtil.bin2base64(encryptedName.nonce!);+ try {+ await _enteDio.post(+ "/collections/rename",+ data: params,+ );+ } catch (e) {+ _logger.warning("failed to rename collection", e);+ rethrow;+ }+ }++ Future<void> move(+ EnteFile file,+ Collection fromCollection,+ Collection toCollection,+ ) async {+ final params = <String, dynamic>{};+ params["fromCollectionID"] = fromCollection.id;+ params["toCollectionID"] = toCollection.id;+ final fileKey = await CollectionService.instance.getFileKey(file);+ final encryptedKeyData = CryptoUtil.encryptSync(+ fileKey,+ CryptoHelper.instance.getCollectionKey(toCollection),+ );+ params["files"] = [];+ params["files"].add(+ CollectionFileItem(+ file.uploadedFileID!,+ CryptoUtil.bin2base64(encryptedKeyData.encryptedData!),+ CryptoUtil.bin2base64(encryptedKeyData.nonce!),+ ).toMap(),+ );+ await _enteDio.post(+ "/collections/move-files",+ data: params,+ );+ }++ Future<void> trashCollection(Collection collection) async {+ try {+ await _enteDio.delete(+ "/collections/v3/${collection.id}?keepFiles=False&collectionID=${collection.id}",+ );+ } catch (e) {+ _logger.severe('failed to trash collection', e);+ rethrow;+ }+ }++ Future<Diff> _getDiff(+ int collectionID,+ Uint8List collectionKey,+ int sinceTime,+ ) async {+ try {+ final response = await _enteDio.get(+ "/collections/v2/diff",+ queryParameters: {+ "collectionID": collectionID,+ "sinceTime": sinceTime,+ },+ );+ int latestUpdatedAtTime = 0;+ final diff = response.data["diff"] as List;+ final bool hasMore = response.data["hasMore"] as bool;+ final startTime = DateTime.now();+ final deletedFiles = <EnteFile>[];+ final updatedFiles = <EnteFile>[];++ for (final item in diff) {+ final file = EnteFile();+ file.uploadedFileID = item["id"];+ file.collectionID = item["collectionID"];+ file.updationTime = item["updationTime"];+ latestUpdatedAtTime = max(latestUpdatedAtTime, file.updationTime!);+ if (item["isDeleted"]) {+ deletedFiles.add(file);+ continue;+ }+ file.ownerID = item["ownerID"];+ file.fileDecryptionHeader = item["file"]["decryptionHeader"];+ file.thumbnailDecryptionHeader = item["thumbnail"]["decryptionHeader"];+ file.metadataDecryptionHeader = item["metadata"]["decryptionHeader"];+ if (item["info"] != null) {+ file.fileSize = item["info"]["fileSize"];+ }+ file.encryptedKey = item["encryptedKey"];+ file.keyDecryptionNonce = item["keyDecryptionNonce"];+ final fileKey = CryptoHelper.instance.getFileKey(+ file.encryptedKey!,+ file.keyDecryptionNonce!,+ collectionKey,+ );+ final encodedMetadata = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item["metadata"]["encryptedData"]),+ fileKey,+ CryptoUtil.base642bin(file.metadataDecryptionHeader!),+ );+ final Map<String, dynamic> metadata =+ jsonDecode(utf8.decode(encodedMetadata));+ file.applyMetadata(metadata);+ if (item['magicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item['magicMetadata']['data']),+ fileKey,+ CryptoUtil.base642bin(item['magicMetadata']['header']),+ );+ file.mMdEncodedJson = utf8.decode(utfEncodedMmd);+ file.mMdVersion = item['magicMetadata']['version'];+ file.magicMetadata =+ MagicMetadata.fromEncodedJson(file.mMdEncodedJson!);+ }+ if (item['pubMagicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item['pubMagicMetadata']['data']),+ fileKey,+ CryptoUtil.base642bin(item['pubMagicMetadata']['header']),+ );+ file.pubMmdEncodedJson = utf8.decode(utfEncodedMmd);+ file.pubMmdVersion = item['pubMagicMetadata']['version'];+ file.pubMagicMetadata =+ PubMagicMetadata.fromEncodedJson(file.pubMmdEncodedJson!);+ }+ updatedFiles.add(file);+ }+ _logger.info('[Collection-$collectionID] parsed ${diff.length} '+ 'diff items ( ${updatedFiles.length} updated) in ${DateTime.now().difference(startTime).inMilliseconds}ms');+ return Diff(updatedFiles, deletedFiles, hasMore, latestUpdatedAtTime);+ } catch (e, s) {+ _logger.severe(e, s);+ rethrow;+ }+ }++ Future<Collection> _fromRemoteCollection(+ Map<String, dynamic>? collectionData,+ ) async {+ final Collection collection = Collection.fromMap(collectionData);+ if (collectionData != null && !collection.isDeleted) {+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);+ if (collectionData['magicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(collectionData['magicMetadata']['data']),+ collectionKey,+ CryptoUtil.base642bin(collectionData['magicMetadata']['header']),+ );+ collection.mMdEncodedJson = utf8.decode(utfEncodedMmd);+ collection.mMdVersion = collectionData['magicMetadata']['version'];+ collection.magicMetadata = CollectionMagicMetadata.fromEncodedJson(+ collection.mMdEncodedJson ?? '{}',+ );+ }++ if (collectionData['pubMagicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(collectionData['pubMagicMetadata']['data']),+ collectionKey,+ CryptoUtil.base642bin(+ collectionData['pubMagicMetadata']['header'],+ ),+ );+ collection.mMdPubEncodedJson = utf8.decode(utfEncodedMmd);+ collection.mMbPubVersion =+ collectionData['pubMagicMetadata']['version'];+ collection.pubMagicMetadata =+ CollectionPubMagicMetadata.fromEncodedJson(+ collection.mMdPubEncodedJson ?? '{}',+ );+ }+ if (collectionData['sharedMagicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(+ collectionData['sharedMagicMetadata']['data'],+ ),+ collectionKey,+ CryptoUtil.base642bin(+ collectionData['sharedMagicMetadata']['header'],+ ),+ );+ collection.sharedMmdJson = utf8.decode(utfEncodedMmd);+ collection.sharedMmdVersion =+ collectionData['sharedMagicMetadata']['version'];+ collection.sharedMagicMetadata = ShareeMagicMetadata.fromEncodedJson(+ collection.sharedMmdJson ?? '{}',+ );+ }+ }+ collection.setName(_getDecryptedCollectionName(collection));+ return collection;+ }++ String _getDecryptedCollectionName(Collection collection) {+ if (collection.isDeleted) {+ return "Deleted Collection";+ }+ if (collection.encryptedName != null &&+ collection.encryptedName!.isNotEmpty) {+ try {+ final collectionKey =+ CryptoHelper.instance.getCollectionKey(collection);+ final result = CryptoUtil.decryptSync(+ CryptoUtil.base642bin(collection.encryptedName!),+ collectionKey,+ CryptoUtil.base642bin(collection.nameDecryptionNonce!),+ );+ return utf8.decode(result);+ } catch (e, s) {+ _logger.severe(+ "failed to decrypt collection name: ${collection.id}",+ e,+ s,+ );+ }+ }+ return collection.name ?? "Untitled";+ }++ Future<Collection> create(String name, CollectionType type) async {+ final collectionKey = CryptoUtil.generateKey();+ final encryptedKeyData =+ CryptoUtil.encryptSync(collectionKey, _config.getKey()!);+ final encryptedName = CryptoUtil.encryptSync(+ utf8.encode(name),+ collectionKey,+ );+ final request = CreateRequest(+ encryptedKey: CryptoUtil.bin2base64(encryptedKeyData.encryptedData!),+ keyDecryptionNonce: CryptoUtil.bin2base64(encryptedKeyData.nonce!),+ encryptedName: CryptoUtil.bin2base64(encryptedName.encryptedData!),+ nameDecryptionNonce: CryptoUtil.bin2base64(encryptedName.nonce!),+ type: type,+ attributes: CollectionAttributes(),+ );+ return _enteDio+ .post(+ "/collections",+ data: request.toJson(),+ )+ .then((response) async {+ final collectionData = response.data["collection"];+ final collection = await _fromRemoteCollection(collectionData);+ return collection;+ });+ }+}++class CreateRequest {+ String encryptedKey;+ String keyDecryptionNonce;+ String encryptedName;+ String nameDecryptionNonce;+ CollectionType type;+ CollectionAttributes? attributes;+ MetadataRequest? magicMetadata;++ CreateRequest({+ required this.encryptedKey,+ required this.keyDecryptionNonce,+ required this.encryptedName,+ required this.nameDecryptionNonce,+ required this.type,+ this.attributes,+ this.magicMetadata,+ });++ CreateRequest copyWith({+ String? encryptedKey,+ String? keyDecryptionNonce,+ String? encryptedName,+ String? nameDecryptionNonce,+ CollectionType? type,+ CollectionAttributes? attributes,+ MetadataRequest? magicMetadata,+ }) =>+ CreateRequest(+ encryptedKey: encryptedKey ?? this.encryptedKey,+ keyDecryptionNonce: keyDecryptionNonce ?? this.keyDecryptionNonce,+ encryptedName: encryptedName ?? this.encryptedName,+ nameDecryptionNonce: nameDecryptionNonce ?? this.nameDecryptionNonce,+ type: type ?? this.type,+ attributes: attributes ?? this.attributes,+ magicMetadata: magicMetadata ?? this.magicMetadata,+ );++ Map<String, dynamic> toJson() {+ final map = <String, dynamic>{};+ map['encryptedKey'] = encryptedKey;+ map['keyDecryptionNonce'] = keyDecryptionNonce;+ map['encryptedName'] = encryptedName;+ map['nameDecryptionNonce'] = nameDecryptionNonce;+ map['type'] = typeToString(type);+ if (attributes != null) {+ map['attributes'] = attributes!.toMap();+ }+ if (magicMetadata != null) {+ map['magicMetadata'] = magicMetadata!.toJson();+ }+ return map;+ }+}diff --git a/mobile/apps/locker/lib/services/collections/collections_db.dart b/mobile/apps/locker/lib/services/collections/collections_db.dartnew file mode 100644index 0000000000..6a1b22a6c9--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/collections_db.dart@@ -0,0 +1,535 @@+import 'dart:convert';++import "package:ente_base/models/database.dart";+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/collections/models/public_url.dart';+import 'package:locker/services/collections/models/user.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:path/path.dart';+import 'package:path_provider/path_provider.dart';+import 'package:sqflite/sqflite.dart';++class CollectionDB extends EnteBaseDatabase {+ CollectionDB._privateConstructor();++ static final CollectionDB instance = CollectionDB._privateConstructor();++ Database? _database;+ int _collectionSyncTime = 0;+ final Map<int, int> _collectionSyncTimesCache = {};++ static const String _collectionsTable = 'collections';+ static const String _filesTable = 'files';+ static const String _collectionFilesTable = 'collection_files';+ static const String _syncTimesTable = 'sync_times';++ Future<void> init() async {+ _database = await _initDatabase();+ await _loadCaches();+ }++ Future<void> _loadCaches() async {+ final syncTimes = await _db.query(+ _syncTimesTable,+ where: 'key LIKE ?',+ whereArgs: ['collection_sync_time_%'],+ );++ for (final row in syncTimes) {+ final key = row['key'] as String;+ final collectionId =+ int.tryParse(key.replaceFirst('collection_sync_time_', ''));+ if (collectionId != null) {+ _collectionSyncTimesCache[collectionId] = row['value'] as int;+ }+ }++ final globalSyncTime = await getSyncTimeAsync();+ _collectionSyncTime = globalSyncTime;+ }++ Future<Database> _initDatabase() async {+ final documentsDirectory = await getApplicationDocumentsDirectory();+ final path = join(documentsDirectory.path, 'collection_store.db');++ return await openDatabase(+ path,+ version: 1,+ onCreate: _createTables,+ );+ }++ Future<void> _createTables(Database db, int version) async {+ await db.execute('''+ CREATE TABLE $_collectionsTable (+ id INTEGER PRIMARY KEY,+ owner_id INTEGER,+ owner_email TEXT,+ owner_name TEXT,+ encrypted_key TEXT,+ key_decryption_nonce TEXT,+ name TEXT,+ type TEXT,+ attributes_version INTEGER,+ attributes_encrypted_path TEXT,+ attributes_path_decryption_nonce TEXT,+ sharees TEXT,+ public_urls TEXT,+ updation_time INTEGER,+ is_deleted INTEGER DEFAULT 0,+ decrypted_path TEXT,+ m_md_encoded_json TEXT,+ m_md_pub_encoded_json TEXT,+ shared_mmd_json TEXT,+ m_md_version INTEGER DEFAULT 0,+ m_mb_pub_version INTEGER DEFAULT 0,+ shared_mmd_version INTEGER DEFAULT 0+ )+ ''');++ await db.execute('''+ CREATE TABLE $_filesTable (+ uploaded_file_id INTEGER,+ local_path TEXT,+ owner_id INTEGER,+ collection_id INTEGER,+ title TEXT,+ creation_time INTEGER,+ modification_time INTEGER,+ updation_time INTEGER,+ added_time INTEGER,+ hash TEXT,+ metadata_version INTEGER,+ encrypted_key TEXT,+ key_decryption_nonce TEXT,+ file_decryption_header TEXT,+ thumbnail_decryption_header TEXT,+ metadata_decryption_header TEXT,+ file_size INTEGER,+ m_md_encoded_json TEXT,+ m_md_version INTEGER DEFAULT 0,+ pub_mmd_encoded_json TEXT,+ pub_mmd_version INTEGER DEFAULT 1+ )+ ''');++ await db.execute('''+ CREATE TABLE $_collectionFilesTable (+ collection_id INTEGER,+ uploaded_file_id INTEGER,+ PRIMARY KEY (collection_id, uploaded_file_id)+ )+ ''');++ await db.execute('''+ CREATE TABLE $_syncTimesTable (+ key TEXT PRIMARY KEY,+ value INTEGER NOT NULL+ )+ ''');++ await db.execute('''+ CREATE INDEX idx_files_collection_id ON $_filesTable (collection_id)+ ''');++ await db.execute('''+ CREATE INDEX idx_files_uploaded_file_id ON $_filesTable (uploaded_file_id)+ ''');++ await db.execute('''+ CREATE INDEX idx_collection_files_uploaded_file_id ON $_collectionFilesTable (uploaded_file_id)+ ''');++ await db.execute('''+ CREATE INDEX idx_collections_updation_time ON $_collectionsTable (updation_time)+ ''');+ }++ Database get _db {+ if (_database == null) {+ throw Exception('Database not initialized. Call init() first.');+ }+ return _database!;+ }++ Future<void> setSyncTime(int lastSyncTime) async {+ _collectionSyncTime = lastSyncTime;+ await _db.insert(+ _syncTimesTable,+ {'key': 'collection_sync_time', 'value': lastSyncTime},+ conflictAlgorithm: ConflictAlgorithm.replace,+ );+ }++ int getSyncTime() {+ return _collectionSyncTime;+ }++ Future<int> getSyncTimeAsync() async {+ final result = await _db.query(+ _syncTimesTable,+ where: 'key = ?',+ whereArgs: ['collection_sync_time'],+ );++ if (result.isNotEmpty) {+ _collectionSyncTime = result.first['value'] as int;+ return _collectionSyncTime;+ }+ return 0;+ }++ int getCollectionSyncTime(int collectionId) {+ return _collectionSyncTimesCache[collectionId] ?? 0;+ }++ Future<int> getCollectionSyncTimeAsync(int collectionId) async {+ final result = await _db.query(+ _syncTimesTable,+ where: 'key = ?',+ whereArgs: ['collection_sync_time_$collectionId'],+ );++ int syncTime = 0;+ if (result.isNotEmpty) {+ syncTime = result.first['value'] as int;+ }++ _collectionSyncTimesCache[collectionId] = syncTime;+ return syncTime;+ }++ Future<void> setCollectionSyncTime(int collectionId, int lastSyncTime) async {+ await _db.insert(+ _syncTimesTable,+ {'key': 'collection_sync_time_$collectionId', 'value': lastSyncTime},+ conflictAlgorithm: ConflictAlgorithm.replace,+ );++ _collectionSyncTimesCache[collectionId] = lastSyncTime;+ }++ Future<Collection> getCollection(int id) async {+ final result = await _db.query(+ _collectionsTable,+ where: 'id = ?',+ whereArgs: [id],+ );++ if (result.isEmpty) {+ throw Exception('Collection with id $id not found');+ }++ return _mapToCollection(result.first);+ }++ Future<void> updateCollections(List<Collection> collections) async {+ final batch = _db.batch();++ for (final collection in collections) {+ batch.delete(+ _collectionsTable,+ where: 'id = ?',+ whereArgs: [collection.id],+ );++ batch.insert(+ _collectionsTable,+ _collectionToMap(collection),+ );+ }++ await batch.commit();+ }++ Future<void> deleteCollection(Collection collection) async {+ final batch = _db.batch();++ batch.delete(+ _collectionsTable,+ where: 'id = ?',+ whereArgs: [collection.id],+ );++ batch.delete(+ _collectionFilesTable,+ where: 'collection_id = ?',+ whereArgs: [collection.id],+ );++ final filesInCollection = await _db.query(+ _collectionFilesTable,+ where: 'collection_id = ?',+ whereArgs: [collection.id],+ );++ for (final fileMap in filesInCollection) {+ final uploadedFileId = fileMap['uploaded_file_id'] as int;+ final otherCollections = await _db.query(+ _collectionFilesTable,+ where: 'uploaded_file_id = ? AND collection_id != ?',+ whereArgs: [uploadedFileId, collection.id],+ );++ if (otherCollections.isEmpty) {+ batch.delete(+ _filesTable,+ where: 'uploaded_file_id = ?',+ whereArgs: [uploadedFileId],+ );+ }+ }++ await batch.commit();+ }++ Future<List<Collection>> getCollections() async {+ final result = await _db.query(_collectionsTable);+ return result.map((row) => _mapToCollection(row)).toList();+ }++ Future<void> addFilesToCollection(+ Collection collection,+ List<EnteFile> files,+ ) async {+ final batch = _db.batch();++ for (final file in files) {+ batch.insert(+ _filesTable,+ _fileToMap(file),+ conflictAlgorithm: ConflictAlgorithm.replace,+ );++ batch.insert(+ _collectionFilesTable,+ {+ 'collection_id': collection.id,+ 'uploaded_file_id': file.uploadedFileID!,+ },+ conflictAlgorithm: ConflictAlgorithm.ignore,+ );+ }++ await batch.commit();+ }++ Future<void> deleteFilesFromCollection(+ Collection collection,+ List<EnteFile> files,+ ) async {+ final batch = _db.batch();++ for (final file in files) {+ batch.delete(+ _collectionFilesTable,+ where: 'collection_id = ? AND uploaded_file_id = ?',+ whereArgs: [collection.id, file.uploadedFileID!],+ );++ final otherCollections = await _db.query(+ _collectionFilesTable,+ where: 'uploaded_file_id = ? AND collection_id != ?',+ whereArgs: [file.uploadedFileID!, collection.id],+ );++ if (otherCollections.isEmpty) {+ batch.delete(+ _filesTable,+ where: 'uploaded_file_id = ?',+ whereArgs: [file.uploadedFileID!],+ );+ }+ }++ await batch.commit();+ }++ Future<List<EnteFile>> getFilesInCollection(Collection collection) async {+ final result = await _db.rawQuery(+ '''+ SELECT f.*+ FROM $_filesTable f+ INNER JOIN $_collectionFilesTable cf ON f.uploaded_file_id = cf.uploaded_file_id+ WHERE cf.collection_id = ?+ ''',+ [collection.id],+ );++ return result.map((row) => _mapToFile(row)).toList();+ }++ Future<List<Collection>> getCollectionsForFile(EnteFile file) async {+ final result = await _db.rawQuery(+ '''+ SELECT c.*+ FROM $_collectionsTable c+ INNER JOIN $_collectionFilesTable cf ON c.id = cf.collection_id+ WHERE cf.uploaded_file_id = ?+ ''',+ [file.uploadedFileID!],+ );++ return result.map((row) => _mapToCollection(row)).toList();+ }++ Future<List<EnteFile>> getAllFiles() async {+ final result = await _db.query(_filesTable);+ return result.map((row) => _mapToFile(row)).toList();+ }++ Map<String, dynamic> _collectionToMap(Collection collection) {+ return {+ 'id': collection.id,+ 'owner_id': collection.owner.id,+ 'owner_email': collection.owner.email,+ 'owner_name': collection.owner.name,+ 'encrypted_key': collection.encryptedKey,+ 'key_decryption_nonce': collection.keyDecryptionNonce,+ 'name': collection.name,+ 'type': typeToString(collection.type),+ 'attributes_version': collection.attributes.version,+ 'attributes_encrypted_path': collection.attributes.encryptedPath,+ 'attributes_path_decryption_nonce':+ collection.attributes.pathDecryptionNonce,+ 'sharees':+ jsonEncode(collection.sharees.map((user) => user.toMap()).toList()),+ 'public_urls':+ jsonEncode(collection.publicURLs.map((url) => url.toMap()).toList()),+ 'updation_time': collection.updationTime,+ 'is_deleted': collection.isDeleted ? 1 : 0,+ 'decrypted_path': collection.decryptedPath,+ 'm_md_encoded_json': collection.mMdEncodedJson,+ 'm_md_pub_encoded_json': collection.mMdPubEncodedJson,+ 'shared_mmd_json': collection.sharedMmdJson,+ 'm_md_version': collection.mMdVersion,+ 'm_mb_pub_version': collection.mMbPubVersion,+ 'shared_mmd_version': collection.sharedMmdVersion,+ };+ }++ Collection _mapToCollection(Map<String, dynamic> map) {+ final owner = User(+ id: map['owner_id'] as int?,+ email: map['owner_email'] as String,+ name: map['owner_name'] as String?,+ );++ final attributes = CollectionAttributes(+ version: map['attributes_version'] as int? ?? 0,+ encryptedPath: map['attributes_encrypted_path'] as String?,+ pathDecryptionNonce: map['attributes_path_decryption_nonce'] as String?,+ );++ final shareesJson = map['sharees'] as String? ?? '[]';+ final shareesData = jsonDecode(shareesJson) as List<dynamic>;+ final sharees = shareesData+ .map((shareeeMap) => User.fromMap(shareeeMap as Map<String, dynamic>))+ .where((user) => user != null)+ .cast<User>()+ .toList();++ final publicUrlsJson = map['public_urls'] as String? ?? '[]';+ final publicURLsData = jsonDecode(publicUrlsJson) as List<dynamic>;+ final publicURLs = publicURLsData+ .map((urlMap) => PublicURL.fromMap(urlMap as Map<String, dynamic>))+ .where((url) => url != null)+ .cast<PublicURL>()+ .toList();++ final collection = Collection(+ map['id'] as int,+ owner,+ map['encrypted_key'] as String,+ map['key_decryption_nonce'] as String?,+ map['name'] as String?,+ null,+ null,+ typeFromString(map['type'] as String),+ attributes,+ sharees,+ publicURLs,+ map['updation_time'] as int,+ isDeleted: (map['is_deleted'] as int? ?? 0) == 1,+ );++ collection.decryptedPath = map['decrypted_path'] as String?;+ collection.mMdEncodedJson = map['m_md_encoded_json'] as String?;+ collection.mMdPubEncodedJson = map['m_md_pub_encoded_json'] as String?;+ collection.sharedMmdJson = map['shared_mmd_json'] as String?;+ collection.mMdVersion = map['m_md_version'] as int? ?? 0;+ collection.mMbPubVersion = map['m_mb_pub_version'] as int? ?? 0;+ collection.sharedMmdVersion = map['shared_mmd_version'] as int? ?? 0;++ return collection;+ }++ Map<String, dynamic> _fileToMap(EnteFile file) {+ return {+ 'uploaded_file_id': file.uploadedFileID,+ 'local_path': file.localPath,+ 'owner_id': file.ownerID,+ 'collection_id': file.collectionID,+ 'title': file.title,+ 'creation_time': file.creationTime,+ 'modification_time': file.modificationTime,+ 'updation_time': file.updationTime,+ 'added_time': file.addedTime,+ 'hash': file.hash,+ 'metadata_version': file.metadataVersion,+ 'encrypted_key': file.encryptedKey,+ 'key_decryption_nonce': file.keyDecryptionNonce,+ 'file_decryption_header': file.fileDecryptionHeader,+ 'thumbnail_decryption_header': file.thumbnailDecryptionHeader,+ 'metadata_decryption_header': file.metadataDecryptionHeader,+ 'file_size': file.fileSize,+ 'm_md_encoded_json': file.mMdEncodedJson,+ 'm_md_version': file.mMdVersion,+ 'pub_mmd_encoded_json': file.pubMmdEncodedJson,+ 'pub_mmd_version': file.pubMmdVersion,+ };+ }++ EnteFile _mapToFile(Map<String, dynamic> map) {+ final file = EnteFile();++ file.localPath = map['local_path'];+ file.uploadedFileID = map['uploaded_file_id'];+ file.ownerID = map['owner_id'];+ file.collectionID = map['collection_id'];+ file.title = map['title'];+ file.creationTime = map['creation_time'];+ file.modificationTime = map['modification_time'];+ file.updationTime = map['updation_time'];+ file.addedTime = map['added_time'];+ file.hash = map['hash'];+ file.metadataVersion = map['metadata_version'];+ file.encryptedKey = map['encrypted_key'];+ file.keyDecryptionNonce = map['key_decryption_nonce'];+ file.fileDecryptionHeader = map['file_decryption_header'];+ file.thumbnailDecryptionHeader = map['thumbnail_decryption_header'];+ file.metadataDecryptionHeader = map['metadata_decryption_header'];+ file.fileSize = map['file_size'];+ file.mMdEncodedJson = map['m_md_encoded_json'];+ file.mMdVersion = map['m_md_version'] ?? 0;+ file.pubMmdEncodedJson = map['pub_mmd_encoded_json'];+ file.pubMmdVersion = map['pub_mmd_version'] ?? 1;++ return file;+ }++ Future<void> close() async {+ await _database?.close();+ _database = null;+ }++ @override+ Future<void> clearTable() async {+ await _database?.delete(_collectionsTable);+ await _database?.delete(_filesTable);+ await _database?.delete(_collectionFilesTable);+ await _database?.delete(_syncTimesTable);+ _collectionSyncTimesCache.clear();+ _collectionSyncTime = 0;+ }+}diff --git a/mobile/apps/locker/lib/services/collections/collections_service.dart b/mobile/apps/locker/lib/services/collections/collections_service.dartnew file mode 100644index 0000000000..9813e68e49--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/collections_service.dart@@ -0,0 +1,343 @@+import 'dart:async';+import 'dart:math';+import 'dart:typed_data';++import 'package:ente_events/event_bus.dart';+import 'package:ente_events/models/signed_in_event.dart';+import 'package:locker/events/collections_updated_event.dart';+import "package:locker/services/collections/collections_api_client.dart";+import "package:locker/services/collections/collections_db.dart";+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/trash/models/trash_item_request.dart';+import "package:locker/services/trash/trash_service.dart";+import "package:locker/utils/crypto_helper.dart";+import 'package:logging/logging.dart';++class CollectionService {+ CollectionService._privateConstructor();++ static final CollectionService instance =+ CollectionService._privateConstructor();++ // Fixed set of suggested collection names+ static const Set<String> _suggestedCollectionNames = {+ 'Personal',+ 'Work',+ 'Travel',+ 'Family',+ 'Projects',+ 'School',+ 'Music',+ 'Books',+ 'Events',+ 'Holidays',+ };++ final _logger = Logger("CollectionService");+ final _apiClient = CollectionApiClient.instance;++ Future<void> init() async {+ if (Configuration.instance.hasConfiguredAccount()) {+ await _init();+ } else {+ Bus.instance.on<SignedInEvent>().listen((event) {+ _logger.info("User signed in, starting initial sync.");+ _init();+ });+ }+ }++ Future<void> sync() async {+ final updatedCollections = await CollectionApiClient.instance+ .getCollections(CollectionDB.instance.getSyncTime());+ if (updatedCollections.isEmpty) {+ _logger.info("No collections to sync.");+ return;+ }+ await CollectionDB.instance.updateCollections(updatedCollections);+ await CollectionDB.instance+ .setSyncTime(updatedCollections.last.updationTime);+ final List<Future> fileFutures = [];+ for (final collection in updatedCollections) {+ if (collection.isDeleted) {+ await CollectionDB.instance.deleteCollection(collection);+ continue;+ }+ final syncTime =+ CollectionDB.instance.getCollectionSyncTime(collection.id);+ fileFutures.add(+ CollectionApiClient.instance+ .getFiles(collection, syncTime)+ .then((diff) async {+ if (diff.updatedFiles.isNotEmpty) {+ await CollectionDB.instance.addFilesToCollection(+ collection,+ diff.updatedFiles,+ );+ }+ if (diff.deletedFiles.isNotEmpty) {+ await CollectionDB.instance.deleteFilesFromCollection(+ collection,+ diff.deletedFiles,+ );+ }+ await CollectionDB.instance+ .setCollectionSyncTime(collection.id, diff.latestUpdatedAtTime);+ }).catchError((e) {+ _logger.warning(+ "Failed to fetch files for collection ${collection.id}: $e",+ );+ }),+ );+ }+ await Future.wait(fileFutures);+ if (updatedCollections.isNotEmpty) {+ Bus.instance.fire(CollectionsUpdatedEvent());+ }+ }++ bool hasCompletedFirstSync() {+ return Configuration.instance.hasConfiguredAccount() &&+ CollectionDB.instance.getSyncTime() > 0;+ }++ Future<Collection> createCollection(+ String name, {+ CollectionType type = CollectionType.folder,+ }) async {+ try {+ final collection = await _apiClient.create(name, type);+ _logger.info("Created collection: ${collection.name}");+ // Let sync update the local state+ await sync();+ return collection;+ } catch (e) {+ _logger.severe("Failed to create collection: $e");+ rethrow;+ }+ }++ Future<List<Collection>> getCollections() async {+ return CollectionDB.instance.getCollections();+ }++ Future<List<Collection>> getCollectionsForFile(EnteFile file) async {+ return CollectionDB.instance.getCollectionsForFile(file);+ }++ Future<List<EnteFile>> getFilesInCollection(Collection collection) async {+ try {+ final files =+ await CollectionDB.instance.getFilesInCollection(collection);+ return files;+ } catch (e) {+ _logger.severe(+ "Failed to fetch files for collection ${collection.name}: $e",+ );+ rethrow;+ }+ }++ Future<List<EnteFile>> getAllFiles() async {+ try {+ final allFiles = await CollectionDB.instance.getAllFiles();+ return allFiles;+ } catch (e) {+ _logger.severe("Failed to fetch all files: $e");+ rethrow;+ }+ }++ Future<void> addToCollection(Collection collection, EnteFile file) async {+ try {+ await _apiClient.addToCollection(collection, [file]);+ _logger.info("Added file ${file.title} to collection ${collection.name}");+ // Let sync update the local state+ await sync();+ } catch (e) {+ _logger.severe("Failed to add file to collection: $e");+ rethrow;+ }+ }++ Future<void> trashFile(EnteFile file, Collection collection) async {+ try {+ final List<TrashRequest> requests = [];+ requests.add(TrashRequest(file.uploadedFileID!, collection.id));+ await _apiClient.trash(requests);+ // Let sync update the local state+ await sync();+ await TrashService.instance.syncTrash();+ } catch (e) {+ _logger.severe("Failed to remove file from collections: $e");+ rethrow;+ }+ }++ Future<void> rename(Collection collection, String newName) async {+ try {+ await CollectionApiClient.instance.rename(+ collection,+ newName,+ );+ _logger.info("Renamed collection ${collection.name} to $newName");+ // Let sync update the local state+ await sync();+ } catch (e, s) {+ _logger.warning("failed to rename collection", e, s);+ rethrow;+ }+ }++ Future<Collection> getOrCreateUncategorizedCollection() async {+ final collections = await getCollections();+ for (final collection in collections) {+ if (collection.type == CollectionType.uncategorized) {+ return collection;+ }+ }+ _logger.info("No collections found, creating uncategorized collection.");+ return await createCollection(+ "Uncategorized",+ type: CollectionType.uncategorized,+ );+ }++ Future<void> _init() async {+ // ignore: unawaited_futures+ sync().then((_) {+ setupDefaultCollections();+ }).catchError((error) {+ _logger.severe("Failed to initialize collections: $error");+ });+ }++ Future<Collection> _getOrCreateImportantCollection() async {+ final collections = await getCollections();+ for (final collection in collections) {+ if (collection.type == CollectionType.favorites) {+ return collection;+ }+ }+ _logger.info("No collections found, creating important collection.");+ return await createCollection("Important", type: CollectionType.favorites);+ }++ Future<void> move(EnteFile file, Collection from, Collection to) async {+ try {+ await _apiClient.move(file, from, to);+ _logger.info("Moved file ${file.title} from ${from.name} to ${to.name}");+ // Let sync update the local state+ await sync();+ } catch (e) {+ _logger.severe("Failed to move file: $e");+ rethrow;+ }+ }++ Future<void> trashCollection(Collection collection) async {+ try {+ await _apiClient.trashCollection(collection);+ _logger.info("Trashed collection: ${collection.name}");+ // Let sync update the local state+ await sync();+ } catch (e) {+ _logger.severe("Failed to trash collection: $e");+ rethrow;+ }+ }++ Future<void> setupDefaultCollections() async {+ try {+ _logger.info("Setting up default collections...");++ // Create uncategorized collection if it doesn't exist+ await getOrCreateUncategorizedCollection();++ // Create important (favorites) collection if it doesn't exist+ await _getOrCreateImportantCollection();++ // Create Documents collection if it doesn't exist+ await _getOrCreateDocumentsCollection();++ _logger.info("Default collections setup completed.");+ } catch (e, s) {+ _logger.severe("Failed to setup default collections", e, s);+ }+ }++ Future<Collection> _getOrCreateDocumentsCollection() async {+ final collections = await getCollections();+ for (final collection in collections) {+ if (collection.type == CollectionType.folder &&+ collection.name == "Documents") {+ return collection;+ }+ }+ _logger+ .info("No Documents collection found, creating Documents collection.");+ return createCollection("Documents", type: CollectionType.folder);+ }++ /// Returns one random collection name that doesn't already exist+ /// If all names are used, returns "Documents"+ Future<String> getRandomUnusedCollectionName() async {+ try {+ final existingCollections = await getCollections();+ final existingNames = existingCollections+ .map((collection) => collection.name?.toLowerCase())+ .where((name) => name != null)+ .toSet();++ final availableNames = _suggestedCollectionNames+ .where((name) => !existingNames.contains(name.toLowerCase()))+ .toList();++ if (availableNames.isEmpty) {+ _logger.info(+ "All suggested collection names are used, returning 'Documents'",+ );+ return "Documents";+ }++ final random = Random();+ final randomName = availableNames[random.nextInt(availableNames.length)];+ _logger.info("Selected random unused collection name: $randomName");+ return randomName;+ } catch (e) {+ _logger.severe("Failed to get random unused collection name: $e");+ return "Documents";+ }+ }++ Future<Collection> getCollection(int collectionID) async {+ return await CollectionDB.instance.getCollection(collectionID);+ }++ Future<Uint8List> getCollectionKey(int collectionID) async {+ final collection = await getCollection(collectionID);+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);+ return collectionKey;+ }++ Future<Uint8List> getFileKey(EnteFile file) async {+ try {+ final collection = await getCollection(file.collectionID!);+ final collectionKey = CryptoHelper.instance.getCollectionKey(collection);++ final fileKey = CryptoHelper.instance.getFileKey(+ file.encryptedKey!,+ file.keyDecryptionNonce!,+ collectionKey,+ );++ _logger.info("Successfully decrypted file key for file ${file.title}");+ return fileKey;+ } catch (e) {+ _logger.severe("Failed to get file key: $e");+ rethrow;+ }+ }+}diff --git a/mobile/apps/locker/lib/services/collections/models/collection.dart b/mobile/apps/locker/lib/services/collections/models/collection.dartnew file mode 100644index 0000000000..2338bc11d9--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/collection.dart@@ -0,0 +1,352 @@+import 'dart:core';++import 'package:flutter/foundation.dart';+import 'package:locker/services/collections/models/collection_magic.dart';+import 'package:locker/services/collections/models/public_url.dart';+import 'package:locker/services/collections/models/user.dart';+import 'package:locker/services/files/sync/models/common_keys.dart';++class Collection {+ final int id;+ final User owner;+ final String encryptedKey;+ final String? keyDecryptionNonce;+ String? name;++ final String? encryptedName;+ final String? nameDecryptionNonce;+ final CollectionType type;+ final CollectionAttributes attributes;+ final List<User> sharees;+ final List<PublicURL> publicURLs;+ final int updationTime;+ final bool isDeleted;++ // decryptedPath will be null for collections now owned by user, deleted+ // collections, && collections which don't have a path. The path is used+ // to map local on-device album on mobile to remote collection on ente.+ String? decryptedPath;+ String? mMdEncodedJson;+ String? mMdPubEncodedJson;+ String? sharedMmdJson;+ int mMdVersion = 0;+ int mMbPubVersion = 0;+ int sharedMmdVersion = 0;+ CollectionMagicMetadata? _mmd;+ CollectionPubMagicMetadata? _pubMmd;+ ShareeMagicMetadata? _sharedMmd;++ CollectionMagicMetadata get magicMetadata =>+ _mmd ?? CollectionMagicMetadata.fromEncodedJson(mMdEncodedJson ?? '{}');++ CollectionPubMagicMetadata get pubMagicMetadata =>+ _pubMmd ??+ CollectionPubMagicMetadata.fromEncodedJson(mMdPubEncodedJson ?? '{}');++ ShareeMagicMetadata get sharedMagicMetadata =>+ _sharedMmd ?? ShareeMagicMetadata.fromEncodedJson(sharedMmdJson ?? '{}');++ set magicMetadata(CollectionMagicMetadata? val) => _mmd = val;++ set pubMagicMetadata(CollectionPubMagicMetadata? val) => _pubMmd = val;++ set sharedMagicMetadata(ShareeMagicMetadata? val) => _sharedMmd = val;++ void setName(String newName) {+ name = newName;+ }++ Collection(+ this.id,+ this.owner,+ this.encryptedKey,+ this.keyDecryptionNonce,+ this.name,+ this.encryptedName,+ this.nameDecryptionNonce,+ this.type,+ this.attributes,+ this.sharees,+ this.publicURLs,+ this.updationTime, {+ this.isDeleted = false,+ });++ bool isArchived() {+ return mMdVersion > 0 && magicMetadata.visibility == archiveVisibility;+ }++ bool hasShareeArchived() {+ return sharedMmdVersion > 0 &&+ sharedMagicMetadata.visibility == archiveVisibility;+ }++ // hasLink returns true if there's any link attached to the collection+ // including expired links+ bool get hasLink => publicURLs.isNotEmpty;++ bool get hasCover => (pubMagicMetadata.coverID ?? 0) > 0;++ // hasSharees returns true if the collection is shared with other ente users+ bool get hasSharees => sharees.isNotEmpty;++ bool get isPinned => (magicMetadata.order ?? 0) != 0;++ bool isHidden() {+ if (isDefaultHidden()) {+ return true;+ }+ return mMdVersion > 0 && (magicMetadata.visibility == hiddenVisibility);+ }++ bool isDefaultHidden() {+ return (magicMetadata.subType ?? 0) == subTypeDefaultHidden;+ }++ bool isQuickLinkCollection() {+ return (magicMetadata.subType ?? 0) == subTypeSharedFilesCollection &&+ !hasSharees;+ }++ List<User> getSharees() {+ return sharees;+ }++ bool isOwner(int userID) {+ return (owner.id ?? -100) == userID;+ }++ bool isDownloadEnabledForPublicLink() {+ if (publicURLs.isEmpty) {+ return false;+ }+ return publicURLs.first.enableDownload;+ }++ bool isCollectEnabledForPublicLink() {+ if (publicURLs.isEmpty) {+ return false;+ }+ return publicURLs.first.enableCollect;+ }++ bool get isJoinEnabled {+ if (publicURLs.isEmpty) {+ return false;+ }+ return publicURLs.first.enableJoin;+ }++ CollectionParticipantRole getRole(int userID) {+ if (isOwner(userID)) {+ return CollectionParticipantRole.owner;+ }+ if (sharees.isEmpty) {+ return CollectionParticipantRole.unknown;+ }+ for (final User u in sharees) {+ if (u.id == userID) {+ if (u.isViewer) {+ return CollectionParticipantRole.viewer;+ } else if (u.isCollaborator) {+ return CollectionParticipantRole.collaborator;+ }+ }+ }+ return CollectionParticipantRole.unknown;+ }++ void updateSharees(List<User> newSharees) {+ sharees.clear();+ sharees.addAll(newSharees);+ }++ Collection copyWith({+ int? id,+ User? owner,+ String? encryptedKey,+ String? keyDecryptionNonce,+ String? name,+ String? encryptedName,+ String? nameDecryptionNonce,+ CollectionType? type,+ CollectionAttributes? attributes,+ List<User>? sharees,+ List<PublicURL>? publicURLs,+ int? updationTime,+ bool? isDeleted,+ String? mMdEncodedJson,+ int? mMdVersion,+ String? decryptedName,+ String? decryptedPath,+ }) {+ final Collection result = Collection(+ id ?? this.id,+ owner ?? this.owner,+ encryptedKey ?? this.encryptedKey,+ keyDecryptionNonce ?? this.keyDecryptionNonce,+ // ignore: deprecated_member_use_from_same_package+ name ?? this.name,+ encryptedName ?? this.encryptedName,+ nameDecryptionNonce ?? this.nameDecryptionNonce,+ type ?? this.type,+ attributes ?? this.attributes,+ sharees ?? this.sharees,+ publicURLs ?? this.publicURLs,+ updationTime ?? this.updationTime,+ isDeleted: isDeleted ?? this.isDeleted,+ );+ result.mMdVersion = mMdVersion ?? this.mMdVersion;+ result.mMdEncodedJson = mMdEncodedJson ?? this.mMdEncodedJson;+ result.decryptedPath = decryptedPath ?? this.decryptedPath;+ result.mMbPubVersion = mMbPubVersion;+ result.mMdPubEncodedJson = mMdPubEncodedJson;+ result.sharedMmdVersion = sharedMmdVersion;+ result.sharedMmdJson = sharedMmdJson;+ return result;+ }++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ final sharees = (map['sharees'] == null || map['sharees'].length == 0)+ ? <User>[]+ : List<User>.from(map['sharees'].map((x) => User.fromMap(x)));+ final publicURLs =+ (map['publicURLs'] == null || map['publicURLs'].length == 0)+ ? <PublicURL>[]+ : List<PublicURL>.from(+ map['publicURLs'].map((x) => PublicURL.fromMap(x)),+ );+ return Collection(+ map['id'],+ User.fromMap(map['owner']),+ map['encryptedKey'],+ map['keyDecryptionNonce'],+ map['name'],+ map['encryptedName'],+ map['nameDecryptionNonce'],+ typeFromString(map['type']),+ CollectionAttributes.fromMap(map['attributes']),+ sharees,+ publicURLs,+ map['updationTime'],+ isDeleted: map['isDeleted'] ?? false,+ );+ }++ @override+ bool operator ==(Object o) {+ if (identical(this, o)) return true;++ return o is Collection && o.id == id;+ }++ @override+ int get hashCode {+ return id.hashCode;+ }+}++enum CollectionType {+ folder,+ favorites,+ uncategorized,+ album,+ unknown,+}++CollectionType typeFromString(String type) {+ switch (type) {+ case "folder":+ return CollectionType.folder;+ case "favorites":+ return CollectionType.favorites;+ case "uncategorized":+ return CollectionType.uncategorized;+ case "album":+ return CollectionType.album;+ case "unknown":+ return CollectionType.unknown;+ }+ debugPrint("unexpected collection type $type");+ return CollectionType.unknown;+}++String typeToString(CollectionType type) {+ switch (type) {+ case CollectionType.folder:+ return "folder";+ case CollectionType.favorites:+ return "favorites";+ case CollectionType.album:+ return "album";+ case CollectionType.uncategorized:+ return "uncategorized";+ case CollectionType.unknown:+ return "unknown";+ }+}++extension CollectionTypeExtn on CollectionType {+ bool get canDelete =>+ this != CollectionType.favorites && this != CollectionType.uncategorized;+}++enum CollectionParticipantRole {+ unknown,+ viewer,+ collaborator,+ owner,+}++extension CollectionParticipantRoleExtn on CollectionParticipantRole {+ static CollectionParticipantRole fromString(String? val) {+ if ((val ?? '') == '') {+ return CollectionParticipantRole.viewer;+ }+ for (var x in CollectionParticipantRole.values) {+ if (x.name.toUpperCase() == val!.toUpperCase()) {+ return x;+ }+ }+ return CollectionParticipantRole.unknown;+ }++ String toStringVal() {+ return name.toUpperCase();+ }+}++class CollectionAttributes {+ final String? encryptedPath;+ final String? pathDecryptionNonce;+ final int? version;++ CollectionAttributes({+ this.encryptedPath,+ this.pathDecryptionNonce,+ this.version,+ });++ Map<String, dynamic> toMap() {+ final map = <String, dynamic>{};+ if (encryptedPath != null) {+ map['encryptedPath'] = encryptedPath;+ }+ if (pathDecryptionNonce != null) {+ map['pathDecryptionNonce'] = pathDecryptionNonce;+ }+ map['version'] = version ?? 0;+ return map;+ }++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;++ return CollectionAttributes(+ encryptedPath: map['encryptedPath'],+ pathDecryptionNonce: map['pathDecryptionNonce'],+ version: map['version'] ?? 0,+ );+ }+}diff --git a/mobile/apps/locker/lib/services/collections/models/collection_file_item.dart b/mobile/apps/locker/lib/services/collections/models/collection_file_item.dartnew file mode 100644index 0000000000..514808cb9a--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/collection_file_item.dart@@ -0,0 +1,66 @@+import 'dart:convert';++class CollectionFileItem {+ final int id;+ final String encryptedKey;+ final String keyDecryptionNonce;++ CollectionFileItem(+ this.id,+ this.encryptedKey,+ this.keyDecryptionNonce,+ );++ CollectionFileItem copyWith({+ int? id,+ String? encryptedKey,+ String? keyDecryptionNonce,+ }) {+ return CollectionFileItem(+ id ?? this.id,+ encryptedKey ?? this.encryptedKey,+ keyDecryptionNonce ?? this.keyDecryptionNonce,+ );+ }++ Map<String, dynamic> toMap() {+ return {+ 'id': id,+ 'encryptedKey': encryptedKey,+ 'keyDecryptionNonce': keyDecryptionNonce,+ };+ }++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;++ return CollectionFileItem(+ map['id'],+ map['encryptedKey'],+ map['keyDecryptionNonce'],+ );+ }++ String toJson() => json.encode(toMap());++ factory CollectionFileItem.fromJson(String source) =>+ CollectionFileItem.fromMap(json.decode(source));++ @override+ String toString() =>+ 'CollectionFileItem(id: $id, encryptedKey: $encryptedKey, keyDecryptionNonce: $keyDecryptionNonce)';++ @override+ bool operator ==(Object o) {+ if (identical(this, o)) return true;++ return o is CollectionFileItem &&+ o.id == id &&+ o.encryptedKey == encryptedKey &&+ o.keyDecryptionNonce == keyDecryptionNonce;+ }++ @override+ int get hashCode =>+ id.hashCode ^ encryptedKey.hashCode ^ keyDecryptionNonce.hashCode;+}diff --git a/mobile/apps/locker/lib/services/collections/models/collection_magic.dart b/mobile/apps/locker/lib/services/collections/models/collection_magic.dartnew file mode 100644index 0000000000..8d3963a5ed--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/collection_magic.dart@@ -0,0 +1,126 @@+import 'dart:convert';++import "package:locker/services/files/sync/models/common_keys.dart";++// Collection SubType Constants+const subTypeDefaultHidden = 1;+const subTypeSharedFilesCollection = 2;++// key for collection subType+const subTypeKey = 'subType';++const muteKey = "mute";++const orderKey = "order";++class CollectionMagicMetadata {+ // 0 -> visible+ // 1 -> archived+ // 2 -> hidden+ int visibility;++ // null/0 value -> no subType+ // 1 -> DEFAULT_HIDDEN COLLECTION for files hidden individually+ // 2 -> Collections created for sharing selected files+ int? subType;++ /* order is initially just used for pinned collections.+ Later it can be used for custom sort order for if needed.+ Higher the value, higher the preference of the collection to show up first.+ */+ int? order;++ CollectionMagicMetadata({required this.visibility, this.subType, this.order});++ Map<String, dynamic> toJson() {+ final result = {magicKeyVisibility: visibility};+ if (subType != null) {+ result[subTypeKey] = subType!;+ }+ if (order != null) {+ result[orderKey] = order!;+ }+ return result;+ }++ factory CollectionMagicMetadata.fromEncodedJson(String encodedJson) =>+ CollectionMagicMetadata.fromJson(jsonDecode(encodedJson));++ factory CollectionMagicMetadata.fromJson(dynamic json) =>+ CollectionMagicMetadata.fromMap(json);++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ return CollectionMagicMetadata(+ visibility: map[magicKeyVisibility] ?? visibleVisibility,+ subType: map[subTypeKey],+ order: map[orderKey],+ );+ }+}++class CollectionPubMagicMetadata {+ // sort order while showing collection+ bool? asc;++ // cover photo id for the collection+ int? coverID;++ CollectionPubMagicMetadata({this.asc, this.coverID});++ Map<String, dynamic> toJson() {+ final Map<String, dynamic> result = {"asc": asc ?? false};+ if (coverID != null) {+ result["coverID"] = coverID!;+ }+ return result;+ }++ factory CollectionPubMagicMetadata.fromEncodedJson(String encodedJson) =>+ CollectionPubMagicMetadata.fromJson(jsonDecode(encodedJson));++ factory CollectionPubMagicMetadata.fromJson(dynamic json) =>+ CollectionPubMagicMetadata.fromMap(json);++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ return CollectionPubMagicMetadata(+ asc: map["asc"] as bool?,+ coverID: map["coverID"],+ );+ }+}++class ShareeMagicMetadata {+ // 0 -> visible+ // 1 -> archived+ // 2 -> hidden etc?+ int visibility;++ // null/false value -> no mute+ bool? mute;++ ShareeMagicMetadata({required this.visibility, this.mute});++ Map<String, dynamic> toJson() {+ final Map<String, dynamic> result = {magicKeyVisibility: visibility};+ if (mute != null) {+ result[muteKey] = mute!;+ }+ return result;+ }++ factory ShareeMagicMetadata.fromEncodedJson(String encodedJson) =>+ ShareeMagicMetadata.fromJson(jsonDecode(encodedJson));++ factory ShareeMagicMetadata.fromJson(dynamic json) =>+ ShareeMagicMetadata.fromMap(json);++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ return ShareeMagicMetadata(+ visibility: map[magicKeyVisibility] ?? visibleVisibility,+ mute: map[muteKey],+ );+ }+}diff --git a/mobile/apps/locker/lib/services/collections/models/diff.dart b/mobile/apps/locker/lib/services/collections/models/diff.dartnew file mode 100644index 0000000000..c37beaa4ad--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/diff.dart@@ -0,0 +1,15 @@+import 'package:locker/services/files/sync/models/file.dart';++class Diff {+ final List<EnteFile> updatedFiles;+ final List<EnteFile> deletedFiles;+ final bool hasMore;+ final int latestUpdatedAtTime;++ Diff(+ this.updatedFiles,+ this.deletedFiles,+ this.hasMore,+ this.latestUpdatedAtTime,+ );+}diff --git a/mobile/apps/locker/lib/services/collections/models/public_url.dart b/mobile/apps/locker/lib/services/collections/models/public_url.dartnew file mode 100644index 0000000000..12556873a0--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/public_url.dart@@ -0,0 +1,63 @@+class PublicURL {+ String url;+ int deviceLimit;+ int validTill;+ bool enableDownload;+ bool enableCollect;+ bool passwordEnabled;+ bool enableJoin;+ String? nonce;+ int? opsLimit;+ int? memLimit;++ PublicURL({+ required this.url,+ required this.deviceLimit,+ required this.validTill,+ this.enableDownload = true,+ this.passwordEnabled = false,+ this.enableCollect = false,+ this.enableJoin = false,+ this.nonce,+ this.opsLimit,+ this.memLimit,+ });++ Map<String, dynamic> toMap() {+ return {+ 'url': url,+ 'deviceLimit': deviceLimit,+ 'validTill': validTill,+ 'enableDownload': enableDownload,+ 'passwordEnabled': passwordEnabled,+ 'enableCollect': enableCollect,+ 'nonce': nonce,+ 'memLimit': memLimit,+ 'opsLimit': opsLimit,+ 'enableJoin': enableJoin,+ };+ }++ bool get hasExpiry => validTill != 0;++ // isExpired indicates whether the link has expired or not+ bool get isExpired =>+ hasExpiry && validTill < DateTime.now().microsecondsSinceEpoch;++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;++ return PublicURL(+ url: map['url'],+ deviceLimit: map['deviceLimit'],+ validTill: map['validTill'] ?? 0,+ enableDownload: map['enableDownload'] ?? true,+ passwordEnabled: map['passwordEnabled'] ?? false,+ enableCollect: map['enableCollect'] ?? false,+ nonce: map['nonce'],+ opsLimit: map['opsLimit'],+ memLimit: map['memLimit'],+ enableJoin: map['enableJoin'] ?? false,+ );+ }+}diff --git a/mobile/apps/locker/lib/services/collections/models/user.dart b/mobile/apps/locker/lib/services/collections/models/user.dartnew file mode 100644index 0000000000..30785b0504--- /dev/null+++ b/mobile/apps/locker/lib/services/collections/models/user.dart@@ -0,0 +1,44 @@+import "dart:convert";++class User {+ int? id;+ String email;+ @Deprecated(+ "Use displayName() extension method instead. Note: Some early users have"+ " value in name field.",+ )+ String? name;+ String? role;++ User({+ this.id,+ required this.email,+ this.name,+ this.role,+ });++ bool get isViewer => role == null || role?.toUpperCase() == 'VIEWER';++ bool get isCollaborator =>+ role != null && role?.toUpperCase() == 'COLLABORATOR';++ Map<String, dynamic> toMap() {+ // ignore: deprecated_member_use_from_same_package+ return {'id': id, 'email': email, 'name': name, "role": role};+ }++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;++ return User(+ id: map['id'],+ email: map['email'],+ name: map['name'],+ role: map['role'] ?? 'VIEWER',+ );+ }++ String toJson() => json.encode(toMap());++ factory User.fromJson(String source) => User.fromMap(json.decode(source));+}diff --git a/mobile/apps/locker/lib/services/configuration.dart b/mobile/apps/locker/lib/services/configuration.dartnew file mode 100644index 0000000000..f1a0b6d97d--- /dev/null+++ b/mobile/apps/locker/lib/services/configuration.dart@@ -0,0 +1,6 @@+import 'package:ente_configuration/base_configuration.dart';++class Configuration extends BaseConfiguration {+ Configuration._privateConstructor();+ static final Configuration instance = Configuration._privateConstructor();+}diff --git a/mobile/apps/locker/lib/services/files/download/file_downloader.dart b/mobile/apps/locker/lib/services/files/download/file_downloader.dartnew file mode 100644index 0000000000..77acd82ef3--- /dev/null+++ b/mobile/apps/locker/lib/services/files/download/file_downloader.dart@@ -0,0 +1,115 @@+import 'dart:io';+import 'dart:typed_data';++import 'package:dio/dio.dart';+import 'package:ente_crypto_dart/ente_crypto_dart.dart';+import 'package:ente_network/network.dart';+import 'package:ente_utils/fake_progress.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/services/files/download/models/task.dart';+import 'package:locker/services/files/download/service_locator.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/utils/data_util.dart';+import 'package:logging/logging.dart';++final _logger = Logger("FileDownloader");++Future<File?> downloadAndDecrypt(+ EnteFile file,+ Uint8List fileKey, {+ ProgressCallback? progressCallback,+ bool shouldFakeProgress = false,+ bool shouldUseCache = false,+}) async {+ final String logPrefix = 'File-${file.uploadedFileID}:';+ _logger.info('$logPrefix starting download');++ final String tempDir = Configuration.instance.getTempDirectory();+ final String cacheDir = Configuration.instance.getCacheDirectory();++ String encryptedFilePath = "$tempDir${file.uploadedFileID}.encrypted";+ File encryptedFile = File(encryptedFilePath);++ final String decryptedFilePath = shouldUseCache+ ? "$cacheDir${file.displayName}"+ : "$tempDir${file.displayName}";++ final startTime = DateTime.now().millisecondsSinceEpoch;++ try {+ if (downloadManager.enableResumableDownload(file.fileSize)) {+ final DownloadResult result = await downloadManager.download(+ file.uploadedFileID!,+ file.displayName,+ file.fileSize!,+ );+ if (result.success) {+ encryptedFilePath = result.task.filePath!;+ encryptedFile = File(encryptedFilePath);+ } else {+ _logger.warning(+ '$logPrefix download failed ${result.task.error} ${result.task.status}',+ );+ return null;+ }+ } else {+ // If the file is small, download it directly to the final location+ final response = await Network.instance.getDio().download(+ file.downloadUrl,+ encryptedFilePath,+ options: Options(+ headers: {"X-Auth-Token": Configuration.instance.getToken()},+ ),+ onReceiveProgress: (a, b) {+ progressCallback?.call(a, b);+ },+ );+ if (response.statusCode != 200 || !encryptedFile.existsSync()) {+ _logger.warning('$logPrefix download failed ${response.toString()}');+ return null;+ }+ }++ final int sizeInBytes = file.fileSize ?? await encryptedFile.length();+ final double elapsedSeconds =+ (DateTime.now().millisecondsSinceEpoch - startTime) / 1000;+ final double speedInKBps = sizeInBytes / 1024.0 / elapsedSeconds;++ _logger.info(+ '$logPrefix download completed: ${formatBytes(sizeInBytes)}, avg speed: ${speedInKBps.toStringAsFixed(2)} KB/s',+ );++ // As decryption can take time, emit fake progress for large files during+ // decryption+ final FakePeriodicProgress? fakeProgress = shouldFakeProgress+ ? FakePeriodicProgress(+ callback: (count) {+ progressCallback?.call(sizeInBytes, sizeInBytes);+ },+ duration: const Duration(milliseconds: 5000),+ )+ : null;+ try {+ // Start the periodic callback after initial 5 seconds+ fakeProgress?.start();+ await CryptoUtil.decryptFile(+ encryptedFilePath,+ decryptedFilePath,+ CryptoUtil.base642bin(file.fileDecryptionHeader!),+ fileKey,+ );+ fakeProgress?.stop();+ _logger+ .info('$logPrefix decryption completed (ID ${file.uploadedFileID})');+ } catch (e, s) {+ fakeProgress?.stop();+ _logger.severe("Critical: $logPrefix failed to decrypt", e, s);+ return null;+ }+ await encryptedFile.delete();+ return File(decryptedFilePath);+ } catch (e, s) {+ _logger.severe("$logPrefix failed to download or decrypt", e, s);+ return null;+ }+}diff --git a/mobile/apps/locker/lib/services/files/download/file_url.dart b/mobile/apps/locker/lib/services/files/download/file_url.dartnew file mode 100644index 0000000000..ec93dd4867--- /dev/null+++ b/mobile/apps/locker/lib/services/files/download/file_url.dart@@ -0,0 +1,41 @@+import "package:locker/core/constants.dart";+import "package:locker/services/configuration.dart";++enum FileUrlType {+ download,+ publicDownload,+ thumbnail,+ publicThumbnail,+ directDownload,+}++class FileUrl {+ static String getUrl(int fileID, FileUrlType type) {+ final endpoint = Configuration.instance.getHttpEndpoint();+ final disableWorker = endpoint != kDefaultProductionEndpoint;++ switch (type) {+ case FileUrlType.directDownload:+ return "$endpoint/files/download/$fileID";+ case FileUrlType.download:+ return disableWorker+ ? "$endpoint/files/download/$fileID"+ : "https://files.ente.io/?fileID=$fileID";++ case FileUrlType.publicDownload:+ return disableWorker+ ? "$endpoint/public-collection/files/download/$fileID"+ : "https://public-albums.ente.io/download/?fileID=$fileID";++ case FileUrlType.thumbnail:+ return disableWorker+ ? "$endpoint/files/preview/$fileID"+ : "https://thumbnails.ente.io/?fileID=$fileID";++ case FileUrlType.publicThumbnail:+ return disableWorker+ ? "$endpoint/public-collection/files/preview/$fileID"+ : "https://public-albums.ente.io/preview/?fileID=$fileID";+ }+ }+}diff --git a/mobile/apps/locker/lib/services/files/download/manager.dart b/mobile/apps/locker/lib/services/files/download/manager.dartnew file mode 100644index 0000000000..2685f2e053--- /dev/null+++ b/mobile/apps/locker/lib/services/files/download/manager.dart@@ -0,0 +1,373 @@+import "dart:async";+import "dart:io";++import "package:dio/dio.dart";+import "package:locker/services/configuration.dart";+import "package:locker/services/files/download/file_url.dart";+import "package:locker/services/files/download/models/task.dart";+import "package:logging/logging.dart";++class DownloadManager {+ final _logger = Logger('DownloadManager');+ static const int downloadChunkSize = 40 * 1024 * 1024;++ final Dio _dio;++ // In-memory storage for download tasks+ final Map<int, DownloadTask> _tasks = {};++ // Active downloads with their completers and streams+ final Map<int, Completer<DownloadResult>> _completers = {};+ final Map<int, StreamController<DownloadTask>> _streams = {};+ final Map<int, CancelToken> _cancelTokens = {};++ DownloadManager(this._dio);++ /// Subscribe to download progress updates for a specific file ID+ Stream<DownloadTask> watchDownload(int fileId) {+ _streams[fileId] ??= StreamController<DownloadTask>.broadcast();+ return _streams[fileId]!.stream;+ }++ bool enableResumableDownload(int? size) {+ if (size == null) return false;+ //todo: Use FileUrlType.direct instead of FileUrlType.directDownload+ return size > downloadChunkSize;+ }++ /// Start download and return a Future that completes when download finishes+ /// If download was paused, calling this again will resume it+ Future<DownloadResult> download(+ int fileId,+ String filename,+ int totalBytes,+ ) async {+ // If already downloading, return existing future+ if (_completers.containsKey(fileId)) {+ return _completers[fileId]!.future;+ }++ final completer = Completer<DownloadResult>();+ _completers[fileId] = completer;++ // Get or create task+ final existingTask = _tasks[fileId];+ final task = existingTask ??+ DownloadTask(+ id: fileId,+ filename: filename,+ totalBytes: totalBytes,+ );++ // Store task in memory+ _tasks[fileId] = task;++ // Don't restart if already completed+ if (task.isCompleted) {+ // ensure that the file exists+ final filePath = task.filePath;+ if (filePath == null || !(await File(filePath).exists())) {+ // If the file doesn't exist, mark the task as error+ _logger.warning(+ 'File not found for ${task.filename} (${task.bytesDownloaded}/${task.totalBytes} bytes)',+ );+ final updatedTask = task.copyWith(+ status: DownloadStatus.error,+ error: 'File not found',+ filePath: null,+ );+ _updateTask(updatedTask);+ final result = DownloadResult(updatedTask, false);+ completer.complete(result);+ return result;+ } else {+ _logger.info(+ 'Download already completed for ${task.filename} (${task.bytesDownloaded}/${task.totalBytes} bytes)',+ );+ final result = DownloadResult(task, true);+ completer.complete(result);+ return result;+ }+ }+ unawaited(_startDownload(task, completer));+ return completer.future;+ }++ /// Pause download+ Future<void> pause(int fileId) async {+ final token = _cancelTokens[fileId];+ if (token != null && !token.isCancelled) {+ token.cancel('paused');+ }++ final task = _tasks[fileId];+ if (task != null && task.isActive) {+ _updateTask(task.copyWith(status: DownloadStatus.paused));+ }++ // Clean up streams if no listeners+ final stream = _streams[fileId];+ if (stream != null && !stream.hasListener) {+ await stream.close();+ _streams.remove(fileId);+ }+ }++ /// Cancel and delete download+ Future<void> cancel(int fileId) async {+ final token = _cancelTokens[fileId];+ if (token != null && !token.isCancelled) {+ token.cancel('cancelled');+ }++ final task = _tasks[fileId];+ if (task != null) {+ await _deleteFiles(task);+ _updateTask(task.copyWith(status: DownloadStatus.cancelled));+ _tasks.remove(fileId);+ }+ _cleanup(fileId);+ }++ /// Get current download status+ Future<DownloadTask?> getDownload(int fileId) async => _tasks[fileId];++ /// Get all downloads+ Future<List<DownloadTask>> getAllDownloads() async => _tasks.values.toList();++ Future<void> _startDownload(+ DownloadTask task,+ Completer<DownloadResult> completer,+ ) async {+ try {+ task = task.copyWith(status: DownloadStatus.downloading);+ _updateTask(task);++ final cancelToken = CancelToken();+ _cancelTokens[task.id] = cancelToken;++ final directory = Configuration.instance.getTempDirectory();+ final basePath = '$directory${task.id}.encrypted';++ // Check existing chunks and calculate progress+ final totalChunks = (task.totalBytes / downloadChunkSize).ceil();+ final existingChunks =+ await _validateExistingChunks(basePath, task.totalBytes, totalChunks);++ task = task.copyWith(+ bytesDownloaded: _calculateDownloadedBytes(+ existingChunks,+ task.totalBytes,+ totalChunks,+ ),+ );+ _updateTask(task);++ _logger.info(+ 'Resuming download for ${task.filename} (${task.bytesDownloaded}/${task.totalBytes} bytes)',+ );+ for (int i = 0; i < totalChunks; i++) {+ if (existingChunks[i] || cancelToken.isCancelled) continue;+ _logger.info('Downloading chunk ${i + 1} of $totalChunks');+ await _downloadChunk(task, basePath, i, totalChunks, cancelToken);+ existingChunks[i] = true;+ }++ if (!cancelToken.isCancelled) {+ final finalPath = await _combineChunks(basePath, totalChunks);+ task = task.copyWith(+ status: DownloadStatus.completed,+ filePath: finalPath,+ bytesDownloaded: task.totalBytes,+ );+ _updateTask(task);+ completer.complete(DownloadResult(task, true));+ }+ } catch (e) {+ if (e is DioException && e.type == DioExceptionType.cancel) {+ // Complete future with current task state (paused or cancelled)+ final currentTask = _tasks[task.id];+ if (currentTask != null && !completer.isCompleted) {+ completer.complete(DownloadResult(currentTask, false));+ }+ return;+ }++ task = task.copyWith(status: DownloadStatus.error, error: e.toString());+ _updateTask(task);+ if (!completer.isCompleted) {+ completer.complete(DownloadResult(task, false));+ }+ } finally {+ _cleanup(task.id);+ }+ }++ String _getChunkPath(String basePath, int part) {+ return '$basePath.${part}_part';+ }++ Future<List<bool>> _validateExistingChunks(+ String basePath,+ int totalBytes,+ int totalChunks,+ ) async {+ final existingChunks = List.filled(totalChunks, false);++ for (int i = 0; i < totalChunks; i++) {+ final chunkFile = File(_getChunkPath(basePath, i + 1));+ if (!await chunkFile.exists()) continue;++ final expectedSize = i == totalChunks - 1+ ? totalBytes - (i * downloadChunkSize)+ : downloadChunkSize;++ final actualSize = await chunkFile.length();+ if (actualSize == expectedSize) {+ _logger.info('existing chunk ${i + 1} is valid');+ existingChunks[i] = true;+ } else {+ _logger.warning(+ 'Chunk ${i + 1} is corrupted: expected $expectedSize bytes, '+ 'but got $actualSize bytes',+ );+ existingChunks[i] = false;+ await chunkFile.delete(); // Remove corrupted chunk+ }+ }++ return existingChunks;+ }++ int _calculateDownloadedBytes(+ List<bool> existingChunks,+ int totalBytes,+ int totalChunks,+ ) {+ int bytes = 0;+ for (int i = 0; i < existingChunks.length; i++) {+ if (existingChunks[i]) {+ bytes += i == totalChunks - 1+ ? totalBytes - (i * downloadChunkSize)+ : downloadChunkSize;+ }+ }+ return bytes;+ }++ Future<void> _downloadChunk(+ DownloadTask task,+ String basePath,+ int chunkIndex,+ int totalChunks,+ CancelToken cancelToken,+ ) async {+ final chunkPath = _getChunkPath(basePath, chunkIndex + 1);+ final startByte = chunkIndex * downloadChunkSize;+ final endByte = chunkIndex == totalChunks - 1+ ? task.totalBytes - 1+ : (startByte + downloadChunkSize) - 1;++ await _dio.download(+ FileUrl.getUrl(task.id, FileUrlType.directDownload),+ chunkPath,+ options: Options(+ headers: {+ "X-Auth-Token": Configuration.instance.getToken(),+ "Range": "bytes=$startByte-$endByte",+ },+ ),+ cancelToken: cancelToken,+ onReceiveProgress: (received, total) async {+ final updatedTask = task.copyWith(+ bytesDownloaded: (chunkIndex) * downloadChunkSize + received,+ );+ _notifyProgress(updatedTask);+ },+ );+ // Update progress after chunk completion+ final chunkFileSize = await File(chunkPath).length();+ task = task.copyWith(+ bytesDownloaded: (chunkIndex) * downloadChunkSize + chunkFileSize,+ );+ _updateTask(task);+ }++ Future<String> _combineChunks(String basePath, int totalChunks) async {+ final finalFile = File(basePath);+ final sink = finalFile.openWrite();+ try {+ for (int i = 1; i <= totalChunks; i++) {+ final chunkFile = File(_getChunkPath(basePath, i));+ final bytes = await chunkFile.readAsBytes();+ sink.add(bytes);+ await chunkFile.delete();+ }+ } finally {+ await sink.close();+ }+ return finalFile.path;+ }++ Future<void> _deleteFiles(DownloadTask task) async {+ try {+ final directory = Configuration.instance.getTempDirectory();+ final basePath = '$directory${task.id}.encrypted';+ final finalFile = File(basePath);+ if (await finalFile.exists()) await finalFile.delete();++ // Delete chunk files+ final totalChunks = (task.totalBytes / downloadChunkSize).ceil();+ for (int i = 1; i <= totalChunks; i++) {+ final chunkFile = File(_getChunkPath(basePath, i));+ if (await chunkFile.exists()) await chunkFile.delete();+ }+ } catch (e) {+ _logger.warning('Error deleting files: $e');+ }+ }++ void _updateTask(DownloadTask task) {+ _tasks[task.id] = task;+ _notifyProgress(task);+ }++ void _notifyProgress(DownloadTask task) {+ final stream = _streams[task.id];+ if (stream != null && !stream.isClosed) {+ stream.add(task);+ }+ }++ void _cleanup(int fileId) {+ _completers.remove(fileId);+ _cancelTokens.remove(fileId);++ final stream = _streams[fileId];+ if (stream != null && !stream.hasListener) {+ stream.close();+ _streams.remove(fileId);+ }+ }++ Future<void> dispose() async {+ for (final completer in _completers.values) {+ if (!completer.isCompleted) {+ completer.completeError('Disposed');+ }+ }+ _completers.clear();++ for (final token in _cancelTokens.values) {+ token.cancel('Disposed');+ }+ _cancelTokens.clear();++ for (final stream in _streams.values) {+ await stream.close();+ }+ _streams.clear();++ _tasks.clear();+ }+}diff --git a/mobile/apps/locker/lib/services/files/download/models/task.dart b/mobile/apps/locker/lib/services/files/download/models/task.dartnew file mode 100644index 0000000000..1bd96ca295--- /dev/null+++ b/mobile/apps/locker/lib/services/files/download/models/task.dart@@ -0,0 +1,80 @@+enum DownloadStatus {+ pending,+ downloading,+ paused,+ completed,+ error,+ cancelled+}++class DownloadTask {+ final int id;+ final String filename;+ final int totalBytes;+ int bytesDownloaded;+ DownloadStatus status;+ String? error;+ String? filePath;++ DownloadTask({+ required this.id,+ required this.filename,+ required this.totalBytes,+ this.bytesDownloaded = 0,+ this.status = DownloadStatus.pending,+ this.error,+ this.filePath,+ });++ double get progress => totalBytes > 0 ? bytesDownloaded / totalBytes : 0.0;+ bool get isCompleted => status == DownloadStatus.completed;+ bool get isActive => status == DownloadStatus.downloading;+ bool get isFinished => [+ DownloadStatus.completed,+ DownloadStatus.error,+ DownloadStatus.cancelled,+ ].contains(status);++ Map<String, dynamic> toMap() => {+ 'id': id,+ 'filename': filename,+ 'totalBytes': totalBytes,+ 'bytesDownloaded': bytesDownloaded,+ 'status': status.name,+ 'error': error,+ 'filePath': filePath,+ };++ static DownloadTask fromMap(Map<String, dynamic> map) => DownloadTask(+ id: map['id'],+ filename: map['filename'],+ totalBytes: map['totalBytes'],+ bytesDownloaded: map['bytesDownloaded'] ?? 0,+ status: DownloadStatus.values.byName(map['status']),+ error: map['error'],+ filePath: map['filePath'],+ );++ DownloadTask copyWith({+ int? bytesDownloaded,+ DownloadStatus? status,+ String? error,+ String? filePath,+ }) =>+ DownloadTask(+ id: id,+ filename: filename,+ totalBytes: totalBytes,+ bytesDownloaded: bytesDownloaded ?? this.bytesDownloaded,+ status: status ?? this.status,+ error: error ?? this.error,+ filePath: filePath ?? this.filePath,+ );+}++class DownloadResult {+ final DownloadTask task;+ final bool success;++ DownloadResult(this.task, this.success);+}diff --git a/mobile/apps/locker/lib/services/files/download/service_locator.dart b/mobile/apps/locker/lib/services/files/download/service_locator.dartnew file mode 100644index 0000000000..5de5f31b4e--- /dev/null+++ b/mobile/apps/locker/lib/services/files/download/service_locator.dart@@ -0,0 +1,36 @@+import 'package:dio/dio.dart';+import 'package:locker/services/files/download/manager.dart';+import 'package:package_info_plus/package_info_plus.dart';+import 'package:shared_preferences/shared_preferences.dart';++class ServiceLocator {+ late final SharedPreferences prefs;+ late final Dio enteDio;+ late final Dio nonEnteDio;+ late final PackageInfo packageInfo;++ // instance+ ServiceLocator._privateConstructor();++ static final ServiceLocator instance = ServiceLocator._privateConstructor();++ init(+ SharedPreferences prefs,+ Dio enteDio,+ Dio nonEnteDio,+ PackageInfo packageInfo,+ ) {+ this.prefs = prefs;+ this.enteDio = enteDio;+ this.nonEnteDio = nonEnteDio;+ this.packageInfo = packageInfo;+ }+}++DownloadManager? _downloadManager;+DownloadManager get downloadManager {+ _downloadManager ??= DownloadManager(+ ServiceLocator.instance.nonEnteDio,+ );+ return _downloadManager!;+}diff --git a/mobile/apps/locker/lib/services/files/links/links_client.dart b/mobile/apps/locker/lib/services/files/links/links_client.dartnew file mode 100644index 0000000000..ca7b6ec8c4--- /dev/null+++ b/mobile/apps/locker/lib/services/files/links/links_client.dart@@ -0,0 +1,39 @@+import "package:ente_network/network.dart";+import "package:locker/services/files/links/models/shareable_link.dart";+import "package:logging/logging.dart";++class LinksClient {+ LinksClient._();++ static final LinksClient instance = LinksClient._();++ final _logger = Logger("LinksClient");+ final _enteDio = Network.instance.enteDio;++ Future<void> init() async {}++ Future<ShareableLink> getOrCreateLink(int fileID) async {+ try {+ final response = await _enteDio.post(+ '/files/share-url',+ data: {+ 'fileID': fileID,+ 'app': 'locker',+ },+ );+ return ShareableLink.fromJson(response.data as Map<String, dynamic>);+ } catch (e, s) {+ _logger.severe('Failed to get or create link for file ID: $fileID', e, s);+ rethrow;+ }+ }++ Future<void> deleteLink(int linkID) async {+ try {+ await _enteDio.delete('/files/share-url/$linkID');+ } catch (e, s) {+ _logger.severe('Failed to delete link with ID: $linkID', e, s);+ rethrow;+ }+ }+}diff --git a/mobile/apps/locker/lib/services/files/links/links_service.dart b/mobile/apps/locker/lib/services/files/links/links_service.dartnew file mode 100644index 0000000000..9114e0c918--- /dev/null+++ b/mobile/apps/locker/lib/services/files/links/links_service.dart@@ -0,0 +1,29 @@+import "package:fast_base58/fast_base58.dart";+import "package:locker/services/collections/collections_service.dart";+import "package:locker/services/files/links/links_client.dart";+import "package:locker/services/files/links/models/shareable_link.dart";+import "package:locker/services/files/sync/models/file.dart";++class LinksService {+ LinksService._();++ static final LinksService instance = LinksService._();++ late final LinksClient _client;++ Future<void> init() async {+ _client = LinksClient.instance;+ }++ Future<ShareableLink> getOrCreateLink(EnteFile file) async {+ final link = await _client.getOrCreateLink(file.uploadedFileID!);+ link.fullURL = link.url ++ "#" ++ Base58Encode(await CollectionService.instance.getFileKey(file));+ return link;+ }++ Future<void> deleteLink(int fileID) async {+ await _client.deleteLink(fileID);+ }+}diff --git a/mobile/apps/locker/lib/services/files/links/models/shareable_link.dart b/mobile/apps/locker/lib/services/files/links/models/shareable_link.dartnew file mode 100644index 0000000000..9e71fdd401--- /dev/null+++ b/mobile/apps/locker/lib/services/files/links/models/shareable_link.dart@@ -0,0 +1,148 @@+class ShareableLink {+ final String linkID;+ final String url;+ final int ownerID;+ final int fileID;+ final int? validTill;+ final int? deviceLimit;+ final bool passwordEnabled;+ final String? nonce;+ final int? memLimit;+ final int? opsLimit;+ final bool enableDownload;+ final int createdAt;+ String? fullURL;++ ShareableLink({+ required this.linkID,+ required this.url,+ required this.ownerID,+ required this.fileID,+ this.validTill,+ this.deviceLimit,+ required this.passwordEnabled,+ this.nonce,+ this.memLimit,+ this.opsLimit,+ required this.enableDownload,+ required this.createdAt,+ });++ factory ShareableLink.fromJson(Map<String, dynamic> json) {+ return ShareableLink(+ linkID: json['linkID'] as String,+ url: json['url'] as String,+ ownerID: json['ownerID'] as int,+ fileID: json['fileID'] as int,+ validTill: json['validTill'] as int?,+ deviceLimit: json['deviceLimit'] as int?,+ passwordEnabled: json['passwordEnabled'] as bool,+ nonce: json['nonce'] as String?,+ memLimit: json['memLimit'] as int?,+ opsLimit: json['opsLimit'] as int?,+ enableDownload: json['enableDownload'] as bool,+ createdAt: json['createdAt'] as int,+ );+ }++ Map<String, dynamic> toJson() {+ return {+ 'linkID': linkID,+ 'url': url,+ 'ownerID': ownerID,+ 'fileID': fileID,+ if (validTill != null) 'validTill': validTill,+ if (deviceLimit != null) 'deviceLimit': deviceLimit,+ 'passwordEnabled': passwordEnabled,+ if (nonce != null) 'nonce': nonce,+ if (memLimit != null) 'memLimit': memLimit,+ if (opsLimit != null) 'opsLimit': opsLimit,+ 'enableDownload': enableDownload,+ 'createdAt': createdAt,+ };+ }++ @override+ bool operator ==(Object other) {+ if (identical(this, other)) return true;+ return other is ShareableLink &&+ other.linkID == linkID &&+ other.url == url &&+ other.ownerID == ownerID &&+ other.fileID == fileID &&+ other.validTill == validTill &&+ other.deviceLimit == deviceLimit &&+ other.passwordEnabled == passwordEnabled &&+ other.nonce == nonce &&+ other.memLimit == memLimit &&+ other.opsLimit == opsLimit &&+ other.enableDownload == enableDownload &&+ other.createdAt == createdAt;+ }++ @override+ int get hashCode {+ return Object.hash(+ linkID,+ url,+ ownerID,+ fileID,+ validTill,+ deviceLimit,+ passwordEnabled,+ nonce,+ memLimit,+ opsLimit,+ enableDownload,+ createdAt,+ );+ }++ @override+ String toString() {+ return 'FileUrl('+ 'linkID: $linkID, '+ 'url: $url, '+ 'ownerID: $ownerID, '+ 'fileID: $fileID, '+ 'validTill: $validTill, '+ 'deviceLimit: $deviceLimit, '+ 'passwordEnabled: $passwordEnabled, '+ 'nonce: $nonce, '+ 'memLimit: $memLimit, '+ 'opsLimit: $opsLimit, '+ 'enableDownload: $enableDownload, '+ 'createdAt: $createdAt'+ ')';+ }++ ShareableLink copyWith({+ String? linkID,+ String? url,+ int? ownerID,+ int? fileID,+ int? validTill,+ int? deviceLimit,+ bool? passwordEnabled,+ String? nonce,+ int? memLimit,+ int? opsLimit,+ bool? enableDownload,+ int? createdAt,+ }) {+ return ShareableLink(+ linkID: linkID ?? this.linkID,+ url: url ?? this.url,+ ownerID: ownerID ?? this.ownerID,+ fileID: fileID ?? this.fileID,+ validTill: validTill ?? this.validTill,+ deviceLimit: deviceLimit ?? this.deviceLimit,+ passwordEnabled: passwordEnabled ?? this.passwordEnabled,+ nonce: nonce ?? this.nonce,+ memLimit: memLimit ?? this.memLimit,+ opsLimit: opsLimit ?? this.opsLimit,+ enableDownload: enableDownload ?? this.enableDownload,+ createdAt: createdAt ?? this.createdAt,+ );+ }+}diff --git a/mobile/apps/locker/lib/services/files/sync/metadata_updater_service.dart b/mobile/apps/locker/lib/services/files/sync/metadata_updater_service.dartnew file mode 100644index 0000000000..c9bdc14fc5--- /dev/null+++ b/mobile/apps/locker/lib/services/files/sync/metadata_updater_service.dart@@ -0,0 +1,202 @@+import 'dart:convert';++import 'package:ente_crypto_dart/ente_crypto_dart.dart';+import 'package:ente_network/network.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/files/sync/models/file_magic.dart';+import 'package:logging/logging.dart';++class MetadataUpdaterService {+ MetadataUpdaterService._privateConstructor();++ static final MetadataUpdaterService instance =+ MetadataUpdaterService._privateConstructor();++ Future<void> init() async {}++ final _logger = Logger("MetadataUpdaterService");+ final _enteDio = Network.instance.enteDio;++ Future<bool> editFileCaption(EnteFile file, String caption) async {+ try {+ await _updatePublicMetadata([file], captionKey, caption);+ await CollectionService.instance.sync();+ return true;+ } catch (e) {+ return false;+ }+ }++ Future<bool> editFileNameAndCaption(+ EnteFile file,+ String name,+ String caption,+ ) async {+ try {+ final Map<String, dynamic> updates = {+ editNameKey: name,+ captionKey: caption,+ };+ await _updatePublicMetadataBulk([file], updates);+ await CollectionService.instance.sync();+ return true;+ } catch (e) {+ return false;+ }+ }++ Future<void> _updatePublicMetadata(+ List<EnteFile> files,+ String key,+ dynamic value,+ ) async {+ if (files.isEmpty) {+ return;+ }+ try {+ final Map<String, dynamic> update = {key: value};+ await _updatePublicMagicMetadata(files, update);+ } catch (e, s) {+ _logger.severe(+ "Failed to update public metadata for files: $files", e, s,);+ rethrow;+ }+ }++ Future<void> _updatePublicMetadataBulk(+ List<EnteFile> files,+ Map<String, dynamic> updates,+ ) async {+ if (files.isEmpty) {+ return;+ }+ try {+ await _updatePublicMagicMetadata(files, updates);+ } catch (e, s) {+ _logger.severe(+ "Failed to update public metadata for files: $files", e, s,);+ rethrow;+ }+ }++ Future<void> _updatePublicMagicMetadata(+ List<EnteFile> files,+ Map<String, dynamic>? newMetadataUpdate, {+ Map<int, Map<String, dynamic>>? metadataUpdateMap,+ }) async {+ final params = <String, dynamic>{};+ params['metadataList'] = [];+ final int ownerID = Configuration.instance.getUserID()!;+ try {+ for (final file in files) {+ if (file.uploadedFileID == null) {+ throw AssertionError(+ "operation is only supported on backed up files",+ );+ } else if (file.ownerID != ownerID) {+ throw AssertionError("cannot modify memories not owned by you");+ }+ // read the existing magic metadata and apply new updates to existing data+ // current update is simple replace. This will be enhanced in the future,+ // as required.+ final newUpdates = metadataUpdateMap != null+ ? metadataUpdateMap[file.uploadedFileID]+ : newMetadataUpdate;+ assert(+ newUpdates != null && newUpdates.isNotEmpty,+ "can not apply empty updates",+ );+ final Map<String, dynamic> jsonToUpdate =+ jsonDecode(file.pubMmdEncodedJson ?? '{}');+ newUpdates!.forEach((key, value) {+ jsonToUpdate[key] = value;+ });++ // update the local information so that it's reflected on UI+ file.pubMmdEncodedJson = jsonEncode(jsonToUpdate);+ file.pubMagicMetadata = PubMagicMetadata.fromJson(jsonToUpdate);++ final fileKey = await CollectionService.instance.getFileKey(file);++ final encryptedMMd = await CryptoUtil.encryptData(+ utf8.encode(jsonEncode(jsonToUpdate)),+ fileKey,+ );+ params['metadataList'].add(+ UpdateMagicMetadataRequest(+ id: file.uploadedFileID!,+ magicMetadata: MetadataRequest(+ version: file.pubMmdVersion,+ count: jsonToUpdate.length,+ data: CryptoUtil.bin2base64(encryptedMMd.encryptedData!),+ header: CryptoUtil.bin2base64(encryptedMMd.header!),+ ),+ ),+ );+ file.pubMmdVersion = file.pubMmdVersion + 1;+ }++ await _enteDio.put("/files/public-magic-metadata", data: params);+ } catch (e, s) {+ _logger.severe(e, s);+ rethrow;+ }+ }+}++class UpdateMagicMetadataRequest {+ final int id;+ final MetadataRequest? magicMetadata;++ UpdateMagicMetadataRequest({required this.id, required this.magicMetadata});++ factory UpdateMagicMetadataRequest.fromJson(dynamic json) {+ return UpdateMagicMetadataRequest(+ id: json['id'],+ magicMetadata: json['magicMetadata'] != null+ ? MetadataRequest.fromJson(json['magicMetadata'])+ : null,+ );+ }++ Map<String, dynamic> toJson() {+ final map = <String, dynamic>{};+ map['id'] = id;+ if (magicMetadata != null) {+ map['magicMetadata'] = magicMetadata!.toJson();+ }+ return map;+ }+}++class MetadataRequest {+ int? version;+ int? count;+ String? data;+ String? header;++ MetadataRequest({+ required this.version,+ required this.count,+ required this.data,+ required this.header,+ });++ MetadataRequest.fromJson(dynamic json) {+ version = json['version'];+ count = json['count'];+ data = json['data'];+ header = json['header'];+ }++ Map<String, dynamic> toJson() {+ final map = <String, dynamic>{};+ map['version'] = version;+ map['count'] = count;+ map['data'] = data;+ map['header'] = header;+ return map;+ }+}diff --git a/mobile/apps/locker/lib/services/files/sync/models/common_keys.dart b/mobile/apps/locker/lib/services/files/sync/models/common_keys.dartnew file mode 100644index 0000000000..1156623e8a--- /dev/null+++ b/mobile/apps/locker/lib/services/files/sync/models/common_keys.dart@@ -0,0 +1,8 @@+const magicKeyVisibility = 'visibility';++// Visibility Constants+const visibleVisibility = 0;+const archiveVisibility = 1;++///Do not use [hiddenVisibility] for hidden files+const hiddenVisibility = 2;diff --git a/mobile/apps/locker/lib/services/files/sync/models/file.dart b/mobile/apps/locker/lib/services/files/sync/models/file.dartnew file mode 100644index 0000000000..50046746e3--- /dev/null+++ b/mobile/apps/locker/lib/services/files/sync/models/file.dart@@ -0,0 +1,123 @@+import 'dart:io';++import 'package:flutter/foundation.dart';+import 'package:locker/services/files/download/file_url.dart';+import 'package:locker/services/files/sync/models/file_magic.dart';+import 'package:logging/logging.dart';++class EnteFile {+ String? localPath;+ int? uploadedFileID;+ int? ownerID;+ int? collectionID;+ String? title;+ int? creationTime;+ int? modificationTime;+ int? updationTime;+ int? addedTime;+ String? hash;+ int? metadataVersion;+ String? encryptedKey;+ String? keyDecryptionNonce;+ String? fileDecryptionHeader;+ String? thumbnailDecryptionHeader;+ String? metadataDecryptionHeader;+ int? fileSize;++ String? mMdEncodedJson;+ int mMdVersion = 0;+ MagicMetadata? _mmd;++ MagicMetadata get magicMetadata =>+ _mmd ?? MagicMetadata.fromEncodedJson(mMdEncodedJson ?? '{}');++ set magicMetadata(val) => _mmd = val;++ String? pubMmdEncodedJson;+ int pubMmdVersion = 1;+ PubMagicMetadata? _pubMmd;++ PubMagicMetadata get pubMagicMetadata =>+ _pubMmd ?? PubMagicMetadata.fromEncodedJson(pubMmdEncodedJson ?? '{}');++ set pubMagicMetadata(val) => _pubMmd = val;++ static const kCurrentMetadataVersion = 2;++ static final _logger = Logger('File');++ EnteFile();++ static EnteFile fromFile(File file) {+ final enteFile = EnteFile();+ enteFile.localPath = file.path;+ enteFile.title = file.path.split('/').last;+ enteFile.creationTime = file.statSync().changed.millisecondsSinceEpoch;+ enteFile.modificationTime = file.statSync().modified.millisecondsSinceEpoch;+ return enteFile;+ }++ Map<String, dynamic> get metadata {+ final metadata = <String, dynamic>{};+ metadata["title"] = title;+ metadata["localPath"] = localPath;+ metadata["creationTime"] = creationTime;+ metadata["modificationTime"] = modificationTime;+ if (hash != null) {+ metadata["hash"] = hash;+ }+ if (metadataVersion != null) {+ metadata["version"] = metadataVersion;+ }+ return metadata;+ }++ String get downloadUrl =>+ FileUrl.getUrl(uploadedFileID!, FileUrlType.download);++ String? get caption {+ return pubMagicMetadata.caption;+ }++ String? debugCaption;++ String get displayName {+ if (pubMagicMetadata.editedName != null) {+ return pubMagicMetadata.editedName!;+ }+ if (title == null && kDebugMode) _logger.severe('File title is null');+ return title ?? '';+ }++ bool get isUploaded {+ return uploadedFileID != null;+ }++ void applyMetadata(Map<String, dynamic> metadata) {+ title = metadata["title"];+ localPath = metadata["localPath"];+ creationTime = metadata["creationTime"] ?? 0;+ modificationTime = metadata["modificationTime"] ?? creationTime;+ hash = metadata["hash"];+ metadataVersion = metadata["version"] ?? 0;+ }++ @override+ String toString() {+ return '''File(title: $title, uploadedFileId: $uploadedFileID,+ modificationTime: $modificationTime, ownerID: $ownerID,+ collectionID: $collectionID, updationTime: $updationTime)''';+ }++ @override+ bool operator ==(Object o) {+ if (identical(this, o)) return true;++ return o is EnteFile && o.uploadedFileID == uploadedFileID;+ }++ @override+ int get hashCode {+ return uploadedFileID.hashCode;+ }+}diff --git a/mobile/apps/locker/lib/services/files/sync/models/file_magic.dart b/mobile/apps/locker/lib/services/files/sync/models/file_magic.dartnew file mode 100644index 0000000000..f99f1e8e4f--- /dev/null+++ b/mobile/apps/locker/lib/services/files/sync/models/file_magic.dart@@ -0,0 +1,127 @@+import "dart:convert";++import "package:flutter/cupertino.dart";+import "package:locker/services/files/sync/models/common_keys.dart";++const editTimeKey = 'editedTime';+const editNameKey = 'editedName';+const captionKey = "caption";+const uploaderNameKey = "uploaderName";+const widthKey = 'w';+const heightKey = 'h';+const streamVersionKey = 'sv';+const mediaTypeKey = 'mediaType';+const latKey = "lat";+const longKey = "long";+const motionVideoIndexKey = "mvi";+const noThumbKey = "noThumb";+const dateTimeKey = 'dateTime';+const offsetTimeKey = 'offsetTime';++class MagicMetadata {+ // 0 -> visible+ // 1 -> archived+ // 2 -> hidden etc?+ int visibility;++ MagicMetadata({required this.visibility});++ factory MagicMetadata.fromEncodedJson(String encodedJson) =>+ MagicMetadata.fromJson(jsonDecode(encodedJson));++ factory MagicMetadata.fromJson(dynamic json) => MagicMetadata.fromMap(json);++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ return MagicMetadata(+ visibility: map[magicKeyVisibility] ?? visibleVisibility,+ );+ }+}++class PubMagicMetadata {+ int? editedTime;+ String? editedName;+ String? caption;+ String? uploaderName;+ int? w;+ int? h;+ double? lat;+ double? long;++ // Indicates streaming version of the file.+ // If this is set, then the file is a streaming version of the original file.+ int? sv;++ // ISO 8601 datetime without timezone. This contains the date and time of the photo in the original tz+ // where the photo was taken.+ String? dateTime;+ String? offsetTime;++ // Motion Video Index. Positive value (>0) indicates that the file is a motion+ // photo+ int? mvi;++ // if true, then the thumbnail is not available+ // Note: desktop/web sets hasStaticThumbnail in the file metadata.+ // As we don't want to support updating the og file metadata (yet), adding+ // this new field to the pub metadata. For static thumbnail, all thumbnails+ // should have exact same hash with should match the constant `blackThumbnailBase64`+ bool? noThumb;++ // null -> not computed+ // 0 -> normal+ // 1 -> panorama+ int? mediaType;++ PubMagicMetadata({+ this.editedTime,+ this.editedName,+ this.caption,+ this.uploaderName,+ this.w,+ this.h,+ this.lat,+ this.long,+ this.mvi,+ this.noThumb,+ this.mediaType,+ this.dateTime,+ this.offsetTime,+ this.sv,+ });++ factory PubMagicMetadata.fromEncodedJson(String encodedJson) =>+ PubMagicMetadata.fromJson(jsonDecode(encodedJson));++ factory PubMagicMetadata.fromJson(dynamic json) =>+ PubMagicMetadata.fromMap(json);++ static fromMap(Map<String, dynamic>? map) {+ if (map == null) return null;+ return PubMagicMetadata(+ editedTime: map[editTimeKey],+ editedName: map[editNameKey],+ caption: map[captionKey],+ uploaderName: map[uploaderNameKey],+ w: safeParseInt(map[widthKey], widthKey),+ h: safeParseInt(map[heightKey], heightKey),+ lat: map[latKey],+ long: map[longKey],+ mvi: map[motionVideoIndexKey],+ noThumb: map[noThumbKey],+ mediaType: map[mediaTypeKey],+ dateTime: map[dateTimeKey],+ offsetTime: map[offsetTimeKey],+ sv: safeParseInt(map[streamVersionKey], streamVersionKey),+ );+ }++ static int? safeParseInt(dynamic value, String key) {+ if (value == null) return null;+ if (value is int) return value;+ debugPrint("PubMagicMetadata key: $key Unexpected value: $value");+ if (value is String) return int.tryParse(value);+ return null;+ }+}diff --git a/mobile/apps/locker/lib/services/files/sync/models/metadata_request.dart b/mobile/apps/locker/lib/services/files/sync/models/metadata_request.dartnew file mode 100644index 0000000000..de0589e1ed--- /dev/null+++ b/mobile/apps/locker/lib/services/files/sync/models/metadata_request.dart@@ -0,0 +1,29 @@+class MetadataRequest {+ int? version;+ int? count;+ String? data;+ String? header;++ MetadataRequest({+ required this.version,+ required this.count,+ required this.data,+ required this.header,+ });++ MetadataRequest.fromJson(dynamic json) {+ version = json['version'];+ count = json['count'];+ data = json['data'];+ header = json['header'];+ }++ Map<String, dynamic> toJson() {+ final map = <String, dynamic>{};+ map['version'] = version;+ map['count'] = count;+ map['data'] = data;+ map['header'] = header;+ return map;+ }+}diff --git a/mobile/apps/locker/lib/services/files/upload/file_upload_service.dart b/mobile/apps/locker/lib/services/files/upload/file_upload_service.dartnew file mode 100644index 0000000000..f56b4611cd--- /dev/null+++ b/mobile/apps/locker/lib/services/files/upload/file_upload_service.dart@@ -0,0 +1,684 @@+import 'dart:async';+import 'dart:collection';+import 'dart:convert';+import 'dart:io';+import 'dart:math' as math;++import 'package:collection/collection.dart';+import 'package:dio/dio.dart';+import 'package:ente_accounts/services/user_service.dart';+import 'package:ente_crypto_dart/ente_crypto_dart.dart';+import 'package:ente_events/event_bus.dart';+import 'package:ente_network/network.dart';+import 'package:flutter/foundation.dart';+import 'package:locker/core/constants.dart';+import 'package:locker/core/errors.dart';+import 'package:locker/events/backup_updated_event.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/configuration.dart';+import "package:locker/services/files/sync/metadata_updater_service.dart";+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/files/sync/models/file_magic.dart';+import 'package:locker/services/files/upload/models/backup_item.dart';+import 'package:locker/services/files/upload/models/backup_item_status.dart';+import 'package:locker/services/files/upload/models/upload_url.dart';+import "package:locker/utils/crypto_helper.dart";+import 'package:locker/utils/data_util.dart';+import 'package:logging/logging.dart';+import "package:path/path.dart";+import 'package:shared_preferences/shared_preferences.dart';+import "package:uuid/uuid.dart";++class FileUploader {+ static const kMaximumConcurrentUploads = 4;+ static const kMaximumConcurrentVideoUploads = 2;+ static const kMaximumThumbnailCompressionAttempts = 2;+ static const kMaximumUploadAttempts = 4;+ static const kMaxFileSize5Gib = 5368709120;+ static const kBlockedUploadsPollFrequency = Duration(seconds: 2);+ static const kFileUploadTimeout = Duration(minutes: 50);+ static const k20MBStorageBuffer = 20 * 1024 * 1024;+ static const _lastStaleFileCleanupTime = "lastStaleFileCleanupTime";++ final _logger = Logger("FileUploader");+ final _dio = Network.instance.getDio();+ final _enteDio = Network.instance.enteDio;+ final LinkedHashMap<String, FileUploadItem> _queue =+ LinkedHashMap<String, FileUploadItem>();+ final LinkedHashMap<String, BackupItem> _allBackups =+ LinkedHashMap<String, BackupItem>();+ final kSafeBufferForLockExpiry = const Duration(hours: 4).inMicroseconds;+ final kBGTaskDeathTimeout = const Duration(seconds: 5).inMicroseconds;+ final _uploadURLs = Queue<UploadURL>();++ LinkedHashMap<String, BackupItem> get allBackups => _allBackups;++ // Maintains the count of files in the current upload session.+ // Upload session is the period between the first entry into the _queue and last entry out of the _queue+ int _totalCountInUploadSession = 0;++ // _uploadCounter indicates number of uploads which are currently in progress+ int _uploadCounter = 0;+ late SharedPreferences _prefs;++ // _hasInitiatedForceUpload is used to track if user attempted force upload+ // where files are uploaded directly (without adding them to DB). In such+ // cases, we don't want to clear the stale upload files. See #removeStaleFiles+ // as it can result in clearing files which are still being force uploaded.+ final bool _hasInitiatedForceUpload = false;++ FileUploader._privateConstructor();++ static FileUploader instance = FileUploader._privateConstructor();++ Future<void> init(SharedPreferences preferences, bool isBackground) async {+ _prefs = preferences;+ final currentTime = DateTime.now().microsecondsSinceEpoch;+ if (currentTime - (_prefs.getInt(_lastStaleFileCleanupTime) ?? 0) >+ tempDirCleanUpInterval) {+ await removeStaleFiles();+ await _prefs.setInt(_lastStaleFileCleanupTime, currentTime);+ }+ }++ Future<EnteFile> upload(File file, Collection collection) {+ _totalCountInUploadSession++;+ final String path = file.path;+ final completer = Completer<EnteFile>();+ _queue[path] = FileUploadItem(file, collection, completer);+ _allBackups[path] = BackupItem(+ status: BackupItemStatus.inQueue,+ file: file,+ collection: collection,+ completer: completer,+ );+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ _pollQueue();+ return completer.future;+ }++ int getCurrentSessionUploadCount() {+ return _totalCountInUploadSession;+ }++ void clearQueue(final Error reason) {+ final List<String> uploadsToBeRemoved = [];+ _queue.entries+ .where((entry) => entry.value.status == UploadStatus.notStarted)+ .forEach((pendingUpload) {+ uploadsToBeRemoved.add(pendingUpload.key);+ });+ for (final id in uploadsToBeRemoved) {+ _queue.remove(id)?.completer.completeError(reason);+ _allBackups[id] = _allBackups[id]!.copyWith(+ status: BackupItemStatus.retry,+ error: reason,+ );+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ }+ _totalCountInUploadSession = 0;+ }++ void clearCachedUploadURLs() {+ _uploadURLs.clear();+ }++ void removeFromQueueWhere(+ final bool Function(File) fn,+ final Error reason,+ ) {+ final List<String> uploadsToBeRemoved = [];+ _queue.entries+ .where((entry) => entry.value.status == UploadStatus.notStarted)+ .forEach((pendingUpload) {+ if (fn(pendingUpload.value.file)) {+ uploadsToBeRemoved.add(pendingUpload.key);+ }+ });+ for (final id in uploadsToBeRemoved) {+ _queue.remove(id)?.completer.completeError(reason);+ _allBackups[id] = _allBackups[id]!+ .copyWith(status: BackupItemStatus.retry, error: reason);+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ }+ _logger.info(+ 'number of enteries removed from queue ${uploadsToBeRemoved.length}',+ );+ _totalCountInUploadSession -= uploadsToBeRemoved.length;+ }++ void _pollQueue() {+ if (_queue.isEmpty) {+ // Upload session completed+ _totalCountInUploadSession = 0;+ return;+ }+ if (_uploadCounter < kMaximumConcurrentUploads) {+ final pendingEntry = _queue.entries+ .firstWhereOrNull(+ (entry) => entry.value.status == UploadStatus.notStarted,+ )+ ?.value;+ if (pendingEntry != null) {+ pendingEntry.status = UploadStatus.inProgress;+ _allBackups[pendingEntry.file.path] =+ _allBackups[pendingEntry.file.path]!+ .copyWith(status: BackupItemStatus.uploading);+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ _encryptAndUploadFileToCollection(+ pendingEntry.file,+ pendingEntry.collection,+ );+ }+ }+ }++ Future<EnteFile?> _encryptAndUploadFileToCollection(+ File file,+ Collection collection, {+ bool forcedUpload = false,+ }) async {+ _uploadCounter++;+ final path = file.path;+ try {+ final uploadedFile =+ await _tryToUpload(file, collection, forcedUpload).timeout(+ kFileUploadTimeout,+ onTimeout: () {+ final message = "Upload timed out for file $file";+ _logger.warning(message);+ throw TimeoutException(message);+ },+ );+ _queue.remove(path)!.completer.complete(uploadedFile);+ _allBackups[path] =+ _allBackups[path]!.copyWith(status: BackupItemStatus.uploaded);+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ return uploadedFile;+ } catch (e) {+ _queue.remove(path)!.completer.completeError(e);+ _allBackups[path] =+ _allBackups[path]!.copyWith(status: BackupItemStatus.retry, error: e);+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ return null;+ } finally {+ _uploadCounter--;+ _pollQueue();+ }+ }++ Future<void> removeStaleFiles() async {+ if (_hasInitiatedForceUpload) {+ _logger.info(+ "Force upload was initiated, skipping stale file cleanup",+ );+ return;+ }+ try {+ final String dir = Configuration.instance.getTempDirectory();+ // delete all files in the temp directory that start with upload_ and+ // ends with .encrypted. Fetch files in async manner+ final files = await Directory(dir).list().toList();+ final filesToDelete = files.where((file) {+ return file.path.contains(uploadTempFilePrefix) &&+ file.path.contains(".encrypted");+ });+ if (filesToDelete.isNotEmpty) {+ _logger.info('Deleting ${filesToDelete.length} stale upload files ');+ for (final file in filesToDelete) {+ await file.delete();+ }+ }+ } catch (e, s) {+ _logger.severe("Failed to remove stale files", e, s);+ }+ }++ Future<EnteFile> _tryToUpload(+ File file,+ Collection collection,+ bool forcedUpload,+ ) async {+ if (_allBackups[file.path] != null &&+ _allBackups[file.path]!.status != BackupItemStatus.uploading) {+ _allBackups[file.path] = _allBackups[file.path]!.copyWith(+ status: BackupItemStatus.uploading,+ );+ Bus.instance.fire(BackupUpdatedEvent(_allBackups));+ }++ final tempDirectory = Configuration.instance.getTempDirectory();+ final String uniqueID =+ '${const Uuid().v4().toString()}_${file.path.split('/').last}';++ final encryptedFilePath =+ '$tempDirectory$uploadTempFilePrefix${uniqueID}_file.encrypted';+ final encryptedThumbnailPath =+ '$tempDirectory$uploadTempFilePrefix${uniqueID}_thumb.encrypted';+ late final int encFileSize;++ var uploadCompleted = false;+ // This flag is used to decide whether to clear the iOS origin file cache+ // or not.+ var uploadHardFailure = false;+ try {+ _logger.info(+ 'starting ${forcedUpload ? 'forced' : ''} '+ 'upload of ${file.toString()}',+ );++ Uint8List? key;+ final encryptedFileExists = File(encryptedFilePath).existsSync();++ if (encryptedFileExists) {+ // otherwise just delete the file for singlepart upload+ await File(encryptedFilePath).delete();+ }+ await _checkIfWithinStorageLimit(file);+ final encryptedFile = File(encryptedFilePath);++ final fileAttributes = await CryptoUtil.encryptFile(+ file.path,+ encryptedFilePath,+ key: key,+ );+ encFileSize = await encryptedFile.length();++ final thumbnailData = base64Decode(blackThumbnailBase64);+ final encryptedThumbnailData = await CryptoUtil.encryptData(+ thumbnailData,+ fileAttributes.key!,+ );+ if (File(encryptedThumbnailPath).existsSync()) {+ await File(encryptedThumbnailPath).delete();+ }+ final encryptedThumbnailFile = File(encryptedThumbnailPath);+ await encryptedThumbnailFile+ .writeAsBytes(encryptedThumbnailData.encryptedData!);+ final encThumbSize = await encryptedThumbnailFile.length();++ final thumbnailUploadURL = await _getUploadURL();+ final thumbnailObjectKey = await _putFile(+ thumbnailUploadURL,+ encryptedThumbnailFile,+ encThumbSize,+ );++ final fileUploadURL = await _getUploadURL();+ final fileObjectKey =+ await _putFile(fileUploadURL, encryptedFile, encFileSize);++ final enteFile = EnteFile.fromFile(file);++ final encryptedMetadataResult = await CryptoUtil.encryptData(+ utf8.encode(jsonEncode(enteFile.metadata)),+ fileAttributes.key!,+ );+ final fileDecryptionHeader =+ CryptoUtil.bin2base64(fileAttributes.header!);+ final thumbnailDecryptionHeader =+ CryptoUtil.bin2base64(encryptedThumbnailData.header!);+ final encryptedMetadata = CryptoUtil.bin2base64(+ encryptedMetadataResult.encryptedData!,+ );+ final metadataDecryptionHeader =+ CryptoUtil.bin2base64(encryptedMetadataResult.header!);+ final encryptedFileKeyData = CryptoUtil.encryptSync(+ fileAttributes.key!,+ CryptoHelper.instance.getCollectionKey(collection),+ );+ final encryptedKey =+ CryptoUtil.bin2base64(encryptedFileKeyData.encryptedData!);+ final keyDecryptionNonce =+ CryptoUtil.bin2base64(encryptedFileKeyData.nonce!);+ final Map<String, dynamic> pubMetadata = {};+ pubMetadata["noThumb"] = true;+ MetadataRequest? pubMetadataRequest;+ if (pubMetadata.isNotEmpty) {+ pubMetadataRequest = await getPubMetadataRequest(+ enteFile,+ pubMetadata,+ fileAttributes.key!,+ );+ }+ final remoteFile = await _uploadFile(+ enteFile,+ collection.id,+ encryptedKey,+ keyDecryptionNonce,+ fileObjectKey,+ fileDecryptionHeader,+ encFileSize,+ thumbnailObjectKey,+ thumbnailDecryptionHeader,+ encThumbSize,+ encryptedMetadata,+ metadataDecryptionHeader,+ pubMetadata: pubMetadataRequest,+ );+ _logger.info("File upload complete for $remoteFile");+ uploadCompleted = true;+ return remoteFile;+ } catch (e, s) {+ if (!(e is NoActiveSubscriptionError ||+ e is StorageLimitExceededError ||+ e is WiFiUnavailableError ||+ e is SilentlyCancelUploadsError ||+ e is InvalidFileError ||+ e is FileTooLargeForPlanError)) {+ _logger.severe("File upload failed for $file", e, s);+ }+ if (e is InvalidFileError) {+ _logger.severe("File upload ignored for $file", e);+ }+ if ((e is StorageLimitExceededError ||+ e is FileTooLargeForPlanError ||+ e is NoActiveSubscriptionError)) {+ // file upload can not be retried in such cases without user intervention+ uploadHardFailure = true;+ }+ rethrow;+ } finally {+ await _onUploadDone(+ file,+ uploadCompleted,+ uploadHardFailure,+ encryptedFilePath,+ encryptedThumbnailPath,+ );+ }+ }++ Future<MetadataRequest> getPubMetadataRequest(+ EnteFile file,+ Map<String, dynamic> newData,+ Uint8List fileKey,+ ) async {+ final Map<String, dynamic> jsonToUpdate =+ jsonDecode(file.pubMmdEncodedJson ?? '{}');+ newData.forEach((key, value) {+ jsonToUpdate[key] = value;+ });++ // update the local information so that it's reflected on UI+ file.pubMmdEncodedJson = jsonEncode(jsonToUpdate);+ file.pubMagicMetadata = PubMagicMetadata.fromJson(jsonToUpdate);+ final encryptedMMd = await CryptoUtil.encryptData(+ utf8.encode(jsonEncode(jsonToUpdate)),+ fileKey,+ );+ return MetadataRequest(+ version: file.pubMmdVersion == 0 ? 1 : file.pubMmdVersion,+ count: jsonToUpdate.length,+ data: CryptoUtil.bin2base64(encryptedMMd.encryptedData!),+ header: CryptoUtil.bin2base64(encryptedMMd.header!),+ );+ }++ Future<void> _onUploadDone(+ File sourceFile,+ bool uploadCompleted,+ bool uploadHardFailure,+ String encryptedFilePath,+ String encryptedThumbnailPath,+ ) async {+ // Note: Consider removing source file if upload has completed / failed+ if (File(encryptedFilePath).existsSync()) {+ await File(encryptedFilePath).delete();+ }+ if (File(encryptedThumbnailPath).existsSync()) {+ await File(encryptedThumbnailPath).delete();+ }+ }++ /*+ _checkIfWithinStorageLimit verifies if the file size for encryption and upload+ is within the storage limit. It throws StorageLimitExceededError if the limit+ is exceeded. This check is best effort and may not be completely accurate+ due to UserDetail cache. It prevents infinite loops when clients attempt to+ upload files that exceed the server's storage limit + buffer.+ Note: Local storageBuffer is 20MB, server storageBuffer is 50MB, and an+ additional 30MB is reserved for thumbnails and encryption overhead.+ */+ Future<void> _checkIfWithinStorageLimit(File fileToBeUploaded) async {+ try {+ final userDetails = UserService.instance.getCachedUserDetails();+ if (userDetails == null) {+ return;+ }+ // add k20MBStorageBuffer to the free storage+ final num freeStorage = userDetails.getFreeStorage() + k20MBStorageBuffer;+ final num fileSize = await fileToBeUploaded.length();+ if (fileSize > freeStorage) {+ _logger.warning('Storage limit exceeded fileSize $fileSize and '+ 'freeStorage $freeStorage');+ throw StorageLimitExceededError();+ }+ if (fileSize > kMaxFileSize5Gib) {+ _logger.warning('File size exceeds 5GiB fileSize $fileSize');+ throw InvalidFileError(+ 'file size above 5GiB',+ InvalidReason.tooLargeFile,+ );+ }+ } catch (e) {+ if (e is StorageLimitExceededError || e is InvalidFileError) {+ rethrow;+ } else {+ _logger.severe('Error checking storage limit', e);+ }+ }+ }++ Future<EnteFile> _uploadFile(+ EnteFile file,+ int collectionID,+ String encryptedKey,+ String keyDecryptionNonce,+ String fileObjectKey,+ String fileDecryptionHeader,+ int fileSize,+ String thumbnailObjectKey,+ String thumbnailDecryptionHeader,+ int thumbnailSize,+ String encryptedMetadata,+ String metadataDecryptionHeader, {+ MetadataRequest? pubMetadata,+ int attempt = 1,+ }) async {+ final request = {+ "collectionID": collectionID,+ "encryptedKey": encryptedKey,+ "keyDecryptionNonce": keyDecryptionNonce,+ "file": {+ "objectKey": fileObjectKey,+ "decryptionHeader": fileDecryptionHeader,+ "size": fileSize,+ },+ "thumbnail": {+ "objectKey": thumbnailObjectKey,+ "decryptionHeader": thumbnailDecryptionHeader,+ "size": thumbnailSize,+ },+ "metadata": {+ "encryptedData": encryptedMetadata,+ "decryptionHeader": metadataDecryptionHeader,+ },+ };+ if (pubMetadata != null) {+ request["pubMagicMetadata"] = pubMetadata;+ }+ try {+ final response = await _enteDio.post("/files", data: request);+ final data = response.data;+ file.uploadedFileID = data["id"];+ file.collectionID = collectionID;+ file.updationTime = data["updationTime"];+ file.ownerID = data["ownerID"];+ file.encryptedKey = encryptedKey;+ file.keyDecryptionNonce = keyDecryptionNonce;+ file.thumbnailDecryptionHeader = thumbnailDecryptionHeader;+ file.fileDecryptionHeader = fileDecryptionHeader;+ file.metadataDecryptionHeader = metadataDecryptionHeader;+ return file;+ } on DioException catch (e) {+ final int statusCode = e.response?.statusCode ?? -1;+ if (statusCode == 413) {+ throw FileTooLargeForPlanError();+ } else if (statusCode == 426) {+ _onStorageLimitExceeded();+ } else if (attempt < kMaximumUploadAttempts && statusCode == -1) {+ // retry when DioException contains no response/status code+ _logger.info(+ "Upload file (${file.displayName}) failed, will retry in 3 seconds",+ );+ await Future.delayed(const Duration(seconds: 3));+ return _uploadFile(+ file,+ collectionID,+ encryptedKey,+ keyDecryptionNonce,+ fileObjectKey,+ fileDecryptionHeader,+ fileSize,+ thumbnailObjectKey,+ thumbnailDecryptionHeader,+ thumbnailSize,+ encryptedMetadata,+ metadataDecryptionHeader,+ attempt: attempt + 1,+ pubMetadata: pubMetadata,+ );+ } else {+ _logger.severe("Failed to upload file ${file.displayName}", e);+ }+ rethrow;+ }+ }++ Future<UploadURL> _getUploadURL() async {+ if (_uploadURLs.isEmpty) {+ // the queue is empty, fetch at least for one file to handle force uploads+ // that are not in the queue. This is to also avoid+ await fetchUploadURLs(math.max(_queue.length, 1));+ }+ try {+ return _uploadURLs.removeFirst();+ } catch (e) {+ if (e is StateError && e.message == 'No element' && _queue.isEmpty) {+ _logger.warning("Oops, uploadUrls has no element now, fetching again");+ return _getUploadURL();+ } else {+ rethrow;+ }+ }+ }++ Future<void>? _uploadURLFetchInProgress;++ Future<void> fetchUploadURLs(int fileCount) async {+ _uploadURLFetchInProgress ??= Future<void>(() async {+ try {+ final response = await _enteDio.get(+ "/files/upload-urls",+ queryParameters: {+ "count": math.min(42, fileCount * 2), // m4gic number+ },+ );+ final urls = (response.data["urls"] as List)+ .map((e) => UploadURL.fromMap(e))+ .toList();+ _uploadURLs.addAll(urls);+ } on DioException catch (e, s) {+ if (e.response != null) {+ if (e.response!.statusCode == 402) {+ final error = NoActiveSubscriptionError();+ clearQueue(error);+ throw error;+ } else if (e.response!.statusCode == 426) {+ final error = StorageLimitExceededError();+ clearQueue(error);+ throw error;+ } else {+ _logger.warning("Could not fetch upload URLs", e, s);+ }+ }+ rethrow;+ } finally {+ _uploadURLFetchInProgress = null;+ }+ });+ return _uploadURLFetchInProgress;+ }++ void _onStorageLimitExceeded() {+ clearQueue(StorageLimitExceededError());+ throw StorageLimitExceededError();+ }++ Future<String> _putFile(+ UploadURL uploadURL,+ File file,+ int fileSize, {+ int attempt = 1,+ }) async {+ final startTime = DateTime.now().millisecondsSinceEpoch;+ final fileName = basename(file.path);+ try {+ await _dio.put(+ uploadURL.url,+ data: file.openRead(),+ options: Options(+ headers: {+ Headers.contentLengthHeader: fileSize,+ },+ ),+ );+ _logger.info(+ "Uploaded object $fileName of size: ${formatBytes(fileSize)} at speed: ${(fileSize / (DateTime.now().millisecondsSinceEpoch - startTime)).toStringAsFixed(2)} KB/s",+ );++ return uploadURL.objectKey;+ } on DioException catch (e) {+ if (e.message?.startsWith("HttpException: Content size") ?? false) {+ rethrow;+ } else if (attempt < kMaximumUploadAttempts) {+ _logger.info("Upload failed for $fileName, retrying");+ final newUploadURL = await _getUploadURL();+ return _putFile(+ newUploadURL,+ file,+ fileSize,+ attempt: attempt + 1,+ );+ } else {+ _logger.info(+ "Failed to upload file ${basename(file.path)} after $attempt attempts",+ e,+ );+ rethrow;+ }+ }+ }+}++class FileUploadItem {+ final File file;+ final Collection collection;+ final Completer<EnteFile> completer;+ UploadStatus status;++ FileUploadItem(+ this.file,+ this.collection,+ this.completer, {+ this.status = UploadStatus.notStarted,+ });+}++enum UploadStatus { notStarted, inProgress, inBackground, completed }++enum ProcessType {+ background,+ foreground,+}diff --git a/mobile/apps/locker/lib/services/files/upload/models/backup_item.dart b/mobile/apps/locker/lib/services/files/upload/models/backup_item.dartnew file mode 100644index 0000000000..10cc725667--- /dev/null+++ b/mobile/apps/locker/lib/services/files/upload/models/backup_item.dart@@ -0,0 +1,62 @@+import "dart:async";+import "dart:io";++import "package:locker/services/collections/models/collection.dart";+import "package:locker/services/files/sync/models/file.dart";+import "package:locker/services/files/upload/models/backup_item_status.dart";++class BackupItem {+ final BackupItemStatus status;+ final File file;+ final Collection collection;+ final Completer<EnteFile>? completer;+ final Object? error;++ BackupItem({+ required this.status,+ required this.file,+ required this.collection,+ required this.completer,+ this.error,+ });++ BackupItem copyWith({+ BackupItemStatus? status,+ File? file,+ Collection? collection,+ Completer<EnteFile>? completer,+ Object? error,+ }) {+ return BackupItem(+ status: status ?? this.status,+ file: file ?? this.file,+ collection: collection ?? this.collection,+ completer: completer ?? this.completer,+ error: error ?? this.error,+ );+ }++ @override+ String toString() {+ return 'BackupItem(status: $status, file: $file, collection: $collection, error: $error)';+ }++ @override+ bool operator ==(covariant BackupItem other) {+ if (identical(this, other)) return true;++ return other.status == status &&+ other.file == file &&+ other.collection == collection &&+ other.completer == completer &&+ other.error == error;+ }++ @override+ int get hashCode {+ return status.hashCode ^+ file.hashCode ^+ collection.hashCode ^+ completer.hashCode;+ }+}diff --git a/mobile/apps/locker/lib/services/files/upload/models/backup_item_status.dart b/mobile/apps/locker/lib/services/files/upload/models/backup_item_status.dartnew file mode 100644index 0000000000..f9de2673ce--- /dev/null+++ b/mobile/apps/locker/lib/services/files/upload/models/backup_item_status.dart@@ -0,0 +1,7 @@+enum BackupItemStatus {+ uploading,+ inQueue,+ retry,+ inBackground,+ uploaded,+}diff --git a/mobile/apps/locker/lib/services/files/upload/models/upload_url.dart b/mobile/apps/locker/lib/services/files/upload/models/upload_url.dartnew file mode 100644index 0000000000..49aa3b6ad7--- /dev/null+++ b/mobile/apps/locker/lib/services/files/upload/models/upload_url.dart@@ -0,0 +1,26 @@+import 'dart:convert';++class UploadURL {+ final String url;+ final String objectKey;++ UploadURL(this.url, this.objectKey);+ Map<String, dynamic> toMap() {+ return {+ 'url': url,+ 'objectKey': objectKey,+ };+ }++ factory UploadURL.fromMap(Map<String, dynamic> map) {+ return UploadURL(+ map['url'],+ map['objectKey'],+ );+ }++ String toJson() => json.encode(toMap());++ factory UploadURL.fromJson(String source) =>+ UploadURL.fromMap(json.decode(source));+}diff --git a/mobile/apps/locker/lib/services/trash/models/trash_file.dart b/mobile/apps/locker/lib/services/trash/models/trash_file.dartnew file mode 100644index 0000000000..50537e7ac7--- /dev/null+++ b/mobile/apps/locker/lib/services/trash/models/trash_file.dart@@ -0,0 +1,14 @@+import 'package:locker/services/files/sync/models/file.dart';++class TrashFile extends EnteFile {+ // time when file was put in the trash for first time+ late int createdAt;++ // for non-deleted trash items, updateAt is usually equal to the latest time+ // when the file was moved to trash+ late int updateAt;++ // time after which will will be deleted from trash & user's storage usage+ // will go down+ late int deleteBy;+}diff --git a/mobile/apps/locker/lib/services/trash/models/trash_item_request.dart b/mobile/apps/locker/lib/services/trash/models/trash_item_request.dartnew file mode 100644index 0000000000..b4169f738d--- /dev/null+++ b/mobile/apps/locker/lib/services/trash/models/trash_item_request.dart@@ -0,0 +1,22 @@+class TrashRequest {+ final int fileID;+ final int collectionID;++ TrashRequest(this.fileID, this.collectionID);++ factory TrashRequest.fromJson(Map<String, dynamic> json) {+ return TrashRequest(json['fileID'], json['collectionID']);+ }++ Map<String, dynamic> toJson() {+ final Map<String, dynamic> data = <String, dynamic>{};+ data['fileID'] = fileID;+ data['collectionID'] = collectionID;+ return data;+ }++ @override+ String toString() {+ return 'TrashItemRequest{fileID: $fileID, collectionID: $collectionID}';+ }+}diff --git a/mobile/apps/locker/lib/services/trash/trash_db.dart b/mobile/apps/locker/lib/services/trash/trash_db.dartnew file mode 100644index 0000000000..7557e3426a--- /dev/null+++ b/mobile/apps/locker/lib/services/trash/trash_db.dart@@ -0,0 +1,173 @@+import "package:ente_base/models/database.dart";+import 'package:locker/services/trash/models/trash_file.dart';+import 'package:path/path.dart';+import 'package:path_provider/path_provider.dart';+import 'package:sqflite/sqflite.dart';++class TrashDB extends EnteBaseDatabase {+ TrashDB._privateConstructor();++ static final TrashDB instance = TrashDB._privateConstructor();++ Database? _database;++ static const String _trashTable = 'trash_files';++ Future<void> init() async {+ _database = await _initDatabase();+ }++ Future<Database> _initDatabase() async {+ final documentsDirectory = await getApplicationDocumentsDirectory();+ final path = join(documentsDirectory.path, 'trash.db');++ return await openDatabase(+ path,+ version: 1,+ onCreate: _createTables,+ );+ }++ Future<void> _createTables(Database db, int version) async {+ await db.execute('''+ CREATE TABLE $_trashTable (+ uploaded_file_id INTEGER PRIMARY KEY,+ local_path TEXT,+ owner_id INTEGER,+ collection_id INTEGER,+ title TEXT,+ creation_time INTEGER,+ modification_time INTEGER,+ updation_time INTEGER,+ added_time INTEGER,+ hash TEXT,+ metadata_version INTEGER,+ encrypted_key TEXT,+ key_decryption_nonce TEXT,+ file_decryption_header TEXT,+ thumbnail_decryption_header TEXT,+ metadata_decryption_header TEXT,+ file_size INTEGER,+ m_md_encoded_json TEXT,+ m_md_version INTEGER,+ pub_mmd_encoded_json TEXT,+ pub_mmd_version INTEGER,+ created_at INTEGER NOT NULL,+ update_at INTEGER NOT NULL,+ delete_by INTEGER NOT NULL+ )+ ''');+ }++ Database get _db {+ if (_database == null) {+ throw Exception('TrashDB not initialized. Call init() first.');+ }+ return _database!;+ }++ Future<void> insertMultiple(List<TrashFile> trashFiles) async {+ final batch = _db.batch();++ for (final trashFile in trashFiles) {+ batch.insert(+ _trashTable,+ _trashFileToMap(trashFile),+ conflictAlgorithm: ConflictAlgorithm.replace,+ );+ }++ await batch.commit();+ }++ Future<void> delete(List<int> uploadedFileIDs) async {+ final batch = _db.batch();++ for (final uploadedFileID in uploadedFileIDs) {+ batch.delete(+ _trashTable,+ where: 'uploaded_file_id = ?',+ whereArgs: [uploadedFileID],+ );+ }++ await batch.commit();+ }++ Future<List<TrashFile>> getAllTrashFiles() async {+ final result = await _db.query(_trashTable);+ return result.map((row) => _mapToTrashFile(row)).toList();+ }++ @override+ Future<void> clearTable() async {+ await _db.delete(_trashTable);+ }++ Map<String, dynamic> _trashFileToMap(TrashFile trashFile) {+ return {+ 'uploaded_file_id': trashFile.uploadedFileID!,+ 'local_path': trashFile.localPath,+ 'owner_id': trashFile.ownerID,+ 'collection_id': trashFile.collectionID,+ 'title': trashFile.title,+ 'creation_time': trashFile.creationTime,+ 'modification_time': trashFile.modificationTime,+ 'updation_time': trashFile.updationTime,+ 'added_time': trashFile.addedTime,+ 'hash': trashFile.hash,+ 'metadata_version': trashFile.metadataVersion,+ 'encrypted_key': trashFile.encryptedKey,+ 'key_decryption_nonce': trashFile.keyDecryptionNonce,+ 'file_decryption_header': trashFile.fileDecryptionHeader,+ 'thumbnail_decryption_header': trashFile.thumbnailDecryptionHeader,+ 'metadata_decryption_header': trashFile.metadataDecryptionHeader,+ 'file_size': trashFile.fileSize,+ 'm_md_encoded_json': trashFile.mMdEncodedJson,+ 'm_md_version': trashFile.mMdVersion,+ 'pub_mmd_encoded_json': trashFile.pubMmdEncodedJson,+ 'pub_mmd_version': trashFile.pubMmdVersion,+ 'created_at': trashFile.createdAt,+ 'update_at': trashFile.updateAt,+ 'delete_by': trashFile.deleteBy,+ };+ }++ TrashFile _mapToTrashFile(Map<String, dynamic> map) {+ final trashFile = TrashFile();++ trashFile.localPath = map['local_path'];+ trashFile.uploadedFileID = map['uploaded_file_id'];+ trashFile.ownerID = map['owner_id'];+ trashFile.collectionID = map['collection_id'];+ trashFile.title = map['title'];+ trashFile.creationTime = map['creation_time'];+ trashFile.modificationTime = map['modification_time'];+ trashFile.updationTime = map['updation_time'];+ trashFile.addedTime = map['added_time'];+ trashFile.hash = map['hash'];+ trashFile.metadataVersion = map['metadata_version'];+ trashFile.encryptedKey = map['encrypted_key'];+ trashFile.keyDecryptionNonce = map['key_decryption_nonce'];+ trashFile.fileDecryptionHeader = map['file_decryption_header'];+ trashFile.thumbnailDecryptionHeader = map['thumbnail_decryption_header'];+ trashFile.metadataDecryptionHeader = map['metadata_decryption_header'];+ trashFile.fileSize = map['file_size'];+ trashFile.mMdEncodedJson = map['m_md_encoded_json'];+ trashFile.mMdVersion = map['m_md_version'] ?? 0;+ trashFile.pubMmdEncodedJson = map['pub_mmd_encoded_json'];+ trashFile.pubMmdVersion = map['pub_mmd_version'] ?? 1;++ // TrashFile specific fields+ trashFile.createdAt = map['created_at'];+ trashFile.updateAt = map['update_at'];+ trashFile.deleteBy = map['delete_by'];++ return trashFile;+ }++ Future<void> close() async {+ await _database?.close();+ _database = null;+ }+}diff --git a/mobile/apps/locker/lib/services/trash/trash_service.dart b/mobile/apps/locker/lib/services/trash/trash_service.dartnew file mode 100644index 0000000000..a6ef50f6b9--- /dev/null+++ b/mobile/apps/locker/lib/services/trash/trash_service.dart@@ -0,0 +1,279 @@+import 'dart:async';+import 'dart:convert';+import 'dart:math';++import 'package:dio/dio.dart';+import 'package:ente_crypto_dart/ente_crypto_dart.dart';+import "package:ente_events/event_bus.dart";+import "package:ente_events/models/signed_in_event.dart";+import 'package:ente_network/network.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/collections/models/collection_file_item.dart';+import "package:locker/services/configuration.dart";+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/files/sync/models/file_magic.dart';+import 'package:locker/services/trash/models/trash_file.dart';+import 'package:locker/services/trash/trash_db.dart';+import "package:locker/utils/crypto_helper.dart";+import 'package:logging/logging.dart';+import 'package:shared_preferences/shared_preferences.dart';++class TrashService {+ TrashService._privateConstructor();+ static final TrashService instance = TrashService._privateConstructor();++ static const kLastTrashSyncTime = "last_trash_sync_time";+ final _logger = Logger("TrashService");+ late SharedPreferences _prefs;+ late Dio _enteDio;+ late TrashDB _trashDB;++ Future<void> init(SharedPreferences preferences) async {+ _prefs = preferences;+ _enteDio = Network.instance.enteDio;+ _trashDB = TrashDB.instance;++ if (Configuration.instance.hasConfiguredAccount()) {+ unawaited(syncTrash());+ } else {+ Bus.instance.on<SignedInEvent>().listen((event) {+ _logger.info("User signed in, starting initial trash sync.");+ unawaited(syncTrash());+ });+ }+ }++ Future<void> syncTrash() async {+ final lastSyncTime = _getSyncTime();+ _logger.fine('sync trash sinceTime : $lastSyncTime');+ final diff = await getTrashFilesDiff(lastSyncTime);+ if (diff.trashedFiles.isNotEmpty) {+ _logger.fine("inserting ${diff.trashedFiles.length} items in trash");+ await _trashDB.insertMultiple(diff.trashedFiles);+ }+ if (diff.deletedUploadIDs.isNotEmpty) {+ _logger.fine("discard ${diff.deletedUploadIDs.length} deleted items");+ await _trashDB.delete(diff.deletedUploadIDs);+ }+ if (diff.restoredFiles.isNotEmpty) {+ _logger.fine("discard ${diff.restoredFiles.length} restored items");+ await _trashDB+ .delete(diff.restoredFiles.map((e) => e.uploadedFileID!).toList());+ }++ if (diff.lastSyncedTimeStamp != 0) {+ await _setSyncTime(diff.lastSyncedTimeStamp);+ }+ if (diff.hasMore) {+ return syncTrash();+ }+ }++ Future<List<TrashFile>> getTrashFiles() async {+ return await _trashDB.getAllTrashFiles();+ }++ Future<bool> _setSyncTime(int time) async {+ return _prefs.setInt(kLastTrashSyncTime, time);+ }++ int _getSyncTime() {+ return _prefs.getInt(kLastTrashSyncTime) ?? 0;+ }++ Future<TrashDiff> getTrashFilesDiff(int sinceTime) async {+ try {+ final response = await _enteDio.get(+ "/trash/v2/diff",+ queryParameters: {+ "sinceTime": sinceTime,+ },+ );+ int latestUpdatedAtTime = 0;+ final trashedFiles = <TrashFile>[];+ final deletedUploadIDs = <int>[];+ final restoredFiles = <TrashFile>[];++ final diff = response.data["diff"] as List;+ final bool hasMore = response.data["hasMore"] as bool;+ final startTime = DateTime.now();+ for (final item in diff) {+ final trash = TrashFile();+ trash.createdAt = item['createdAt'];+ trash.updateAt = item['updatedAt'];+ latestUpdatedAtTime = max(latestUpdatedAtTime, trash.updateAt);+ if (item["isDeleted"]) {+ deletedUploadIDs.add(item["file"]["id"]);+ continue;+ }++ trash.deleteBy = item['deleteBy'];+ trash.uploadedFileID = item["file"]["id"];+ trash.collectionID = item["file"]["collectionID"];+ trash.updationTime = item["file"]["updationTime"];+ trash.ownerID = item["file"]["ownerID"];+ trash.encryptedKey = item["file"]["encryptedKey"];+ trash.keyDecryptionNonce = item["file"]["keyDecryptionNonce"];+ trash.fileDecryptionHeader = item["file"]["file"]["decryptionHeader"];+ trash.thumbnailDecryptionHeader =+ item["file"]["thumbnail"]["decryptionHeader"];+ trash.metadataDecryptionHeader =+ item["file"]["metadata"]["decryptionHeader"];+ // TODO: Refactor+ final collections = await CollectionService.instance.getCollections();+ final Collection? collection =+ collections.where((c) => c.id == trash.collectionID).isNotEmpty+ ? collections.firstWhere((c) => c.id == trash.collectionID)+ : null;+ if (collection == null) {+ continue;+ }+ final collectionKey =+ CryptoHelper.instance.getCollectionKey(collection);+ final key = CryptoHelper.instance.getFileKey(+ trash.encryptedKey!,+ trash.keyDecryptionNonce!,+ collectionKey,+ );+ final encodedMetadata = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item["file"]["metadata"]["encryptedData"]),+ key,+ CryptoUtil.base642bin(trash.metadataDecryptionHeader!),+ );+ final Map<String, dynamic> metadata =+ jsonDecode(utf8.decode(encodedMetadata));+ trash.applyMetadata(metadata);+ if (item["file"]['magicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item["file"]['magicMetadata']['data']),+ key,+ CryptoUtil.base642bin(item["file"]['magicMetadata']['header']),+ );+ trash.mMdEncodedJson = utf8.decode(utfEncodedMmd);+ trash.mMdVersion = item["file"]['magicMetadata']['version'];+ }+ if (item["file"]['pubMagicMetadata'] != null) {+ final utfEncodedMmd = await CryptoUtil.decryptData(+ CryptoUtil.base642bin(item["file"]['pubMagicMetadata']['data']),+ key,+ CryptoUtil.base642bin(item["file"]['pubMagicMetadata']['header']),+ );+ trash.pubMmdEncodedJson = utf8.decode(utfEncodedMmd);+ trash.pubMmdVersion = item["file"]['pubMagicMetadata']['version'];+ trash.pubMagicMetadata =+ PubMagicMetadata.fromEncodedJson(trash.pubMmdEncodedJson!);+ }+ if (item['isRestored']) {+ restoredFiles.add(trash);+ continue;+ }+ trashedFiles.add(trash);+ }++ final endTime = DateTime.now();+ _logger.info(+ "time for parsing ${diff.length}: ${Duration(+ microseconds: (endTime.microsecondsSinceEpoch -+ startTime.microsecondsSinceEpoch),+ ).inMilliseconds}",+ );+ return TrashDiff(+ trashedFiles,+ restoredFiles,+ deletedUploadIDs,+ hasMore,+ latestUpdatedAtTime,+ );+ } catch (e, s) {+ _logger.severe(e, s);+ rethrow;+ }+ }++ Future<void> deleteFromTrash(List<EnteFile> files) async {+ final params = <String, dynamic>{};+ final uniqueFileIds = files.map((e) => e.uploadedFileID!).toSet().toList();+ params["fileIDs"] = [];+ for (final fileID in uniqueFileIds) {+ params["fileIDs"].add(fileID);+ }+ try {+ await _enteDio.post(+ "/trash/delete",+ data: params,+ );+ await _trashDB.delete(uniqueFileIds);+ } catch (e, s) {+ _logger.severe("failed to delete from trash", e, s);+ rethrow;+ }+ // no need to await on syncing trash from remote+ unawaited(syncTrash());+ }++ Future<void> emptyTrash() async {+ final params = <String, dynamic>{};+ params["lastUpdatedAt"] = _getSyncTime();+ try {+ await _enteDio.post(+ "/trash/empty",+ data: params,+ );+ await _trashDB.clearTable();+ unawaited(syncTrash());+ } catch (e, s) {+ _logger.severe("failed to empty trash", e, s);+ rethrow;+ }+ }++ Future<void> restore(List<EnteFile> files, Collection toCollection) async {+ final params = <String, dynamic>{};+ params["collectionID"] = toCollection.id;+ final toCollectionKey =+ CryptoHelper.instance.getCollectionKey(toCollection);+ params["files"] = [];+ for (final file in files) {+ final fileKey = await CollectionService.instance.getFileKey(file);+ file.collectionID = toCollection.id;+ final encryptedKeyData = CryptoUtil.encryptSync(fileKey, toCollectionKey);+ final encryptedKey =+ CryptoUtil.bin2base64(encryptedKeyData.encryptedData!);+ final keyDecryptionNonce = CryptoUtil.bin2base64(encryptedKeyData.nonce!);+ params["files"].add(+ CollectionFileItem(+ file.uploadedFileID!,+ encryptedKey,+ keyDecryptionNonce,+ ).toMap(),+ );+ }+ try {+ await _enteDio.post(+ "/collections/restore-files",+ data: params,+ );+ await _trashDB.delete(files.map((e) => e.uploadedFileID!).toList());+ // Force reload home gallery to pull in the restored files+ } catch (e, s) {+ _logger.severe("failed to restore files", e, s);+ rethrow;+ }+ }+}++class TrashDiff {+ final List<TrashFile> trashedFiles;+ final List<TrashFile> restoredFiles;+ final List<int> deletedUploadIDs;+ final bool hasMore;+ final int lastSyncedTimeStamp;+ TrashDiff(+ this.trashedFiles,+ this.restoredFiles,+ this.deletedUploadIDs,+ this.hasMore,+ this.lastSyncedTimeStamp,+ );+}diff --git a/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dartnew file mode 100644index 0000000000..b263ddc960--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/collection_selection_widget.dart@@ -0,0 +1,250 @@+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/utils/collection_actions.dart';++class CollectionSelectionWidget extends StatefulWidget {+ final List<Collection> collections;+ final Set<int> selectedCollectionIds;+ final Function(int) onToggleCollection;+ final Function(List<Collection>)? onCollectionsUpdated;++ const CollectionSelectionWidget({+ super.key,+ required this.collections,+ required this.selectedCollectionIds,+ required this.onToggleCollection,+ this.onCollectionsUpdated,+ });++ @override+ State<CollectionSelectionWidget> createState() =>+ _CollectionSelectionWidgetState();+}++class _CollectionSelectionWidgetState extends State<CollectionSelectionWidget> {+ List<Collection> _availableCollections = [];++ @override+ void initState() {+ super.initState();+ _availableCollections = List.from(widget.collections);+ }++ @override+ void didUpdateWidget(CollectionSelectionWidget oldWidget) {+ super.didUpdateWidget(oldWidget);+ if (oldWidget.collections != widget.collections) {+ _availableCollections = List.from(widget.collections);+ }+ }++ Future<void> _createNewCollection() async {+ final newCollection = await CollectionActions.createCollection(context);++ if (newCollection != null) {+ setState(() {+ _availableCollections.add(newCollection);+ });++ widget.onToggleCollection(newCollection.id);++ widget.onCollectionsUpdated?.call(_availableCollections);+ }+ }++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);++ return Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ 'Collections',+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ ),+ ),+ const SizedBox(height: 8),+ Container(+ height: 150,+ decoration: BoxDecoration(+ borderRadius: BorderRadius.circular(8),+ border: Border.all(color: colorScheme.strokeFaint),+ ),+ child: _availableCollections.isEmpty+ ? Container(+ padding: const EdgeInsets.all(16),+ decoration: BoxDecoration(+ color: colorScheme.fillFaint,+ borderRadius: BorderRadius.circular(8),+ ),+ child: Center(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Text(+ 'No collections available',+ style: textTheme.body.copyWith(+ color: colorScheme.textMuted,+ ),+ ),+ const SizedBox(height: 8),+ InkWell(+ onTap: _createNewCollection,+ child: Container(+ padding: const EdgeInsets.symmetric(+ horizontal: 12,+ vertical: 6,+ ),+ decoration: BoxDecoration(+ color: colorScheme.primary300.withOpacity(0.1),+ borderRadius: BorderRadius.circular(6),+ border: Border.all(+ color: colorScheme.primary500,+ width: 1,+ ),+ ),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Icon(+ Icons.add,+ size: 16,+ color: colorScheme.primary700,+ ),+ const SizedBox(width: 4),+ Text(+ 'Create collection',+ style: textTheme.small.copyWith(+ color: colorScheme.primary700,+ fontWeight: FontWeight.w600,+ ),+ ),+ ],+ ),+ ),+ ),+ ],+ ),+ ),+ )+ : Scrollbar(+ thumbVisibility: true,+ thickness: 6,+ radius: const Radius.circular(3),+ child: GridView.builder(+ gridDelegate:+ const SliverGridDelegateWithFixedCrossAxisCount(+ crossAxisCount: 2,+ childAspectRatio: 3.5,+ crossAxisSpacing: 6,+ mainAxisSpacing: 6,+ ),+ padding: const EdgeInsets.all(6),+ itemCount: _availableCollections.length ++ 1, // +1 for "Create New" option+ itemBuilder: (context, index) {+ if (index < _availableCollections.length) {+ final collection = _availableCollections[index];+ final isSelected = widget.selectedCollectionIds+ .contains(collection.id);+ final collectionName =+ collection.name ?? 'Unnamed Collection';++ return InkWell(+ onTap: () => widget.onToggleCollection(collection.id),+ borderRadius: BorderRadius.circular(8),+ child: Container(+ padding: const EdgeInsets.symmetric(+ horizontal: 6,+ vertical: 4,+ ),+ decoration: BoxDecoration(+ color: isSelected+ ? colorScheme.primary300.withOpacity(0.3)+ : colorScheme.fillFaint,+ borderRadius: BorderRadius.circular(8),+ border: Border.all(+ color: isSelected+ ? colorScheme.primary500+ : colorScheme.strokeFaint,+ width: isSelected ? 2 : 1,+ ),+ ),+ child: Center(+ child: Text(+ collectionName,+ style: textTheme.small.copyWith(+ color: isSelected+ ? colorScheme.primary500+ : colorScheme.textBase,+ fontWeight: isSelected+ ? FontWeight.w600+ : FontWeight.normal,+ ),+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ textAlign: TextAlign.center,+ ),+ ),+ ),+ );+ }++ return InkWell(+ onTap: _createNewCollection,+ borderRadius: BorderRadius.circular(8),+ child: Container(+ padding: const EdgeInsets.symmetric(+ horizontal: 6,+ vertical: 4,+ ),+ decoration: BoxDecoration(+ color: colorScheme.backgroundElevated,+ borderRadius: BorderRadius.circular(8),+ border: Border.all(+ color: colorScheme.strokeFaint.withOpacity(0.5),+ width: 1,+ style: BorderStyle.solid,+ ),+ ),+ child: Center(+ child: Row(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Icon(+ Icons.add_outlined,+ size: 14,+ color: colorScheme.textBase,+ ),+ const SizedBox(width: 4),+ Flexible(+ child: Text(+ 'Collection',+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ fontWeight: FontWeight.w400,+ ),+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ textAlign: TextAlign.center,+ ),+ ),+ ],+ ),+ ),+ ),+ );+ },+ ),+ ),+ ),+ ],+ );+ }++ List<Collection> get availableCollections => _availableCollections;+}diff --git a/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart b/mobile/apps/locker/lib/ui/components/file_edit_dialog.dartnew file mode 100644index 0000000000..0851a7acb3--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/file_edit_dialog.dart@@ -0,0 +1,234 @@+import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/components/text_input_widget.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/collection_selection_widget.dart';+import 'package:locker/utils/file_icon_utils.dart';+import 'package:locker/utils/snack_bar_utils.dart';++class FileEditDialogResult {+ final String title;+ final String caption;+ final List<Collection> selectedCollections;++ FileEditDialogResult({+ required this.title,+ required this.caption,+ required this.selectedCollections,+ });+}++class FileEditDialog extends StatefulWidget {+ final EnteFile file;+ final List<Collection> collections;++ const FileEditDialog({+ super.key,+ required this.file,+ required this.collections,+ });++ @override+ State<FileEditDialog> createState() => _FileEditDialogState();+}++class _FileEditDialogState extends State<FileEditDialog> {+ final TextEditingController _titleController = TextEditingController();+ final TextEditingController _captionController = TextEditingController();+ final Set<int> _selectedCollectionIds = <int>{};+ List<Collection> _availableCollections = [];++ @override+ void initState() {+ super.initState();++ _availableCollections = List.from(widget.collections);++ _titleController.text = widget.file.displayName;++ _captionController.text = widget.file.caption ?? '';++ CollectionService.instance+ .getCollectionsForFile(widget.file)+ .then((fileCollections) {+ for (final collection in fileCollections) {+ _selectedCollectionIds.add(collection.id);+ }+ setState(() {});+ });+ }++ @override+ void dispose() {+ _titleController.dispose();+ _captionController.dispose();+ super.dispose();+ }++ void _toggleCollection(int collectionId) {+ setState(() {+ if (_selectedCollectionIds.contains(collectionId)) {+ _selectedCollectionIds.remove(collectionId);+ } else {+ _selectedCollectionIds.add(collectionId);+ }+ });+ }++ void _onCollectionsUpdated(List<Collection> updatedCollections) {+ setState(() {+ _availableCollections = updatedCollections;+ });+ }++ Future<void> _onCancel() async {+ Navigator.of(context).pop();+ }++ Future<void> _onSave() async {+ final selectedCollections = _availableCollections+ .where((c) => _selectedCollectionIds.contains(c.id))+ .toList();++ if (selectedCollections.isEmpty) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.pleaseSelectAtLeastOneCollection,+ );+ return;+ }++ final result = FileEditDialogResult(+ title: _titleController.text.trim(),+ caption: _captionController.text.trim(),+ selectedCollections: selectedCollections,+ );++ Navigator.of(context).pop(result);+ }++ String get _fileName {+ return widget.file.displayName;+ }++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);++ return Dialog(+ backgroundColor: colorScheme.backgroundElevated,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(8),+ ),+ child: Container(+ width: 400,+ constraints: const BoxConstraints(maxHeight: 600),+ padding: const EdgeInsets.all(20),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ Icon(+ FileIconUtils.getFileIcon(_fileName),+ color: FileIconUtils.getFileIconColor(_fileName),+ size: 24,+ ),+ const SizedBox(width: 8),+ Expanded(+ child: Text(+ _fileName,+ style: textTheme.largeBold,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ ],+ ),+ const SizedBox(height: 20),+ Text(+ 'Title',+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ ),+ ),+ const SizedBox(height: 8),+ TextInputWidget(+ hintText: context.l10n.fileTitle,+ initialValue: _titleController.text,+ onChange: (value) => _titleController.text = value,+ maxLength: 200,+ textCapitalization: TextCapitalization.words,+ ),+ const SizedBox(height: 16),+ Text(+ context.l10n.note,+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ ),+ ),+ const SizedBox(height: 8),+ TextInputWidget(+ hintText: context.l10n.optionalNote,+ initialValue: _captionController.text,+ onChange: (value) => _captionController.text = value,+ maxLength: 500,+ textCapitalization: TextCapitalization.sentences,+ ),+ const SizedBox(height: 16),+ CollectionSelectionWidget(+ collections: _availableCollections,+ selectedCollectionIds: _selectedCollectionIds,+ onToggleCollection: _toggleCollection,+ onCollectionsUpdated: _onCollectionsUpdated,+ ),+ const SizedBox(height: 20),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.secondary,+ labelText: context.l10n.cancel,+ onTap: _onCancel,+ ),+ ),+ const SizedBox(width: 12),+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.primary,+ labelText: context.l10n.save,+ onTap: _onSave,+ isDisabled: _selectedCollectionIds.isEmpty,+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ );+ }+}++Future<FileEditDialogResult?> showFileEditDialog(+ BuildContext context, {+ required EnteFile file,+ required List<Collection> collections,+}) async {+ return showDialog<FileEditDialogResult>(+ context: context,+ barrierColor: getEnteColorScheme(context).backdropBase,+ builder: (context) => FileEditDialog(+ file: file,+ collections: collections,+ ),+ );+}diff --git a/mobile/apps/locker/lib/ui/components/file_upload_dialog.dart b/mobile/apps/locker/lib/ui/components/file_upload_dialog.dartnew file mode 100644index 0000000000..f1bcdd38c9--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/file_upload_dialog.dart@@ -0,0 +1,208 @@+import 'dart:io';++import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/components/text_input_widget.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/ui/components/collection_selection_widget.dart';+import 'package:locker/utils/file_icon_utils.dart';+import 'package:locker/utils/snack_bar_utils.dart';+import 'package:path/path.dart' as path;++class FileUploadDialogResult {+ final String note;+ final List<Collection> selectedCollections;++ FileUploadDialogResult({+ required this.note,+ required this.selectedCollections,+ });+}++class FileUploadDialog extends StatefulWidget {+ final File file;+ final List<Collection> collections;+ final Collection? selectedCollection;++ const FileUploadDialog({+ super.key,+ required this.file,+ required this.collections,+ this.selectedCollection,+ });++ @override+ State<FileUploadDialog> createState() => _FileUploadDialogState();+}++class _FileUploadDialogState extends State<FileUploadDialog> {+ final TextEditingController _noteController = TextEditingController();+ final Set<int> _selectedCollectionIds = <int>{};+ List<Collection> _availableCollections = [];++ @override+ void initState() {+ super.initState();+ _availableCollections = List.from(widget.collections);+ if (widget.selectedCollection != null) {+ _selectedCollectionIds.add(widget.selectedCollection!.id);+ }+ }++ @override+ void dispose() {+ _noteController.dispose();+ super.dispose();+ }++ void _toggleCollection(int collectionId) {+ setState(() {+ if (_selectedCollectionIds.contains(collectionId)) {+ _selectedCollectionIds.remove(collectionId);+ } else {+ _selectedCollectionIds.add(collectionId);+ }+ });+ }++ void _onCollectionsUpdated(List<Collection> updatedCollections) {+ setState(() {+ _availableCollections = updatedCollections;+ });+ }++ Future<void> _onCancel() async {+ Navigator.of(context).pop();+ }++ Future<void> _onSave() async {+ final selectedCollections = _availableCollections+ .where((c) => _selectedCollectionIds.contains(c.id))+ .toList();++ if (selectedCollections.isEmpty) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.pleaseSelectAtLeastOneCollection,+ );+ return;+ }++ final result = FileUploadDialogResult(+ note: _noteController.text.trim(),+ selectedCollections: selectedCollections,+ );++ Navigator.of(context).pop(result);+ }++ String get _fileName {+ return path.basename(widget.file.path);+ }++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);++ return Dialog(+ backgroundColor: colorScheme.backgroundElevated,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(8),+ ),+ child: Container(+ width: 400,+ constraints: const BoxConstraints(maxHeight: 600),+ padding: const EdgeInsets.all(20),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ Icon(+ FileIconUtils.getFileIcon(_fileName),+ color: FileIconUtils.getFileIconColor(_fileName),+ size: 24,+ ),+ const SizedBox(width: 8),+ Expanded(+ child: Text(+ _fileName,+ style: textTheme.largeBold,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ ],+ ),+ const SizedBox(height: 20),+ CollectionSelectionWidget(+ collections: _availableCollections,+ selectedCollectionIds: _selectedCollectionIds,+ onToggleCollection: _toggleCollection,+ onCollectionsUpdated: _onCollectionsUpdated,+ ),+ const SizedBox(height: 16),+ Text(+ 'Note',+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ ),+ ),+ const SizedBox(height: 8),+ TextInputWidget(+ hintText: context.l10n.optionalNote,+ initialValue: _noteController.text,+ onChange: (value) => _noteController.text = value,+ maxLength: 500,+ textCapitalization: TextCapitalization.sentences,+ ),+ const SizedBox(height: 20),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.secondary,+ labelText: context.l10n.cancel,+ onTap: _onCancel,+ ),+ ),+ const SizedBox(width: 12),+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.primary,+ labelText: context.l10n.upload,+ onTap: _onSave,+ isDisabled: _selectedCollectionIds.isEmpty,+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ );+ }+}++Future<FileUploadDialogResult?> showFileUploadDialog(+ BuildContext context, {+ required File file,+ required List<Collection> collections,+ Collection? selectedCollection,+}) async {+ return showDialog<FileUploadDialogResult>(+ context: context,+ barrierColor: getEnteColorScheme(context).backdropBase,+ builder: (context) => FileUploadDialog(+ file: file,+ collections: collections,+ selectedCollection: selectedCollection,+ ),+ );+}diff --git a/mobile/apps/locker/lib/ui/components/information_addition_dialog.dart b/mobile/apps/locker/lib/ui/components/information_addition_dialog.dartnew file mode 100644index 0000000000..63021a39a7--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/information_addition_dialog.dart@@ -0,0 +1,208 @@+import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';++enum InformationType {+ physicalDocument,+ emergencyContact,+ accountCredential,+}++class InformationAdditionResult {+ final InformationType type;++ InformationAdditionResult({+ required this.type,+ });+}++class InformationAdditionDialog extends StatefulWidget {+ const InformationAdditionDialog({super.key});++ @override+ State<InformationAdditionDialog> createState() =>+ _InformationAdditionDialogState();+}++class _InformationAdditionDialogState extends State<InformationAdditionDialog> {+ void _onTypeSelected(InformationType type) {+ final result = InformationAdditionResult(type: type);+ Navigator.of(context).pop(result);+ }++ Future<void> _onCancel() async {+ Navigator.of(context).pop();+ }++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);++ return Dialog(+ backgroundColor: colorScheme.backgroundElevated,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(8),+ ),+ child: Container(+ width: 400,+ constraints: const BoxConstraints(maxHeight: 600),+ padding: const EdgeInsets.all(20),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ const Icon(+ Icons.post_add,+ color: Colors.blue,+ size: 24,+ ),+ const SizedBox(width: 8),+ Expanded(+ child: Text(+ context.l10n.addInformation,+ style: textTheme.largeBold,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ ],+ ),+ const SizedBox(height: 8),+ Text(+ context.l10n.addInformationDialogSubtitle,+ style: textTheme.body.copyWith(+ color: colorScheme.textMuted,+ ),+ ),+ const SizedBox(height: 20),+ Flexible(+ child: SingleChildScrollView(+ child: Column(+ children: [+ _buildOptionTile(+ type: InformationType.physicalDocument,+ icon: Icons.description,+ title: context.l10n.physicalDocument,+ subtitle: context.l10n.physicalDocumentDescription,+ colorScheme: colorScheme,+ textTheme: textTheme,+ ),+ const SizedBox(height: 12),+ _buildOptionTile(+ type: InformationType.emergencyContact,+ icon: Icons.emergency,+ title: context.l10n.emergencyContact,+ subtitle: context.l10n.emergencyContactDescription,+ colorScheme: colorScheme,+ textTheme: textTheme,+ ),+ const SizedBox(height: 12),+ _buildOptionTile(+ type: InformationType.accountCredential,+ icon: Icons.key,+ title: context.l10n.accountCredential,+ subtitle: context.l10n.accountCredentialDescription,+ colorScheme: colorScheme,+ textTheme: textTheme,+ ),+ ],+ ),+ ),+ ),+ const SizedBox(height: 20),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.secondary,+ labelText: context.l10n.cancel,+ onTap: _onCancel,+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ );+ }++ Widget _buildOptionTile({+ required InformationType type,+ required IconData icon,+ required String title,+ required String subtitle,+ required colorScheme,+ required textTheme,+ }) {+ return InkWell(+ onTap: () => _onTypeSelected(type),+ borderRadius: BorderRadius.circular(8),+ child: Container(+ padding: const EdgeInsets.all(16),+ decoration: BoxDecoration(+ color: colorScheme.fillFaint,+ borderRadius: BorderRadius.circular(8),+ border: Border.all(+ color: colorScheme.strokeFaint,+ width: 1,+ ),+ ),+ child: Row(+ children: [+ Container(+ padding: const EdgeInsets.all(8),+ decoration: BoxDecoration(+ color: colorScheme.fillMuted,+ borderRadius: BorderRadius.circular(6),+ ),+ child: Icon(+ icon,+ color: colorScheme.textMuted,+ size: 20,+ ),+ ),+ const SizedBox(width: 16),+ Expanded(+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ title,+ style: textTheme.body.copyWith(+ fontWeight: FontWeight.w600,+ color: colorScheme.textBase,+ ),+ ),+ const SizedBox(height: 4),+ Text(+ subtitle,+ style: textTheme.small.copyWith(+ color: colorScheme.textMuted,+ ),+ ),+ ],+ ),+ ),+ ],+ ),+ ),+ );+ }+}++Future<InformationAdditionResult?> showInformationAdditionDialog(+ BuildContext context,+) async {+ return showDialog<InformationAdditionResult>(+ context: context,+ barrierColor: getEnteColorScheme(context).backdropBase,+ builder: (context) => const InformationAdditionDialog(),+ );+}diff --git a/mobile/apps/locker/lib/ui/components/item_list_view.dart b/mobile/apps/locker/lib/ui/components/item_list_view.dartnew file mode 100644index 0000000000..5da2fe18e2--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/item_list_view.dart@@ -0,0 +1,1296 @@+import 'dart:io';++import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:ente_utils/share_utils.dart';+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/services/files/download/file_downloader.dart';+import 'package:locker/services/files/links/links_service.dart';+import 'package:locker/services/files/sync/metadata_updater_service.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/file_edit_dialog.dart';+import 'package:locker/ui/pages/collection_page.dart';+import 'package:locker/utils/collection_actions.dart';+import 'package:locker/utils/collection_sort_util.dart';+import 'package:locker/utils/date_time_util.dart';+import 'package:locker/utils/file_icon_utils.dart';+import 'package:locker/utils/snack_bar_utils.dart';+import 'package:open_file/open_file.dart';++class OverflowMenuAction {+ final String id;+ final String label;+ final IconData icon;+ final void Function(+ BuildContext context,+ EnteFile? file,+ Collection? collection,+ ) onTap;++ const OverflowMenuAction({+ required this.id,+ required this.label,+ required this.icon,+ required this.onTap,+ });+}++class ItemListView extends StatefulWidget {+ final List<EnteFile> files;+ final List<Collection> collections;+ final bool enableSorting;+ final Widget? emptyStateWidget;+ final List<OverflowMenuAction>? fileOverflowActions;+ final List<OverflowMenuAction>? collectionOverflowActions;++ const ItemListView({+ super.key,+ this.files = const [],+ this.collections = const [],+ this.enableSorting = false,+ this.emptyStateWidget,+ this.fileOverflowActions,+ this.collectionOverflowActions,+ });++ @override+ State<ItemListView> createState() => _ItemListViewState();+}++class _ItemListViewState extends State<ItemListView> {+ List<_ListItem> _sortedItems = [];+ int _sortColumnIndex = 1;+ bool _sortAscending = false;++ @override+ void initState() {+ super.initState();+ _updateItems();+ }++ @override+ void didUpdateWidget(ItemListView oldWidget) {+ super.didUpdateWidget(oldWidget);+ if (widget.files != oldWidget.files ||+ widget.collections != oldWidget.collections) {+ _updateItems();+ }+ }++ void _updateItems() {+ final sortedCollections =+ CollectionSortUtil.getSortedCollections(widget.collections);++ _sortedItems = [+ ...sortedCollections.map((c) => _CollectionListItem(c)),+ ...widget.files.map((f) => _FileListItem(f)),+ ];++ if (widget.enableSorting) {+ _sortItems(_sortColumnIndex, _sortAscending);+ }+ }++ void _sortItems(int columnIndex, bool ascending) {+ if (!widget.enableSorting) return;++ setState(() {+ _sortColumnIndex = columnIndex;+ _sortAscending = ascending;++ final files = _sortedItems.whereType<_FileListItem>().toList();+ final collections =+ _sortedItems.whereType<_CollectionListItem>().toList();++ switch (columnIndex) {+ case 0:+ files.sort((a, b) {+ final nameA = a.name.toLowerCase();+ final nameB = b.name.toLowerCase();+ return ascending ? nameA.compareTo(nameB) : nameB.compareTo(nameA);+ });+ collections.sort((a, b) {+ return CollectionSortUtil.compareCollectionsWithFavoritesPriority(+ a.collection,+ b.collection,+ ascending,+ );+ });+ break;+ case 1:+ files.sort((a, b) {+ final dateA = a.modificationTime;+ final dateB = b.modificationTime;+ return ascending ? dateA.compareTo(dateB) : dateB.compareTo(dateA);+ });+ collections.sort((a, b) {+ return CollectionSortUtil+ .compareCollectionsByDateWithFavoritesPriority(+ a.collection,+ b.collection,+ ascending,+ );+ });+ break;+ }++ _sortedItems = [...collections, ...files];+ });+ }++ @override+ Widget build(BuildContext context) {+ if (_sortedItems.isEmpty && widget.emptyStateWidget != null) {+ return widget.emptyStateWidget!;+ }++ if (_sortedItems.isEmpty) {+ return _buildDefaultEmptyState(context);+ }++ return Card(+ margin: EdgeInsets.zero,+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ if (widget.enableSorting) _buildSortingHeader(context),+ ListView.builder(+ shrinkWrap: true,+ physics: const NeverScrollableScrollPhysics(),+ padding: EdgeInsets.zero,+ itemCount: _sortedItems.length,+ itemBuilder: (context, index) {+ final item = _sortedItems[index];+ final isLastItem = index == _sortedItems.length - 1;+ return ListItemWidget(+ item: item,+ collections: widget.collections,+ fileOverflowActions: widget.fileOverflowActions,+ collectionOverflowActions: widget.collectionOverflowActions,+ isLastItem: isLastItem,+ );+ },+ ),+ ],+ ),+ );+ }++ Widget _buildDefaultEmptyState(BuildContext context) {+ return Center(+ child: Padding(+ padding: const EdgeInsets.all(32.0),+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.folder_off,+ size: 64,+ color: Colors.grey,+ ),+ const SizedBox(height: 16),+ Text(+ context.l10n.noFilesFound,+ style: getEnteTextTheme(context).body.copyWith(+ color: Colors.grey,+ ),+ textAlign: TextAlign.center,+ ),+ ],+ ),+ ),+ );+ }++ Widget _buildSortingHeader(BuildContext context) {+ return Container(+ padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),+ decoration: BoxDecoration(+ border: Border(+ bottom: BorderSide(+ color: Theme.of(context).dividerColor,+ width: 0.1,+ ),+ ),+ ),+ child: Row(+ children: [+ Expanded(+ flex: 2,+ child: GestureDetector(+ behavior: HitTestBehavior.translucent,+ onTap: () =>+ _sortItems(0, _sortColumnIndex == 0 ? !_sortAscending : true),+ child: Container(+ width: double.infinity,+ padding: const EdgeInsets.symmetric(vertical: 8.0),+ child: Row(+ children: [+ Flexible(+ child: Text(+ context.l10n.name,+ style: const TextStyle(fontWeight: FontWeight.bold),+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ ),+ ),+ const SizedBox(width: 8),+ if (_sortColumnIndex == 0)+ Icon(+ _sortAscending+ ? Icons.arrow_upward+ : Icons.arrow_downward,+ size: 16,+ color: Theme.of(context).primaryColor,+ ),+ ],+ ),+ ),+ ),+ ),+ Expanded(+ flex: 1,+ child: GestureDetector(+ behavior: HitTestBehavior.translucent,+ onTap: () =>+ _sortItems(1, _sortColumnIndex == 1 ? !_sortAscending : true),+ child: Container(+ width: double.infinity,+ padding: const EdgeInsets.symmetric(vertical: 8.0),+ child: Row(+ children: [+ Flexible(+ child: Text(+ context.l10n.date,+ style: const TextStyle(fontWeight: FontWeight.bold),+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ ),+ ),+ const SizedBox(width: 8),+ if (_sortColumnIndex == 1)+ Icon(+ _sortAscending+ ? Icons.arrow_upward+ : Icons.arrow_downward,+ size: 16,+ color: Theme.of(context).primaryColor,+ ),+ ],+ ),+ ),+ ),+ ),+ const SizedBox(width: 48),+ ],+ ),+ );+ }+}++abstract class _ListItem {+ String get name;+ DateTime get modificationTime;+ bool get isCollection;++ Collection? get collection => null;++ EnteFile? get file => null;+}++class _CollectionListItem extends _ListItem {+ final Collection _collection;++ _CollectionListItem(this._collection);++ @override+ String get name {+ return _collection.name ?? 'Unnamed Collection';+ }++ @override+ DateTime get modificationTime {+ return DateTime.fromMicrosecondsSinceEpoch(_collection.updationTime);+ }++ @override+ bool get isCollection => true;++ @override+ Collection get collection => _collection;+}++class _FileListItem extends _ListItem {+ final EnteFile _file;++ _FileListItem(this._file);++ @override+ String get name {+ return _file.displayName;+ }++ @override+ DateTime get modificationTime {+ if (_file.updationTime != null) {+ return DateTime.fromMicrosecondsSinceEpoch(_file.updationTime!);+ }+ if (_file.modificationTime != null) {+ return DateTime.fromMillisecondsSinceEpoch(_file.modificationTime!);+ }+ if (_file.creationTime != null) {+ return DateTime.fromMillisecondsSinceEpoch(_file.creationTime!);+ }+ return DateTime.now();+ }++ @override+ bool get isCollection => false;++ @override+ EnteFile get file => _file;+}++class ListItemWidget extends StatelessWidget {+ // ignore: library_private_types_in_public_api+ final _ListItem item;+ final List<Collection> collections;+ final List<OverflowMenuAction>? fileOverflowActions;+ final List<OverflowMenuAction>? collectionOverflowActions;+ final bool isLastItem;++ const ListItemWidget({+ super.key,+ // ignore: library_private_types_in_public_api+ required this.item,+ required this.collections,+ this.fileOverflowActions,+ this.collectionOverflowActions,+ this.isLastItem = false,+ });++ @override+ Widget build(BuildContext context) {+ if (item.isCollection && item.collection != null) {+ return CollectionRowWidget(+ collection: item.collection!,+ overflowActions: collectionOverflowActions,+ isLastItem: isLastItem,+ );+ } else if (!item.isCollection && item.file != null) {+ return FileRowWidget(+ file: item.file!,+ collections: collections,+ overflowActions: fileOverflowActions,+ isLastItem: isLastItem,+ );+ } else {+ return Container(+ padding: const EdgeInsets.all(16),+ child: Text(context.l10n.unknownItemType),+ );+ }+ }+}++class CollectionRowWidget extends StatelessWidget {+ final Collection collection;+ final List<OverflowMenuAction>? overflowActions;+ final bool isLastItem;++ const CollectionRowWidget({+ super.key,+ required this.collection,+ this.overflowActions,+ this.isLastItem = false,+ });++ @override+ Widget build(BuildContext context) {+ final updateTime =+ DateTime.fromMicrosecondsSinceEpoch(collection.updationTime);++ return InkWell(+ onTap: () => _openCollection(context),+ child: Container(+ padding: EdgeInsets.fromLTRB(16.0, 2, 16.0, isLastItem ? 8 : 2),+ decoration: BoxDecoration(+ border: isLastItem+ ? null+ : Border(+ bottom: BorderSide(+ color: Theme.of(context).dividerColor.withOpacity(0.3),+ width: 0.5,+ ),+ ),+ ),+ child: Row(+ children: [+ Expanded(+ flex: 2,+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ Icon(+ Icons.folder_open,+ color: collection.type == CollectionType.favorites+ ? getEnteColorScheme(context).primary500+ : Colors.grey,+ size: 20,+ ),+ const SizedBox(width: 12),+ Flexible(+ child: Text(+ collection.name ?? 'Unnamed Collection',+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ style: getEnteTextTheme(context).body,+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ Expanded(+ flex: 1,+ child: Text(+ formatDate(context, updateTime),+ style: getEnteTextTheme(context).small.copyWith(+ color: Theme.of(context).textTheme.bodySmall?.color,+ ),+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ ),+ ),+ PopupMenuButton<String>(+ onSelected: (value) => _handleMenuAction(context, value),+ icon: const Icon(+ Icons.more_vert,+ size: 20,+ ),+ itemBuilder: (BuildContext context) {+ if (overflowActions != null && overflowActions!.isNotEmpty) {+ return overflowActions!+ .map(+ (action) => PopupMenuItem<String>(+ value: action.id,+ child: Row(+ children: [+ Icon(action.icon, size: 16),+ const SizedBox(width: 8),+ Text(action.label),+ ],+ ),+ ),+ )+ .toList();+ } else {+ return [+ PopupMenuItem<String>(+ value: 'edit',+ child: Row(+ children: [+ const Icon(Icons.edit, size: 16),+ const SizedBox(width: 8),+ Text(context.l10n.edit),+ ],+ ),+ ),+ PopupMenuItem<String>(+ value: 'delete',+ child: Row(+ children: [+ const Icon(Icons.delete, size: 16),+ const SizedBox(width: 8),+ Text(context.l10n.delete),+ ],+ ),+ ),+ ];+ }+ },+ ),+ ],+ ),+ ),+ );+ }++ void _handleMenuAction(BuildContext context, String action) {+ if (overflowActions != null && overflowActions!.isNotEmpty) {+ final customAction = overflowActions!.firstWhere(+ (a) => a.id == action,+ orElse: () => throw StateError('Action not found'),+ );+ customAction.onTap(context, null, collection);+ } else {+ switch (action) {+ case 'edit':+ _editCollection(context);+ break;+ case 'delete':+ _deleteCollection(context);+ break;+ }+ }+ }++ void _editCollection(BuildContext context) {+ CollectionActions.editCollection(context, collection);+ }++ void _deleteCollection(BuildContext context) {+ CollectionActions.deleteCollection(context, collection);+ }++ void _openCollection(BuildContext context) {+ Navigator.of(context).push(+ MaterialPageRoute(+ builder: (context) => CollectionPage(collection: collection),+ ),+ );+ }+}++class FileRowWidget extends StatelessWidget {+ final EnteFile file;+ final List<Collection> collections;+ final List<OverflowMenuAction>? overflowActions;+ final bool isLastItem;++ const FileRowWidget({+ super.key,+ required this.file,+ required this.collections,+ this.overflowActions,+ this.isLastItem = false,+ });++ @override+ Widget build(BuildContext context) {+ final updateTime = file.updationTime != null+ ? DateTime.fromMicrosecondsSinceEpoch(file.updationTime!)+ : (file.modificationTime != null+ ? DateTime.fromMillisecondsSinceEpoch(file.modificationTime!)+ : (file.creationTime != null+ ? DateTime.fromMillisecondsSinceEpoch(file.creationTime!)+ : DateTime.now()));++ return InkWell(+ onTap: () => _openFile(context),+ child: Container(+ padding: EdgeInsets.fromLTRB(16.0, 2, 16.0, isLastItem ? 8 : 2),+ decoration: BoxDecoration(+ border: isLastItem+ ? null+ : Border(+ bottom: BorderSide(+ color: Theme.of(context).dividerColor.withOpacity(0.3),+ width: 0.5,+ ),+ ),+ ),+ child: Row(+ children: [+ Expanded(+ flex: 2,+ child: Padding(+ padding: const EdgeInsets.only(right: 16.0),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ Icon(+ FileIconUtils.getFileIcon(file.displayName),+ color:+ FileIconUtils.getFileIconColor(file.displayName),+ size: 20,+ ),+ const SizedBox(width: 12),+ Flexible(+ child: Text(+ file.displayName,+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ style: getEnteTextTheme(context).body,+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ ),+ Expanded(+ flex: 1,+ child: Text(+ formatDate(context, updateTime),+ style: getEnteTextTheme(context).small.copyWith(+ color: Theme.of(context).textTheme.bodySmall?.color,+ ),+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ ),+ ),+ PopupMenuButton<String>(+ onSelected: (value) => _handleMenuAction(context, value),+ icon: const Icon(+ Icons.more_vert,+ size: 20,+ ),+ itemBuilder: (BuildContext context) {+ if (overflowActions != null && overflowActions!.isNotEmpty) {+ return overflowActions!+ .map(+ (action) => PopupMenuItem<String>(+ value: action.id,+ child: Row(+ children: [+ Icon(action.icon, size: 16),+ const SizedBox(width: 8),+ Text(action.label),+ ],+ ),+ ),+ )+ .toList();+ } else {+ return [+ PopupMenuItem<String>(+ value: 'edit',+ child: Row(+ children: [+ const Icon(Icons.edit, size: 16),+ const SizedBox(width: 8),+ Text(context.l10n.edit),+ ],+ ),+ ),+ PopupMenuItem<String>(+ value: 'share_link',+ child: Row(+ children: [+ const Icon(Icons.share, size: 16),+ const SizedBox(width: 8),+ Text(context.l10n.share),+ ],+ ),+ ),+ PopupMenuItem<String>(+ value: 'delete',+ child: Row(+ children: [+ const Icon(Icons.delete, size: 16),+ const SizedBox(width: 8),+ Text(context.l10n.delete),+ ],+ ),+ ),+ ];+ }+ },+ ),+ ],+ ),+ ),+ );+ }++ void _handleMenuAction(BuildContext context, String action) {+ if (overflowActions != null && overflowActions!.isNotEmpty) {+ final customAction = overflowActions!.firstWhere(+ (a) => a.id == action,+ orElse: () => throw StateError('Action not found'),+ );+ customAction.onTap(context, file, null);+ } else {+ switch (action) {+ case 'edit':+ _showEditDialog(context);+ break;+ case 'share_link':+ _shareLink(context);+ break;+ case 'delete':+ _showDeleteConfirmationDialog(context);+ break;+ }+ }+ }++ Future<void> _shareLink(BuildContext context) async {+ final dialog = createProgressDialog(+ context,+ context.l10n.creatingShareLink,+ isDismissible: false,+ );++ try {+ await dialog.show();++ // Get or create the share link+ final shareableLink = await LinksService.instance.getOrCreateLink(file);++ await dialog.hide();++ // Show the link dialog with copy and delete options+ if (context.mounted) {+ await _showShareLinkDialog(+ context,+ shareableLink.fullURL!,+ shareableLink.linkID,+ );+ }+ } catch (e) {+ await dialog.hide();++ if (context.mounted) {+ SnackBarUtils.showWarningSnackBar(+ context,+ '${context.l10n.failedToCreateShareLink}: ${e.toString()}',+ );+ }+ }+ }++ Future<void> _showShareLinkDialog(+ BuildContext context,+ String url,+ String linkID,+ ) async {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);+ // Capture the root context (with Scaffold) before showing dialog+ final rootContext = context;++ await showDialog<void>(+ context: context,+ builder: (BuildContext dialogContext) {+ return StatefulBuilder(+ builder: (context, setState) {+ return AlertDialog(+ title: Text(+ dialogContext.l10n.share,+ style: textTheme.largeBold,+ ),+ content: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ dialogContext.l10n.shareThisLink,+ style: textTheme.body,+ ),+ const SizedBox(height: 20),+ Container(+ padding: const EdgeInsets.all(12),+ decoration: BoxDecoration(+ color: colorScheme.fillFaint,+ borderRadius: BorderRadius.circular(8),+ border: Border.all(color: colorScheme.strokeFaint),+ ),+ child: Row(+ children: [+ Expanded(+ child: SelectableText(+ url,+ style: textTheme.small,+ ),+ ),+ const SizedBox(width: 8),+ _CopyButton(+ url: url,+ ),+ ],+ ),+ ),+ ],+ ),+ actions: [+ TextButton(+ onPressed: () async {+ Navigator.of(context).pop();+ await _deleteShareLink(rootContext, file.uploadedFileID!);+ },+ child: Text(+ dialogContext.l10n.deleteLink,+ style:+ textTheme.body.copyWith(color: colorScheme.warning500),+ ),+ ),+ TextButton(+ onPressed: () async {+ Navigator.of(dialogContext).pop();+ // Use system share sheet to share the URL+ await shareText(+ url,+ context: rootContext,+ );+ },+ child: Text(+ dialogContext.l10n.shareLink,+ style:+ textTheme.body.copyWith(color: colorScheme.primary500),+ ),+ ),+ ],+ );+ },+ );+ },+ );+ }++ Future<void> _deleteShareLink(BuildContext context, int fileID) async {+ final result = await showChoiceDialog(+ context,+ title: context.l10n.deleteShareLinkDialogTitle,+ body: context.l10n.deleteShareLinkConfirmation,+ firstButtonLabel: context.l10n.delete,+ secondButtonLabel: context.l10n.cancel,+ firstButtonType: ButtonType.critical,+ isCritical: true,+ );+ if (result?.action == ButtonAction.first && context.mounted) {+ final dialog = createProgressDialog(+ context,+ context.l10n.deletingShareLink,+ isDismissible: false,+ );++ try {+ await dialog.show();+ await LinksService.instance.deleteLink(fileID);+ await dialog.hide();++ if (context.mounted) {+ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.shareLinkDeletedSuccessfully,+ );+ }+ } catch (e) {+ await dialog.hide();++ if (context.mounted) {+ SnackBarUtils.showWarningSnackBar(+ context,+ '${context.l10n.failedToDeleteShareLink}: ${e.toString()}',+ );+ }+ }+ }+ }++ Future<void> _showDeleteConfirmationDialog(BuildContext context) async {+ final result = await showChoiceDialog(+ context,+ title: context.l10n.deleteFile,+ body: context.l10n.deleteFileConfirmation(file.displayName),+ firstButtonLabel: context.l10n.delete,+ secondButtonLabel: context.l10n.cancel,+ firstButtonType: ButtonType.critical,+ isCritical: true,+ );++ if (result?.action == ButtonAction.first && context.mounted) {+ await _deleteFile(context);+ }+ }++ Future<void> _deleteFile(BuildContext context) async {+ final dialog = createProgressDialog(+ context,+ context.l10n.deletingFile,+ isDismissible: false,+ );++ try {+ await dialog.show();++ final collections =+ await CollectionService.instance.getCollectionsForFile(file);+ if (collections.isNotEmpty) {+ await CollectionService.instance.trashFile(file, collections.first);+ }++ await dialog.hide();++ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.fileDeletedSuccessfully,+ );+ } catch (e) {+ await dialog.hide();++ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToDeleteFile(e.toString()),+ );+ }+ }++ Future<void> _showEditDialog(BuildContext context) async {+ final allCollections = await CollectionService.instance.getCollections();+ allCollections.removeWhere(+ (c) => c.type == CollectionType.uncategorized,+ );++ final result = await showFileEditDialog(+ context,+ file: file,+ collections: allCollections,+ );++ if (result != null && context.mounted) {+ List<Collection> currentCollections;+ try {+ currentCollections =+ await CollectionService.instance.getCollectionsForFile(file);+ } catch (e) {+ currentCollections = <Collection>[];+ }++ final currentCollectionsSet = currentCollections.toSet();++ final newCollectionsSet = result.selectedCollections.toSet();++ final collectionsToAdd =+ newCollectionsSet.difference(currentCollectionsSet).toList();++ final collectionsToRemove =+ currentCollectionsSet.difference(newCollectionsSet).toList();++ final currentTitle = file.displayName;+ final currentCaption = file.caption ?? '';+ final hasMetadataChanged =+ result.title != currentTitle || result.caption != currentCaption;++ if (hasMetadataChanged || currentCollectionsSet != newCollectionsSet) {+ final dialog = createProgressDialog(+ context,+ context.l10n.pleaseWait,+ isDismissible: false,+ );+ await dialog.show();++ try {+ final List<Future<void>> apiCalls = [];+ for (final collection in collectionsToAdd) {+ apiCalls.add(+ CollectionService.instance.addToCollection(collection, file),+ );+ }+ await Future.wait(apiCalls);+ apiCalls.clear();++ for (final collection in collectionsToRemove) {+ apiCalls.add(+ CollectionService.instance+ .move(file, collection, newCollectionsSet.first),+ );+ }+ if (hasMetadataChanged) {+ apiCalls.add(+ MetadataUpdaterService.instance+ .editFileNameAndCaption(file, result.title, result.caption),+ );+ }+ await Future.wait(apiCalls);++ await dialog.hide();++ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.fileUpdatedSuccessfully,+ );+ } catch (e) {+ await dialog.hide();++ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToUpdateFile(e.toString()),+ );+ }+ } else {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.noChangesWereMade,+ );+ }+ }+ }++ Future<void> _openFile(BuildContext context) async {+ if (file.localPath != null) {+ final localFile = File(file.localPath!);+ if (await localFile.exists()) {+ await _launchFile(context, localFile, file.displayName);+ return;+ }+ }++ final String cachedFilePath =+ "${Configuration.instance.getCacheDirectory()}${file.displayName}";+ final File cachedFile = File(cachedFilePath);+ if (await cachedFile.exists()) {+ await _launchFile(context, cachedFile, file.displayName);+ return;+ }++ final dialog = createProgressDialog(+ context,+ context.l10n.downloading,+ isDismissible: false,+ );++ try {+ await dialog.show();+ final fileKey = await CollectionService.instance.getFileKey(file);+ final decryptedFile = await downloadAndDecrypt(+ file,+ fileKey,+ progressCallback: (downloaded, total) {+ if (total > 0 && downloaded >= 0) {+ final percentage =+ ((downloaded / total) * 100).clamp(0, 100).round();+ dialog.update(+ message: context.l10n.downloadingProgress(percentage),+ );+ } else {+ dialog.update(message: context.l10n.downloading);+ }+ },+ shouldUseCache: true,+ );++ await dialog.hide();++ if (decryptedFile != null) {+ await _launchFile(context, decryptedFile, file.displayName);+ } else {+ await showErrorDialog(+ context,+ context.l10n.downloadFailed,+ context.l10n.failedToDownloadOrDecrypt,+ );+ }+ } catch (e) {+ await dialog.hide();+ await showErrorDialog(+ context,+ context.l10n.errorOpeningFile,+ context.l10n.errorOpeningFileMessage(e.toString()),+ );+ }+ }++ Future<void> _launchFile(+ BuildContext context,+ File file,+ String fileName,+ ) async {+ try {+ await OpenFile.open(file.path);+ } catch (e) {+ await showErrorDialog(+ context,+ context.l10n.errorOpeningFile,+ context.l10n.couldNotOpenFile(e.toString()),+ );+ }+ }+}++class _CopyButton extends StatefulWidget {+ final String url;++ const _CopyButton({+ required this.url,+ });++ @override+ State<_CopyButton> createState() => _CopyButtonState();+}++class _CopyButtonState extends State<_CopyButton> {+ bool _isCopied = false;++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);++ return IconButton(+ onPressed: () async {+ await Clipboard.setData(ClipboardData(text: widget.url));+ setState(() {+ _isCopied = true;+ });+ // Reset the state after 2 seconds+ Future.delayed(const Duration(seconds: 2), () {+ if (mounted) {+ setState(() {+ _isCopied = false;+ });+ }+ });+ },+ icon: Icon(+ _isCopied ? Icons.check : Icons.copy,+ size: 16,+ color: _isCopied ? colorScheme.primary500 : colorScheme.primary500,+ ),+ iconSize: 16,+ constraints: const BoxConstraints(),+ padding: const EdgeInsets.all(4),+ tooltip: _isCopied+ ? context.l10n.linkCopiedToClipboard+ : context.l10n.copyLink,+ );+ }+}++class FileListViewHelpers {+ static Widget createSearchEmptyState({+ required String searchQuery,+ String? message,+ }) {+ return Center(+ child: Padding(+ padding: const EdgeInsets.all(32.0),+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.search_off,+ size: 64,+ color: Colors.grey,+ ),+ const SizedBox(height: 16),+ Text(+ message ?? 'No results found for "$searchQuery"',+ style: const TextStyle(+ color: Colors.grey,+ fontSize: 16,+ ),+ textAlign: TextAlign.center,+ ),+ const SizedBox(height: 8),+ const Text(+ 'Try adjusting your search query',+ style: TextStyle(+ color: Colors.grey,+ fontSize: 14,+ ),+ textAlign: TextAlign.center,+ ),+ ],+ ),+ ),+ );+ }++ static Widget createSearchEverywhereFooter({+ required String searchQuery,+ required VoidCallback onTap,+ BuildContext? context,+ }) {+ return Container(+ margin: const EdgeInsets.all(16.0),+ child: Card(+ elevation: 2,+ child: InkWell(+ onTap: onTap,+ borderRadius: BorderRadius.circular(8.0),+ child: Padding(+ padding: const EdgeInsets.all(16.0),+ child: Row(+ children: [+ Icon(+ Icons.search,+ color: context != null+ ? Theme.of(context).primaryColor+ : Colors.blue,+ size: 24,+ ),+ const SizedBox(width: 16),+ Expanded(+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ 'Search everywhere for "$searchQuery"',+ style: context != null+ ? getEnteTextTheme(context).large.copyWith(+ fontWeight: FontWeight.w500,+ color: Theme.of(context).primaryColor,+ )+ : const TextStyle(+ fontSize: 16,+ fontWeight: FontWeight.w500,+ color: Colors.blue,+ ),+ ),+ const SizedBox(height: 4),+ Text(+ 'Search across all collections and files',+ style: context != null+ ? getEnteTextTheme(context).body.copyWith(+ color: Colors.grey[600],+ )+ : TextStyle(+ fontSize: 14,+ color: Colors.grey[600],+ ),+ ),+ ],+ ),+ ),+ Icon(+ Icons.arrow_forward_ios,+ color: Colors.grey[400],+ size: 16,+ ),+ ],+ ),+ ),+ ),+ ),+ );+ }+}++class FileDataTable extends StatelessWidget {+ final List<EnteFile> files;+ final Function(EnteFile)? onFileTap;+ final bool enableSorting;++ const FileDataTable({+ super.key,+ required this.files,+ this.onFileTap,+ this.enableSorting = false,+ });++ @override+ Widget build(BuildContext context) {+ return Container(+ padding: const EdgeInsets.all(16),+ child: const Text(+ 'FileDataTable is deprecated. Use FileListView instead.',+ style: TextStyle(color: Colors.red),+ ),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/components/recents_section_widget.dart b/mobile/apps/locker/lib/ui/components/recents_section_widget.dartnew file mode 100644index 0000000000..ed30e5fbf8--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/recents_section_widget.dart@@ -0,0 +1,462 @@+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/item_list_view.dart';++class RecentsSectionWidget extends StatefulWidget {+ final List<Collection> collections;+ final List<EnteFile> recentFiles;++ const RecentsSectionWidget({+ super.key,+ required this.collections,+ required this.recentFiles,+ });++ @override+ State<RecentsSectionWidget> createState() => _RecentsSectionWidgetState();+}++class _RecentsSectionWidgetState extends State<RecentsSectionWidget> {+ final Set<Collection> _selectedCollections = {};+ final List<Collection> _selectionOrder = [];+ List<EnteFile> _filteredFilesByCollections = [];+ List<Collection> _availableCollections = [];+ late List<Collection> _originalCollectionOrder;++ @override+ void initState() {+ super.initState();+ _originalCollectionOrder = List.from(widget.collections);+ _availableCollections = List.from(widget.collections);+ _updateFilteredFilesByCollections();+ _updateAvailableCollections();+ }++ @override+ void didUpdateWidget(RecentsSectionWidget oldWidget) {+ super.didUpdateWidget(oldWidget);+ if (oldWidget.recentFiles != widget.recentFiles ||+ oldWidget.collections != widget.collections) {+ _originalCollectionOrder = List.from(widget.collections);+ _updateFilteredFilesByCollections();+ _updateAvailableCollections();+ }+ }++ List<EnteFile> get _displayedFiles {+ if (_selectedCollections.isNotEmpty) {+ return _filteredFilesByCollections;+ } else {+ return widget.recentFiles;+ }+ }++ @override+ Widget build(BuildContext context) {+ return Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ _buildRecentsHeader(),+ const SizedBox(height: 12),+ if (widget.collections.isNotEmpty) ...[+ _buildCollectionChips(),+ const SizedBox(height: 16),+ ],+ _buildRecentsTable(),+ ],+ );+ }++ Widget _buildRecentsHeader() {+ return Text(+ 'Recents',+ style: getEnteTextTheme(context).h3Bold,+ );+ }++ Widget _buildCollectionChips() {+ final orderedCollections = _getOrderedCollections();++ if (orderedCollections.isEmpty) {+ return SizedBox(+ height: 40,+ child: Center(+ child: Text(+ 'No collections to filter by',+ style: TextStyle(+ color: Colors.grey[600],+ fontSize: 14,+ ),+ ),+ ),+ );+ }++ return SizedBox(+ height: 40,+ child: Row(+ children: [+ Expanded(+ child: AnimatedSwitcher(+ duration: const Duration(milliseconds: 300),+ child: ListView.builder(+ key: ValueKey(orderedCollections.map((c) => c.id).join('-')),+ scrollDirection: Axis.horizontal,+ itemCount: orderedCollections.length,+ itemBuilder: (context, index) {+ final collection = orderedCollections[index];+ final isSelected = _selectedCollections.contains(collection);++ return AnimatedContainer(+ duration: const Duration(milliseconds: 200),+ margin: const EdgeInsets.only(right: 8),+ child: _buildCollectionChip(collection, isSelected),+ );+ },+ ),+ ),+ ),+ AnimatedSwitcher(+ duration: const Duration(milliseconds: 300),+ switchInCurve: Curves.easeOut,+ switchOutCurve: Curves.easeIn,+ transitionBuilder: (Widget child, Animation<double> animation) {+ return SlideTransition(+ position: Tween<Offset>(+ begin: const Offset(1.0, 0.0),+ end: Offset.zero,+ ).animate(+ CurvedAnimation(+ parent: animation,+ curve: Curves.easeOut,+ ),+ ),+ child: FadeTransition(+ opacity: animation,+ child: child,+ ),+ );+ },+ child: _selectedCollections.isNotEmpty+ ? Container(+ key: const ValueKey('clear_button'),+ margin: const EdgeInsets.only(left: 8),+ child: _buildClearAllButton(),+ )+ : const SizedBox.shrink(key: ValueKey('no_clear_button')),+ ),+ ],+ ),+ );+ }++ Widget _buildCollectionChip(Collection collection, bool isSelected) {+ return AnimatedSize(+ duration: const Duration(milliseconds: 300),+ curve: Curves.easeOut,+ alignment: Alignment.centerLeft,+ child: GestureDetector(+ onTap: () => _onCollectionSelected(collection),+ child: Container(+ padding: const EdgeInsets.symmetric(horizontal: 12),+ decoration: BoxDecoration(+ color: isSelected ? getEnteColorScheme(context).fillMuted : null,+ border: Border.all(+ color: isSelected+ ? getEnteColorScheme(context).strokeBase+ : getEnteColorScheme(context).fillFaint,+ width: 1,+ ),+ borderRadius: const BorderRadius.all(Radius.circular(20.0)),+ ),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Text(+ collection.name ?? 'Untitled',+ style: getEnteTextTheme(context).mini,+ ),+ AnimatedSwitcher(+ duration: const Duration(milliseconds: 300),+ switchInCurve: Curves.easeOut,+ switchOutCurve: Curves.easeIn,+ transitionBuilder: (Widget child, Animation<double> animation) {+ return SlideTransition(+ position: Tween<Offset>(+ begin: const Offset(1.0, 0.0),+ end: Offset.zero,+ ).animate(+ CurvedAnimation(+ parent: animation,+ curve: Curves.easeOut,+ ),+ ),+ child: FadeTransition(+ opacity: animation,+ child: child,+ ),+ );+ },+ child: isSelected+ ? Row(+ key: const ValueKey('close_button'),+ mainAxisSize: MainAxisSize.min,+ children: [+ const SizedBox(width: 8),+ GestureDetector(+ onTap: () => _onCollectionSelected(collection),+ child: Container(+ padding: const EdgeInsets.all(1),+ decoration: BoxDecoration(+ color: getEnteColorScheme(context).strokeBase,+ shape: BoxShape.circle,+ ),+ child: Icon(+ Icons.close,+ size: 10,+ color: getEnteColorScheme(context).backdropBase,+ ),+ ),+ ),+ ],+ )+ : const SizedBox.shrink(key: ValueKey('no_button')),+ ),+ ],+ ),+ ),+ ),+ );+ }++ Widget _buildClearAllButton() {+ return GestureDetector(+ onTap: _clearAllSelections,+ child: Container(+ padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),+ decoration: BoxDecoration(+ color: getEnteColorScheme(context).fillFaint,+ border: Border.all(+ color: getEnteColorScheme(context).strokeMuted,+ width: 1,+ ),+ borderRadius: const BorderRadius.all(Radius.circular(16.0)),+ ),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Icon(+ Icons.clear_all,+ size: 14,+ color: getEnteColorScheme(context).textMuted,+ ),+ const SizedBox(width: 4),+ Text(+ 'Clear',+ style: getEnteTextTheme(context).miniMuted,+ ),+ ],+ ),+ ),+ );+ }++ Widget _buildRecentsTable() {+ if (_displayedFiles.isEmpty) {+ return Container(+ padding: const EdgeInsets.symmetric(vertical: 40),+ child: Center(+ child: Column(+ children: [+ Icon(+ Icons.folder_off,+ size: 48,+ color: Colors.grey[400],+ ),+ const SizedBox(height: 16),+ Text(+ 'No common items in selected collections',+ style: getEnteTextTheme(context).body.copyWith(+ color: Colors.grey[600],+ ),+ ),+ ],+ ),+ ),+ );+ }++ return ItemListView(+ files: _displayedFiles,+ enableSorting: true,+ );+ }++ void _onCollectionSelected(Collection collection) {+ HapticFeedback.lightImpact();++ setState(() {+ if (_selectedCollections.contains(collection)) {+ _selectedCollections.remove(collection);+ _selectionOrder.remove(collection);+ } else {+ _selectedCollections.add(collection);+ _selectionOrder.add(collection);+ }+ });++ _updateFilteredFilesByCollections();+ _updateAvailableCollections();+ }++ void _clearAllSelections() {+ HapticFeedback.lightImpact();++ setState(() {+ _selectedCollections.clear();+ _selectionOrder.clear();+ });++ _updateFilteredFilesByCollections();+ _updateAvailableCollections();+ }++ Future<void> _updateAvailableCollections() async {+ try {+ final collectionsWithCommonFiles = await _getCollectionsWithCommonFiles(+ _selectedCollections.toList(),+ widget.collections,+ );++ if (mounted) {+ setState(() {+ _availableCollections = collectionsWithCommonFiles;+ });+ }+ } catch (e) {+ if (mounted) {+ setState(() {+ _availableCollections = List.from(widget.collections);+ });+ }+ }+ }++ Future<void> _updateFilteredFilesByCollections() async {+ if (_selectedCollections.isEmpty) {+ _filteredFilesByCollections = [];+ return;+ }++ final filteredFiles = <EnteFile>[];+ for (final file in widget.recentFiles) {+ try {+ final fileCollections =+ await CollectionService.instance.getCollectionsForFile(file);+ final hasAllSelectedCollections = _selectedCollections.every(+ (selectedCollection) => fileCollections.contains(selectedCollection),+ );+ if (hasAllSelectedCollections) {+ filteredFiles.add(file);+ }+ } catch (e) {+ continue;+ }+ }++ if (mounted) {+ setState(() {+ _filteredFilesByCollections = filteredFiles;+ });+ }+ }++ Future<List<Collection>> _getCollectionsWithCommonFiles(+ List<Collection> selectedCollections,+ List<Collection> allCollections,+ ) async {+ if (selectedCollections.isEmpty) {+ return allCollections;+ }++ if (selectedCollections.length == allCollections.length) {+ return allCollections;+ }++ try {+ final Map<int, Set<int>> collectionFileCache = {};++ Future<Set<int>> getCollectionFileIds(Collection collection) async {+ if (collectionFileCache.containsKey(collection.id)) {+ return collectionFileCache[collection.id]!;+ }++ final files =+ await CollectionService.instance.getFilesInCollection(collection);+ final fileIds = files+ .where((file) => file.uploadedFileID != null)+ .map((file) => file.uploadedFileID!)+ .toSet();++ collectionFileCache[collection.id] = fileIds;+ return fileIds;+ }++ final selectedFileIdSets = await Future.wait(+ selectedCollections.map(getCollectionFileIds),+ );++ if (selectedFileIdSets.any((set) => set.isEmpty)) {+ return selectedCollections;+ }++ final commonFileIds =+ selectedFileIdSets.reduce((a, b) => a.intersection(b));++ if (commonFileIds.isEmpty) {+ return selectedCollections;+ }++ final result = <Collection>[];++ for (final collection in allCollections) {+ if (selectedCollections+ .any((selected) => selected.id == collection.id)) {+ result.add(collection);+ } else {+ final collectionFileIds = await getCollectionFileIds(collection);+ if (commonFileIds.any(collectionFileIds.contains)) {+ result.add(collection);+ }+ }+ }++ return result;+ } catch (e) {+ return allCollections;+ }+ }++ List<Collection> _getOrderedCollections() {+ final orderedCollections = <Collection>[];++ for (final collection in _selectionOrder) {+ if (_availableCollections.contains(collection)) {+ orderedCollections.add(collection);+ }+ }++ for (final collection in _originalCollectionOrder) {+ if (_availableCollections.contains(collection) &&+ !_selectedCollections.contains(collection)) {+ orderedCollections.add(collection);+ }+ }++ return orderedCollections;+ }+}diff --git a/mobile/apps/locker/lib/ui/components/search_result_view.dart b/mobile/apps/locker/lib/ui/components/search_result_view.dartnew file mode 100644index 0000000000..6096495a57--- /dev/null+++ b/mobile/apps/locker/lib/ui/components/search_result_view.dart@@ -0,0 +1,60 @@+import 'package:flutter/material.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/item_list_view.dart';++class SearchResultView extends StatelessWidget {+ final List<Collection> collections;+ final List<EnteFile> files;+ final String searchQuery;+ final bool enableSorting;+ final VoidCallback? onCollectionTap;+ final bool isHomePage;+ final VoidCallback? onSearchEverywhere;+ final bool showCollections;++ const SearchResultView({+ super.key,+ required this.collections,+ required this.files,+ this.searchQuery = '',+ this.enableSorting = false,+ this.onCollectionTap,+ this.isHomePage = false,+ this.onSearchEverywhere,+ this.showCollections = true,+ });++ @override+ Widget build(BuildContext context) {+ final displayCollections = showCollections ? collections : <Collection>[];++ // For non-home pages, show search everywhere option+ return Padding(+ padding: const EdgeInsets.only(left: 16, right: 16),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ ItemListView(+ files: files,+ collections: displayCollections,+ enableSorting: enableSorting,+ emptyStateWidget: searchQuery.isNotEmpty+ ? FileListViewHelpers.createSearchEmptyState(+ searchQuery: searchQuery,+ )+ : null,+ ),+ if (!isHomePage &&+ onSearchEverywhere != null &&+ searchQuery.isNotEmpty)+ FileListViewHelpers.createSearchEverywhereFooter(+ searchQuery: searchQuery,+ onTap: onSearchEverywhere!,+ context: context,+ ),+ ],+ ),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/mixins/search_mixin.dart b/mobile/apps/locker/lib/ui/mixins/search_mixin.dartnew file mode 100644index 0000000000..e52437cf94--- /dev/null+++ b/mobile/apps/locker/lib/ui/mixins/search_mixin.dart@@ -0,0 +1,348 @@+import 'dart:async';++import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';++class CollectionSearchResult {+ final bool matches;+ final bool nameMatches;+ final List<EnteFile> files;++ CollectionSearchResult({+ required this.matches,+ required this.nameMatches,+ required this.files,+ });+}++mixin SearchMixin<T extends StatefulWidget> on State<T> {+ String _searchQuery = '';+ bool _isSearchActive = false;+ bool _isSearching = false;+ Timer? _searchDebounceTimer;+ final TextEditingController _searchController = TextEditingController();+ final FocusNode _searchFocusNode = FocusNode();++ List<Collection> get allCollections;+ List<EnteFile> get allFiles;++ void onSearchResultsChanged(+ List<Collection> collections,+ List<EnteFile> files,+ );++ void onSearchStateChanged(bool isActive) {}++ @override+ void dispose() {+ _searchController.dispose();+ _searchFocusNode.dispose();+ _searchDebounceTimer?.cancel();+ super.dispose();+ }++ Widget buildSearchAction() {+ if (_isSearchActive) {+ return Flexible(+ child: Container(+ margin: const EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),+ constraints: const BoxConstraints(+ minWidth: 200,+ maxWidth: double.infinity,+ ),+ child: TextField(+ controller: _searchController,+ focusNode: _searchFocusNode,+ autofocus: true,+ onChanged: _onSearchChanged,+ decoration: InputDecoration(+ hintText: context.l10n.searchHint,+ hintStyle: TextStyle(+ color: Theme.of(context)+ .textTheme+ .bodyMedium+ ?.color+ ?.withOpacity(0.6),+ ),+ border: OutlineInputBorder(+ borderRadius: BorderRadius.circular(20.0),+ borderSide: BorderSide.none,+ ),+ filled: true,+ fillColor: getEnteColorScheme(context).backdropBase,+ contentPadding: const EdgeInsets.symmetric(+ horizontal: 16.0,+ vertical: 8.0,+ ),+ prefixIcon: _isSearching+ ? Container(+ width: 20,+ height: 20,+ padding: const EdgeInsets.all(8.0),+ child: CircularProgressIndicator(+ strokeWidth: 2,+ valueColor: AlwaysStoppedAnimation<Color>(+ Theme.of(context)+ .textTheme+ .bodyMedium+ ?.color+ ?.withOpacity(0.6) ??+ Colors.grey,+ ),+ ),+ )+ : Icon(+ Icons.search,+ size: 20,+ color: Theme.of(context)+ .textTheme+ .bodyMedium+ ?.color+ ?.withOpacity(0.6),+ ),+ ),+ style: TextStyle(+ fontSize: 14,+ color: Theme.of(context).textTheme.bodyMedium?.color,+ ),+ ),+ ),+ );+ } else {+ return IconButton(+ icon: const Icon(Icons.search),+ onPressed: _activateSearch,+ );+ }+ }++ List<Widget> buildSearchActions() {+ if (_isSearchActive) {+ return [+ IconButton(+ icon: const Icon(Icons.close),+ onPressed: _deactivateSearch,+ ),+ ];+ }+ return [];+ }++ Widget? buildSearchLeading({Widget? defaultLeading}) {+ if (_isSearchActive) {+ return null;+ }+ return defaultLeading;+ }++ void _activateSearch() {+ setState(() {+ _isSearchActive = true;+ });+ onSearchStateChanged(true);+ WidgetsBinding.instance.addPostFrameCallback((_) {+ _searchFocusNode.requestFocus();+ });+ }++ void _deactivateSearch() {+ setState(() {+ _isSearchActive = false;+ _searchQuery = '';+ });+ _searchController.clear();+ onSearchStateChanged(false);+ unawaited(_performSearch(''));+ }++ void _clearSearch() {+ _searchController.clear();+ _onSearchChanged('');+ }++ void _onSearchChanged(String query) {+ _searchDebounceTimer?.cancel();++ if (query.isEmpty && _searchQuery.isNotEmpty) {+ setState(() {+ _searchQuery = query;+ });+ unawaited(_performSearch(query));+ return;+ }++ _searchDebounceTimer = Timer(const Duration(milliseconds: 300), () {+ if (mounted) {+ setState(() {+ _searchQuery = query;+ });+ unawaited(_performSearch(query));+ }+ });+ }++ Future<void> _performSearch(String query) async {+ if (!mounted) return;++ setState(() {+ _isSearching = true;+ });++ try {+ if (query.isEmpty) {+ if (mounted) {+ onSearchResultsChanged(allCollections, allFiles);+ }+ return;+ }++ final List<Collection> filteredCollections = [];+ final List<EnteFile> collectionFiles = [];++ for (final collection in allCollections) {+ if (!mounted) return;+ final searchResult = await _searchInCollection(collection, query);+ if (searchResult.matches) {+ filteredCollections.add(collection);+ if (searchResult.nameMatches) {+ collectionFiles.addAll(searchResult.files);+ }+ }+ }++ final Set<String> addedFileIds =+ collectionFiles.map((f) => f.uploadedFileID.toString()).toSet();+ final filteredFiles = allFiles.where((file) {+ if (addedFileIds.contains(file.uploadedFileID.toString())) {+ return false;+ }+ return _searchInFile(file, query);+ }).toList();++ final List<EnteFile> allFilteredFiles = [+ ...collectionFiles,+ ...filteredFiles,+ ];++ if (mounted) {+ onSearchResultsChanged(filteredCollections, allFilteredFiles);+ }+ } catch (e) {+ debugPrint('Search error: $e');+ if (mounted) {+ onSearchResultsChanged(allCollections, allFiles);+ }+ } finally {+ if (mounted) {+ setState(() {+ _isSearching = false;+ });+ }+ }+ }++ Future<CollectionSearchResult> _searchInCollection(+ Collection collection,+ String query,+ ) async {+ try {+ final files =+ await CollectionService.instance.getFilesInCollection(collection);+ final collectionNameMatches = _containsQuery(+ collection.name ?? '',+ query,+ );+ final fileMatches = files.any((file) => _searchInFile(file, query));++ return CollectionSearchResult(+ matches: collectionNameMatches || fileMatches,+ nameMatches: collectionNameMatches,+ files: collectionNameMatches ? files : [],+ );+ } catch (e) {+ debugPrint('Error searching in collection ${collection.name}: $e');+ final collectionNameMatches = _containsQuery(+ collection.name ?? '',+ query,+ );+ return CollectionSearchResult(+ matches: collectionNameMatches,+ nameMatches: collectionNameMatches,+ files: [],+ );+ }+ }++ bool _searchInFile(EnteFile file, String query) {+ return _containsQuery(file.displayName, query) ||+ _containsQuery(file.title ?? '', query) ||+ _containsQuery(file.caption ?? '', query) ||+ _containsQuery(file.pubMagicMetadata.editedName ?? '', query) ||+ _containsQuery(file.pubMagicMetadata.uploaderName ?? '', query);+ }++ bool _containsQuery(String text, String query) {+ if (text.isEmpty) return false;+ final lowerText = text.toLowerCase();+ final lowerQuery = query.toLowerCase();++ if (lowerText.contains(lowerQuery)) {+ return true;+ }+ final words = lowerText.split(RegExp(r'[\s\-_\.]+'));+ return words.any((word) => word.startsWith(lowerQuery));+ }++ /// Handle keyboard shortcuts+ bool handleKeyEvent(KeyEvent event) {+ if (event is KeyDownEvent) {+ // Clear search or close search on ESC+ if (event.logicalKey == LogicalKeyboardKey.escape) {+ if (_isSearchActive) {+ if (_searchQuery.isNotEmpty) {+ _clearSearch();+ } else {+ _deactivateSearch();+ }+ return true;+ }+ }+ // Activate search on Ctrl+F (Cmd+F on Mac)+ else if (event.logicalKey == LogicalKeyboardKey.keyF &&+ (HardwareKeyboard.instance.isMetaPressed ||+ HardwareKeyboard.instance.isControlPressed)) {+ if (!_isSearchActive) {+ _activateSearch();+ return true;+ }+ }+ }+ return false;+ }++ String get searchQuery => _searchQuery;+ bool get isSearchActive => _isSearchActive;+ bool get isSearching => _isSearching;+ TextEditingController get searchController => _searchController;++ /// Programmatically activate search with a specific query+ void activateSearchWithQuery(String query) {+ setState(() {+ _isSearchActive = true;+ _searchQuery = query;+ });+ _searchController.text = query;+ onSearchStateChanged(true);+ unawaited(_performSearch(query));++ // Focus the search field after the widget is built+ WidgetsBinding.instance.addPostFrameCallback((_) {+ _searchFocusNode.requestFocus();+ });+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart b/mobile/apps/locker/lib/ui/pages/all_collections_page.dartnew file mode 100644index 0000000000..f225f4f0e2--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart@@ -0,0 +1,408 @@+import 'dart:async';++import 'package:ente_events/event_bus.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/events/collections_updated_event.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/trash/trash_service.dart';+import 'package:locker/ui/components/item_list_view.dart';+import 'package:locker/ui/components/search_result_view.dart';+import 'package:locker/ui/mixins/search_mixin.dart';+import 'package:locker/ui/pages/collection_page.dart';+import 'package:locker/ui/pages/home_page.dart';+import 'package:locker/ui/pages/trash_page.dart';+import 'package:locker/utils/collection_sort_util.dart';+import 'package:logging/logging.dart';++class AllCollectionsPage extends StatefulWidget {+ const AllCollectionsPage({super.key});++ @override+ State<AllCollectionsPage> createState() => _AllCollectionsPageState();+}++class _AllCollectionsPageState extends State<AllCollectionsPage>+ with SearchMixin {+ List<Collection> _sortedCollections = [];+ List<Collection> _allCollections = [];+ Collection? _uncategorizedCollection;+ int? _uncategorizedFileCount;+ List<EnteFile> _allFiles = [];+ bool _isLoading = true;+ String? _error;+ final _logger = Logger("AllCollectionsPage");++ @override+ List<Collection> get allCollections => _allCollections;++ @override+ List<EnteFile> get allFiles => _allFiles;++ @override+ void onSearchResultsChanged(+ List<Collection> collections,+ List<EnteFile> files,+ ) {+ setState(() {+ if (searchQuery.isEmpty) {+ final regularCollections = collections+ .where((c) => c.type != CollectionType.uncategorized)+ .toList();+ _sortedCollections =+ CollectionSortUtil.getSortedCollections(regularCollections);+ } else {+ _sortedCollections =+ CollectionSortUtil.getSortedCollections(collections);+ }+ });+ }++ @override+ void initState() {+ super.initState();+ _loadCollections();+ Bus.instance.on<CollectionsUpdatedEvent>().listen((event) async {+ await _loadCollections();+ });+ }++ Future<void> _loadCollections() async {+ setState(() {+ _isLoading = true;+ _error = null;+ });++ try {+ final collections = await CollectionService.instance.getCollections();++ final regularCollections = <Collection>[];+ Collection? uncategorized;++ for (final collection in collections) {+ if (collection.type == CollectionType.uncategorized) {+ uncategorized = collection;+ } else {+ regularCollections.add(collection);+ }+ }++ CollectionSortUtil.sortCollections(regularCollections);++ _allCollections = List.from(collections);+ _sortedCollections = List.from(regularCollections);+ _uncategorizedCollection = uncategorized;+ _uncategorizedFileCount = uncategorized != null+ ? (await CollectionService.instance+ .getFilesInCollection(uncategorized))+ .length+ : 0;+ _allFiles = await CollectionService.instance.getAllFiles();++ setState(() {+ _isLoading = false;+ });+ } catch (e) {+ _logger.severe("Failed to load collections", e);+ setState(() {+ _error = 'Failed to load collections: $e';+ _isLoading = false;+ });+ }+ }++ @override+ Widget build(BuildContext context) {+ return KeyboardListener(+ focusNode: FocusNode(),+ onKeyEvent: handleKeyEvent,+ child: Scaffold(+ appBar: AppBar(+ leading: buildSearchLeading(),+ title: Text(context.l10n.collections),+ centerTitle: false,+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,+ foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,+ actions: [+ buildSearchAction(),+ ...buildSearchActions(),+ ],+ ),+ body: _buildBody(),+ ),+ );+ }++ Widget _buildBody() {+ if (_isLoading) {+ return const Center(+ child: CircularProgressIndicator(),+ );+ }++ if (_error != null) {+ return Center(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.error_outline,+ color: Colors.red,+ size: 64,+ ),+ const SizedBox(height: 16),+ Text(+ _error!,+ style: const TextStyle(color: Colors.red),+ textAlign: TextAlign.center,+ ),+ const SizedBox(height: 16),+ ElevatedButton(+ onPressed: _loadCollections,+ child: Text(context.l10n.retry),+ ),+ ],+ ),+ );+ }++ if (isSearchActive) {+ return Padding(+ padding: const EdgeInsets.only(top: 16),+ child: SearchResultView(+ collections: _sortedCollections,+ files: const [],+ searchQuery: searchQuery,+ enableSorting: true,+ isHomePage: false,+ onSearchEverywhere: _searchEverywhere,+ ),+ );+ }++ if (_sortedCollections.isEmpty) {+ if (searchQuery.isNotEmpty) {+ return FileListViewHelpers.createSearchEmptyState(+ searchQuery: searchQuery,+ message: context.l10n.noCollectionsFoundForQuery(searchQuery),+ );+ } else {+ return Center(+ child: Padding(+ padding: const EdgeInsets.all(32.0),+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.folder_open,+ size: 64,+ color: Colors.grey,+ ),+ const SizedBox(height: 16),+ Text(+ context.l10n.noCollectionsFound,+ style: getEnteTextTheme(context).large.copyWith(+ color: Colors.grey,+ ),+ textAlign: TextAlign.center,+ ),+ ],+ ),+ ),+ );+ }+ }++ return Padding(+ padding: const EdgeInsets.all(16.0),+ child: Column(+ children: [+ if (searchQuery.isNotEmpty)+ Container(+ padding: const EdgeInsets.only(bottom: 16.0),+ alignment: Alignment.centerLeft,+ child: Text(+ '${_sortedCollections.length} result${_sortedCollections.length == 1 ? '' : 's'} for "$searchQuery"',+ style: getEnteTextTheme(context).small.copyWith(+ color: Theme.of(context).textTheme.bodySmall?.color,+ ),+ ),+ ),+ Flexible(+ child: ItemListView(+ collections: _sortedCollections,+ enableSorting: true,+ ),+ ),+ if (!isSearchActive && _uncategorizedCollection != null)+ _buildUncategorizedHook(),+ _buildTrashHook(),+ ],+ ),+ );+ }++ Widget _buildTrashHook() {+ return Container(+ margin: const EdgeInsets.only(top: 8.0, bottom: 16.0),+ child: InkWell(+ onTap: _openTrash,+ borderRadius: BorderRadius.circular(12.0),+ child: Container(+ padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),+ decoration: BoxDecoration(+ color: Theme.of(context).colorScheme.surface.withOpacity(0.3),+ border: Border.all(+ color: Theme.of(context).dividerColor.withOpacity(0.5),+ width: 0.5,+ ),+ borderRadius: BorderRadius.circular(12.0),+ ),+ child: Row(+ children: [+ Icon(+ Icons.delete_outline,+ color: Theme.of(context)+ .textTheme+ .bodyLarge+ ?.color+ ?.withOpacity(0.7),+ size: 22,+ ),+ const SizedBox(width: 12),+ Expanded(+ child: Text(+ context.l10n.trash,+ style: getEnteTextTheme(context).large.copyWith(+ fontWeight: FontWeight.w500,+ ),+ ),+ ),+ Icon(+ Icons.chevron_right,+ color: Theme.of(context)+ .textTheme+ .bodyMedium+ ?.color+ ?.withOpacity(0.6),+ size: 20,+ ),+ ],+ ),+ ),+ ),+ );+ }++ Future<void> _openTrash() async {+ final trashFiles = await TrashService.instance.getTrashFiles();+ await Navigator.of(context).push(+ MaterialPageRoute(+ builder: (context) => TrashPage(trashFiles: trashFiles),+ ),+ );+ }++ void _searchEverywhere() {+ Navigator.of(context).pushAndRemoveUntil(+ MaterialPageRoute(+ builder: (context) => HomePage(initialSearchQuery: searchQuery),+ ),+ (route) => false,+ );+ }++ Widget _buildUncategorizedHook() {+ if (_uncategorizedCollection == null) return const SizedBox.shrink();++ return Container(+ margin: const EdgeInsets.only(top: 16.0, bottom: 8.0),+ child: InkWell(+ onTap: () => _openUncategorized(),+ borderRadius: BorderRadius.circular(12.0),+ child: Container(+ padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),+ decoration: BoxDecoration(+ color: Theme.of(context).colorScheme.surface.withOpacity(0.3),+ border: Border.all(+ color: Theme.of(context).dividerColor.withOpacity(0.5),+ width: 0.5,+ ),+ borderRadius: BorderRadius.circular(12.0),+ ),+ child: Row(+ children: [+ Icon(+ Icons.folder_open_outlined,+ color: Theme.of(context)+ .textTheme+ .bodyLarge+ ?.color+ ?.withOpacity(0.7),+ size: 22,+ ),+ const SizedBox(width: 12),+ Expanded(+ child: Row(+ children: [+ Text(+ context.l10n.uncategorized,+ style: getEnteTextTheme(context).large.copyWith(+ fontWeight: FontWeight.w500,+ ),+ ),+ if (_uncategorizedFileCount! > 0) ...[+ const SizedBox(width: 8),+ Text(+ 'β’',+ style: getEnteTextTheme(context).small.copyWith(+ color: Theme.of(context)+ .textTheme+ .bodySmall+ ?.color+ ?.withOpacity(0.5),+ ),+ ),+ const SizedBox(width: 8),+ Text(+ '${_uncategorizedFileCount!}',+ style: getEnteTextTheme(context).small.copyWith(+ color: Theme.of(context)+ .textTheme+ .bodySmall+ ?.color+ ?.withOpacity(0.7),+ ),+ ),+ ],+ ],+ ),+ ),+ Icon(+ Icons.chevron_right,+ color: Theme.of(context)+ .textTheme+ .bodyMedium+ ?.color+ ?.withOpacity(0.6),+ size: 20,+ ),+ ],+ ),+ ),+ ),+ );+ }++ Future<void> _openUncategorized() async {+ await Navigator.of(context).push(+ MaterialPageRoute(+ builder: (context) =>+ CollectionPage(collection: _uncategorizedCollection!),+ ),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/collection_page.dart b/mobile/apps/locker/lib/ui/pages/collection_page.dartnew file mode 100644index 0000000000..4185890b45--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/collection_page.dart@@ -0,0 +1,275 @@+import 'package:ente_events/event_bus.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:locker/events/collections_updated_event.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/item_list_view.dart';+import 'package:locker/ui/components/search_result_view.dart';+import 'package:locker/ui/mixins/search_mixin.dart';+import 'package:locker/ui/pages/home_page.dart';+import 'package:locker/ui/pages/uploader_page.dart';+import 'package:locker/utils/collection_actions.dart';++class CollectionPage extends UploaderPage {+ final Collection collection;++ const CollectionPage({+ super.key,+ required this.collection,+ });++ @override+ State<CollectionPage> createState() => _CollectionPageState();+}++class _CollectionPageState extends UploaderPageState<CollectionPage>+ with SearchMixin {+ late Collection _collection;+ List<EnteFile> _files = [];+ List<EnteFile> _filteredFiles = [];++ @override+ void onFileUploadComplete() {+ CollectionService.instance.getCollections().then((collections) {+ setState(() {+ _initializeData(collections.where((c) => c.id == _collection.id).first);+ });+ });+ }++ @override+ List<Collection> get allCollections => [];++ @override+ List<EnteFile> get allFiles => _files;++ @override+ Collection get selectedCollection => _collection;++ @override+ void onSearchResultsChanged(+ List<Collection> collections, List<EnteFile> files,) {+ setState(() {+ _filteredFiles = files;+ });+ }++ @override+ void onSearchStateChanged(bool isActive) {+ if (!isActive) {+ setState(() {+ _filteredFiles = _files;+ });+ }+ }++ List<EnteFile> get _displayedFiles =>+ isSearchActive ? _filteredFiles : _files;++ @override+ void initState() {+ super.initState();+ _initializeData(widget.collection);+ Bus.instance.on<CollectionsUpdatedEvent>().listen((event) async {+ final collection = (await CollectionService.instance.getCollections())+ .where(+ (c) => c.id == widget.collection.id,+ )+ .first;+ await _initializeData(collection);+ });+ }++ Future<void> _initializeData(Collection collection) async {+ _collection = collection;+ _files = await CollectionService.instance.getFilesInCollection(_collection);+ _filteredFiles = _files;+ setState(() {});+ }++ Future<void> _deleteCollection() async {+ await CollectionActions.deleteCollection(+ context,+ _collection,+ onSuccess: () {+ if (mounted) {+ Navigator.of(context).pop();+ }+ },+ );+ }++ Future<void> _editCollection() async {+ await CollectionActions.editCollection(+ context,+ _collection,+ onSuccess: () {+ setState(() {});+ },+ );+ }++ @override+ Widget build(BuildContext context) {+ return KeyboardListener(+ focusNode: FocusNode(),+ onKeyEvent: handleKeyEvent,+ child: Scaffold(+ appBar: _buildAppBar(),+ body: _buildBody(),+ floatingActionButton:+ isSearchActive ? const SizedBox.shrink() : _buildFAB(),+ ),+ );+ }++ PreferredSizeWidget _buildAppBar() {+ return AppBar(+ leading: buildSearchLeading(),+ title: Text(+ _collection.name ?? context.l10n.untitled,+ style: const TextStyle(fontWeight: FontWeight.bold),+ ),+ elevation: 0,+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,+ foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,+ actions: [+ buildSearchAction(),+ ...buildSearchActions(),+ _buildMenuButton(),+ ],+ );+ }++ Widget _buildMenuButton() {+ return PopupMenuButton<String>(+ icon: const Icon(Icons.more_vert),+ onSelected: (value) {+ switch (value) {+ case 'edit':+ _editCollection();+ break;+ case 'delete':+ _deleteCollection();+ break;+ }+ },+ itemBuilder: (BuildContext context) {+ return [+ PopupMenuItem<String>(+ value: 'edit',+ child: Row(+ children: [+ const Icon(Icons.edit),+ const SizedBox(width: 12),+ Text(context.l10n.edit),+ ],+ ),+ ),+ PopupMenuItem<String>(+ value: 'delete',+ child: Row(+ children: [+ const Icon(Icons.delete, color: Colors.red),+ const SizedBox(width: 12),+ Text(+ context.l10n.delete,+ style: const TextStyle(color: Colors.red),+ ),+ ],+ ),+ ),+ ];+ },+ );+ }++ Widget _buildBody() {+ if (isSearchActive) {+ return SearchResultView(+ collections: const [], // CollectionPage primarily shows files+ files: _filteredFiles,+ searchQuery: searchQuery,+ enableSorting: true,+ isHomePage: false,+ onSearchEverywhere: _searchEverywhere,+ );+ }++ return SingleChildScrollView(+ padding: const EdgeInsets.only(left: 16, right: 16),+ child: _buildFilesList(),+ );+ }++ Widget _buildFilesList() {+ return _displayedFiles.isEmpty+ ? SizedBox(+ height: 400,+ child: _buildEmptyState(),+ )+ : ItemListView(+ key: ValueKey(_displayedFiles.length),+ files: _displayedFiles,+ enableSorting: true,+ );+ }++ Widget _buildEmptyState() {+ return Padding(+ padding: const EdgeInsets.all(32.0),+ child: Center(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Icon(+ isSearchActive ? Icons.search_off : Icons.folder_off,+ size: 64,+ color: Colors.grey,+ ),+ const SizedBox(height: 16),+ Text(+ isSearchActive+ ? 'No files found for "$searchQuery"'+ : context.l10n.noFilesFound,+ style: getEnteTextTheme(context).large.copyWith(+ color: Colors.grey,+ ),+ textAlign: TextAlign.center,+ ),+ if (isSearchActive) ...[+ const SizedBox(height: 8),+ Text(+ 'Try adjusting your search query',+ style: getEnteTextTheme(context).body.copyWith(+ color: Colors.grey[600],+ ),+ textAlign: TextAlign.center,+ ),+ ],+ ],+ ),+ ),+ );+ }++ void _searchEverywhere() {+ Navigator.of(context).pushAndRemoveUntil(+ MaterialPageRoute(+ builder: (context) => HomePage(initialSearchQuery: searchQuery),+ ),+ (route) => false,+ );+ }++ Widget _buildFAB() {+ return FloatingActionButton(+ onPressed: addFile,+ tooltip: context.l10n.addFiles,+ child: const Icon(Icons.add),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dartnew file mode 100644index 0000000000..86aa5b708e--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart@@ -0,0 +1,785 @@+import 'dart:async';+import 'dart:io';+import 'dart:math';++import 'package:ente_events/event_bus.dart';+import 'package:ente_ui/components/buttons/gradient_button.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:ente_utils/email_util.dart';+import 'package:flutter/material.dart';+import 'package:listen_sharing_intent/listen_sharing_intent.dart';+import 'package:locker/events/collections_updated_event.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/ui/components/information_addition_dialog.dart';+import 'package:locker/ui/components/recents_section_widget.dart';+import 'package:locker/ui/components/search_result_view.dart';+import 'package:locker/ui/mixins/search_mixin.dart';+import 'package:locker/ui/pages/all_collections_page.dart';+import 'package:locker/ui/pages/collection_page.dart';+import 'package:locker/ui/pages/uploader_page.dart';+import 'package:locker/utils/collection_actions.dart';+import 'package:locker/utils/collection_sort_util.dart';+import "package:locker/utils/snack_bar_utils.dart";+import 'package:logging/logging.dart';++class HomePage extends UploaderPage {+ final String? initialSearchQuery;++ const HomePage({super.key, this.initialSearchQuery});++ @override+ State<HomePage> createState() => _HomePageState();+}++class _HomePageState extends UploaderPageState<HomePage>+ with TickerProviderStateMixin, SearchMixin {+ List<Collection> _collections = [];+ List<Collection> _filteredCollections = [];+ List<EnteFile> _recentFiles = [];+ List<EnteFile> _filteredFiles = [];+ Map<int, int> _collectionFileCounts = {};+ bool _isLoading = true;+ String? _error;+ final _logger = Logger('HomePage');+ StreamSubscription? _mediaStreamSubscription;++ @override+ void onFileUploadComplete() {+ _loadCollections();+ }++ @override+ List<Collection> get allCollections => _collections;++ @override+ List<EnteFile> get allFiles => _recentFiles;++ @override+ void onSearchResultsChanged(+ List<Collection> collections,+ List<EnteFile> files,+ ) {+ setState(() {+ _filteredCollections =+ CollectionSortUtil.filterAndSortCollections(collections);+ _filteredFiles = files;+ });+ }++ @override+ void onSearchStateChanged(bool isActive) {+ if (!isActive) {+ setState(() {+ _filteredCollections =+ CollectionSortUtil.filterAndSortCollections(_collections);+ _filteredFiles = _recentFiles;+ });+ }+ }++ List<Collection> get _displayedCollections {+ final collections = isSearchActive ? _filteredCollections : _collections;+ return CollectionSortUtil.filterAndSortCollections(collections);+ }++ final ValueNotifier<bool> _isFabOpen = ValueNotifier<bool>(false);+ late AnimationController _animationController;+ late Animation<double> _animation;++ @override+ void initState() {+ super.initState();+ _animationController = AnimationController(+ duration: const Duration(milliseconds: 300),+ vsync: this,+ );+ _animation = Tween<double>(+ begin: 0.0,+ end: 1.0,+ ).animate(+ CurvedAnimation(+ parent: _animationController,+ curve: Curves.easeInOut,+ ),+ );++ if (CollectionService.instance.hasCompletedFirstSync()) {+ _loadCollections();+ }++ // Initialize sharing functionality to handle shared files+ WidgetsBinding.instance.addPostFrameCallback((_) {+ if (mounted) {+ // Add a small delay to ensure the app is fully loaded+ Future.delayed(const Duration(milliseconds: 1000), () {+ if (mounted) {+ initializeSharing();+ }+ });+ }+ });++ // Activate search if initial query is provided (after collections are loaded)+ if (widget.initialSearchQuery != null &&+ widget.initialSearchQuery!.isNotEmpty) {+ WidgetsBinding.instance.addPostFrameCallback((_) {+ // Wait a bit more to ensure collections are loaded+ Future.delayed(const Duration(milliseconds: 100), () {+ if (mounted) {+ activateSearchWithQuery(widget.initialSearchQuery!);+ }+ });+ });+ }++ Bus.instance.on<CollectionsUpdatedEvent>().listen((event) async {+ await _loadCollections();+ });+ }++ @override+ void dispose() {+ _animationController.dispose();+ _isFabOpen.dispose();+ disposeSharing();+ super.dispose();+ }++ void initializeSharing() {+ _logger.info('Initializing sharing functionality...');++ try {+ _mediaStreamSubscription =+ ReceiveSharingIntent.instance.getMediaStream().listen(+ (List<SharedMediaFile> value) {+ _logger+ .info('Received shared media files via stream: ${value.length}');+ for (var file in value) {+ _logger.info('Shared file: ${file.path}, type: ${file.type}');+ }+ if (value.isNotEmpty) {+ _handleSharedFiles(value);+ }+ },+ onError: (err) {+ _logger.severe('Error receiving shared media: $err');+ },+ );++ _logger.info('Media stream subscription created successfully');+ } catch (e) {+ _logger.severe('Error setting up media stream: $e');+ }++ _checkInitialSharedContent();+ }++ Future<void> _checkInitialSharedContent() async {+ try {+ _logger.info('Checking for initial shared content...');++ final initialMedia =+ await ReceiveSharingIntent.instance.getInitialMedia();+ _logger.info('Initial media check result: ${initialMedia.length} files');++ if (initialMedia.isNotEmpty) {+ _logger+ .info('Found initial shared media files: ${initialMedia.length}');+ for (var file in initialMedia) {+ _logger.info('Initial shared file: ${file.path}, type: ${file.type}');+ }+ await _handleSharedFiles(initialMedia);+ } else {+ _logger.info('No initial shared media files found');+ }+ } catch (e) {+ _logger.severe('Error checking initial shared content: $e');+ }+ }++ Future<void> _handleSharedFiles(List<SharedMediaFile> sharedFiles) async {+ _logger.info('_handleSharedFiles called with ${sharedFiles.length} files');++ if (!mounted) {+ _logger.warning('Context not mounted, cannot handle shared files');+ return;+ }++ try {+ for (final sharedFile in sharedFiles) {+ _logger.info('Processing shared file: ${sharedFile.path}');+ if (sharedFile.path.isNotEmpty) {+ final file = File(sharedFile.path);+ if (await file.exists()) {+ _logger.info('File exists, uploading: ${sharedFile.path}');+ await uploadFile(file);+ } else {+ _logger.warning('Shared file does not exist: ${sharedFile.path}');+ }+ } else {+ _logger.warning('Shared file has empty path');+ }+ }++ await ReceiveSharingIntent.instance.reset();+ _logger.info('Reset sharing intent after handling files');+ } catch (e) {+ _logger.severe('Error handling shared files: $e');+ if (mounted) {+ await showErrorDialog(+ context,+ 'Upload Error',+ 'Failed to process shared files: $e',+ );+ }+ }+ }++ void disposeSharing() {+ _mediaStreamSubscription?.cancel();+ ReceiveSharingIntent.instance.reset();+ _logger.info('Sharing functionality disposed');+ }++ Future<void> _loadCollections() async {+ try {+ setState(() {+ _isLoading = true;+ _error = null;+ });++ final collections = await CollectionService.instance.getCollections();+ await _loadRecentFiles(collections);++ final sortedCollections =+ CollectionSortUtil.getSortedCollections(collections);++ setState(() {+ _collections = sortedCollections;+ _filteredCollections =+ CollectionSortUtil.filterAndSortCollections(sortedCollections);+ _filteredFiles = _recentFiles;+ _isLoading = false;+ });++ await _loadCollectionFileCounts();+ } catch (error) {+ setState(() {+ _error = 'Error fetching collections: $error';+ _isLoading = false;+ });+ }+ }++ Future<void> _loadRecentFiles(List<Collection> collections) async {+ final allFiles = await CollectionService.instance.getAllFiles();++ final uniqueFilesMap = <String, EnteFile>{};++ for (final file in allFiles) {+ final key = file.uploadedFileID?.toString() ?? file.toString();+ if (!uniqueFilesMap.containsKey(key)) {+ uniqueFilesMap[key] = file;+ }+ }++ final uniqueFiles = uniqueFilesMap.values.toList();+ uniqueFiles.sort((a, b) {+ final timeA = a.updationTime ?? a.modificationTime ?? 0;+ final timeB = b.updationTime ?? b.modificationTime ?? 0;+ return timeB.compareTo(timeA);+ });++ _recentFiles = uniqueFiles;+ }++ void _navigateToCollection(Collection collection) {+ Navigator.of(context).push(+ MaterialPageRoute(+ builder: (context) => CollectionPage(collection: collection),+ ),+ );+ }++ @override+ Widget build(BuildContext context) {+ return KeyboardListener(+ focusNode: FocusNode(),+ onKeyEvent: handleKeyEvent,+ child: Scaffold(+ appBar: AppBar(+ automaticallyImplyLeading: false,+ leading: buildSearchLeading(),+ title: GestureDetector(+ onLongPress: () {+ sendLogs(+ context,+ '[email protected]',+ subject: 'Locker logs',+ body: 'Debug logs for Locker app.\n\n',+ );+ },+ child: const Text(+ 'Locker',+ style: TextStyle(fontWeight: FontWeight.bold),+ ),+ ),+ elevation: 0,+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,+ foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,+ actions: [+ buildSearchAction(),+ ...buildSearchActions(),+ ],+ ),+ body: _buildBody(),+ floatingActionButton:+ isSearchActive ? const SizedBox.shrink() : _buildMultiOptionFab(),+ ),+ );+ }++ Widget _buildBody() {+ if (_isLoading) {+ return const Center(+ child: CircularProgressIndicator(),+ );+ }++ if (_error != null) {+ return SingleChildScrollView(+ physics: const AlwaysScrollableScrollPhysics(),+ child: SizedBox(+ height: MediaQuery.of(context).size.height - 200,+ child: Center(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.error_outline,+ color: Colors.red,+ size: 64,+ ),+ const SizedBox(height: 16),+ Text(+ _error!,+ style: const TextStyle(color: Colors.red),+ textAlign: TextAlign.center,+ ),+ const SizedBox(height: 16),+ ElevatedButton(+ onPressed: () => _loadCollections(),+ child: Text(context.l10n.retry),+ ),+ ],+ ),+ ),+ ),+ );+ }++ if (isSearchActive) {+ return SingleChildScrollView(+ physics: const AlwaysScrollableScrollPhysics(),+ child: SearchResultView(+ collections: _filteredCollections,+ files: _filteredFiles,+ searchQuery: searchQuery,+ enableSorting: true,+ isHomePage: true,+ ),+ );+ }++ if (_displayedCollections.isEmpty) {+ return SingleChildScrollView(+ physics: const AlwaysScrollableScrollPhysics(),+ child: SizedBox(+ height: MediaQuery.of(context).size.height - 200,+ child: _buildEmptyState(+ icon: Icons.folder_outlined,+ title: context.l10n.noCollectionsFound,+ subtitle: context.l10n.createYourFirstCollection,+ action: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 40),+ child: GradientButton(+ onTap: _createCollection,+ text: context.l10n.createCollection,+ iconData: Icons.add,+ paddingValue: 8.0,+ ),+ ),+ ),+ ),+ );+ }++ return LayoutBuilder(+ builder: (context, constraints) {+ return SingleChildScrollView(+ padding: const EdgeInsets.all(16.0),+ physics: const AlwaysScrollableScrollPhysics(),+ child: ConstrainedBox(+ constraints: BoxConstraints(+ minHeight: constraints.maxHeight - 32, // Account for padding+ ),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ _buildCollectionsHeader(),+ const SizedBox(height: 24),+ _buildCollectionsGrid(),+ const SizedBox(height: 24),+ _buildRecentsSection(),+ ],+ ),+ ),+ );+ },+ );+ }++ Widget _buildRecentsSection() {+ if (_recentFiles.isEmpty) {+ return Container(+ padding: const EdgeInsets.symmetric(vertical: 40),+ child: _buildEmptyState(+ icon: Icons.description_outlined,+ title: context.l10n.nothingYet,+ subtitle: context.l10n.uploadYourFirstDocument,+ action: GradientButton(+ onTap: addFile,+ text: context.l10n.uploadDocument,+ iconData: Icons.file_upload,+ paddingValue: 8.0,+ ),+ ),+ );+ }+ return RecentsSectionWidget(+ collections: CollectionSortUtil.filterAndSortCollections(_collections),+ recentFiles: _recentFiles,+ );+ }++ Future<void> _createCollection() async {+ final createdCollection = await CollectionActions.createCollection(context);++ if (createdCollection != null) {+ await _loadCollections();+ _navigateToCollection(createdCollection);+ }+ }++ Future<void> _addInformation() async {+ final result = await showInformationAdditionDialog(context);++ if (result != null && mounted) {+ switch (result.type) {+ case InformationType.physicalDocument:+ await _addPhysicalDocument();+ break;+ case InformationType.emergencyContact:+ await _addEmergencyContact();+ break;+ case InformationType.accountCredential:+ await _addAccountCredential();+ break;+ }+ }+ }++ Future<void> _addPhysicalDocument() async {+ SnackBarUtils.showInfoSnackBar(+ context,+ "Soon",+ );+ }++ Future<void> _addEmergencyContact() async {+ SnackBarUtils.showInfoSnackBar(+ context,+ "Soon",+ );+ }++ Future<void> _addAccountCredential() async {+ SnackBarUtils.showInfoSnackBar(+ context,+ "Soon",+ );+ }++ Widget _buildEmptyState({+ required IconData icon,+ required String title,+ required String subtitle,+ Widget? action,+ }) {+ return Center(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Icon(icon, size: 64, color: Colors.grey),+ const SizedBox(height: 16),+ Text(+ title,+ style: getEnteTextTheme(context).large.copyWith(color: Colors.grey),+ ),+ const SizedBox(height: 8),+ Text(+ subtitle,+ style: getEnteTextTheme(context).body.copyWith(color: Colors.grey),+ ),+ if (action != null) ...[+ const SizedBox(height: 24),+ action,+ ],+ ],+ ),+ );+ }++ Widget _buildFabLabel(String text) {+ return Container(+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),+ decoration: BoxDecoration(+ color: getEnteColorScheme(context).fillBase,+ borderRadius: BorderRadius.circular(16),+ ),+ child: Text(+ text,+ style: getEnteTextTheme(context).small.copyWith(+ color: getEnteColorScheme(context).backgroundBase,+ ),+ ),+ );+ }++ Widget _buildFabOption({+ required String label,+ required IconData icon,+ required VoidCallback onPressed,+ required String heroTag,+ }) {+ return Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ _buildFabLabel(label),+ const SizedBox(width: 8),+ FloatingActionButton(+ heroTag: heroTag,+ mini: true,+ onPressed: onPressed,+ backgroundColor: getEnteColorScheme(context).fillBase,+ child: Icon(icon),+ ),+ ],+ );+ }++ Widget _buildCollectionsHeader() {+ return GestureDetector(+ behavior: HitTestBehavior.opaque,+ onTap: () {+ SnackBarUtils.showWarningSnackBar(context, "Hello");+ Navigator.of(context).push(+ MaterialPageRoute(+ builder: (context) => const AllCollectionsPage(),+ ),+ );+ },+ child: Row(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [+ Text(+ context.l10n.collections,+ style: getEnteTextTheme(context).h3Bold,+ ),+ const Icon(+ Icons.chevron_right,+ color: Colors.grey,+ ),+ ],+ ),+ );+ }++ Widget _buildCollectionsGrid() {+ return MediaQuery.removePadding(+ context: context,+ removeBottom: true,+ removeTop: true,+ child: GridView.builder(+ shrinkWrap: true,+ physics: const NeverScrollableScrollPhysics(),+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(+ crossAxisCount: 2,+ crossAxisSpacing: 12,+ mainAxisSpacing: 12,+ childAspectRatio: 2.2,+ ),+ itemCount: min(_displayedCollections.length, 4),+ itemBuilder: (context, index) {+ final collection = _displayedCollections[index];+ final collectionName = collection.name ?? 'Unnamed Collection';++ return GestureDetector(+ onTap: () => _navigateToCollection(collection),+ child: Container(+ decoration: BoxDecoration(+ borderRadius: BorderRadius.circular(8),+ color: getEnteColorScheme(context).fillFaint,+ ),+ padding: const EdgeInsets.all(12),+ child: Stack(+ children: [+ Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Text(+ collectionName,+ style: getEnteTextTheme(context).body.copyWith(+ fontWeight: FontWeight.w500,+ ),+ textAlign: TextAlign.left,+ overflow: TextOverflow.ellipsis,+ maxLines: 1,+ ),+ const SizedBox(height: 4),+ Text(+ context.l10n+ .items(_collectionFileCounts[collection.id] ?? 0),+ style: getEnteTextTheme(context).small.copyWith(+ color: Colors.grey[600],+ ),+ textAlign: TextAlign.left,+ ),+ ],+ ),+ if (collection.type == CollectionType.favorites)+ Positioned(+ top: 0,+ right: 0,+ child: Icon(+ Icons.star,+ color: getEnteColorScheme(context).primary500,+ size: 18,+ ),+ ),+ ],+ ),+ ),+ );+ },+ ),+ );+ }++ Widget _buildMultiOptionFab() {+ return ValueListenableBuilder<bool>(+ valueListenable: _isFabOpen,+ builder: (context, isFabOpen, child) {+ return Stack(+ children: [+ if (isFabOpen)+ Positioned.fill(+ child: GestureDetector(+ onTap: _toggleFab,+ child: Container(+ color: Colors.transparent,+ ),+ ),+ ),+ Positioned(+ right: 0,+ bottom: 0,+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.end,+ children: [+ if (isFabOpen) ...[+ ScaleTransition(+ scale: _animation,+ child: Container(+ margin: const EdgeInsets.only(bottom: 16),+ child: _buildFabOption(+ label: context.l10n.addInformation,+ icon: Icons.post_add,+ onPressed: () {+ _toggleFab();+ _addInformation();+ },+ heroTag: "addInformation",+ ),+ ),+ ),+ if (_collections.isNotEmpty)+ ScaleTransition(+ scale: _animation,+ child: Container(+ margin: const EdgeInsets.only(bottom: 8),+ child: _buildFabOption(+ label: context.l10n.uploadDocumentTooltip,+ icon: Icons.file_upload,+ onPressed: () {+ _toggleFab();+ addFile();+ },+ heroTag: "addFile",+ ),+ ),+ ),+ ],+ FloatingActionButton(+ onPressed: _toggleFab,+ child: AnimatedRotation(+ turns: isFabOpen ? 0.125 : 0.0, // 45 degrees when open+ duration: const Duration(milliseconds: 300),+ child: const Icon(Icons.add),+ ),+ ),+ ],+ ),+ ),+ ],+ );+ },+ );+ }++ void _toggleFab() {+ _isFabOpen.value = !_isFabOpen.value;++ if (_isFabOpen.value) {+ _animationController.forward();+ } else {+ _animationController.reverse();+ }+ }++ Future<void> _loadCollectionFileCounts() async {+ final counts = <int, int>{};++ for (final collection in _displayedCollections.take(4)) {+ try {+ final files =+ await CollectionService.instance.getFilesInCollection(collection);+ counts[collection.id] = files.length;+ } catch (e) {+ counts[collection.id] = 0;+ }+ }++ if (mounted) {+ setState(() {+ _collectionFileCounts = counts;+ });+ }+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/onboarding_page.dart b/mobile/apps/locker/lib/ui/pages/onboarding_page.dartnew file mode 100644index 0000000000..a5654f0e3a--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/onboarding_page.dart@@ -0,0 +1,227 @@+import 'package:ente_accounts/pages/email_entry_page.dart';+import 'package:ente_accounts/pages/login_page.dart';+import 'package:ente_accounts/pages/password_entry_page.dart';+import 'package:ente_accounts/pages/password_reentry_page.dart';+import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/gradient_button.dart';+import 'package:ente_ui/components/developer_settings_widget.dart';+import "package:ente_ui/pages/developer_settings_page.dart";+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/configuration.dart';+import 'package:locker/ui/pages/home_page.dart';++class OnboardingPage extends StatefulWidget {+ const OnboardingPage({super.key});++ @override+ State<OnboardingPage> createState() => _OnboardingPageState();+}++class _OnboardingPageState extends State<OnboardingPage> {+ static const kDeveloperModeTapCountThreshold = 7;++ int _developerModeTapCount = 0;++ @override+ Widget build(BuildContext context) {+ debugPrint("Building OnboardingPage");+ final l10n = context.l10n;+ return Scaffold(+ body: SafeArea(+ child: GestureDetector(+ onTap: () async {+ _developerModeTapCount++;+ if (_developerModeTapCount >= kDeveloperModeTapCountThreshold) {+ _developerModeTapCount = 0;+ final result = await showChoiceDialog(+ context,+ title: l10n.developerSettings,+ firstButtonLabel: l10n.yes,+ body: l10n.developerSettingsWarning,+ isDismissible: false,+ );+ if (result?.action == ButtonAction.first) {+ await Navigator.of(context).push(+ MaterialPageRoute(+ builder: (BuildContext context) {+ return DeveloperSettingsPage(Configuration.instance);+ },+ ),+ );+ setState(() {});+ }+ }+ },+ child: LayoutBuilder(+ builder: (context, constraints) {+ return SingleChildScrollView(+ child: ConstrainedBox(+ constraints: BoxConstraints(+ minHeight: constraints.maxHeight,+ maxWidth: 450,+ ),+ child: IntrinsicHeight(+ child: Padding(+ padding: const EdgeInsets.symmetric(+ vertical: 40.0,+ horizontal: 40,+ ),+ child: Column(+ children: [+ Expanded(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ Image.asset(+ "assets/locker.png",+ width: 200,+ height: 200,+ ),+ const SizedBox(height: 12),+ Text(+ "ente",+ style: getEnteTextTheme(context).h1.copyWith(+ fontWeight: FontWeight.bold,+ fontFamily: 'Montserrat',+ ),+ ),+ const SizedBox(height: 4),+ Text(+ "Locker",+ style: Theme.of(context)+ .textTheme+ .headlineMedium,+ ),+ const SizedBox(height: 32),+ Text(+ l10n.onBoardingBody,+ textAlign: TextAlign.center,+ style: Theme.of(context)+ .textTheme+ .titleLarge!+ .copyWith(+ color: Colors.white38,+ ),+ ),+ ],+ ),+ ),+ Container(+ width: double.infinity,+ padding: const EdgeInsets.symmetric(horizontal: 20),+ child: GradientButton(+ onTap: _navigateToSignUpPage,+ text: l10n.newUser,+ ),+ ),+ const SizedBox(height: 16),+ Container(+ height: 56,+ width: double.infinity,+ padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),+ child: Hero(+ tag: "log_in",+ child: ElevatedButton(+ style: ElevatedButton.styleFrom().copyWith(+ shape: WidgetStateProperty.all<+ RoundedRectangleBorder>(+ RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(32.0),+ ),+ ),+ ),+ onPressed: _navigateToSignInPage,+ child: Text(+ l10n.existingUser,+ style: const TextStyle(+ color: Colors.white, // same for both themes+ ),+ ),+ ),+ ),+ ),+ const SizedBox(height: 4),+ DeveloperSettingsWidget(Configuration.instance),+ ],+ ),+ ),+ ),+ ),+ );+ },+ ),+ ),+ ),+ );+ }++ void _navigateToSignUpPage() {+ Widget page;+ if (Configuration.instance.getEncryptedToken() == null) {+ page = EmailEntryPage(Configuration.instance);+ } else {+ // No key+ if (Configuration.instance.getKeyAttributes() == null) {+ // Never had a key+ page = PasswordEntryPage(+ Configuration.instance,+ PasswordEntryMode.set,+ const HomePage(),+ );+ } else if (Configuration.instance.getKey() == null) {+ // Yet to decrypt the key+ page = PasswordReentryPage(+ Configuration.instance,+ const HomePage(),+ );+ } else {+ // All is well, user just has not subscribed+ page = const HomePage();+ }+ }+ Navigator.of(context).push(+ MaterialPageRoute(+ builder: (BuildContext context) {+ return page;+ },+ ),+ );+ }++ void _navigateToSignInPage() {+ Widget page;+ if (Configuration.instance.getEncryptedToken() == null) {+ page = LoginPage(Configuration.instance);+ } else {+ // No key+ if (Configuration.instance.getKeyAttributes() == null) {+ // Never had a key+ page = PasswordEntryPage(+ Configuration.instance,+ PasswordEntryMode.set,+ const HomePage(),+ );+ } else if (Configuration.instance.getKey() == null) {+ // Yet to decrypt the key+ page = PasswordReentryPage(+ Configuration.instance,+ const HomePage(),+ );+ } else {+ // All is well, user just has not subscribed+ // page = getSubscriptionPage(isOnBoarding: true);+ page = const HomePage();+ }+ }+ Navigator.of(context).push(+ MaterialPageRoute(+ builder: (BuildContext context) {+ return page;+ },+ ),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/trash_page.dart b/mobile/apps/locker/lib/ui/pages/trash_page.dartnew file mode 100644index 0000000000..5f4261898d--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/trash_page.dart@@ -0,0 +1,404 @@+import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/models/file.dart';+import 'package:locker/services/trash/models/trash_file.dart';+import 'package:locker/services/trash/trash_service.dart';+import 'package:locker/ui/components/item_list_view.dart';+import 'package:locker/utils/snack_bar_utils.dart';++class TrashPage extends StatefulWidget {+ final List<TrashFile> trashFiles;++ const TrashPage({+ super.key,+ required this.trashFiles,+ });++ @override+ State<TrashPage> createState() => _TrashPageState();+}++class _TrashPageState extends State<TrashPage> {+ List<TrashFile> _sortedTrashFiles = [];+ List<TrashFile> _allTrashFiles = [];++ @override+ void initState() {+ super.initState();+ _allTrashFiles = List.from(widget.trashFiles);+ _sortedTrashFiles = List.from(widget.trashFiles);+ }++ List<OverflowMenuAction> _getFileOverflowActions() {+ return [+ OverflowMenuAction(+ id: 'restore',+ label: context.l10n.restore,+ icon: Icons.restore,+ onTap: (context, file, collection) {+ _restoreFile(context, file!);+ },+ ),+ OverflowMenuAction(+ id: 'delete',+ label: context.l10n.delete,+ icon: Icons.delete_forever,+ onTap: (context, file, collection) {+ _deleteFilePermanently(context, file!);+ },+ ),+ ];+ }++ void _restoreFile(BuildContext context, EnteFile file) async {+ final collections = await CollectionService.instance.getCollections();++ final availableCollections = collections+ .where((c) => !c.isDeleted && c.type != CollectionType.uncategorized)+ .toList();++ if (availableCollections.isEmpty) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.noCollectionsAvailableForRestore,+ );+ return;+ }++ final selectedCollection = await _showCollectionPickerDialog(+ context,+ availableCollections,+ file.displayName,+ );++ if (selectedCollection != null) {+ await _performRestore(context, file, selectedCollection);+ }+ }++ void _deleteFilePermanently(BuildContext context, EnteFile file) {+ TrashService.instance.deleteFromTrash([file]).then((_) {+ setState(() {+ _sortedTrashFiles.remove(file);+ _allTrashFiles.remove(file);+ });+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.deletedPermanently(file.displayName),+ );+ }).catchError((error) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToDeleteFile(error.toString()),+ );+ });+ }++ Future<Collection?> _showCollectionPickerDialog(+ BuildContext context,+ List<Collection> collections,+ String fileName,+ ) async {+ return showDialog<Collection>(+ context: context,+ barrierColor: getEnteColorScheme(context).backdropBase,+ builder: (context) => _CollectionPickerDialog(+ collections: collections,+ fileName: fileName,+ ),+ );+ }++ Future<void> _performRestore(+ BuildContext context,+ EnteFile file,+ Collection targetCollection,+ ) async {+ final dialog = createProgressDialog(+ context,+ context.l10n.restoring,+ isDismissible: false,+ );++ try {+ await dialog.show();++ await TrashService.instance.restore([file], targetCollection);++ setState(() {+ _sortedTrashFiles.remove(file);+ _allTrashFiles.remove(file);+ });++ await dialog.hide();++ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.restoredFileToCollection(+ file.displayName,+ targetCollection.name ?? 'Unnamed Collection',+ ),+ );+ } catch (error) {+ await dialog.hide();++ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToRestoreFile(file.displayName, error.toString()),+ );+ }+ }++ Future<void> _emptyTrash() async {+ final result = await showChoiceDialog(+ context,+ title: context.l10n.emptyTrash,+ body: context.l10n.emptyTrashConfirmation,+ firstButtonLabel: context.l10n.emptyTrash,+ secondButtonLabel: context.l10n.cancel,+ firstButtonType: ButtonType.critical,+ isCritical: true,+ );++ if (result?.action == ButtonAction.first && context.mounted) {+ await _performEmptyTrash();+ }+ }++ Future<void> _performEmptyTrash() async {+ final dialog = createProgressDialog(+ context,+ context.l10n.clearingTrash,+ isDismissible: false,+ );+ await dialog.show();+ try {+ await TrashService.instance.emptyTrash();+ setState(() {+ _sortedTrashFiles.clear();+ _allTrashFiles.clear();+ });+ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.trashClearedSuccessfully,+ );+ Navigator.of(context).pop();+ } catch (error) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToClearTrash(error.toString()),+ );+ } finally {+ await dialog.hide();+ }+ }++ @override+ Widget build(BuildContext context) {+ return Scaffold(+ appBar: AppBar(+ title: Text(context.l10n.trash),+ centerTitle: false,+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,+ foregroundColor: Theme.of(context).textTheme.bodyLarge?.color,+ actions: [+ IconButton(+ icon: const Icon(Icons.delete_sweep),+ onPressed: _emptyTrash,+ tooltip: context.l10n.emptyTrashTooltip,+ ),+ ],+ ),+ body: _buildBody(),+ );+ }++ Widget _buildBody() {+ if (_sortedTrashFiles.isEmpty) {+ return Center(+ child: Padding(+ padding: const EdgeInsets.all(32.0),+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [+ const Icon(+ Icons.delete_outline,+ size: 64,+ color: Colors.grey,+ ),+ const SizedBox(height: 16),+ Text(+ context.l10n.trashIsEmpty,+ style: getEnteTextTheme(context).large.copyWith(+ color: Colors.grey,+ ),+ textAlign: TextAlign.center,+ ),+ ],+ ),+ ),+ );+ }++ return Padding(+ padding: const EdgeInsets.all(16.0),+ child: ItemListView(+ files: _sortedTrashFiles.cast<EnteFile>(),+ enableSorting: true,+ fileOverflowActions: _getFileOverflowActions(),+ ),+ );+ }+}++class _CollectionPickerDialog extends StatefulWidget {+ final List<Collection> collections;+ final String fileName;++ const _CollectionPickerDialog({+ required this.collections,+ required this.fileName,+ });++ @override+ State<_CollectionPickerDialog> createState() =>+ _CollectionPickerDialogState();+}++class _CollectionPickerDialogState extends State<_CollectionPickerDialog> {+ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final textTheme = getEnteTextTheme(context);++ return Dialog(+ backgroundColor: colorScheme.backgroundElevated,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(8),+ ),+ child: Container(+ width: 400,+ constraints: const BoxConstraints(maxHeight: 600),+ padding: const EdgeInsets.all(20),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ const Icon(+ Icons.restore,+ color: Colors.green,+ size: 24,+ ),+ const SizedBox(width: 8),+ Expanded(+ child: Text(+ context.l10n.restoreFile(widget.fileName),+ style: textTheme.largeBold,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ ],+ ),+ const SizedBox(height: 20),+ Flexible(+ child: Container(+ height: 150,+ decoration: BoxDecoration(+ borderRadius: BorderRadius.circular(8),+ border: Border.all(color: colorScheme.strokeFaint),+ ),+ child: widget.collections.isEmpty+ ? Container(+ padding: const EdgeInsets.all(16),+ child: Center(+ child: Text(+ context.l10n.noCollectionsAvailable,+ style: textTheme.body.copyWith(+ color: colorScheme.textMuted,+ ),+ ),+ ),+ )+ : Scrollbar(+ thumbVisibility: true,+ thickness: 6,+ radius: const Radius.circular(3),+ child: GridView.builder(+ gridDelegate:+ const SliverGridDelegateWithFixedCrossAxisCount(+ crossAxisCount: 2,+ childAspectRatio: 3.5,+ crossAxisSpacing: 6,+ mainAxisSpacing: 6,+ ),+ padding: const EdgeInsets.all(6),+ itemCount: widget.collections.length,+ itemBuilder: (context, index) {+ final collection = widget.collections[index];+ final collectionName =+ collection.name ?? 'Unnamed Collection';++ return InkWell(+ onTap: () =>+ Navigator.of(context).pop(collection),+ borderRadius: BorderRadius.circular(8),+ child: Container(+ padding: const EdgeInsets.symmetric(+ horizontal: 6,+ vertical: 4,+ ),+ decoration: BoxDecoration(+ color: colorScheme.fillFaint,+ borderRadius: BorderRadius.circular(8),+ border: Border.all(+ color: colorScheme.strokeFaint,+ width: 1,+ ),+ ),+ child: Center(+ child: Text(+ collectionName,+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ fontWeight: FontWeight.normal,+ ),+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ textAlign: TextAlign.center,+ ),+ ),+ ),+ );+ },+ ),+ ),+ ),+ ),+ const SizedBox(height: 20),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ Flexible(+ child: ButtonWidget(+ buttonType: ButtonType.secondary,+ labelText: context.l10n.cancel,+ onTap: () async => Navigator.of(context).pop(),+ ),+ ),+ ],+ ),+ ],+ ),+ ),+ );+ }+}diff --git a/mobile/apps/locker/lib/ui/pages/uploader_page.dart b/mobile/apps/locker/lib/ui/pages/uploader_page.dartnew file mode 100644index 0000000000..ae2e3145fc--- /dev/null+++ b/mobile/apps/locker/lib/ui/pages/uploader_page.dart@@ -0,0 +1,111 @@+import 'dart:io';++import 'package:ente_ui/pages/base_home_page.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:file_picker/file_picker.dart';+import 'package:flutter/material.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/services/files/sync/metadata_updater_service.dart';+import 'package:locker/services/files/upload/file_upload_service.dart';+import 'package:locker/ui/components/file_upload_dialog.dart';+import 'package:logging/logging.dart';++/// Abstract base class that provides file upload functionality.+/// Contains common file picking and uploading logic that can be reused+/// across different pages like HomePage and CollectionPage.+abstract class UploaderPage extends BaseHomePage {+ const UploaderPage({super.key});+}++abstract class UploaderPageState<T extends UploaderPage> extends State<T> {+ final _logger = Logger('UploaderPage');++ /// Returns the collection that should be pre-selected in the upload dialog.+ /// Return null to default to uncategorized collection.+ Collection? get selectedCollection => null;++ /// Called after a successful file upload to refresh the UI+ void onFileUploadComplete();++ /// Opens a file picker dialog and uploads the selected file+ Future<void> addFile() async {+ final FilePickerResult? result =+ await FilePicker.platform.pickFiles(type: FileType.any);++ if (result != null && result.files.isNotEmpty) {+ final selectedFile = result.files.first;+ if (selectedFile.path != null) {+ await uploadFile(File(selectedFile.path!));+ }+ }+ }++ Future<void> uploadFile(File file) async {+ final progressDialog = createProgressDialog(context, "Uploading...");+ try {+ final List<Future> futures = [];++ final collections = await CollectionService.instance.getCollections();++ final collectionsWithoutUncategorized = collections+ .where((c) => c.type != CollectionType.uncategorized)+ .toList();++ final uploadResult = await showFileUploadDialog(+ context,+ file: file,+ collections: collectionsWithoutUncategorized,+ selectedCollection: selectedCollection,+ );++ if (uploadResult != null && uploadResult.selectedCollections.isNotEmpty) {+ final fileUploadFuture = FileUploader.instance+ .upload(file, uploadResult.selectedCollections.first);+ futures.add(fileUploadFuture);+ futures.add(+ fileUploadFuture.then((enteFile) async {+ // Add to additional collections if multiple were selected+ for (int cIndex = 1;+ cIndex < uploadResult.selectedCollections.length;+ cIndex++) {+ futures.add(+ CollectionService.instance.addToCollection(+ uploadResult.selectedCollections[cIndex],+ enteFile,+ ),+ );+ }++ if (uploadResult.note.isNotEmpty) {+ futures.add(+ MetadataUpdaterService.instance+ .editFileCaption(enteFile, uploadResult.note),+ );+ }+ }).catchError((e) {+ _logger.severe('File upload failed', e);+ }),+ );+ }++ if (futures.isNotEmpty) {+ await progressDialog.show();+ await Future.wait(futures);+ _logger.info('File upload completed successfully');+ await CollectionService.instance.sync();+ onFileUploadComplete();+ }+ } catch (e, s) {+ _logger.severe('Failed to upload file', e, s);+ await showGenericErrorDialog(+ context: context,+ error: e,+ );+ } finally {+ if (progressDialog.isShowing()) {+ await progressDialog.hide();+ }+ }+ }+}diff --git a/mobile/apps/locker/lib/utils/collection_actions.dart b/mobile/apps/locker/lib/utils/collection_actions.dartnew file mode 100644index 0000000000..90bdc76473--- /dev/null+++ b/mobile/apps/locker/lib/utils/collection_actions.dart@@ -0,0 +1,160 @@+import 'package:ente_ui/components/buttons/button_widget.dart';+import 'package:ente_ui/components/buttons/models/button_type.dart';+import 'package:ente_ui/utils/dialog_util.dart';+import 'package:flutter/material.dart';+import 'package:locker/l10n/l10n.dart';+import 'package:locker/services/collections/collections_service.dart';+import 'package:locker/services/collections/models/collection.dart';+import 'package:locker/utils/snack_bar_utils.dart';+import 'package:logging/logging.dart';++/// Utility class for common collection actions like edit and delete+class CollectionActions {+ static final _logger = Logger('CollectionActions');++ /// Shows a dialog to create a new collection+ static Future<Collection?> createCollection(+ BuildContext context, {+ bool autoSelectInParent = false,+ }) async {+ Collection? createdCollection;++ final nameSuggestion =+ await CollectionService.instance.getRandomUnusedCollectionName();++ final result = await showTextInputDialog(+ context,+ title: context.l10n.createNewCollection,+ submitButtonLabel: context.l10n.create,+ hintText: nameSuggestion,+ alwaysShowSuccessState: true,+ textCapitalization: TextCapitalization.words,+ onSubmit: (String text) async {+ // indicates user cancelled the creation request+ if (text.trim().isEmpty) {+ return;+ }++ try {+ createdCollection =+ await CollectionService.instance.createCollection(text.trim());+ } catch (e, s) {+ _logger.severe('Failed to create collection', e, s);+ rethrow;+ }+ },+ );++ if (result is Exception) {+ if (context.mounted) {+ await showGenericErrorDialog(+ context: context,+ error: result,+ );+ }+ return null;+ } else if (createdCollection != null) {+ return createdCollection;+ }++ return null;+ }++ // Shows a dialog to edit/rename a collection+ static Future<void> editCollection(+ BuildContext context,+ Collection collection, {+ VoidCallback? onSuccess,+ }) async {+ await showTextInputDialog(+ context,+ title: context.l10n.renameCollection,+ initialValue: collection.name ?? '',+ hintText: context.l10n.documentsHint,+ submitButtonLabel: context.l10n.save,+ onSubmit: (String newName) async {+ if (newName.isEmpty || newName == collection.name) return;++ final progressDialog =+ createProgressDialog(context, context.l10n.pleaseWait);+ await progressDialog.show();++ try {+ await CollectionService.instance.rename(collection, newName);+ await progressDialog.hide();++ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.collectionRenamedSuccessfully,+ );++ // Update the collection name locally+ collection.setName(newName);++ // Call success callback if provided+ onSuccess?.call();+ } catch (error) {+ await progressDialog.hide();++ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToRenameCollection(error.toString()),+ );+ }+ },+ );+ }++ /// Shows a confirmation dialog and deletes a collection+ static Future<void> deleteCollection(+ BuildContext context,+ Collection collection, {+ VoidCallback? onSuccess,+ }) async {+ if (!collection.type.canDelete) {+ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.collectionCannotBeDeleted,+ );+ return;+ }++ final collectionName = collection.name ?? 'this collection';++ final dialogChoice = await showChoiceDialog(+ context,+ title: context.l10n.deleteCollection,+ body: context.l10n.deleteCollectionConfirmation(collectionName),+ firstButtonLabel: context.l10n.delete,+ secondButtonLabel: context.l10n.cancel,+ firstButtonType: ButtonType.critical,+ isCritical: true,+ );++ if (dialogChoice?.action != ButtonAction.first) return;++ final progressDialog =+ createProgressDialog(context, context.l10n.pleaseWait);+ await progressDialog.show();++ try {+ await CollectionService.instance.trashCollection(collection);+ await progressDialog.hide();++ SnackBarUtils.showInfoSnackBar(+ context,+ context.l10n.collectionDeletedSuccessfully,+ );++ // Call success callback if provided+ onSuccess?.call();+ } catch (error) {+ await progressDialog.hide();++ SnackBarUtils.showWarningSnackBar(+ context,+ context.l10n.failedToDeleteCollection(error.toString()),+ );+ }+ }+}diff --git a/mobile/apps/locker/lib/utils/collection_sort_util.dart b/mobile/apps/locker/lib/utils/collection_sort_util.dartnew file mode 100644index 0000000000..80e12f9426--- /dev/null+++ b/mobile/apps/locker/lib/utils/collection_sort_util.dart@@ -0,0 +1,101 @@+import 'package:locker/services/collections/models/collection.dart';++/// Utility class for sorting collections with consistent logic across the app+class CollectionSortUtil {+ /// Sorts collections with Important (favorites) collection first, then alphabetically by name+ static void sortCollections(List<Collection> collections) {+ collections.sort((a, b) {+ // Important collection (favorites) should come first+ if (a.type == CollectionType.favorites &&+ b.type != CollectionType.favorites) {+ return -1;+ }+ if (b.type == CollectionType.favorites &&+ a.type != CollectionType.favorites) {+ return 1;+ }+ // For other collections, sort alphabetically by name+ final nameA = a.name ?? a.name ?? '';+ final nameB = b.name ?? b.name ?? '';+ return nameA.toLowerCase().compareTo(nameB.toLowerCase());+ });+ }++ /// Returns a new sorted list of collections with Important (favorites) first+ static List<Collection> getSortedCollections(List<Collection> collections) {+ final sortedList = List<Collection>.from(collections);+ sortCollections(sortedList);+ return sortedList;+ }++ /// Filters out uncategorized collections and sorts the remaining ones+ static List<Collection> filterAndSortCollections(+ List<Collection> collections,+ ) {+ final filtered = collections+ .where((c) => c.type != CollectionType.uncategorized)+ .toList();+ sortCollections(filtered);+ return filtered;+ }++ /// Compares two collections for sorting, prioritizing Important collection+ /// Returns -1 if a should come before b, 1 if b should come before a, 0 if equal+ static int compareCollections(Collection a, Collection b) {+ // Important collection (favorites) should come first+ if (a.type == CollectionType.favorites &&+ b.type != CollectionType.favorites) {+ return -1;+ }+ if (b.type == CollectionType.favorites &&+ a.type != CollectionType.favorites) {+ return 1;+ }+ // For other collections, sort alphabetically by name+ final nameA = a.name ?? a.name ?? '';+ final nameB = b.name ?? b.name ?? '';+ return nameA.toLowerCase().compareTo(nameB.toLowerCase());+ }++ /// Compares two collections for sorting with Important always first regardless of sort direction+ /// Used for table sorting where Important should always be first+ static int compareCollectionsWithFavoritesPriority(+ Collection a,+ Collection b,+ bool ascending,+ ) {+ // Important collection (favorites) should always come first regardless of sort direction+ if (a.type == CollectionType.favorites &&+ b.type != CollectionType.favorites) {+ return -1;+ }+ if (b.type == CollectionType.favorites &&+ a.type != CollectionType.favorites) {+ return 1;+ }+ // For other collections, use normal comparison+ return ascending ? compareCollections(a, b) : compareCollections(b, a);+ }++ /// Compares two collections for date sorting with Important always first regardless of sort direction+ /// Used for table sorting where Important should always be first+ static int compareCollectionsByDateWithFavoritesPriority(+ Collection a,+ Collection b,+ bool ascending,+ ) {+ // Important collection (favorites) should always come first regardless of sort direction+ if (a.type == CollectionType.favorites &&+ b.type != CollectionType.favorites) {+ return -1;+ }+ if (b.type == CollectionType.favorites &&+ a.type != CollectionType.favorites) {+ return 1;+ }+ // For other collections, sort by modification time+ final dateA = DateTime.fromMicrosecondsSinceEpoch(a.updationTime);+ final dateB = DateTime.fromMicrosecondsSinceEpoch(b.updationTime);+ return ascending ? dateA.compareTo(dateB) : dateB.compareTo(dateA);+ }+}diff --git a/mobile/apps/locker/lib/utils/crypto_helper.dart b/mobile/apps/locker/lib/utils/crypto_helper.dartnew file mode 100644index 0000000000..8ad4329af7--- /dev/null+++ b/mobile/apps/locker/lib/utils/crypto_helper.dart@@ -0,0 +1,48 @@+import "dart:typed_data";++import "package:ente_crypto_dart/ente_crypto_dart.dart";+import "package:locker/services/collections/models/collection.dart";+import "package:locker/services/configuration.dart";++class CryptoHelper {+ CryptoHelper._privateConstructor();+ static final CryptoHelper instance = CryptoHelper._privateConstructor();++ Uint8List getFileKey(+ String encryptedKey,+ String keyDecryptionNonce,+ Uint8List collectionKey,+ ) {+ final eKey = CryptoUtil.base642bin(encryptedKey);+ final nonce = CryptoUtil.base642bin(keyDecryptionNonce);+ return CryptoUtil.decryptSync(eKey, collectionKey, nonce);+ }++ Uint8List getCollectionKey(Collection collection) {+ final encryptedKey = CryptoUtil.base642bin(collection.encryptedKey);+ Uint8List? collectionKey;+ if (collection.owner.id == Configuration.instance.getUserID()) {+ // If the collection is owned by the user, decrypt with the master key+ if (Configuration.instance.getKey() == null) {+ // Possible during AppStore account migration, where SecureStorage+ // would become inaccessible to the new Developer Account+ throw Exception("key can not be null");+ }+ collectionKey = CryptoUtil.decryptSync(+ encryptedKey,+ Configuration.instance.getKey()!,+ CryptoUtil.base642bin(collection.keyDecryptionNonce!),+ );+ } else {+ // If owned by a different user, decrypt with the public key+ collectionKey = CryptoUtil.openSealSync(+ encryptedKey,+ CryptoUtil.base642bin(+ Configuration.instance.getKeyAttributes()!.publicKey,+ ),+ Configuration.instance.getSecretKey()!,+ );+ }+ return collectionKey;+ }+}diff --git a/mobile/apps/locker/lib/utils/data_util.dart b/mobile/apps/locker/lib/utils/data_util.dartnew file mode 100644index 0000000000..d324cde35d--- /dev/null+++ b/mobile/apps/locker/lib/utils/data_util.dart@@ -0,0 +1,63 @@+import 'dart:math';++final storageUnits = ["bytes", "KB", "MB", "GB", "TB"];++String convertBytesToReadableFormat(int bytes) {+ int storageUnitIndex = 0;+ while (bytes >= 1024 && storageUnitIndex < storageUnits.length - 1) {+ storageUnitIndex++;+ bytes = (bytes / 1024).round();+ }+ return "$bytes ${storageUnits[storageUnitIndex]}";+}++(int, String) convertBytesToNumberAndUnit(int bytes) {+ int storageUnitIndex = 0;+ while (bytes >= 1024 && storageUnitIndex < storageUnits.length - 1) {+ storageUnitIndex++;+ bytes = (bytes / 1024).round();+ }+ return (bytes, storageUnits[storageUnitIndex]);+}++String formatBytes(int bytes, [int decimals = 2]) {+ if (bytes == 0) return '0 bytes';+ const k = 1024;+ final int dm = decimals < 0 ? 0 : decimals;+ final int i = (log(bytes) / log(k)).floor();+ return '${(bytes / pow(k, i)).toStringAsFixed(dm)} ${storageUnits[i]}';+}++//shows 1st decimal only if less than 10GB & omits decimal if decimal is 0+num roundBytesUsedToGBs(int usedBytes, int freeSpace) {+ const tenGBinBytes = 10737418240;+ num bytesInGB = convertBytesToGBs(usedBytes);+ if ((usedBytes >= tenGBinBytes && freeSpace >= tenGBinBytes) ||+ bytesInGB % 1 == 0) {+ bytesInGB = bytesInGB.truncate();+ }+ return bytesInGB;+}++//Eg: 0.3 GB, 11.0 GB, 532.3 GB+num convertBytesToGBs(int bytes) {+ return num.parse((bytes / (pow(1024, 3))).toStringAsFixed(1));+}++int convertBytesToAbsoluteGBs(int bytes) {+ return (bytes / pow(1024, 3)).round();+}++int convertBytesToMBs(int bytes) {+ return (bytes / pow(1024, 2)).round();+}++//Eg: 1TB, 1.3TB, 4.9TB, 3TB+num roundGBsToTBs(sizeInGBs) {+ final num sizeInTBs = num.parse((sizeInGBs / 1000).toStringAsFixed(1));+ if (sizeInTBs % 1 == 0) {+ return sizeInTBs.truncate();+ } else {+ return sizeInTBs;+ }+}diff --git a/mobile/apps/locker/lib/utils/date_time_util.dart b/mobile/apps/locker/lib/utils/date_time_util.dartnew file mode 100644index 0000000000..3e3ea6850d--- /dev/null+++ b/mobile/apps/locker/lib/utils/date_time_util.dart@@ -0,0 +1,259 @@+import 'package:flutter/material.dart';+import 'package:intl/intl.dart';+import 'package:locker/l10n/l10n.dart';++const Set<int> monthWith31Days = {1, 3, 5, 7, 8, 10, 12};+const Set<int> monthWith30Days = {4, 6, 9, 11};+Map<int, String> _months = {+ 1: "Jan",+ 2: "Feb",+ 3: "March",+ 4: "April",+ 5: "May",+ 6: "Jun",+ 7: "July",+ 8: "Aug",+ 9: "Sep",+ 10: "Oct",+ 11: "Nov",+ 12: "Dec",+};++Map<int, String> _fullMonths = {+ 1: "January",+ 2: "February",+ 3: "March",+ 4: "April",+ 5: "May",+ 6: "June",+ 7: "July",+ 8: "August",+ 9: "September",+ 10: "October",+ 11: "November",+ 12: "December",+};++Map<int, String> _days = {+ 1: "Mon",+ 2: "Tue",+ 3: "Wed",+ 4: "Thu",+ 5: "Fri",+ 6: "Sat",+ 7: "Sun",+};++final currentYear = int.parse(DateTime.now().year.toString());+const searchStartYear = 1970;++//Jun 2022+String getMonthAndYear(DateTime dateTime) {+ return "${_months[dateTime.month]!} ${dateTime.year}";+}++//Thu, 30 Jun+String getDayAndMonth(DateTime dateTime) {+ return "${_days[dateTime.weekday]!}, ${dateTime.day} ${_months[dateTime.month]!}";+}++//30 Jun, 2022+String getDateAndMonthAndYear(DateTime dateTime) {+ return "${dateTime.day} ${_months[dateTime.month]!}, ${dateTime.year}";+}++String getDay(DateTime dateTime) {+ return _days[dateTime.weekday]!;+}++String getMonth(DateTime dateTime) {+ return _months[dateTime.month]!;+}++String getFullMonth(DateTime dateTime) {+ return _fullMonths[dateTime.month]!;+}++String getAbbreviationOfYear(DateTime dateTime) {+ return (dateTime.year % 100).toString();+}++//14:32+String getTime(DateTime dateTime) {+ final hours =+ dateTime.hour > 9 ? dateTime.hour.toString() : "0${dateTime.hour}";+ final minutes =+ dateTime.minute > 9 ? dateTime.minute.toString() : "0${dateTime.minute}";+ return "$hours:$minutes";+}++//11:22 AM+String getTimeIn12hrFormat(DateTime dateTime) {+ return DateFormat.jm().format(dateTime);+}++//Thu, Jun 30, 2022 - 14:32+String getFormattedTime(DateTime dateTime) {+ return "${getDay(dateTime)}, ${getMonth(dateTime)} ${dateTime.day}, ${dateTime.year} - ${getTime(dateTime)}";+}++//30 Jun'22+String getFormattedDate(DateTime dateTime) {+ return "${dateTime.day} ${getMonth(dateTime)}'${getAbbreviationOfYear(dateTime)}";+}++String getFullDate(DateTime dateTime) {+ return "${getDay(dateTime)}, ${getMonth(dateTime)} ${dateTime.day} ${dateTime.year}";+}++String daysLeft(int futureTime) {+ final int daysLeft = ((futureTime - DateTime.now().microsecondsSinceEpoch) /+ Duration.microsecondsPerDay)+ .ceil();+ return '$daysLeft day${daysLeft <= 1 ? "" : "s"}';+}++String formatDuration(Duration position) {+ final ms = position.inMilliseconds;++ int seconds = ms ~/ 1000;+ final int hours = seconds ~/ 3600;+ seconds = seconds % 3600;+ final minutes = seconds ~/ 60;+ seconds = seconds % 60;++ final hoursString = hours >= 10+ ? '$hours'+ : hours == 0+ ? '00'+ : '0$hours';++ final minutesString = minutes >= 10+ ? '$minutes'+ : minutes == 0+ ? '00'+ : '0$minutes';++ final secondsString = seconds >= 10+ ? '$seconds'+ : seconds == 0+ ? '00'+ : '0$seconds';++ final formattedTime =+ '${hoursString == '00' ? '' : '$hoursString:'}$minutesString:$secondsString';++ return formattedTime;+}++bool isLeapYear(DateTime dateTime) {+ final year = dateTime.year;+ if (year % 4 == 0) {+ if (year % 100 == 0) {+ if (year % 400 == 0) {+ return true;+ } else {+ return false;+ }+ } else {+ return true;+ }+ } else {+ return false;+ }+}++Widget getDayWidget(+ BuildContext context,+ int timestamp,+ bool smallerTodayFont,+) {+ return Container(+ padding: const EdgeInsets.fromLTRB(4, 14, 0, 8),+ alignment: Alignment.centerLeft,+ child: Text(+ getDayTitle(timestamp),+ style: (getDayTitle(timestamp) == "Today" && !smallerTodayFont)+ ? Theme.of(context).textTheme.headlineSmall+ : Theme.of(context).textTheme.bodySmall?.copyWith(+ fontSize: 16,+ fontWeight: FontWeight.w600,+ fontFamily: 'Inter-SemiBold',+ ),+ ),+ );+}++String getDayTitle(int timestamp) {+ final date = DateTime.fromMicrosecondsSinceEpoch(timestamp);+ final now = DateTime.now();+ var title = getDayAndMonth(date);+ if (date.year == now.year && date.month == now.month) {+ if (date.day == now.day) {+ title = "Today";+ } else if (date.day == now.day - 1) {+ title = "Yesterday";+ }+ }+ if (date.year != DateTime.now().year) {+ title += " ${date.year}";+ }+ return title;+}++String secondsToHHMMSS(int value) {+ int h, m, s;+ h = value ~/ 3600;+ m = ((value - h * 3600)) ~/ 60;+ s = value - (h * 3600) - (m * 60);+ final String hourLeft = h.toString().length < 2 ? "0$h" : h.toString();++ final String minuteLeft = m.toString().length < 2 ? "0$m" : m.toString();++ final String secondsLeft = s.toString().length < 2 ? "0$s" : s.toString();++ final String result = "$hourLeft:$minuteLeft:$secondsLeft";++ return result;+}++bool isValidDate({+ required int day,+ required int month,+ required int year,+}) {+ if (day < 0 || day > 31 || month < 0 || month > 12 || year < 0) {+ return false;+ }+ if (monthWith30Days.contains(month) && day > 30) {+ return false;+ }+ if (month == 2) {+ if (day > 29) {+ return false;+ }+ if (day == 29 && year % 4 != 0) {+ return false;+ }+ }+ return true;+}++String formatDate(BuildContext context, DateTime date) {+ final now = DateTime.now();+ final difference = now.difference(date);++ if (difference.inMinutes < 1) {+ return 'Just now';+ } else if (difference.inMinutes < 60) {+ return context.l10n.minutesAgo(difference.inMinutes);+ } else if (difference.inDays == 0) {+ return context.l10n.hoursAgo(difference.inHours);+ } else if (difference.inDays == 1) {+ return context.l10n.yesterday;+ } else if (difference.inDays < 7) {+ return context.l10n.daysAgo(difference.inDays);+ } else {+ return '${date.day}/${date.month}/${date.year}';+ }+}diff --git a/mobile/apps/locker/lib/utils/file_icon_utils.dart b/mobile/apps/locker/lib/utils/file_icon_utils.dartnew file mode 100644index 0000000000..bc1f238200--- /dev/null+++ b/mobile/apps/locker/lib/utils/file_icon_utils.dart@@ -0,0 +1,72 @@+import 'package:flutter/material.dart';++class FileIconConfig {+ final IconData icon;+ final Color color;+ final Set<String> extensions;++ const FileIconConfig({+ required this.icon,+ required this.color,+ required this.extensions,+ });+}++class FileIconUtils {+ // Centralized configuration - change icons and colors here only+ static const Map<String, FileIconConfig> _fileTypeConfigs = {+ 'pdf': FileIconConfig(+ extensions: {'.pdf'},+ icon: Icons.picture_as_pdf,+ color: Colors.red,+ ),+ 'image': FileIconConfig(+ extensions: {'.jpg', '.png', '.heic'},+ icon: Icons.image,+ color: Colors.blue,+ ),+ 'presentation': FileIconConfig(+ extensions: {'.pptx'},+ icon: Icons.slideshow,+ color: Colors.orange,+ ),+ 'spreadsheet': FileIconConfig(+ extensions: {'.xlsx'},+ icon: Icons.table_chart,+ color: Colors.green,+ ),+ };++ static const FileIconConfig _defaultConfig = FileIconConfig(+ extensions: {},+ icon: Icons.insert_drive_file,+ color: Colors.grey,+ );++ static FileIconConfig _getFileConfig(String fileName) {+ final lowerFileName = fileName.toLowerCase();+ final lastDotIndex = lowerFileName.lastIndexOf('.');++ if (lastDotIndex == -1) {+ return _defaultConfig; // No extension found+ }++ final extension = lowerFileName.substring(lastDotIndex);++ for (final config in _fileTypeConfigs.values) {+ if (config.extensions.contains(extension)) {+ return config;+ }+ }++ return _defaultConfig;+ }++ static IconData getFileIcon(String fileName) {+ return _getFileConfig(fileName).icon;+ }++ static Color getFileIconColor(String fileName) {+ return _getFileConfig(fileName).color;+ }+}diff --git a/mobile/apps/locker/lib/utils/snack_bar_utils.dart b/mobile/apps/locker/lib/utils/snack_bar_utils.dartnew file mode 100644index 0000000000..ab03c69ac1--- /dev/null+++ b/mobile/apps/locker/lib/utils/snack_bar_utils.dart@@ -0,0 +1,36 @@+import 'package:ente_ui/theme/ente_theme.dart';+import 'package:flutter/material.dart';++class SnackBarUtils {+ static void showInfoSnackBar(BuildContext context, String message) {+ _showSnackBar(+ context,+ message,+ backgroundColor: getEnteColorScheme(context).primary500,+ );+ }++ static void showWarningSnackBar(BuildContext context, String message) {+ _showSnackBar(+ context,+ message,+ backgroundColor: getEnteColorScheme(context).warning500,+ );+ }++ static void _showSnackBar(+ BuildContext context,+ String message, {+ Color? backgroundColor,+ }) {+ if (!context.mounted) return;++ ScaffoldMessenger.of(context).showSnackBar(+ SnackBar(+ content: Text(message),+ backgroundColor:+ backgroundColor ?? getEnteColorScheme(context).primary500,+ ),+ );+ }+}diff --git a/mobile/apps/locker/linux/.gitignore b/mobile/apps/locker/linux/.gitignorenew file mode 100644index 0000000000..d3896c9844--- /dev/null+++ b/mobile/apps/locker/linux/.gitignore@@ -0,0 +1 @@+flutter/ephemeraldiff --git a/mobile/apps/locker/linux/CMakeLists.txt b/mobile/apps/locker/linux/CMakeLists.txtnew file mode 100644index 0000000000..0ce05024f9--- /dev/null+++ b/mobile/apps/locker/linux/CMakeLists.txt@@ -0,0 +1,145 @@+# Project-level configuration.+cmake_minimum_required(VERSION 3.10)+project(runner LANGUAGES CXX)++# The name of the executable created for the application. Change this to change+# the on-disk name of your application.+set(BINARY_NAME "locker")+# The unique GTK application identifier for this application. See:+# https://wiki.gnome.org/HowDoI/ChooseApplicationID+set(APPLICATION_ID "io.ente.locker")++# Explicitly opt in to modern CMake behaviors to avoid warnings with recent+# versions of CMake.+cmake_policy(SET CMP0063 NEW)++# Load bundled libraries from the lib/ directory relative to the binary.+set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")++# Root filesystem for cross-building.+if(FLUTTER_TARGET_PLATFORM_SYSROOT)+ set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})+ set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)+ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)+endif()++# Define build configuration options.+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)+ set(CMAKE_BUILD_TYPE "Debug" CACHE+ STRING "Flutter build mode" FORCE)+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS+ "Debug" "Profile" "Release")+endif()++# Compilation settings that should be applied to most targets.+#+# Be cautious about adding new options here, as plugins use this function by+# default. In most cases, you should add new options to specific targets instead+# of modifying this function.+function(APPLY_STANDARD_SETTINGS TARGET)+ target_compile_features(${TARGET} PUBLIC cxx_std_14)+ target_compile_options(${TARGET} PRIVATE -Wall -Werror)+ target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")+ target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")+endfunction()++# Flutter library and tool build rules.+set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")+add_subdirectory(${FLUTTER_MANAGED_DIR})++# System-level dependencies.+find_package(PkgConfig REQUIRED)+pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)++add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")++# Define the application target. To change its name, change BINARY_NAME above,+# not the value here, or `flutter run` will no longer work.+#+# Any new source files that you add to the application should be added here.+add_executable(${BINARY_NAME}+ "main.cc"+ "my_application.cc"+ "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"+)++# Apply the standard set of build settings. This can be removed for applications+# that need different build settings.+apply_standard_settings(${BINARY_NAME})++# Add dependency libraries. Add any application-specific dependencies here.+target_link_libraries(${BINARY_NAME} PRIVATE flutter)+target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)++# Run the Flutter tool portions of the build. This must not be removed.+add_dependencies(${BINARY_NAME} flutter_assemble)++# Only the install-generated bundle's copy of the executable will launch+# correctly, since the resources must in the right relative locations. To avoid+# people trying to run the unbundled copy, put it in a subdirectory instead of+# the default top-level location.+set_target_properties(${BINARY_NAME}+ PROPERTIES+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"+)+++# Generated plugin build rules, which manage building the plugins and adding+# them to the application.+include(flutter/generated_plugins.cmake)+++# === Installation ===+# By default, "installing" just makes a relocatable bundle in the build+# directory.+set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)+ set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)+endif()++# Start with a clean build bundle directory every time.+install(CODE "+ file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")+ " COMPONENT Runtime)++set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")+set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")++install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"+ COMPONENT Runtime)++install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"+ COMPONENT Runtime)++install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)++foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})+ install(FILES "${bundled_library}"+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)+endforeach(bundled_library)++# Copy the native assets provided by the build.dart from all packages.+set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")+install(DIRECTORY "${NATIVE_ASSETS_DIR}"+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)++# Fully re-copy the assets directory on each build to avoid having stale files+# from a previous install.+set(FLUTTER_ASSET_DIR_NAME "flutter_assets")+install(CODE "+ file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")+ " COMPONENT Runtime)+install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"+ DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)++# Install the AOT library on non-Debug builds only.+if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")+ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)+endif()diff --git a/mobile/apps/locker/linux/flutter/CMakeLists.txt b/mobile/apps/locker/linux/flutter/CMakeLists.txtnew file mode 100644index 0000000000..d5bd01648a--- /dev/null+++ b/mobile/apps/locker/linux/flutter/CMakeLists.txt@@ -0,0 +1,88 @@+# This file controls Flutter-level build steps. It should not be edited.+cmake_minimum_required(VERSION 3.10)++set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")++# Configuration provided via flutter tool.+include(${EPHEMERAL_DIR}/generated_config.cmake)++# TODO: Move the rest of this into files in ephemeral. See+# https://github.com/flutter/flutter/issues/57146.++# Serves the same purpose as list(TRANSFORM ... PREPEND ...),+# which isn't available in 3.10.+function(list_prepend LIST_NAME PREFIX)+ set(NEW_LIST "")+ foreach(element ${${LIST_NAME}})+ list(APPEND NEW_LIST "${PREFIX}${element}")+ endforeach(element)+ set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)+endfunction()++# === Flutter Library ===+# System-level dependencies.+find_package(PkgConfig REQUIRED)+pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)+pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)+pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)++set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")++# Published to parent scope for install step.+set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)+set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)+set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)+set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)++list(APPEND FLUTTER_LIBRARY_HEADERS+ "fl_basic_message_channel.h"+ "fl_binary_codec.h"+ "fl_binary_messenger.h"+ "fl_dart_project.h"+ "fl_engine.h"+ "fl_json_message_codec.h"+ "fl_json_method_codec.h"+ "fl_message_codec.h"+ "fl_method_call.h"+ "fl_method_channel.h"+ "fl_method_codec.h"+ "fl_method_response.h"+ "fl_plugin_registrar.h"+ "fl_plugin_registry.h"+ "fl_standard_message_codec.h"+ "fl_standard_method_codec.h"+ "fl_string_codec.h"+ "fl_value.h"+ "fl_view.h"+ "flutter_linux.h"+)+list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")+add_library(flutter INTERFACE)+target_include_directories(flutter INTERFACE+ "${EPHEMERAL_DIR}"+)+target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")+target_link_libraries(flutter INTERFACE+ PkgConfig::GTK+ PkgConfig::GLIB+ PkgConfig::GIO+)+add_dependencies(flutter flutter_assemble)++# === Flutter tool backend ===+# _phony_ is a non-existent file to force this command to run every time,+# since currently there's no way to get a full input/output list from the+# flutter tool.+add_custom_command(+ OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}+ ${CMAKE_CURRENT_BINARY_DIR}/_phony_+ COMMAND ${CMAKE_COMMAND} -E env+ ${FLUTTER_TOOL_ENVIRONMENT}+ "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"+ ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}+ VERBATIM+)+add_custom_target(flutter_assemble DEPENDS+ "${FLUTTER_LIBRARY}"+ ${FLUTTER_LIBRARY_HEADERS}+)diff --git a/mobile/apps/locker/linux/flutter/generated_plugin_registrant.cc b/mobile/apps/locker/linux/flutter/generated_plugin_registrant.ccnew file mode 100644index 0000000000..fafe406725--- /dev/null+++ b/mobile/apps/locker/linux/flutter/generated_plugin_registrant.cc@@ -0,0 +1,55 @@+//+// Generated file. Do not edit.+//++// clang-format off++#include "generated_plugin_registrant.h"++#include <file_saver/file_saver_plugin.h>+#include <flutter_local_authentication/flutter_local_authentication_plugin.h>+#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>+#include <gtk/gtk_plugin.h>+#include <open_file_linux/open_file_linux_plugin.h>+#include <screen_retriever_linux/screen_retriever_linux_plugin.h>+#include <sentry_flutter/sentry_flutter_plugin.h>+#include <sodium_libs/sodium_libs_plugin.h>+#include <tray_manager/tray_manager_plugin.h>+#include <url_launcher_linux/url_launcher_plugin.h>+#include <window_manager/window_manager_plugin.h>++void fl_register_plugins(FlPluginRegistry* registry) {+ g_autoptr(FlPluginRegistrar) file_saver_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "FileSaverPlugin");+ file_saver_plugin_register_with_registrar(file_saver_registrar);+ g_autoptr(FlPluginRegistrar) flutter_local_authentication_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLocalAuthenticationPlugin");+ flutter_local_authentication_plugin_register_with_registrar(flutter_local_authentication_registrar);+ g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");+ flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);+ g_autoptr(FlPluginRegistrar) gtk_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");+ gtk_plugin_register_with_registrar(gtk_registrar);+ g_autoptr(FlPluginRegistrar) open_file_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "OpenFileLinuxPlugin");+ open_file_linux_plugin_register_with_registrar(open_file_linux_registrar);+ g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");+ screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);+ g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");+ sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);+ g_autoptr(FlPluginRegistrar) sodium_libs_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "SodiumLibsPlugin");+ sodium_libs_plugin_register_with_registrar(sodium_libs_registrar);+ g_autoptr(FlPluginRegistrar) tray_manager_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin");+ tray_manager_plugin_register_with_registrar(tray_manager_registrar);+ g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");+ url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);+ g_autoptr(FlPluginRegistrar) window_manager_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");+ window_manager_plugin_register_with_registrar(window_manager_registrar);+}diff --git a/mobile/apps/locker/linux/flutter/generated_plugin_registrant.h b/mobile/apps/locker/linux/flutter/generated_plugin_registrant.hnew file mode 100644index 0000000000..e0f0a47bc0--- /dev/null+++ b/mobile/apps/locker/linux/flutter/generated_plugin_registrant.h@@ -0,0 +1,15 @@+//+// Generated file. Do not edit.+//++// clang-format off++#ifndef GENERATED_PLUGIN_REGISTRANT_+#define GENERATED_PLUGIN_REGISTRANT_++#include <flutter_linux/flutter_linux.h>++// Registers Flutter plugins.+void fl_register_plugins(FlPluginRegistry* registry);++#endif // GENERATED_PLUGIN_REGISTRANT_diff --git a/mobile/apps/locker/linux/flutter/generated_plugins.cmake b/mobile/apps/locker/linux/flutter/generated_plugins.cmakenew file mode 100644index 0000000000..a193fb26ff--- /dev/null+++ b/mobile/apps/locker/linux/flutter/generated_plugins.cmake@@ -0,0 +1,35 @@+#+# Generated file, do not edit.+#++list(APPEND FLUTTER_PLUGIN_LIST+ file_saver+ flutter_local_authentication+ flutter_secure_storage_linux+ gtk+ open_file_linux+ screen_retriever_linux+ sentry_flutter+ sodium_libs+ tray_manager+ url_launcher_linux+ window_manager+)++list(APPEND FLUTTER_FFI_PLUGIN_LIST+ jni+)++set(PLUGIN_BUNDLED_LIBRARIES)++foreach(plugin ${FLUTTER_PLUGIN_LIST})+ add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})+ target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)+ list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)+ list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})+endforeach(plugin)++foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})+ add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})+ list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})+endforeach(ffi_plugin)diff --git a/mobile/apps/locker/linux/main.cc b/mobile/apps/locker/linux/main.ccnew file mode 100644index 0000000000..e7c5c54370--- /dev/null+++ b/mobile/apps/locker/linux/main.cc@@ -0,0 +1,6 @@+#include "my_application.h"++int main(int argc, char** argv) {+ g_autoptr(MyApplication) app = my_application_new();+ return g_application_run(G_APPLICATION(app), argc, argv);+}diff --git a/mobile/apps/locker/linux/my_application.cc b/mobile/apps/locker/linux/my_application.ccnew file mode 100644index 0000000000..c16008ea45--- /dev/null+++ b/mobile/apps/locker/linux/my_application.cc@@ -0,0 +1,124 @@+#include "my_application.h"++#include <flutter_linux/flutter_linux.h>+#ifdef GDK_WINDOWING_X11+#include <gdk/gdkx.h>+#endif++#include "flutter/generated_plugin_registrant.h"++struct _MyApplication {+ GtkApplication parent_instance;+ char** dart_entrypoint_arguments;+};++G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)++// Implements GApplication::activate.+static void my_application_activate(GApplication* application) {+ MyApplication* self = MY_APPLICATION(application);+ GtkWindow* window =+ GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));++ // Use a header bar when running in GNOME as this is the common style used+ // by applications and is the setup most users will be using (e.g. Ubuntu+ // desktop).+ // If running on X and not using GNOME then just use a traditional title bar+ // in case the window manager does more exotic layout, e.g. tiling.+ // If running on Wayland assume the header bar will work (may need changing+ // if future cases occur).+ gboolean use_header_bar = TRUE;+#ifdef GDK_WINDOWING_X11+ GdkScreen* screen = gtk_window_get_screen(window);+ if (GDK_IS_X11_SCREEN(screen)) {+ const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);+ if (g_strcmp0(wm_name, "GNOME Shell") != 0) {+ use_header_bar = FALSE;+ }+ }+#endif+ if (use_header_bar) {+ GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());+ gtk_widget_show(GTK_WIDGET(header_bar));+ gtk_header_bar_set_title(header_bar, "locker");+ gtk_header_bar_set_show_close_button(header_bar, TRUE);+ gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));+ } else {+ gtk_window_set_title(window, "locker");+ }++ gtk_window_set_default_size(window, 1280, 720);+ gtk_widget_show(GTK_WIDGET(window));++ g_autoptr(FlDartProject) project = fl_dart_project_new();+ fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);++ FlView* view = fl_view_new(project);+ gtk_widget_show(GTK_WIDGET(view));+ gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));++ fl_register_plugins(FL_PLUGIN_REGISTRY(view));++ gtk_widget_grab_focus(GTK_WIDGET(view));+}++// Implements GApplication::local_command_line.+static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {+ MyApplication* self = MY_APPLICATION(application);+ // Strip out the first argument as it is the binary name.+ self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);++ g_autoptr(GError) error = nullptr;+ if (!g_application_register(application, nullptr, &error)) {+ g_warning("Failed to register: %s", error->message);+ *exit_status = 1;+ return TRUE;+ }++ g_application_activate(application);+ *exit_status = 0;++ return TRUE;+}++// Implements GApplication::startup.+static void my_application_startup(GApplication* application) {+ //MyApplication* self = MY_APPLICATION(object);++ // Perform any actions required at application startup.++ G_APPLICATION_CLASS(my_application_parent_class)->startup(application);+}++// Implements GApplication::shutdown.+static void my_application_shutdown(GApplication* application) {+ //MyApplication* self = MY_APPLICATION(object);++ // Perform any actions required at application shutdown.++ G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);+}++// Implements GObject::dispose.+static void my_application_dispose(GObject* object) {+ MyApplication* self = MY_APPLICATION(object);+ g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);+ G_OBJECT_CLASS(my_application_parent_class)->dispose(object);+}++static void my_application_class_init(MyApplicationClass* klass) {+ G_APPLICATION_CLASS(klass)->activate = my_application_activate;+ G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;+ G_APPLICATION_CLASS(klass)->startup = my_application_startup;+ G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;+ G_OBJECT_CLASS(klass)->dispose = my_application_dispose;+}++static void my_application_init(MyApplication* self) {}++MyApplication* my_application_new() {+ return MY_APPLICATION(g_object_new(my_application_get_type(),+ "application-id", APPLICATION_ID,+ "flags", G_APPLICATION_NON_UNIQUE,+ nullptr));+}diff --git a/mobile/apps/locker/linux/my_application.h b/mobile/apps/locker/linux/my_application.hnew file mode 100644index 0000000000..72271d5e41--- /dev/null+++ b/mobile/apps/locker/linux/my_application.h@@ -0,0 +1,18 @@+#ifndef FLUTTER_MY_APPLICATION_H_+#define FLUTTER_MY_APPLICATION_H_++#include <gtk/gtk.h>++G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,+ GtkApplication)++/**+ * my_application_new:+ *+ * Creates a new Flutter-based application.+ *+ * Returns: a new #MyApplication.+ */+MyApplication* my_application_new();++#endif // FLUTTER_MY_APPLICATION_H_diff --git a/mobile/apps/locker/macos/.gitignore b/mobile/apps/locker/macos/.gitignorenew file mode 100644index 0000000000..746adbb6b9--- /dev/null+++ b/mobile/apps/locker/macos/.gitignore@@ -0,0 +1,7 @@+# Flutter-related+**/Flutter/ephemeral/+**/Pods/++# Xcode-related+**/dgph+**/xcuserdata/diff --git a/mobile/apps/locker/macos/Flutter/Flutter-Debug.xcconfig b/mobile/apps/locker/macos/Flutter/Flutter-Debug.xcconfignew file mode 100644index 0000000000..4b81f9b2d2--- /dev/null+++ b/mobile/apps/locker/macos/Flutter/Flutter-Debug.xcconfig@@ -0,0 +1,2 @@+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"+#include "ephemeral/Flutter-Generated.xcconfig"diff --git a/mobile/apps/locker/macos/Flutter/Flutter-Release.xcconfig b/mobile/apps/locker/macos/Flutter/Flutter-Release.xcconfignew file mode 100644index 0000000000..5caa9d1579--- /dev/null+++ b/mobile/apps/locker/macos/Flutter/Flutter-Release.xcconfig@@ -0,0 +1,2 @@+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"+#include "ephemeral/Flutter-Generated.xcconfig"diff --git a/mobile/apps/locker/macos/Flutter/GeneratedPluginRegistrant.swift b/mobile/apps/locker/macos/Flutter/GeneratedPluginRegistrant.swiftnew file mode 100644index 0000000000..1eca850c4c--- /dev/null+++ b/mobile/apps/locker/macos/Flutter/GeneratedPluginRegistrant.swift@@ -0,0 +1,50 @@+//+// Generated file. Do not edit.+//++import FlutterMacOS+import Foundation++import app_links+import device_info_plus+import file_picker+import file_saver+import flutter_inappwebview_macos+import flutter_local_authentication+import flutter_secure_storage_macos+import local_auth_darwin+import open_file_mac+import package_info_plus+import path_provider_foundation+import screen_retriever_macos+import sentry_flutter+import share_plus+import shared_preferences_foundation+import sodium_libs+import sqflite_darwin+import tray_manager+import url_launcher_macos+import window_manager++func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {+ AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))+ DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))+ FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))+ FileSaverPlugin.register(with: registry.registrar(forPlugin: "FileSaverPlugin"))+ InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))+ FlutterLocalAuthenticationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalAuthenticationPlugin"))+ FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))+ FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))+ OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin"))+ FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))+ PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))+ ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))+ SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))+ SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))+ SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))+ SodiumLibsPlugin.register(with: registry.registrar(forPlugin: "SodiumLibsPlugin"))+ SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))+ TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin"))+ UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))+ WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))+}diff --git a/mobile/apps/locker/macos/Podfile b/mobile/apps/locker/macos/Podfilenew file mode 100644index 0000000000..b52666a103--- /dev/null+++ b/mobile/apps/locker/macos/Podfile@@ -0,0 +1,43 @@+platform :osx, '10.15'++# CocoaPods analytics sends network stats synchronously affecting flutter build latency.+ENV['COCOAPODS_DISABLE_STATS'] = 'true'++project 'Runner', {+ 'Debug' => :debug,+ 'Profile' => :release,+ 'Release' => :release,+}++def flutter_root+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)+ unless File.exist?(generated_xcode_build_settings_path)+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"+ end++ File.foreach(generated_xcode_build_settings_path) do |line|+ matches = line.match(/FLUTTER_ROOT\=(.*)/)+ return matches[1].strip if matches+ end+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""+end++require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)++flutter_macos_podfile_setup++target 'Runner' do+ use_frameworks!+ use_modular_headers!++ flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))+ target 'RunnerTests' do+ inherit! :search_paths+ end+end++post_install do |installer|+ installer.pods_project.targets.each do |target|+ flutter_additional_macos_build_settings(target)+ end+enddiff --git a/mobile/apps/locker/macos/Podfile.lock b/mobile/apps/locker/macos/Podfile.locknew file mode 100644index 0000000000..c6e7122103--- /dev/null+++ b/mobile/apps/locker/macos/Podfile.lock@@ -0,0 +1,152 @@+PODS:+ - app_links (1.0.0):+ - FlutterMacOS+ - cupertino_http (0.0.1):+ - Flutter+ - FlutterMacOS+ - device_info_plus (0.0.1):+ - FlutterMacOS+ - file_picker (0.0.1):+ - FlutterMacOS+ - file_saver (0.0.1):+ - FlutterMacOS+ - flutter_inappwebview_macos (0.0.1):+ - FlutterMacOS+ - OrderedSet (~> 6.0.3)+ - flutter_local_authentication (1.2.0):+ - FlutterMacOS+ - flutter_secure_storage_macos (6.1.3):+ - FlutterMacOS+ - FlutterMacOS (1.0.0)+ - local_auth_darwin (0.0.1):+ - Flutter+ - FlutterMacOS+ - objective_c (0.0.1):+ - FlutterMacOS+ - OrderedSet (6.0.3)+ - package_info_plus (0.0.1):+ - FlutterMacOS+ - path_provider_foundation (0.0.1):+ - Flutter+ - FlutterMacOS+ - screen_retriever_macos (0.0.1):+ - FlutterMacOS+ - Sentry/HybridSDK (8.46.0)+ - sentry_flutter (8.14.2):+ - Flutter+ - FlutterMacOS+ - Sentry/HybridSDK (= 8.46.0)+ - share_plus (0.0.1):+ - FlutterMacOS+ - shared_preferences_foundation (0.0.1):+ - Flutter+ - FlutterMacOS+ - sodium_libs (2.2.1):+ - FlutterMacOS+ - tray_manager (0.0.1):+ - FlutterMacOS+ - url_launcher_macos (0.0.1):+ - FlutterMacOS+ - window_manager (0.2.0):+ - FlutterMacOS++DEPENDENCIES:+ - app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`)+ - cupertino_http (from `Flutter/ephemeral/.symlinks/plugins/cupertino_http/darwin`)+ - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`)+ - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`)+ - file_saver (from `Flutter/ephemeral/.symlinks/plugins/file_saver/macos`)+ - flutter_inappwebview_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos`)+ - flutter_local_authentication (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_authentication/macos`)+ - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`)+ - FlutterMacOS (from `Flutter/ephemeral`)+ - local_auth_darwin (from `Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin`)+ - objective_c (from `Flutter/ephemeral/.symlinks/plugins/objective_c/macos`)+ - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)+ - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)+ - screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`)+ - sentry_flutter (from `Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos`)+ - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)+ - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)+ - sodium_libs (from `Flutter/ephemeral/.symlinks/plugins/sodium_libs/macos`)+ - tray_manager (from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos`)+ - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)+ - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)++SPEC REPOS:+ trunk:+ - OrderedSet+ - Sentry++EXTERNAL SOURCES:+ app_links:+ :path: Flutter/ephemeral/.symlinks/plugins/app_links/macos+ cupertino_http:+ :path: Flutter/ephemeral/.symlinks/plugins/cupertino_http/darwin+ device_info_plus:+ :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos+ file_picker:+ :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos+ file_saver:+ :path: Flutter/ephemeral/.symlinks/plugins/file_saver/macos+ flutter_inappwebview_macos:+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_inappwebview_macos/macos+ flutter_local_authentication:+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_local_authentication/macos+ flutter_secure_storage_macos:+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos+ FlutterMacOS:+ :path: Flutter/ephemeral+ local_auth_darwin:+ :path: Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin+ objective_c:+ :path: Flutter/ephemeral/.symlinks/plugins/objective_c/macos+ package_info_plus:+ :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos+ path_provider_foundation:+ :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin+ screen_retriever_macos:+ :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos+ sentry_flutter:+ :path: Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos+ share_plus:+ :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos+ shared_preferences_foundation:+ :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin+ sodium_libs:+ :path: Flutter/ephemeral/.symlinks/plugins/sodium_libs/macos+ tray_manager:+ :path: Flutter/ephemeral/.symlinks/plugins/tray_manager/macos+ url_launcher_macos:+ :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos+ window_manager:+ :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos++SPEC CHECKSUMS:+ app_links: 86a57d95d4dec830373b8c85c21d1c59a4a5dc21+ cupertino_http: 947a233f40cfea55167a49f2facc18434ea117ba+ device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f+ file_picker: e716a70a9fe5fd9e09ebc922d7541464289443af+ file_saver: 44e6fbf666677faf097302460e214e977fdd977b+ flutter_inappwebview_macos: bdf207b8f4ebd58e86ae06cd96b147de99a67c9b+ flutter_local_authentication: 85674893931e1c9cfa7c9e4f5973cb8c56b018b0+ flutter_secure_storage_macos: c2754d3483d20bb207bb9e5a14f1b8e771abcdb9+ FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24+ local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3+ objective_c: e5f8194456e8fc943e034d1af00510a1bc29c067+ OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94+ package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b+ path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46+ screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161+ Sentry: da60d980b197a46db0b35ea12cb8f39af48d8854+ sentry_flutter: 2df8b0aab7e4aba81261c230cbea31c82a62dd1b+ share_plus: 1fa619de8392a4398bfaf176d441853922614e89+ shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78+ sodium_libs: d39bd76697736cb11ce4a0be73b9b4bc64466d6f+ tray_manager: 9064e219c56d75c476e46b9a21182087930baf90+ url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404+ window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8++PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3++COCOAPODS: 1.16.2diff --git a/mobile/apps/locker/macos/Runner.xcodeproj/project.pbxproj b/mobile/apps/locker/macos/Runner.xcodeproj/project.pbxprojnew file mode 100644index 0000000000..ae214f8ff9--- /dev/null+++ b/mobile/apps/locker/macos/Runner.xcodeproj/project.pbxproj@@ -0,0 +1,809 @@+// !$*UTF8*$!+{+ archiveVersion = 1;+ classes = {+ };+ objectVersion = 54;+ objects = {++/* Begin PBXAggregateTarget section */+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {+ isa = PBXAggregateTarget;+ buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;+ buildPhases = (+ 33CC111E2044C6BF0003C045 /* ShellScript */,+ );+ dependencies = (+ );+ name = "Flutter Assemble";+ productName = FLX;+ };+/* End PBXAggregateTarget section */++/* Begin PBXBuildFile section */+ 0BE25975B65D6BA73D3A1354 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 525AD39957F290EBEA71D275 /* Pods_Runner.framework */; };+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };+ C9A78EA7917BBDA4B497AD6E /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 858DFB73D44507E1FE278030 /* Pods_RunnerTests.framework */; };+/* End PBXBuildFile section */++/* Begin PBXContainerItemProxy section */+ 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {+ isa = PBXContainerItemProxy;+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;+ proxyType = 1;+ remoteGlobalIDString = 33CC10EC2044A3C60003C045;+ remoteInfo = Runner;+ };+ 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {+ isa = PBXContainerItemProxy;+ containerPortal = 33CC10E52044A3C60003C045 /* Project object */;+ proxyType = 1;+ remoteGlobalIDString = 33CC111A2044C6BA0003C045;+ remoteInfo = FLX;+ };+/* End PBXContainerItemProxy section */++/* Begin PBXCopyFilesBuildPhase section */+ 33CC110E2044A8840003C045 /* Bundle Framework */ = {+ isa = PBXCopyFilesBuildPhase;+ buildActionMask = 2147483647;+ dstPath = "";+ dstSubfolderSpec = 10;+ files = (+ );+ name = "Bundle Framework";+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXCopyFilesBuildPhase section */++/* Begin PBXFileReference section */+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };+ 33CC10ED2044A3C60003C045 /* locker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = locker.app; sourceTree = BUILT_PRODUCTS_DIR; };+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };+ 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };+ 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };+ 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; };+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; };+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };+ 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };+ 525AD39957F290EBEA71D275 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ 54856530D3CF926D9FC7D5AB /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };+ 56670D826B6B386CB46D62A4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };+ 6C5BBAB371CF35A643A7437A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };+ 858DFB73D44507E1FE278030 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };+ A7673CE67E05A584D01EA757 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };+ F74F319179D2B77563D2E697 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };+ FFAC0A535D20ED9BDF0ADAD2 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };+/* End PBXFileReference section */++/* Begin PBXFrameworksBuildPhase section */+ 331C80D2294CF70F00263BE5 /* Frameworks */ = {+ isa = PBXFrameworksBuildPhase;+ buildActionMask = 2147483647;+ files = (+ C9A78EA7917BBDA4B497AD6E /* Pods_RunnerTests.framework in Frameworks */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 33CC10EA2044A3C60003C045 /* Frameworks */ = {+ isa = PBXFrameworksBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 0BE25975B65D6BA73D3A1354 /* Pods_Runner.framework in Frameworks */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXFrameworksBuildPhase section */++/* Begin PBXGroup section */+ 331C80D6294CF71000263BE5 /* RunnerTests */ = {+ isa = PBXGroup;+ children = (+ 331C80D7294CF71000263BE5 /* RunnerTests.swift */,+ );+ path = RunnerTests;+ sourceTree = "<group>";+ };+ 33BA886A226E78AF003329D5 /* Configs */ = {+ isa = PBXGroup;+ children = (+ 33E5194F232828860026EE4D /* AppInfo.xcconfig */,+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,+ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */,+ );+ path = Configs;+ sourceTree = "<group>";+ };+ 33CC10E42044A3C60003C045 = {+ isa = PBXGroup;+ children = (+ 33FAB671232836740065AC1E /* Runner */,+ 33CEB47122A05771004F2AC0 /* Flutter */,+ 331C80D6294CF71000263BE5 /* RunnerTests */,+ 33CC10EE2044A3C60003C045 /* Products */,+ D73912EC22F37F3D000D13A0 /* Frameworks */,+ B360C8315A7BC96A51347C06 /* Pods */,+ );+ sourceTree = "<group>";+ };+ 33CC10EE2044A3C60003C045 /* Products */ = {+ isa = PBXGroup;+ children = (+ 33CC10ED2044A3C60003C045 /* locker.app */,+ 331C80D5294CF71000263BE5 /* RunnerTests.xctest */,+ );+ name = Products;+ sourceTree = "<group>";+ };+ 33CC11242044D66E0003C045 /* Resources */ = {+ isa = PBXGroup;+ children = (+ 33CC10F22044A3C60003C045 /* Assets.xcassets */,+ 33CC10F42044A3C60003C045 /* MainMenu.xib */,+ 33CC10F72044A3C60003C045 /* Info.plist */,+ );+ name = Resources;+ path = ..;+ sourceTree = "<group>";+ };+ 33CEB47122A05771004F2AC0 /* Flutter */ = {+ isa = PBXGroup;+ children = (+ 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,+ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,+ 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,+ 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,+ );+ path = Flutter;+ sourceTree = "<group>";+ };+ 33FAB671232836740065AC1E /* Runner */ = {+ isa = PBXGroup;+ children = (+ 33CC10F02044A3C60003C045 /* AppDelegate.swift */,+ 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,+ 33E51913231747F40026EE4D /* DebugProfile.entitlements */,+ 33E51914231749380026EE4D /* Release.entitlements */,+ 33CC11242044D66E0003C045 /* Resources */,+ 33BA886A226E78AF003329D5 /* Configs */,+ );+ path = Runner;+ sourceTree = "<group>";+ };+ B360C8315A7BC96A51347C06 /* Pods */ = {+ isa = PBXGroup;+ children = (+ 56670D826B6B386CB46D62A4 /* Pods-Runner.debug.xcconfig */,+ FFAC0A535D20ED9BDF0ADAD2 /* Pods-Runner.release.xcconfig */,+ 6C5BBAB371CF35A643A7437A /* Pods-Runner.profile.xcconfig */,+ F74F319179D2B77563D2E697 /* Pods-RunnerTests.debug.xcconfig */,+ 54856530D3CF926D9FC7D5AB /* Pods-RunnerTests.release.xcconfig */,+ A7673CE67E05A584D01EA757 /* Pods-RunnerTests.profile.xcconfig */,+ );+ path = Pods;+ sourceTree = "<group>";+ };+ D73912EC22F37F3D000D13A0 /* Frameworks */ = {+ isa = PBXGroup;+ children = (+ 525AD39957F290EBEA71D275 /* Pods_Runner.framework */,+ 858DFB73D44507E1FE278030 /* Pods_RunnerTests.framework */,+ );+ name = Frameworks;+ sourceTree = "<group>";+ };+/* End PBXGroup section */++/* Begin PBXNativeTarget section */+ 331C80D4294CF70F00263BE5 /* RunnerTests */ = {+ isa = PBXNativeTarget;+ buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;+ buildPhases = (+ 85A4B508E9D300E4FD85782F /* [CP] Check Pods Manifest.lock */,+ 331C80D1294CF70F00263BE5 /* Sources */,+ 331C80D2294CF70F00263BE5 /* Frameworks */,+ 331C80D3294CF70F00263BE5 /* Resources */,+ );+ buildRules = (+ );+ dependencies = (+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */,+ );+ name = RunnerTests;+ productName = RunnerTests;+ productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;+ productType = "com.apple.product-type.bundle.unit-test";+ };+ 33CC10EC2044A3C60003C045 /* Runner */ = {+ isa = PBXNativeTarget;+ buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;+ buildPhases = (+ 4C5450204892FC1CE86D7750 /* [CP] Check Pods Manifest.lock */,+ 33CC10E92044A3C60003C045 /* Sources */,+ 33CC10EA2044A3C60003C045 /* Frameworks */,+ 33CC10EB2044A3C60003C045 /* Resources */,+ 33CC110E2044A8840003C045 /* Bundle Framework */,+ 3399D490228B24CF009A79C7 /* ShellScript */,+ B035DB2B7066A1CE24DA098C /* [CP] Embed Pods Frameworks */,+ );+ buildRules = (+ );+ dependencies = (+ 33CC11202044C79F0003C045 /* PBXTargetDependency */,+ );+ name = Runner;+ productName = Runner;+ productReference = 33CC10ED2044A3C60003C045 /* locker.app */;+ productType = "com.apple.product-type.application";+ };+/* End PBXNativeTarget section */++/* Begin PBXProject section */+ 33CC10E52044A3C60003C045 /* Project object */ = {+ isa = PBXProject;+ attributes = {+ BuildIndependentTargetsInParallel = YES;+ LastSwiftUpdateCheck = 0920;+ LastUpgradeCheck = 1510;+ ORGANIZATIONNAME = "";+ TargetAttributes = {+ 331C80D4294CF70F00263BE5 = {+ CreatedOnToolsVersion = 14.0;+ TestTargetID = 33CC10EC2044A3C60003C045;+ };+ 33CC10EC2044A3C60003C045 = {+ CreatedOnToolsVersion = 9.2;+ LastSwiftMigration = 1100;+ ProvisioningStyle = Automatic;+ SystemCapabilities = {+ com.apple.Sandbox = {+ enabled = 1;+ };+ };+ };+ 33CC111A2044C6BA0003C045 = {+ CreatedOnToolsVersion = 9.2;+ ProvisioningStyle = Manual;+ };+ };+ };+ buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;+ compatibilityVersion = "Xcode 9.3";+ developmentRegion = en;+ hasScannedForEncodings = 0;+ knownRegions = (+ en,+ Base,+ );+ mainGroup = 33CC10E42044A3C60003C045;+ productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;+ projectDirPath = "";+ projectRoot = "";+ targets = (+ 33CC10EC2044A3C60003C045 /* Runner */,+ 331C80D4294CF70F00263BE5 /* RunnerTests */,+ 33CC111A2044C6BA0003C045 /* Flutter Assemble */,+ );+ };+/* End PBXProject section */++/* Begin PBXResourcesBuildPhase section */+ 331C80D3294CF70F00263BE5 /* Resources */ = {+ isa = PBXResourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 33CC10EB2044A3C60003C045 /* Resources */ = {+ isa = PBXResourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,+ 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXResourcesBuildPhase section */++/* Begin PBXShellScriptBuildPhase section */+ 3399D490228B24CF009A79C7 /* ShellScript */ = {+ isa = PBXShellScriptBuildPhase;+ alwaysOutOfDate = 1;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ );+ outputFileListPaths = (+ );+ outputPaths = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";+ };+ 33CC111E2044C6BF0003C045 /* ShellScript */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ Flutter/ephemeral/FlutterInputs.xcfilelist,+ );+ inputPaths = (+ Flutter/ephemeral/tripwire,+ );+ outputFileListPaths = (+ Flutter/ephemeral/FlutterOutputs.xcfilelist,+ );+ outputPaths = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";+ };+ 4C5450204892FC1CE86D7750 /* [CP] Check Pods Manifest.lock */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",+ "${PODS_ROOT}/Manifest.lock",+ );+ name = "[CP] Check Pods Manifest.lock";+ outputFileListPaths = (+ );+ outputPaths = (+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";+ showEnvVarsInLog = 0;+ };+ 85A4B508E9D300E4FD85782F /* [CP] Check Pods Manifest.lock */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",+ "${PODS_ROOT}/Manifest.lock",+ );+ name = "[CP] Check Pods Manifest.lock";+ outputFileListPaths = (+ );+ outputPaths = (+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";+ showEnvVarsInLog = 0;+ };+ B035DB2B7066A1CE24DA098C /* [CP] Embed Pods Frameworks */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",+ );+ name = "[CP] Embed Pods Frameworks";+ outputFileListPaths = (+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";+ showEnvVarsInLog = 0;+ };+/* End PBXShellScriptBuildPhase section */++/* Begin PBXSourcesBuildPhase section */+ 331C80D1294CF70F00263BE5 /* Sources */ = {+ isa = PBXSourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+ 33CC10E92044A3C60003C045 /* Sources */ = {+ isa = PBXSourcesBuildPhase;+ buildActionMask = 2147483647;+ files = (+ 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,+ 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,+ 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,+ );+ runOnlyForDeploymentPostprocessing = 0;+ };+/* End PBXSourcesBuildPhase section */++/* Begin PBXTargetDependency section */+ 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {+ isa = PBXTargetDependency;+ target = 33CC10EC2044A3C60003C045 /* Runner */;+ targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;+ };+ 33CC11202044C79F0003C045 /* PBXTargetDependency */ = {+ isa = PBXTargetDependency;+ target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;+ targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;+ };+/* End PBXTargetDependency section */++/* Begin PBXVariantGroup section */+ 33CC10F42044A3C60003C045 /* MainMenu.xib */ = {+ isa = PBXVariantGroup;+ children = (+ 33CC10F52044A3C60003C045 /* Base */,+ );+ name = MainMenu.xib;+ path = Runner;+ sourceTree = "<group>";+ };+/* End PBXVariantGroup section */++/* Begin XCBuildConfiguration section */+ 331C80DB294CF71000263BE5 /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = F74F319179D2B77563D2E697 /* Pods-RunnerTests.debug.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/locker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/locker";+ };+ name = Debug;+ };+ 331C80DC294CF71000263BE5 /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 54856530D3CF926D9FC7D5AB /* Pods-RunnerTests.release.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/locker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/locker";+ };+ name = Release;+ };+ 331C80DD294CF71000263BE5 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = A7673CE67E05A584D01EA757 /* Pods-RunnerTests.profile.xcconfig */;+ buildSettings = {+ BUNDLE_LOADER = "$(TEST_HOST)";+ CURRENT_PROJECT_VERSION = 1;+ GENERATE_INFOPLIST_FILE = YES;+ MARKETING_VERSION = 1.0;+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker.RunnerTests;+ PRODUCT_NAME = "$(TARGET_NAME)";+ SWIFT_VERSION = 5.0;+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/locker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/locker";+ };+ name = Profile;+ };+ 338D0CE9231458BD00FA5F75 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CODE_SIGN_IDENTITY = "-";+ COPY_PHASE_STRIP = NO;+ DEAD_CODE_STRIPPING = YES;+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";+ ENABLE_NS_ASSERTIONS = NO;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu11;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ MACOSX_DEPLOYMENT_TARGET = 10.14;+ MTL_ENABLE_DEBUG_INFO = NO;+ SDKROOT = macosx;+ SWIFT_COMPILATION_MODE = wholemodule;+ SWIFT_OPTIMIZATION_LEVEL = "-O";+ };+ name = Profile;+ };+ 338D0CEA231458BD00FA5F75 /* Profile */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";+ CODE_SIGN_STYLE = Automatic;+ COMBINE_HIDPI_IMAGES = YES;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ INFOPLIST_FILE = Runner/Info.plist;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/../Frameworks",+ );+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PROVISIONING_PROFILE_SPECIFIER = "";+ SWIFT_VERSION = 5.0;+ };+ name = Profile;+ };+ 338D0CEB231458BD00FA5F75 /* Profile */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ CODE_SIGN_STYLE = Manual;+ PRODUCT_NAME = "$(TARGET_NAME)";+ };+ name = Profile;+ };+ 33CC10F92044A3C60003C045 /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CODE_SIGN_IDENTITY = "-";+ COPY_PHASE_STRIP = NO;+ DEAD_CODE_STRIPPING = YES;+ DEBUG_INFORMATION_FORMAT = dwarf;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_TESTABILITY = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu11;+ GCC_DYNAMIC_NO_PIC = NO;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_OPTIMIZATION_LEVEL = 0;+ GCC_PREPROCESSOR_DEFINITIONS = (+ "DEBUG=1",+ "$(inherited)",+ );+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ MACOSX_DEPLOYMENT_TARGET = 10.14;+ MTL_ENABLE_DEBUG_INFO = YES;+ ONLY_ACTIVE_ARCH = YES;+ SDKROOT = macosx;+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";+ };+ name = Debug;+ };+ 33CC10FA2044A3C60003C045 /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;+ buildSettings = {+ ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;+ CLANG_ANALYZER_NONNULL = YES;+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";+ CLANG_CXX_LIBRARY = "libc++";+ CLANG_ENABLE_MODULES = YES;+ CLANG_ENABLE_OBJC_ARC = YES;+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;+ CLANG_WARN_BOOL_CONVERSION = YES;+ CLANG_WARN_CONSTANT_CONVERSION = YES;+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;+ CLANG_WARN_EMPTY_BODY = YES;+ CLANG_WARN_ENUM_CONVERSION = YES;+ CLANG_WARN_INFINITE_RECURSION = YES;+ CLANG_WARN_INT_CONVERSION = YES;+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;+ CLANG_WARN_SUSPICIOUS_MOVE = YES;+ CODE_SIGN_IDENTITY = "-";+ COPY_PHASE_STRIP = NO;+ DEAD_CODE_STRIPPING = YES;+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";+ ENABLE_NS_ASSERTIONS = NO;+ ENABLE_STRICT_OBJC_MSGSEND = YES;+ ENABLE_USER_SCRIPT_SANDBOXING = NO;+ GCC_C_LANGUAGE_STANDARD = gnu11;+ GCC_NO_COMMON_BLOCKS = YES;+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;+ GCC_WARN_UNUSED_FUNCTION = YES;+ GCC_WARN_UNUSED_VARIABLE = YES;+ MACOSX_DEPLOYMENT_TARGET = 10.14;+ MTL_ENABLE_DEBUG_INFO = NO;+ SDKROOT = macosx;+ SWIFT_COMPILATION_MODE = wholemodule;+ SWIFT_OPTIMIZATION_LEVEL = "-O";+ };+ name = Release;+ };+ 33CC10FC2044A3C60003C045 /* Debug */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";+ CODE_SIGN_STYLE = Automatic;+ COMBINE_HIDPI_IMAGES = YES;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ INFOPLIST_FILE = Runner/Info.plist;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/../Frameworks",+ );+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PROVISIONING_PROFILE_SPECIFIER = "";+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";+ SWIFT_VERSION = 5.0;+ };+ name = Debug;+ };+ 33CC10FD2044A3C60003C045 /* Release */ = {+ isa = XCBuildConfiguration;+ baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;+ buildSettings = {+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CLANG_ENABLE_MODULES = YES;+ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";+ CODE_SIGN_STYLE = Automatic;+ COMBINE_HIDPI_IMAGES = YES;+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;+ INFOPLIST_FILE = Runner/Info.plist;+ LD_RUNPATH_SEARCH_PATHS = (+ "$(inherited)",+ "@executable_path/../Frameworks",+ );+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker;+ PROVISIONING_PROFILE_SPECIFIER = "";+ SWIFT_VERSION = 5.0;+ };+ name = Release;+ };+ 33CC111C2044C6BA0003C045 /* Debug */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ CODE_SIGN_STYLE = Manual;+ PRODUCT_NAME = "$(TARGET_NAME)";+ };+ name = Debug;+ };+ 33CC111D2044C6BA0003C045 /* Release */ = {+ isa = XCBuildConfiguration;+ buildSettings = {+ CODE_SIGN_STYLE = Automatic;+ PRODUCT_NAME = "$(TARGET_NAME)";+ };+ name = Release;+ };+/* End XCBuildConfiguration section */++/* Begin XCConfigurationList section */+ 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 331C80DB294CF71000263BE5 /* Debug */,+ 331C80DC294CF71000263BE5 /* Release */,+ 331C80DD294CF71000263BE5 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 33CC10F92044A3C60003C045 /* Debug */,+ 33CC10FA2044A3C60003C045 /* Release */,+ 338D0CE9231458BD00FA5F75 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 33CC10FC2044A3C60003C045 /* Debug */,+ 33CC10FD2044A3C60003C045 /* Release */,+ 338D0CEA231458BD00FA5F75 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+ 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {+ isa = XCConfigurationList;+ buildConfigurations = (+ 33CC111C2044C6BA0003C045 /* Debug */,+ 33CC111D2044C6BA0003C045 /* Release */,+ 338D0CEB231458BD00FA5F75 /* Profile */,+ );+ defaultConfigurationIsVisible = 0;+ defaultConfigurationName = Release;+ };+/* End XCConfigurationList section */+ };+ rootObject = 33CC10E52044A3C60003C045 /* Project object */;+}diff --git a/mobile/apps/locker/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/mobile/apps/locker/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistnew file mode 100644index 0000000000..18d981003d--- /dev/null+++ b/mobile/apps/locker/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>IDEDidComputeMac32BitWarning</key>+ <true/>+</dict>+</plist>diff --git a/mobile/apps/locker/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/mobile/apps/locker/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemenew file mode 100644index 0000000000..0e55ebac0f--- /dev/null+++ b/mobile/apps/locker/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme@@ -0,0 +1,98 @@+<?xml version="1.0" encoding="UTF-8"?>+<Scheme+ LastUpgradeVersion = "1510"+ version = "1.3">+ <BuildAction+ parallelizeBuildables = "YES"+ buildImplicitDependencies = "YES">+ <BuildActionEntries>+ <BuildActionEntry+ buildForTesting = "YES"+ buildForRunning = "YES"+ buildForProfiling = "YES"+ buildForArchiving = "YES"+ buildForAnalyzing = "YES">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "33CC10EC2044A3C60003C045"+ BuildableName = "locker.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildActionEntry>+ </BuildActionEntries>+ </BuildAction>+ <TestAction+ buildConfiguration = "Debug"+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"+ shouldUseLaunchSchemeArgsEnv = "YES">+ <MacroExpansion>+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "33CC10EC2044A3C60003C045"+ BuildableName = "locker.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </MacroExpansion>+ <Testables>+ <TestableReference+ skipped = "NO"+ parallelizable = "YES">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "331C80D4294CF70F00263BE5"+ BuildableName = "RunnerTests.xctest"+ BlueprintName = "RunnerTests"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </TestableReference>+ </Testables>+ </TestAction>+ <LaunchAction+ buildConfiguration = "Debug"+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"+ launchStyle = "0"+ useCustomWorkingDirectory = "NO"+ ignoresPersistentStateOnLaunch = "NO"+ debugDocumentVersioning = "YES"+ debugServiceExtension = "internal"+ allowLocationSimulation = "YES">+ <BuildableProductRunnable+ runnableDebuggingMode = "0">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "33CC10EC2044A3C60003C045"+ BuildableName = "locker.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildableProductRunnable>+ </LaunchAction>+ <ProfileAction+ buildConfiguration = "Profile"+ shouldUseLaunchSchemeArgsEnv = "YES"+ savedToolIdentifier = ""+ useCustomWorkingDirectory = "NO"+ debugDocumentVersioning = "YES">+ <BuildableProductRunnable+ runnableDebuggingMode = "0">+ <BuildableReference+ BuildableIdentifier = "primary"+ BlueprintIdentifier = "33CC10EC2044A3C60003C045"+ BuildableName = "locker.app"+ BlueprintName = "Runner"+ ReferencedContainer = "container:Runner.xcodeproj">+ </BuildableReference>+ </BuildableProductRunnable>+ </ProfileAction>+ <AnalyzeAction+ buildConfiguration = "Debug">+ </AnalyzeAction>+ <ArchiveAction+ buildConfiguration = "Release"+ revealArchiveInOrganizer = "YES">+ </ArchiveAction>+</Scheme>diff --git a/mobile/apps/locker/macos/Runner.xcworkspace/contents.xcworkspacedata b/mobile/apps/locker/macos/Runner.xcworkspace/contents.xcworkspacedatanew file mode 100644index 0000000000..21a3cc14c7--- /dev/null+++ b/mobile/apps/locker/macos/Runner.xcworkspace/contents.xcworkspacedata@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="UTF-8"?>+<Workspace+ version = "1.0">+ <FileRef+ location = "group:Runner.xcodeproj">+ </FileRef>+ <FileRef+ location = "group:Pods/Pods.xcodeproj">+ </FileRef>+</Workspace>diff --git a/mobile/apps/locker/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/mobile/apps/locker/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistnew file mode 100644index 0000000000..18d981003d--- /dev/null+++ b/mobile/apps/locker/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist@@ -0,0 +1,8 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>IDEDidComputeMac32BitWarning</key>+ <true/>+</dict>+</plist>diff --git a/mobile/apps/locker/macos/Runner/AppDelegate.swift b/mobile/apps/locker/macos/Runner/AppDelegate.swiftnew file mode 100644index 0000000000..8e02df2888--- /dev/null+++ b/mobile/apps/locker/macos/Runner/AppDelegate.swift@@ -0,0 +1,9 @@+import Cocoa+import FlutterMacOS++@main+class AppDelegate: FlutterAppDelegate {+ override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {+ return true+ }+}diff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.jsonnew file mode 100644index 0000000000..a2ec33f19f--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json@@ -0,0 +1,68 @@+{+ "images" : [+ {+ "size" : "16x16",+ "idiom" : "mac",+ "filename" : "app_icon_16.png",+ "scale" : "1x"+ },+ {+ "size" : "16x16",+ "idiom" : "mac",+ "filename" : "app_icon_32.png",+ "scale" : "2x"+ },+ {+ "size" : "32x32",+ "idiom" : "mac",+ "filename" : "app_icon_32.png",+ "scale" : "1x"+ },+ {+ "size" : "32x32",+ "idiom" : "mac",+ "filename" : "app_icon_64.png",+ "scale" : "2x"+ },+ {+ "size" : "128x128",+ "idiom" : "mac",+ "filename" : "app_icon_128.png",+ "scale" : "1x"+ },+ {+ "size" : "128x128",+ "idiom" : "mac",+ "filename" : "app_icon_256.png",+ "scale" : "2x"+ },+ {+ "size" : "256x256",+ "idiom" : "mac",+ "filename" : "app_icon_256.png",+ "scale" : "1x"+ },+ {+ "size" : "256x256",+ "idiom" : "mac",+ "filename" : "app_icon_512.png",+ "scale" : "2x"+ },+ {+ "size" : "512x512",+ "idiom" : "mac",+ "filename" : "app_icon_512.png",+ "scale" : "1x"+ },+ {+ "size" : "512x512",+ "idiom" : "mac",+ "filename" : "app_icon_1024.png",+ "scale" : "2x"+ }+ ],+ "info" : {+ "version" : 1,+ "author" : "xcode"+ }+}diff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.pngnew file mode 100644index 0000000000..82b6f9d9a3Binary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.pngnew file mode 100644index 0000000000..13b35eba55Binary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.pngnew file mode 100644index 0000000000..0a3f5fa40fBinary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.pngnew file mode 100644index 0000000000..bdb57226d5Binary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.pngnew file mode 100644index 0000000000..f083318e09Binary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.pngnew file mode 100644index 0000000000..326c0e72c9Binary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differdiff --git a/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.pngnew file mode 100644index 0000000000..2f1632cfddBinary files /dev/null and b/mobile/apps/locker/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differdiff --git a/mobile/apps/locker/macos/Runner/Base.lproj/MainMenu.xib b/mobile/apps/locker/macos/Runner/Base.lproj/MainMenu.xibnew file mode 100644index 0000000000..80e867a4e0--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Base.lproj/MainMenu.xib@@ -0,0 +1,343 @@+<?xml version="1.0" encoding="UTF-8"?>+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">+ <dependencies>+ <deployment identifier="macosx"/>+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>+ </dependencies>+ <objects>+ <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">+ <connections>+ <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>+ </connections>+ </customObject>+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>+ <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target">+ <connections>+ <outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/>+ <outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>+ </connections>+ </customObject>+ <customObject id="YLy-65-1bz" customClass="NSFontManager"/>+ <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">+ <items>+ <menuItem title="APP_NAME" id="1Xt-HY-uBw">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr">+ <items>+ <menuItem title="About APP_NAME" id="5kV-Vb-QxS">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>+ <menuItem title="Preferencesβ¦" keyEquivalent="," id="BOF-NM-1cW"/>+ <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>+ <menuItem title="Services" id="NMo-om-nkz">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>+ <menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN">+ <connections>+ <action selector="hide:" target="-1" id="PnN-Uc-m68"/>+ </connections>+ </menuItem>+ <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>+ <connections>+ <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>+ </connections>+ </menuItem>+ <menuItem title="Show All" id="Kd2-mp-pUS">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>+ <menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi">+ <connections>+ <action selector="terminate:" target="-1" id="Te7-pn-YzF"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Edit" id="5QF-Oa-p0T">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Edit" id="W48-6f-4Dl">+ <items>+ <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">+ <connections>+ <action selector="undo:" target="-1" id="M6e-cu-g7V"/>+ </connections>+ </menuItem>+ <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">+ <connections>+ <action selector="redo:" target="-1" id="oIA-Rs-6OD"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>+ <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">+ <connections>+ <action selector="cut:" target="-1" id="YJe-68-I9s"/>+ </connections>+ </menuItem>+ <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">+ <connections>+ <action selector="copy:" target="-1" id="G1f-GL-Joy"/>+ </connections>+ </menuItem>+ <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">+ <connections>+ <action selector="paste:" target="-1" id="UvS-8e-Qdg"/>+ </connections>+ </menuItem>+ <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>+ <connections>+ <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>+ </connections>+ </menuItem>+ <menuItem title="Delete" id="pa3-QI-u2k">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>+ </connections>+ </menuItem>+ <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">+ <connections>+ <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>+ <menuItem title="Find" id="4EN-yA-p0u">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Find" id="1b7-l0-nxx">+ <items>+ <menuItem title="Findβ¦" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">+ <connections>+ <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>+ </connections>+ </menuItem>+ <menuItem title="Find and Replaceβ¦" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>+ <connections>+ <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>+ </connections>+ </menuItem>+ <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">+ <connections>+ <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>+ </connections>+ </menuItem>+ <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">+ <connections>+ <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>+ </connections>+ </menuItem>+ <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">+ <connections>+ <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>+ </connections>+ </menuItem>+ <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">+ <connections>+ <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Spelling" id="3IN-sU-3Bg">+ <items>+ <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">+ <connections>+ <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>+ </connections>+ </menuItem>+ <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">+ <connections>+ <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>+ <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>+ </connections>+ </menuItem>+ <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>+ </connections>+ </menuItem>+ <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Substitutions" id="9ic-FL-obx">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Substitutions" id="FeM-D8-WVr">+ <items>+ <menuItem title="Show Substitutions" id="z6F-FW-3nz">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>+ <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>+ </connections>+ </menuItem>+ <menuItem title="Smart Quotes" id="hQb-2v-fYv">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>+ </connections>+ </menuItem>+ <menuItem title="Smart Dashes" id="rgM-f4-ycn">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>+ </connections>+ </menuItem>+ <menuItem title="Smart Links" id="cwL-P1-jid">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>+ </connections>+ </menuItem>+ <menuItem title="Data Detectors" id="tRr-pd-1PS">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>+ </connections>+ </menuItem>+ <menuItem title="Text Replacement" id="HFQ-gK-NFA">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Transformations" id="2oI-Rn-ZJC">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Transformations" id="c8a-y6-VQd">+ <items>+ <menuItem title="Make Upper Case" id="vmV-6d-7jI">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>+ </connections>+ </menuItem>+ <menuItem title="Make Lower Case" id="d9M-CD-aMd">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>+ </connections>+ </menuItem>+ <menuItem title="Capitalize" id="UEZ-Bs-lqG">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Speech" id="xrE-MZ-jX0">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Speech" id="3rS-ZA-NoH">+ <items>+ <menuItem title="Start Speaking" id="Ynk-f8-cLZ">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>+ </connections>+ </menuItem>+ <menuItem title="Stop Speaking" id="Oyz-dy-DGm">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="View" id="H8h-7b-M4v">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="View" id="HyV-fh-RgO">+ <items>+ <menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">+ <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>+ <connections>+ <action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Window" id="aUF-d1-5bR">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">+ <items>+ <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">+ <connections>+ <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>+ </connections>+ </menuItem>+ <menuItem title="Zoom" id="R4o-n2-Eq4">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>+ </connections>+ </menuItem>+ <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>+ <menuItem title="Bring All to Front" id="LE2-aR-0XJ">+ <modifierMask key="keyEquivalentModifierMask"/>+ <connections>+ <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>+ </connections>+ </menuItem>+ </items>+ </menu>+ </menuItem>+ <menuItem title="Help" id="EPT-qC-fAb">+ <modifierMask key="keyEquivalentModifierMask"/>+ <menu key="submenu" title="Help" systemMenu="help" id="rJ0-wn-3NY"/>+ </menuItem>+ </items>+ <point key="canvasLocation" x="142" y="-258"/>+ </menu>+ <window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">+ <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>+ <rect key="contentRect" x="335" y="390" width="800" height="600"/>+ <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>+ <view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">+ <rect key="frame" x="0.0" y="0.0" width="800" height="600"/>+ <autoresizingMask key="autoresizingMask"/>+ </view>+ </window>+ </objects>+</document>diff --git a/mobile/apps/locker/macos/Runner/Configs/AppInfo.xcconfig b/mobile/apps/locker/macos/Runner/Configs/AppInfo.xcconfignew file mode 100644index 0000000000..1463149715--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Configs/AppInfo.xcconfig@@ -0,0 +1,17 @@+// Application-level settings for the Runner target.+//+// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the+// future. If not, the values below would default to using the project name when this becomes a+// 'flutter create' template.++// The application's name. By default this is also the title of the Flutter window.+PRODUCT_NAME = locker++// The application's bundle identifier+PRODUCT_BUNDLE_IDENTIFIER = io.ente.locker++// The copyright displayed in application information+PRODUCT_COPYRIGHT = Copyright Β© 2025 Ente Technologies, Inc. All rights reserved.++// The minimum macOS deployment target+MACOSX_DEPLOYMENT_TARGET = 10.15diff --git a/mobile/apps/locker/macos/Runner/Configs/Debug.xcconfig b/mobile/apps/locker/macos/Runner/Configs/Debug.xcconfignew file mode 100644index 0000000000..36b0fd9464--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Configs/Debug.xcconfig@@ -0,0 +1,2 @@+#include "../../Flutter/Flutter-Debug.xcconfig"+#include "Warnings.xcconfig"diff --git a/mobile/apps/locker/macos/Runner/Configs/Release.xcconfig b/mobile/apps/locker/macos/Runner/Configs/Release.xcconfignew file mode 100644index 0000000000..dff4f49561--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Configs/Release.xcconfig@@ -0,0 +1,2 @@+#include "../../Flutter/Flutter-Release.xcconfig"+#include "Warnings.xcconfig"diff --git a/mobile/apps/locker/macos/Runner/Configs/Warnings.xcconfig b/mobile/apps/locker/macos/Runner/Configs/Warnings.xcconfignew file mode 100644index 0000000000..42bcbf4780--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Configs/Warnings.xcconfig@@ -0,0 +1,13 @@+WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings+GCC_WARN_UNDECLARED_SELECTOR = YES+CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES+CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE+CLANG_WARN__DUPLICATE_METHOD_MATCH = YES+CLANG_WARN_PRAGMA_PACK = YES+CLANG_WARN_STRICT_PROTOTYPES = YES+CLANG_WARN_COMMA = YES+GCC_WARN_STRICT_SELECTOR_MATCH = YES+CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES+CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES+GCC_WARN_SHADOW = YES+CLANG_WARN_UNREACHABLE_CODE = YESdiff --git a/mobile/apps/locker/macos/Runner/DebugProfile.entitlements b/mobile/apps/locker/macos/Runner/DebugProfile.entitlementsnew file mode 100644index 0000000000..7c098966de--- /dev/null+++ b/mobile/apps/locker/macos/Runner/DebugProfile.entitlements@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.app-sandbox</key>+ <true/>+ <key>com.apple.security.cs.allow-jit</key>+ <true/>+ <key>com.apple.security.network.server</key>+ <true/>+ <key>com.apple.security.network.client</key>+ <true/>+ <key>com.apple.security.files.user-selected.read-only</key>+ <true/>+ <key>keychain-access-groups</key>+ <array/>+</dict>+</plist>diff --git a/mobile/apps/locker/macos/Runner/Info.plist b/mobile/apps/locker/macos/Runner/Info.plistnew file mode 100644index 0000000000..4789daa6a4--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Info.plist@@ -0,0 +1,32 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>CFBundleDevelopmentRegion</key>+ <string>$(DEVELOPMENT_LANGUAGE)</string>+ <key>CFBundleExecutable</key>+ <string>$(EXECUTABLE_NAME)</string>+ <key>CFBundleIconFile</key>+ <string></string>+ <key>CFBundleIdentifier</key>+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>+ <key>CFBundleInfoDictionaryVersion</key>+ <string>6.0</string>+ <key>CFBundleName</key>+ <string>$(PRODUCT_NAME)</string>+ <key>CFBundlePackageType</key>+ <string>APPL</string>+ <key>CFBundleShortVersionString</key>+ <string>$(FLUTTER_BUILD_NAME)</string>+ <key>CFBundleVersion</key>+ <string>$(FLUTTER_BUILD_NUMBER)</string>+ <key>LSMinimumSystemVersion</key>+ <string>$(MACOSX_DEPLOYMENT_TARGET)</string>+ <key>NSHumanReadableCopyright</key>+ <string>$(PRODUCT_COPYRIGHT)</string>+ <key>NSMainNibFile</key>+ <string>MainMenu</string>+ <key>NSPrincipalClass</key>+ <string>NSApplication</string>+</dict>+</plist>diff --git a/mobile/apps/locker/macos/Runner/MainFlutterWindow.swift b/mobile/apps/locker/macos/Runner/MainFlutterWindow.swiftnew file mode 100644index 0000000000..3cc05eb234--- /dev/null+++ b/mobile/apps/locker/macos/Runner/MainFlutterWindow.swift@@ -0,0 +1,15 @@+import Cocoa+import FlutterMacOS++class MainFlutterWindow: NSWindow {+ override func awakeFromNib() {+ let flutterViewController = FlutterViewController()+ let windowFrame = self.frame+ self.contentViewController = flutterViewController+ self.setFrame(windowFrame, display: true)++ RegisterGeneratedPlugins(registry: flutterViewController)++ super.awakeFromNib()+ }+}diff --git a/mobile/apps/locker/macos/Runner/Release.entitlements b/mobile/apps/locker/macos/Runner/Release.entitlementsnew file mode 100644index 0000000000..1de9b453af--- /dev/null+++ b/mobile/apps/locker/macos/Runner/Release.entitlements@@ -0,0 +1,14 @@+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+ <key>com.apple.security.app-sandbox</key>+ <true/>+ <key>com.apple.security.files.user-selected.read-only</key>+ <true/>+ <key>com.apple.security.network.client</key>+ <true/>+ <key>keychain-access-groups</key>+ <array/>+</dict>+</plist>diff --git a/mobile/apps/locker/macos/RunnerTests/RunnerTests.swift b/mobile/apps/locker/macos/RunnerTests/RunnerTests.swiftnew file mode 100644index 0000000000..61f3bd1fc5--- /dev/null+++ b/mobile/apps/locker/macos/RunnerTests/RunnerTests.swift@@ -0,0 +1,12 @@+import Cocoa+import FlutterMacOS+import XCTest++class RunnerTests: XCTestCase {++ func testExample() {+ // If you add code to the Runner application, consider adding tests here.+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.+ }++}diff --git a/mobile/apps/locker/pubspec.lock b/mobile/apps/locker/pubspec.locknew file mode 100644index 0000000000..a69b237c67--- /dev/null+++ b/mobile/apps/locker/pubspec.lock@@ -0,0 +1,1471 @@+# Generated by pub+# See https://dart.dev/tools/pub/glossary#lockfile+packages:+ adaptive_theme:+ dependency: "direct main"+ description:+ name: adaptive_theme+ sha256: f4ee609b464e5efc68131d9d15ba9aa1de4e3b5ede64be17781c6e19a52d637d+ url: "https://pub.dev"+ source: hosted+ version: "3.6.0"+ app_links:+ dependency: transitive+ description:+ name: app_links+ sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba"+ url: "https://pub.dev"+ source: hosted+ version: "6.4.0"+ app_links_linux:+ dependency: transitive+ description:+ name: app_links_linux+ sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81+ url: "https://pub.dev"+ source: hosted+ version: "1.0.3"+ app_links_platform_interface:+ dependency: transitive+ description:+ name: app_links_platform_interface+ sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"+ url: "https://pub.dev"+ source: hosted+ version: "2.0.2"+ app_links_web:+ dependency: transitive+ description:+ name: app_links_web+ sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555+ url: "https://pub.dev"+ source: hosted+ version: "1.0.4"+ archive:+ dependency: transitive+ description:+ name: archive+ sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"+ url: "https://pub.dev"+ source: hosted+ version: "4.0.7"+ args:+ dependency: transitive+ description:+ name: args+ sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04+ url: "https://pub.dev"+ source: hosted+ version: "2.7.0"+ async:+ dependency: transitive+ description:+ name: async+ sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"+ url: "https://pub.dev"+ source: hosted+ version: "2.13.0"+ bip39:+ dependency: transitive+ description:+ name: bip39+ sha256: de1ee27ebe7d96b84bb3a04a4132a0a3007dcdd5ad27dd14aa87a29d97c45edc+ url: "https://pub.dev"+ source: hosted+ version: "1.0.6"+ boolean_selector:+ dependency: transitive+ description:+ name: boolean_selector+ sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.2"+ characters:+ dependency: transitive+ description:+ name: characters+ sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ clock:+ dependency: transitive+ description:+ name: clock+ sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b+ url: "https://pub.dev"+ source: hosted+ version: "1.1.2"+ collection:+ dependency: "direct main"+ description:+ name: collection+ sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"+ url: "https://pub.dev"+ source: hosted+ version: "1.19.1"+ convert:+ dependency: transitive+ description:+ name: convert+ sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68+ url: "https://pub.dev"+ source: hosted+ version: "3.1.2"+ cronet_http:+ dependency: transitive+ description:+ name: cronet_http+ sha256: "5ed075c59b2d4bd43af4e73d906b8082e98ecd2af9c625327370ef28361bf635"+ url: "https://pub.dev"+ source: hosted+ version: "1.3.4"+ cross_file:+ dependency: transitive+ description:+ name: cross_file+ sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"+ url: "https://pub.dev"+ source: hosted+ version: "0.3.4+2"+ crypto:+ dependency: transitive+ description:+ name: crypto+ sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"+ url: "https://pub.dev"+ source: hosted+ version: "3.0.6"+ csslib:+ dependency: transitive+ description:+ name: csslib+ sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.2"+ cupertino_http:+ dependency: transitive+ description:+ name: cupertino_http+ sha256: "8fb9e2c36d0732d9d96abd76683406b57e78a2514e27c962e0c603dbe6f2e3f8"+ url: "https://pub.dev"+ source: hosted+ version: "2.2.0"+ device_info_plus:+ dependency: transitive+ description:+ name: device_info_plus+ sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"+ url: "https://pub.dev"+ source: hosted+ version: "9.1.2"+ device_info_plus_platform_interface:+ dependency: transitive+ description:+ name: device_info_plus_platform_interface+ sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2"+ url: "https://pub.dev"+ source: hosted+ version: "7.0.2"+ dio:+ dependency: "direct main"+ description:+ name: dio+ sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"+ url: "https://pub.dev"+ source: hosted+ version: "5.8.0+1"+ dio_web_adapter:+ dependency: transitive+ description:+ name: dio_web_adapter+ sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.1"+ dotted_border:+ dependency: transitive+ description:+ name: dotted_border+ sha256: "99b091ec6891ba0c5331fdc2b502993c7c108f898995739a73c6845d71dad70c"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.0"+ email_validator:+ dependency: "direct main"+ description:+ name: email_validator+ sha256: b19aa5d92fdd76fbc65112060c94d45ba855105a28bb6e462de7ff03b12fa1fb+ url: "https://pub.dev"+ source: hosted+ version: "3.0.0"+ ente_accounts:+ dependency: "direct main"+ description:+ path: "../../packages/accounts"+ relative: true+ source: path+ version: "1.0.0"+ ente_base:+ dependency: "direct main"+ description:+ path: "../../packages/base"+ relative: true+ source: path+ version: "1.0.0"+ ente_configuration:+ dependency: "direct main"+ description:+ path: "../../packages/configuration"+ relative: true+ source: path+ version: "1.0.0"+ ente_crypto_dart:+ dependency: "direct main"+ description:+ path: "."+ ref: HEAD+ resolved-ref: f91e1545f8263df127762240c4da54a0c42835b2+ url: "https://github.com/ente-io/ente_crypto_dart.git"+ source: git+ version: "1.0.0"+ ente_events:+ dependency: "direct main"+ description:+ path: "../../packages/events"+ relative: true+ source: path+ version: "1.0.0"+ ente_lock_screen:+ dependency: "direct main"+ description:+ path: "../../packages/lock_screen"+ relative: true+ source: path+ version: "1.0.0"+ ente_logging:+ dependency: "direct main"+ description:+ path: "../../packages/logging"+ relative: true+ source: path+ version: "1.0.0"+ ente_network:+ dependency: "direct main"+ description:+ path: "../../packages/network"+ relative: true+ source: path+ version: "1.0.0"+ ente_strings:+ dependency: "direct main"+ description:+ path: "../../packages/strings"+ relative: true+ source: path+ version: "1.0.0"+ ente_ui:+ dependency: "direct main"+ description:+ path: "../../packages/ui"+ relative: true+ source: path+ version: "1.0.0"+ ente_utils:+ dependency: "direct main"+ description:+ path: "../../packages/utils"+ relative: true+ source: path+ version: "1.0.0"+ event_bus:+ dependency: "direct main"+ description:+ name: event_bus+ sha256: "1a55e97923769c286d295240048fc180e7b0768902c3c2e869fe059aafa15304"+ url: "https://pub.dev"+ source: hosted+ version: "2.0.1"+ expandable:+ dependency: transitive+ description:+ name: expandable+ sha256: "9604d612d4d1146dafa96c6d8eec9c2ff0994658d6d09fed720ab788c7f5afc2"+ url: "https://pub.dev"+ source: hosted+ version: "5.0.1"+ fake_async:+ dependency: transitive+ description:+ name: fake_async+ sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"+ url: "https://pub.dev"+ source: hosted+ version: "1.3.3"+ fast_base58:+ dependency: "direct main"+ description:+ name: fast_base58+ sha256: "611f65633b734f27a850b51371b3eba993a5165650e12e8e7b02959f3768ba06"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.1"+ ffi:+ dependency: transitive+ description:+ name: ffi+ sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.3"+ file:+ dependency: transitive+ description:+ name: file+ sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4+ url: "https://pub.dev"+ source: hosted+ version: "7.0.1"+ file_picker:+ dependency: "direct main"+ description:+ name: file_picker+ sha256: ef9908739bdd9c476353d6adff72e88fd00c625f5b959ae23f7567bd5137db0a+ url: "https://pub.dev"+ source: hosted+ version: "10.2.0"+ file_saver:+ dependency: transitive+ description:+ name: file_saver+ sha256: "9d93db09bd4da9e43238f9dd485360fc51a5c138eea5ef5f407ec56e58079ac0"+ url: "https://pub.dev"+ source: hosted+ version: "0.3.1"+ fixnum:+ dependency: transitive+ description:+ name: fixnum+ sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be+ url: "https://pub.dev"+ source: hosted+ version: "1.1.1"+ flutter:+ dependency: "direct main"+ description: flutter+ source: sdk+ version: "0.0.0"+ flutter_animate:+ dependency: transitive+ description:+ name: flutter_animate+ sha256: "7befe2d3252728afb77aecaaea1dec88a89d35b9b1d2eea6d04479e8af9117b5"+ url: "https://pub.dev"+ source: hosted+ version: "4.5.2"+ flutter_displaymode:+ dependency: "direct main"+ description:+ name: flutter_displaymode+ sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef"+ url: "https://pub.dev"+ source: hosted+ version: "0.6.0"+ flutter_email_sender:+ dependency: transitive+ description:+ name: flutter_email_sender+ sha256: d39eb5e91358fc19ec4050da69accec21f9d5b2b6bcf188aa246327b6ca2352c+ url: "https://pub.dev"+ source: hosted+ version: "7.0.0"+ flutter_inappwebview:+ dependency: transitive+ description:+ name: flutter_inappwebview+ sha256: "80092d13d3e29b6227e25b67973c67c7210bd5e35c4b747ca908e31eb71a46d5"+ url: "https://pub.dev"+ source: hosted+ version: "6.1.5"+ flutter_inappwebview_android:+ dependency: transitive+ description:+ name: flutter_inappwebview_android+ sha256: "62557c15a5c2db5d195cb3892aab74fcaec266d7b86d59a6f0027abd672cddba"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.3"+ flutter_inappwebview_internal_annotations:+ dependency: transitive+ description:+ name: flutter_inappwebview_internal_annotations+ sha256: "787171d43f8af67864740b6f04166c13190aa74a1468a1f1f1e9ee5b90c359cd"+ url: "https://pub.dev"+ source: hosted+ version: "1.2.0"+ flutter_inappwebview_ios:+ dependency: transitive+ description:+ name: flutter_inappwebview_ios+ sha256: "5818cf9b26cf0cbb0f62ff50772217d41ea8d3d9cc00279c45f8aabaa1b4025d"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.2"+ flutter_inappwebview_macos:+ dependency: transitive+ description:+ name: flutter_inappwebview_macos+ sha256: c1fbb86af1a3738e3541364d7d1866315ffb0468a1a77e34198c9be571287da1+ url: "https://pub.dev"+ source: hosted+ version: "1.1.2"+ flutter_inappwebview_platform_interface:+ dependency: transitive+ description:+ name: flutter_inappwebview_platform_interface+ sha256: cf5323e194096b6ede7a1ca808c3e0a078e4b33cc3f6338977d75b4024ba2500+ url: "https://pub.dev"+ source: hosted+ version: "1.3.0+1"+ flutter_inappwebview_web:+ dependency: transitive+ description:+ name: flutter_inappwebview_web+ sha256: "55f89c83b0a0d3b7893306b3bb545ba4770a4df018204917148ebb42dc14a598"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.2"+ flutter_inappwebview_windows:+ dependency: transitive+ description:+ name: flutter_inappwebview_windows+ sha256: "8b4d3a46078a2cdc636c4a3d10d10f2a16882f6be607962dbfff8874d1642055"+ url: "https://pub.dev"+ source: hosted+ version: "0.6.0"+ flutter_lints:+ dependency: "direct dev"+ description:+ name: flutter_lints+ sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"+ url: "https://pub.dev"+ source: hosted+ version: "4.0.0"+ flutter_local_authentication:+ dependency: "direct main"+ description:+ path: "."+ ref: "1ac346a04592a05fd75acccf2e01fa3c7e955d96"+ resolved-ref: "1ac346a04592a05fd75acccf2e01fa3c7e955d96"+ url: "https://github.com/eaceto/flutter_local_authentication"+ source: git+ version: "1.2.0"+ flutter_localizations:+ dependency: "direct main"+ description: flutter+ source: sdk+ version: "0.0.0"+ flutter_plugin_android_lifecycle:+ dependency: transitive+ description:+ name: flutter_plugin_android_lifecycle+ sha256: "1c2b787f99bdca1f3718543f81d38aa1b124817dfeb9fb196201bea85b6134bf"+ url: "https://pub.dev"+ source: hosted+ version: "2.0.26"+ flutter_secure_storage:+ dependency: transitive+ description:+ name: flutter_secure_storage+ sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea"+ url: "https://pub.dev"+ source: hosted+ version: "9.2.4"+ flutter_secure_storage_linux:+ dependency: transitive+ description:+ name: flutter_secure_storage_linux+ sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688+ url: "https://pub.dev"+ source: hosted+ version: "1.2.3"+ flutter_secure_storage_macos:+ dependency: transitive+ description:+ name: flutter_secure_storage_macos+ sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.3"+ flutter_secure_storage_platform_interface:+ dependency: transitive+ description:+ name: flutter_secure_storage_platform_interface+ sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8+ url: "https://pub.dev"+ source: hosted+ version: "1.1.2"+ flutter_secure_storage_web:+ dependency: transitive+ description:+ name: flutter_secure_storage_web+ sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9+ url: "https://pub.dev"+ source: hosted+ version: "1.2.1"+ flutter_secure_storage_windows:+ dependency: transitive+ description:+ name: flutter_secure_storage_windows+ sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709+ url: "https://pub.dev"+ source: hosted+ version: "3.1.2"+ flutter_shaders:+ dependency: transitive+ description:+ name: flutter_shaders+ sha256: "34794acadd8275d971e02df03afee3dee0f98dbfb8c4837082ad0034f612a3e2"+ url: "https://pub.dev"+ source: hosted+ version: "0.1.3"+ flutter_test:+ dependency: "direct dev"+ description: flutter+ source: sdk+ version: "0.0.0"+ flutter_web_plugins:+ dependency: transitive+ description: flutter+ source: sdk+ version: "0.0.0"+ fluttertoast:+ dependency: transitive+ description:+ name: fluttertoast+ sha256: "25e51620424d92d3db3832464774a6143b5053f15e382d8ffbfd40b6e795dcf1"+ url: "https://pub.dev"+ source: hosted+ version: "8.2.12"+ freezed_annotation:+ dependency: transitive+ description:+ name: freezed_annotation+ sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2+ url: "https://pub.dev"+ source: hosted+ version: "2.4.4"+ gtk:+ dependency: transitive+ description:+ name: gtk+ sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c+ url: "https://pub.dev"+ source: hosted+ version: "2.1.0"+ hex:+ dependency: transitive+ description:+ name: hex+ sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ html:+ dependency: transitive+ description:+ name: html+ sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602"+ url: "https://pub.dev"+ source: hosted+ version: "0.15.6"+ http:+ dependency: "direct main"+ description:+ name: http+ sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ http_parser:+ dependency: transitive+ description:+ name: http_parser+ sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"+ url: "https://pub.dev"+ source: hosted+ version: "4.0.2"+ http_profile:+ dependency: transitive+ description:+ name: http_profile+ sha256: "7e679e355b09aaee2ab5010915c932cce3f2d1c11c3b2dc177891687014ffa78"+ url: "https://pub.dev"+ source: hosted+ version: "0.1.0"+ intl:+ dependency: "direct main"+ description:+ name: intl+ sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"+ url: "https://pub.dev"+ source: hosted+ version: "0.20.2"+ io:+ dependency: "direct main"+ description:+ name: io+ sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b+ url: "https://pub.dev"+ source: hosted+ version: "1.0.5"+ jni:+ dependency: transitive+ description:+ name: jni+ sha256: "459727a9daf91bdfb39b014cf3c186cf77f0136124a274ac83c186e12262ac4e"+ url: "https://pub.dev"+ source: hosted+ version: "0.12.2"+ js:+ dependency: transitive+ description:+ name: js+ sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3+ url: "https://pub.dev"+ source: hosted+ version: "0.6.7"+ json_annotation:+ dependency: transitive+ description:+ name: json_annotation+ sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"+ url: "https://pub.dev"+ source: hosted+ version: "4.9.0"+ leak_tracker:+ dependency: transitive+ description:+ name: leak_tracker+ sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"+ url: "https://pub.dev"+ source: hosted+ version: "10.0.9"+ leak_tracker_flutter_testing:+ dependency: transitive+ description:+ name: leak_tracker_flutter_testing+ sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573+ url: "https://pub.dev"+ source: hosted+ version: "3.0.9"+ leak_tracker_testing:+ dependency: transitive+ description:+ name: leak_tracker_testing+ sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"+ url: "https://pub.dev"+ source: hosted+ version: "3.0.1"+ lints:+ dependency: transitive+ description:+ name: lints+ sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"+ url: "https://pub.dev"+ source: hosted+ version: "4.0.0"+ listen_sharing_intent:+ dependency: "direct main"+ description:+ name: listen_sharing_intent+ sha256: df12e6c78666018985c39df494fc12412ece6510c38c79fe1230f2abef0965fa+ url: "https://pub.dev"+ source: hosted+ version: "1.9.2"+ local_auth:+ dependency: transitive+ description:+ name: local_auth+ sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b"+ url: "https://pub.dev"+ source: hosted+ version: "2.3.0"+ local_auth_android:+ dependency: transitive+ description:+ name: local_auth_android+ sha256: "8bba79f4f0f7bc812fce2ca20915d15618c37721246ba6c3ef2aa7a763a90cf2"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.47"+ local_auth_darwin:+ dependency: transitive+ description:+ name: local_auth_darwin+ sha256: "630996cd7b7f28f5ab92432c4b35d055dd03a747bc319e5ffbb3c4806a3e50d2"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.3"+ local_auth_platform_interface:+ dependency: transitive+ description:+ name: local_auth_platform_interface+ sha256: "1b842ff177a7068442eae093b64abe3592f816afd2a533c0ebcdbe40f9d2075a"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.10"+ local_auth_windows:+ dependency: transitive+ description:+ name: local_auth_windows+ sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5+ url: "https://pub.dev"+ source: hosted+ version: "1.0.11"+ logging:+ dependency: "direct main"+ description:+ name: logging+ sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61+ url: "https://pub.dev"+ source: hosted+ version: "1.3.0"+ matcher:+ dependency: transitive+ description:+ name: matcher+ sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2+ url: "https://pub.dev"+ source: hosted+ version: "0.12.17"+ material_color_utilities:+ dependency: transitive+ description:+ name: material_color_utilities+ sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec+ url: "https://pub.dev"+ source: hosted+ version: "0.11.1"+ menu_base:+ dependency: transitive+ description:+ name: menu_base+ sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405"+ url: "https://pub.dev"+ source: hosted+ version: "0.1.1"+ meta:+ dependency: transitive+ description:+ name: meta+ sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c+ url: "https://pub.dev"+ source: hosted+ version: "1.16.0"+ mime:+ dependency: transitive+ description:+ name: mime+ sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"+ url: "https://pub.dev"+ source: hosted+ version: "2.0.0"+ modal_bottom_sheet:+ dependency: transitive+ description:+ name: modal_bottom_sheet+ sha256: eac66ef8cb0461bf069a38c5eb0fa728cee525a531a8304bd3f7b2185407c67e+ url: "https://pub.dev"+ source: hosted+ version: "3.0.0"+ native_dio_adapter:+ dependency: transitive+ description:+ name: native_dio_adapter+ sha256: "7420bc9517b2abe09810199a19924617b45690a44ecfb0616ac9babc11875c03"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ objective_c:+ dependency: transitive+ description:+ name: objective_c+ sha256: "9f034ba1eeca53ddb339bc8f4813cb07336a849cd735559b60cdc068ecce2dc7"+ url: "https://pub.dev"+ source: hosted+ version: "7.1.0"+ open_file:+ dependency: "direct main"+ description:+ name: open_file+ sha256: d17e2bddf5b278cb2ae18393d0496aa4f162142ba97d1a9e0c30d476adf99c0e+ url: "https://pub.dev"+ source: hosted+ version: "3.5.10"+ open_file_android:+ dependency: transitive+ description:+ name: open_file_android+ sha256: "58141fcaece2f453a9684509a7275f231ac0e3d6ceb9a5e6de310a7dff9084aa"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.6"+ open_file_ios:+ dependency: transitive+ description:+ name: open_file_ios+ sha256: "02996f01e5f6863832068e97f8f3a5ef9b613516db6897f373b43b79849e4d07"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.3"+ open_file_linux:+ dependency: transitive+ description:+ name: open_file_linux+ sha256: d189f799eecbb139c97f8bc7d303f9e720954fa4e0fa1b0b7294767e5f2d7550+ url: "https://pub.dev"+ source: hosted+ version: "0.0.5"+ open_file_mac:+ dependency: transitive+ description:+ name: open_file_mac+ sha256: "1440b1e37ceb0642208cfeb2c659c6cda27b25187a90635c9d1acb7d0584d324"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.3"+ open_file_platform_interface:+ dependency: transitive+ description:+ name: open_file_platform_interface+ sha256: "101b424ca359632699a7e1213e83d025722ab668b9fd1412338221bf9b0e5757"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.3"+ open_file_web:+ dependency: transitive+ description:+ name: open_file_web+ sha256: e3dbc9584856283dcb30aef5720558b90f88036360bd078e494ab80a80130c4f+ url: "https://pub.dev"+ source: hosted+ version: "0.0.4"+ open_file_windows:+ dependency: transitive+ description:+ name: open_file_windows+ sha256: d26c31ddf935a94a1a3aa43a23f4fff8a5ff4eea395fe7a8cb819cf55431c875+ url: "https://pub.dev"+ source: hosted+ version: "0.0.3"+ package_config:+ dependency: transitive+ description:+ name: package_config+ sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc+ url: "https://pub.dev"+ source: hosted+ version: "2.2.0"+ package_info_plus:+ dependency: "direct main"+ description:+ name: package_info_plus+ sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191"+ url: "https://pub.dev"+ source: hosted+ version: "8.3.0"+ package_info_plus_platform_interface:+ dependency: transitive+ description:+ name: package_info_plus_platform_interface+ sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c"+ url: "https://pub.dev"+ source: hosted+ version: "3.2.0"+ password_strength:+ dependency: transitive+ description:+ name: password_strength+ sha256: "0e51e3d864e37873a1347e658147f88b66e141ee36c58e19828dc5637961e1ce"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ path:+ dependency: "direct main"+ description:+ name: path+ sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"+ url: "https://pub.dev"+ source: hosted+ version: "1.9.1"+ path_provider:+ dependency: "direct main"+ description:+ name: path_provider+ sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.5"+ path_provider_android:+ dependency: transitive+ description:+ name: path_provider_android+ sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"+ url: "https://pub.dev"+ source: hosted+ version: "2.2.15"+ path_provider_foundation:+ dependency: transitive+ description:+ name: path_provider_foundation+ sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ path_provider_linux:+ dependency: transitive+ description:+ name: path_provider_linux+ sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279+ url: "https://pub.dev"+ source: hosted+ version: "2.2.1"+ path_provider_platform_interface:+ dependency: transitive+ description:+ name: path_provider_platform_interface+ sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.2"+ path_provider_windows:+ dependency: transitive+ description:+ name: path_provider_windows+ sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7+ url: "https://pub.dev"+ source: hosted+ version: "2.3.0"+ pinput:+ dependency: transitive+ description:+ name: pinput+ sha256: "8a73be426a91fefec90a7f130763ca39772d547e92f19a827cf4aa02e323d35a"+ url: "https://pub.dev"+ source: hosted+ version: "5.0.1"+ platform:+ dependency: transitive+ description:+ name: platform+ sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.6"+ plugin_platform_interface:+ dependency: transitive+ description:+ name: plugin_platform_interface+ sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.8"+ pointycastle:+ dependency: transitive+ description:+ name: pointycastle+ sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"+ url: "https://pub.dev"+ source: hosted+ version: "3.9.1"+ posix:+ dependency: transitive+ description:+ name: posix+ sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62+ url: "https://pub.dev"+ source: hosted+ version: "6.0.2"+ privacy_screen:+ dependency: transitive+ description:+ name: privacy_screen+ sha256: "2856e3a3ed082061a5cd2a1518f1ce6367c55916fb75e5db72e5983033a1ca54"+ url: "https://pub.dev"+ source: hosted+ version: "0.0.8"+ pub_semver:+ dependency: transitive+ description:+ name: pub_semver+ sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"+ url: "https://pub.dev"+ source: hosted+ version: "2.2.0"+ screen_retriever:+ dependency: transitive+ description:+ name: screen_retriever+ sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ screen_retriever_linux:+ dependency: transitive+ description:+ name: screen_retriever_linux+ sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ screen_retriever_macos:+ dependency: transitive+ description:+ name: screen_retriever_macos+ sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ screen_retriever_platform_interface:+ dependency: transitive+ description:+ name: screen_retriever_platform_interface+ sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ screen_retriever_windows:+ dependency: transitive+ description:+ name: screen_retriever_windows+ sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13"+ url: "https://pub.dev"+ source: hosted+ version: "0.2.0"+ sentry:+ dependency: transitive+ description:+ name: sentry+ sha256: "599701ca0693a74da361bc780b0752e1abc98226cf5095f6b069648116c896bb"+ url: "https://pub.dev"+ source: hosted+ version: "8.14.2"+ sentry_flutter:+ dependency: transitive+ description:+ name: sentry_flutter+ sha256: "5ba2cf40646a77d113b37a07bd69f61bb3ec8a73cbabe5537b05a7c89d2656f8"+ url: "https://pub.dev"+ source: hosted+ version: "8.14.2"+ share_plus:+ dependency: transitive+ description:+ name: share_plus+ sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0+ url: "https://pub.dev"+ source: hosted+ version: "11.0.0"+ share_plus_platform_interface:+ dependency: transitive+ description:+ name: share_plus_platform_interface+ sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef"+ url: "https://pub.dev"+ source: hosted+ version: "6.0.0"+ shared_preferences:+ dependency: "direct main"+ description:+ name: shared_preferences+ sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5"+ url: "https://pub.dev"+ source: hosted+ version: "2.5.3"+ shared_preferences_android:+ dependency: transitive+ description:+ name: shared_preferences_android+ sha256: "9f9f3d372d4304723e6136663bb291c0b93f5e4c8a4a6314347f481a33bda2b1"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.7"+ shared_preferences_foundation:+ dependency: transitive+ description:+ name: shared_preferences_foundation+ sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"+ url: "https://pub.dev"+ source: hosted+ version: "2.5.4"+ shared_preferences_linux:+ dependency: transitive+ description:+ name: shared_preferences_linux+ sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ shared_preferences_platform_interface:+ dependency: transitive+ description:+ name: shared_preferences_platform_interface+ sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ shared_preferences_web:+ dependency: transitive+ description:+ name: shared_preferences_web+ sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019+ url: "https://pub.dev"+ source: hosted+ version: "2.4.3"+ shared_preferences_windows:+ dependency: transitive+ description:+ name: shared_preferences_windows+ sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ shortid:+ dependency: transitive+ description:+ name: shortid+ sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb+ url: "https://pub.dev"+ source: hosted+ version: "0.1.2"+ sky_engine:+ dependency: transitive+ description: flutter+ source: sdk+ version: "0.0.0"+ sodium:+ dependency: transitive+ description:+ name: sodium+ sha256: d9830a388e37c82891888e64cfd4c6764fa3ac716bed80ac6eab89ee42c3cd76+ url: "https://pub.dev"+ source: hosted+ version: "2.3.1+1"+ sodium_libs:+ dependency: transitive+ description:+ name: sodium_libs+ sha256: aa764acd6ccc6113e119c2d99471aeeb4637a9a501639549b297d3a143ff49b3+ url: "https://pub.dev"+ source: hosted+ version: "2.2.1+6"+ source_span:+ dependency: transitive+ description:+ name: source_span+ sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"+ url: "https://pub.dev"+ source: hosted+ version: "1.10.1"+ sprintf:+ dependency: transitive+ description:+ name: sprintf+ sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"+ url: "https://pub.dev"+ source: hosted+ version: "7.0.0"+ sqflite:+ dependency: "direct main"+ description:+ name: sqflite+ sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03+ url: "https://pub.dev"+ source: hosted+ version: "2.4.2"+ sqflite_android:+ dependency: transitive+ description:+ name: sqflite_android+ sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ sqflite_common:+ dependency: transitive+ description:+ name: sqflite_common+ sha256: "84731e8bfd8303a3389903e01fb2141b6e59b5973cacbb0929021df08dddbe8b"+ url: "https://pub.dev"+ source: hosted+ version: "2.5.5"+ sqflite_darwin:+ dependency: transitive+ description:+ name: sqflite_darwin+ sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.2"+ sqflite_platform_interface:+ dependency: transitive+ description:+ name: sqflite_platform_interface+ sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.0"+ stack_trace:+ dependency: transitive+ description:+ name: stack_trace+ sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"+ url: "https://pub.dev"+ source: hosted+ version: "1.12.1"+ step_progress_indicator:+ dependency: transitive+ description:+ name: step_progress_indicator+ sha256: b51bb1fcfc78454359f0658c5a2c21548c3825ebf76e826308e9ca10f383bbb8+ url: "https://pub.dev"+ source: hosted+ version: "1.0.2"+ stream_channel:+ dependency: transitive+ description:+ name: stream_channel+ sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.4"+ string_scanner:+ dependency: transitive+ description:+ name: string_scanner+ sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.1"+ styled_text:+ dependency: "direct main"+ description:+ name: styled_text+ sha256: fd624172cf629751b4f171dd0ecf9acf02a06df3f8a81bb56c0caa4f1df706c3+ url: "https://pub.dev"+ source: hosted+ version: "8.1.0"+ synchronized:+ dependency: transitive+ description:+ name: synchronized+ sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"+ url: "https://pub.dev"+ source: hosted+ version: "3.3.0+3"+ term_glyph:+ dependency: transitive+ description:+ name: term_glyph+ sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"+ url: "https://pub.dev"+ source: hosted+ version: "1.2.2"+ test_api:+ dependency: transitive+ description:+ name: test_api+ sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd+ url: "https://pub.dev"+ source: hosted+ version: "0.7.4"+ tray_manager:+ dependency: "direct main"+ description:+ name: tray_manager+ sha256: ad18c4cd73003097d182884bacb0578ad2865f3ab842a0ad00f6d043ed49eaf0+ url: "https://pub.dev"+ source: hosted+ version: "0.5.0"+ tuple:+ dependency: transitive+ description:+ name: tuple+ sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151+ url: "https://pub.dev"+ source: hosted+ version: "2.0.2"+ typed_data:+ dependency: transitive+ description:+ name: typed_data+ sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ ua_client_hints:+ dependency: transitive+ description:+ name: ua_client_hints+ sha256: "1b8759a46bfeab355252881df27f2604c01bded86aa2b578869fb1b638b23118"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.1"+ universal_platform:+ dependency: transitive+ description:+ name: universal_platform+ sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ url_launcher:+ dependency: transitive+ description:+ name: url_launcher+ sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"+ url: "https://pub.dev"+ source: hosted+ version: "6.3.1"+ url_launcher_android:+ dependency: transitive+ description:+ name: url_launcher_android+ sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"+ url: "https://pub.dev"+ source: hosted+ version: "6.3.14"+ url_launcher_ios:+ dependency: transitive+ description:+ name: url_launcher_ios+ sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"+ url: "https://pub.dev"+ source: hosted+ version: "6.3.3"+ url_launcher_linux:+ dependency: transitive+ description:+ name: url_launcher_linux+ sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"+ url: "https://pub.dev"+ source: hosted+ version: "3.2.1"+ url_launcher_macos:+ dependency: transitive+ description:+ name: url_launcher_macos+ sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"+ url: "https://pub.dev"+ source: hosted+ version: "3.2.2"+ url_launcher_platform_interface:+ dependency: transitive+ description:+ name: url_launcher_platform_interface+ sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"+ url: "https://pub.dev"+ source: hosted+ version: "2.3.2"+ url_launcher_web:+ dependency: transitive+ description:+ name: url_launcher_web+ sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"+ url: "https://pub.dev"+ source: hosted+ version: "2.3.3"+ url_launcher_windows:+ dependency: transitive+ description:+ name: url_launcher_windows+ sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.4"+ uuid:+ dependency: "direct main"+ description:+ name: uuid+ sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff+ url: "https://pub.dev"+ source: hosted+ version: "4.5.1"+ vector_math:+ dependency: transitive+ description:+ name: vector_math+ sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.4"+ vm_service:+ dependency: transitive+ description:+ name: vm_service+ sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02+ url: "https://pub.dev"+ source: hosted+ version: "15.0.0"+ web:+ dependency: transitive+ description:+ name: web+ sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.1"+ web_socket:+ dependency: transitive+ description:+ name: web_socket+ sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"+ url: "https://pub.dev"+ source: hosted+ version: "1.0.1"+ win32:+ dependency: transitive+ description:+ name: win32+ sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e+ url: "https://pub.dev"+ source: hosted+ version: "5.10.1"+ win32_registry:+ dependency: transitive+ description:+ name: win32_registry+ sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.5"+ window_manager:+ dependency: "direct main"+ description:+ name: window_manager+ sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd"+ url: "https://pub.dev"+ source: hosted+ version: "0.5.1"+ xdg_directories:+ dependency: transitive+ description:+ name: xdg_directories+ sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ xmlstream:+ dependency: transitive+ description:+ name: xmlstream+ sha256: cfc14e3f256997897df9481ae630d94c2d85ada5187ebeb868bb1aabc2c977b4+ url: "https://pub.dev"+ source: hosted+ version: "1.1.1"+sdks:+ dart: ">=3.7.2 <4.0.0"+ flutter: ">=3.24.0"diff --git a/mobile/apps/locker/pubspec.yaml b/mobile/apps/locker/pubspec.yamlnew file mode 100644index 0000000000..1e1197b001--- /dev/null+++ b/mobile/apps/locker/pubspec.yaml@@ -0,0 +1,87 @@+name: locker+description: "Ente Locker β Safe space for your important documents"+publish_to: "none"+version: 0.1.0++environment:+ sdk: ^3.6.0++dependencies:+ adaptive_theme: ^3.6.0+ collection: ^1.18.0+ dio: ^5.8.0+1+ email_validator: ^3.0.0+ ente_accounts:+ path: ../../packages/accounts+ ente_base:+ path: ../../packages/base+ ente_configuration:+ path: ../../packages/configuration+ ente_crypto_dart:+ git:+ url: https://github.com/ente-io/ente_crypto_dart.git+ ente_events:+ path: ../../packages/events+ ente_lock_screen:+ path: ../../packages/lock_screen+ ente_logging:+ path: ../../packages/logging+ ente_network:+ path: ../../packages/network+ ente_strings:+ path: ../../packages/strings+ ente_ui:+ path: ../../packages/ui+ ente_utils:+ path: ../../packages/utils+ event_bus: ^2.0.1+ fast_base58: ^0.2.1+ file_picker: ^10.2.0+ flutter:+ sdk: flutter+ flutter_displaymode: ^0.6.0+ flutter_local_authentication:+ git:+ url: https://github.com/eaceto/flutter_local_authentication+ ref: 1ac346a04592a05fd75acccf2e01fa3c7e955d96+ flutter_localizations:+ sdk: flutter+ http: ^1.4.0+ intl: ^0.20.2+ io: ^1.0.5+ listen_sharing_intent: ^1.9.2+ logging: ^1.3.0+ open_file: ^3.5.10+ package_info_plus: ^8.3.0+ path: ^1.9.0+ path_provider: ^2.1.5+ shared_preferences: ^2.5.3+ sqflite: ^2.4.1+ styled_text: ^8.1.0+ tray_manager: ^0.5.0+ uuid: ^4.5.1+ window_manager: ^0.5.0++dev_dependencies:+ flutter_lints: ^4.0.0+ flutter_test:+ sdk: flutter++flutter:+ uses-material-design: true+ generate: true++ assets:+ - assets/++ fonts:+ - family: Inter+ fonts:+ - asset: assets/fonts/Inter-Regular.ttf+ - asset: assets/fonts/Inter-Medium.ttf+ - asset: assets/fonts/Inter-Light.ttf+ - asset: assets/fonts/Inter-SemiBold.ttf+ - asset: assets/fonts/Inter-Bold.ttf+ - family: Montserrat+ fonts:+ - asset: assets/fonts/Montserrat-Bold.ttfdiff --git a/mobile/apps/locker/web/favicon.png b/mobile/apps/locker/web/favicon.pngnew file mode 100644index 0000000000..8aaa46ac1aBinary files /dev/null and b/mobile/apps/locker/web/favicon.png differdiff --git a/mobile/apps/locker/web/icons/Icon-192.png b/mobile/apps/locker/web/icons/Icon-192.pngnew file mode 100644index 0000000000..b749bfef07Binary files /dev/null and b/mobile/apps/locker/web/icons/Icon-192.png differdiff --git a/mobile/apps/locker/web/icons/Icon-512.png b/mobile/apps/locker/web/icons/Icon-512.pngnew file mode 100644index 0000000000..88cfd48dffBinary files /dev/null and b/mobile/apps/locker/web/icons/Icon-512.png differdiff --git a/mobile/apps/locker/web/icons/Icon-maskable-192.png b/mobile/apps/locker/web/icons/Icon-maskable-192.pngnew file mode 100644index 0000000000..eb9b4d76e5Binary files /dev/null and b/mobile/apps/locker/web/icons/Icon-maskable-192.png differdiff --git a/mobile/apps/locker/web/icons/Icon-maskable-512.png b/mobile/apps/locker/web/icons/Icon-maskable-512.pngnew file mode 100644index 0000000000..d69c56691fBinary files /dev/null and b/mobile/apps/locker/web/icons/Icon-maskable-512.png differdiff --git a/mobile/apps/locker/web/index.html b/mobile/apps/locker/web/index.htmlnew file mode 100644index 0000000000..ec3b5634e6--- /dev/null+++ b/mobile/apps/locker/web/index.html@@ -0,0 +1,38 @@+<!DOCTYPE html>+<html>+<head>+ <!--+ If you are serving your web app in a path other than the root, change the+ href value below to reflect the base path you are serving from.++ The path provided below has to start and end with a slash "/" in order for+ it to work correctly.++ For more details:+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base++ This is a placeholder for base href that will be replaced by the value of+ the `--base-href` argument provided to `flutter build`.+ -->+ <base href="$FLUTTER_BASE_HREF">++ <meta charset="UTF-8">+ <meta content="IE=Edge" http-equiv="X-UA-Compatible">+ <meta name="description" content="A new Flutter project.">++ <!-- iOS meta tags & icons -->+ <meta name="apple-mobile-web-app-capable" content="yes">+ <meta name="apple-mobile-web-app-status-bar-style" content="black">+ <meta name="apple-mobile-web-app-title" content="Ente Locker">+ <link rel="apple-touch-icon" href="icons/Icon-192.png">++ <!-- Favicon -->+ <link rel="icon" type="image/png" href="favicon.png"/>++ <title>Ente Locker</title>+ <link rel="manifest" href="manifest.json">+</head>+<body>+ <script src="flutter_bootstrap.js" async></script>+</body>+</html>diff --git a/mobile/apps/locker/web/manifest.json b/mobile/apps/locker/web/manifest.jsonnew file mode 100644index 0000000000..3edea1b115--- /dev/null+++ b/mobile/apps/locker/web/manifest.json@@ -0,0 +1,35 @@+{+ "name": "Ente Locker",+ "short_name": "Ente Locker",+ "start_url": ".",+ "display": "standalone",+ "background_color": "#0175C2",+ "theme_color": "#0175C2",+ "description": "A new Flutter project.",+ "orientation": "portrait-primary",+ "prefer_related_applications": false,+ "icons": [+ {+ "src": "icons/Icon-192.png",+ "sizes": "192x192",+ "type": "image/png"+ },+ {+ "src": "icons/Icon-512.png",+ "sizes": "512x512",+ "type": "image/png"+ },+ {+ "src": "icons/Icon-maskable-192.png",+ "sizes": "192x192",+ "type": "image/png",+ "purpose": "maskable"+ },+ {+ "src": "icons/Icon-maskable-512.png",+ "sizes": "512x512",+ "type": "image/png",+ "purpose": "maskable"+ }+ ]+}diff --git a/mobile/apps/locker/windows/.gitignore b/mobile/apps/locker/windows/.gitignorenew file mode 100644index 0000000000..d492d0d98c--- /dev/null+++ b/mobile/apps/locker/windows/.gitignore@@ -0,0 +1,17 @@+flutter/ephemeral/++# Visual Studio user-specific files.+*.suo+*.user+*.userosscache+*.sln.docstates++# Visual Studio build-related files.+x64/+x86/++# Visual Studio cache files+# files ending in .cache can be ignored+*.[Cc]ache+# but keep track of directories ending in .cache+!*.[Cc]ache/diff --git a/mobile/apps/locker/windows/CMakeLists.txt b/mobile/apps/locker/windows/CMakeLists.txtnew file mode 100644index 0000000000..5c2121d6e0--- /dev/null+++ b/mobile/apps/locker/windows/CMakeLists.txt@@ -0,0 +1,108 @@+# Project-level configuration.+cmake_minimum_required(VERSION 3.14)+project(locker LANGUAGES CXX)++# The name of the executable created for the application. Change this to change+# the on-disk name of your application.+set(BINARY_NAME "locker")++# Explicitly opt in to modern CMake behaviors to avoid warnings with recent+# versions of CMake.+cmake_policy(VERSION 3.14...3.25)++# Define build configuration option.+get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)+if(IS_MULTICONFIG)+ set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"+ CACHE STRING "" FORCE)+else()+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)+ set(CMAKE_BUILD_TYPE "Debug" CACHE+ STRING "Flutter build mode" FORCE)+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS+ "Debug" "Profile" "Release")+ endif()+endif()+# Define settings for the Profile build mode.+set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")+set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")+set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")+set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")++# Use Unicode for all projects.+add_definitions(-DUNICODE -D_UNICODE)++# Compilation settings that should be applied to most targets.+#+# Be cautious about adding new options here, as plugins use this function by+# default. In most cases, you should add new options to specific targets instead+# of modifying this function.+function(APPLY_STANDARD_SETTINGS TARGET)+ target_compile_features(${TARGET} PUBLIC cxx_std_17)+ target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")+ target_compile_options(${TARGET} PRIVATE /EHsc)+ target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")+ target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")+endfunction()++# Flutter library and tool build rules.+set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")+add_subdirectory(${FLUTTER_MANAGED_DIR})++# Application build; see runner/CMakeLists.txt.+add_subdirectory("runner")+++# Generated plugin build rules, which manage building the plugins and adding+# them to the application.+include(flutter/generated_plugins.cmake)+++# === Installation ===+# Support files are copied into place next to the executable, so that it can+# run in place. This is done instead of making a separate bundle (as on Linux)+# so that building and running from within Visual Studio will work.+set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")+# Make the "install" step default, as it's required to run.+set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)+ set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)+endif()++set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")+set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")++install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"+ COMPONENT Runtime)++install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"+ COMPONENT Runtime)++install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)++if(PLUGIN_BUNDLED_LIBRARIES)+ install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)+endif()++# Copy the native assets provided by the build.dart from all packages.+set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")+install(DIRECTORY "${NATIVE_ASSETS_DIR}"+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"+ COMPONENT Runtime)++# Fully re-copy the assets directory on each build to avoid having stale files+# from a previous install.+set(FLUTTER_ASSET_DIR_NAME "flutter_assets")+install(CODE "+ file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")+ " COMPONENT Runtime)+install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"+ DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)++# Install the AOT library on non-Debug builds only.+install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"+ CONFIGURATIONS Profile;Release+ COMPONENT Runtime)diff --git a/mobile/apps/locker/windows/flutter/CMakeLists.txt b/mobile/apps/locker/windows/flutter/CMakeLists.txtnew file mode 100644index 0000000000..903f4899d6--- /dev/null+++ b/mobile/apps/locker/windows/flutter/CMakeLists.txt@@ -0,0 +1,109 @@+# This file controls Flutter-level build steps. It should not be edited.+cmake_minimum_required(VERSION 3.14)++set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")++# Configuration provided via flutter tool.+include(${EPHEMERAL_DIR}/generated_config.cmake)++# TODO: Move the rest of this into files in ephemeral. See+# https://github.com/flutter/flutter/issues/57146.+set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")++# Set fallback configurations for older versions of the flutter tool.+if (NOT DEFINED FLUTTER_TARGET_PLATFORM)+ set(FLUTTER_TARGET_PLATFORM "windows-x64")+endif()++# === Flutter Library ===+set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")++# Published to parent scope for install step.+set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)+set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)+set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)+set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)++list(APPEND FLUTTER_LIBRARY_HEADERS+ "flutter_export.h"+ "flutter_windows.h"+ "flutter_messenger.h"+ "flutter_plugin_registrar.h"+ "flutter_texture_registrar.h"+)+list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")+add_library(flutter INTERFACE)+target_include_directories(flutter INTERFACE+ "${EPHEMERAL_DIR}"+)+target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")+add_dependencies(flutter flutter_assemble)++# === Wrapper ===+list(APPEND CPP_WRAPPER_SOURCES_CORE+ "core_implementations.cc"+ "standard_codec.cc"+)+list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")+list(APPEND CPP_WRAPPER_SOURCES_PLUGIN+ "plugin_registrar.cc"+)+list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")+list(APPEND CPP_WRAPPER_SOURCES_APP+ "flutter_engine.cc"+ "flutter_view_controller.cc"+)+list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")++# Wrapper sources needed for a plugin.+add_library(flutter_wrapper_plugin STATIC+ ${CPP_WRAPPER_SOURCES_CORE}+ ${CPP_WRAPPER_SOURCES_PLUGIN}+)+apply_standard_settings(flutter_wrapper_plugin)+set_target_properties(flutter_wrapper_plugin PROPERTIES+ POSITION_INDEPENDENT_CODE ON)+set_target_properties(flutter_wrapper_plugin PROPERTIES+ CXX_VISIBILITY_PRESET hidden)+target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)+target_include_directories(flutter_wrapper_plugin PUBLIC+ "${WRAPPER_ROOT}/include"+)+add_dependencies(flutter_wrapper_plugin flutter_assemble)++# Wrapper sources needed for the runner.+add_library(flutter_wrapper_app STATIC+ ${CPP_WRAPPER_SOURCES_CORE}+ ${CPP_WRAPPER_SOURCES_APP}+)+apply_standard_settings(flutter_wrapper_app)+target_link_libraries(flutter_wrapper_app PUBLIC flutter)+target_include_directories(flutter_wrapper_app PUBLIC+ "${WRAPPER_ROOT}/include"+)+add_dependencies(flutter_wrapper_app flutter_assemble)++# === Flutter tool backend ===+# _phony_ is a non-existent file to force this command to run every time,+# since currently there's no way to get a full input/output list from the+# flutter tool.+set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")+set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)+add_custom_command(+ OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}+ ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}+ ${CPP_WRAPPER_SOURCES_APP}+ ${PHONY_OUTPUT}+ COMMAND ${CMAKE_COMMAND} -E env+ ${FLUTTER_TOOL_ENVIRONMENT}+ "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"+ ${FLUTTER_TARGET_PLATFORM} $<CONFIG>+ VERBATIM+)+add_custom_target(flutter_assemble DEPENDS+ "${FLUTTER_LIBRARY}"+ ${FLUTTER_LIBRARY_HEADERS}+ ${CPP_WRAPPER_SOURCES_CORE}+ ${CPP_WRAPPER_SOURCES_PLUGIN}+ ${CPP_WRAPPER_SOURCES_APP}+)diff --git a/mobile/apps/locker/windows/flutter/generated_plugin_registrant.cc b/mobile/apps/locker/windows/flutter/generated_plugin_registrant.ccnew file mode 100644index 0000000000..725202fc0a--- /dev/null+++ b/mobile/apps/locker/windows/flutter/generated_plugin_registrant.cc@@ -0,0 +1,50 @@+//+// Generated file. Do not edit.+//++// clang-format off++#include "generated_plugin_registrant.h"++#include <app_links/app_links_plugin_c_api.h>+#include <file_saver/file_saver_plugin.h>+#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>+#include <flutter_local_authentication/flutter_local_authentication_plugin_c_api.h>+#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>+#include <local_auth_windows/local_auth_plugin.h>+#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>+#include <sentry_flutter/sentry_flutter_plugin.h>+#include <share_plus/share_plus_windows_plugin_c_api.h>+#include <sodium_libs/sodium_libs_plugin_c_api.h>+#include <tray_manager/tray_manager_plugin.h>+#include <url_launcher_windows/url_launcher_windows.h>+#include <window_manager/window_manager_plugin.h>++void RegisterPlugins(flutter::PluginRegistry* registry) {+ AppLinksPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("AppLinksPluginCApi"));+ FileSaverPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("FileSaverPlugin"));+ FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));+ FlutterLocalAuthenticationPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("FlutterLocalAuthenticationPluginCApi"));+ FlutterSecureStorageWindowsPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));+ LocalAuthPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("LocalAuthPlugin"));+ ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));+ SentryFlutterPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("SentryFlutterPlugin"));+ SharePlusWindowsPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));+ SodiumLibsPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("SodiumLibsPluginCApi"));+ TrayManagerPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("TrayManagerPlugin"));+ UrlLauncherWindowsRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("UrlLauncherWindows"));+ WindowManagerPluginRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("WindowManagerPlugin"));+}diff --git a/mobile/apps/locker/windows/flutter/generated_plugin_registrant.h b/mobile/apps/locker/windows/flutter/generated_plugin_registrant.hnew file mode 100644index 0000000000..dc139d85a9--- /dev/null+++ b/mobile/apps/locker/windows/flutter/generated_plugin_registrant.h@@ -0,0 +1,15 @@+//+// Generated file. Do not edit.+//++// clang-format off++#ifndef GENERATED_PLUGIN_REGISTRANT_+#define GENERATED_PLUGIN_REGISTRANT_++#include <flutter/plugin_registry.h>++// Registers Flutter plugins.+void RegisterPlugins(flutter::PluginRegistry* registry);++#endif // GENERATED_PLUGIN_REGISTRANT_diff --git a/mobile/apps/locker/windows/flutter/generated_plugins.cmake b/mobile/apps/locker/windows/flutter/generated_plugins.cmakenew file mode 100644index 0000000000..ddd64f7ebe--- /dev/null+++ b/mobile/apps/locker/windows/flutter/generated_plugins.cmake@@ -0,0 +1,37 @@+#+# Generated file, do not edit.+#++list(APPEND FLUTTER_PLUGIN_LIST+ app_links+ file_saver+ flutter_inappwebview_windows+ flutter_local_authentication+ flutter_secure_storage_windows+ local_auth_windows+ screen_retriever_windows+ sentry_flutter+ share_plus+ sodium_libs+ tray_manager+ url_launcher_windows+ window_manager+)++list(APPEND FLUTTER_FFI_PLUGIN_LIST+ jni+)++set(PLUGIN_BUNDLED_LIBRARIES)++foreach(plugin ${FLUTTER_PLUGIN_LIST})+ add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})+ target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)+ list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)+ list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})+endforeach(plugin)++foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})+ add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})+ list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})+endforeach(ffi_plugin)diff --git a/mobile/apps/locker/windows/runner/CMakeLists.txt b/mobile/apps/locker/windows/runner/CMakeLists.txtnew file mode 100644index 0000000000..394917c053--- /dev/null+++ b/mobile/apps/locker/windows/runner/CMakeLists.txt@@ -0,0 +1,40 @@+cmake_minimum_required(VERSION 3.14)+project(runner LANGUAGES CXX)++# Define the application target. To change its name, change BINARY_NAME in the+# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer+# work.+#+# Any new source files that you add to the application should be added here.+add_executable(${BINARY_NAME} WIN32+ "flutter_window.cpp"+ "main.cpp"+ "utils.cpp"+ "win32_window.cpp"+ "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"+ "Runner.rc"+ "runner.exe.manifest"+)++# Apply the standard set of build settings. This can be removed for applications+# that need different build settings.+apply_standard_settings(${BINARY_NAME})++# Add preprocessor definitions for the build version.+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")+target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")++# Disable Windows macros that collide with C++ standard library functions.+target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")++# Add dependency libraries and include directories. Add any application-specific+# dependencies here.+target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)+target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")+target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")++# Run the Flutter tool portions of the build. This must not be removed.+add_dependencies(${BINARY_NAME} flutter_assemble)diff --git a/mobile/apps/locker/windows/runner/Runner.rc b/mobile/apps/locker/windows/runner/Runner.rcnew file mode 100644index 0000000000..793fab1e4e--- /dev/null+++ b/mobile/apps/locker/windows/runner/Runner.rc@@ -0,0 +1,121 @@+// Microsoft Visual C++ generated resource script.+//+#pragma code_page(65001)+#include "resource.h"++#define APSTUDIO_READONLY_SYMBOLS+/////////////////////////////////////////////////////////////////////////////+//+// Generated from the TEXTINCLUDE 2 resource.+//+#include "winres.h"++/////////////////////////////////////////////////////////////////////////////+#undef APSTUDIO_READONLY_SYMBOLS++/////////////////////////////////////////////////////////////////////////////+// English (United States) resources++#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US++#ifdef APSTUDIO_INVOKED+/////////////////////////////////////////////////////////////////////////////+//+// TEXTINCLUDE+//++1 TEXTINCLUDE+BEGIN+ "resource.h\0"+END++2 TEXTINCLUDE+BEGIN+ "#include ""winres.h""\r\n"+ "\0"+END++3 TEXTINCLUDE+BEGIN+ "\r\n"+ "\0"+END++#endif // APSTUDIO_INVOKED+++/////////////////////////////////////////////////////////////////////////////+//+// Icon+//++// Icon with lowest ID value placed first to ensure application icon+// remains consistent on all systems.+IDI_APP_ICON ICON "resources\\app_icon.ico"+++/////////////////////////////////////////////////////////////////////////////+//+// Version+//++#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)+#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD+#else+#define VERSION_AS_NUMBER 1,0,0,0+#endif++#if defined(FLUTTER_VERSION)+#define VERSION_AS_STRING FLUTTER_VERSION+#else+#define VERSION_AS_STRING "1.0.0"+#endif++VS_VERSION_INFO VERSIONINFO+ FILEVERSION VERSION_AS_NUMBER+ PRODUCTVERSION VERSION_AS_NUMBER+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK+#ifdef _DEBUG+ FILEFLAGS VS_FF_DEBUG+#else+ FILEFLAGS 0x0L+#endif+ FILEOS VOS__WINDOWS32+ FILETYPE VFT_APP+ FILESUBTYPE 0x0L+BEGIN+ BLOCK "StringFileInfo"+ BEGIN+ BLOCK "040904e4"+ BEGIN+ VALUE "CompanyName", "io.ente" "\0"+ VALUE "FileDescription", "locker" "\0"+ VALUE "FileVersion", VERSION_AS_STRING "\0"+ VALUE "InternalName", "locker" "\0"+ VALUE "LegalCopyright", "Copyright (C) 2025 Ente Technologies, Inc. All rights reserved." "\0"+ VALUE "OriginalFilename", "locker.exe" "\0"+ VALUE "ProductName", "locker" "\0"+ VALUE "ProductVersion", VERSION_AS_STRING "\0"+ END+ END+ BLOCK "VarFileInfo"+ BEGIN+ VALUE "Translation", 0x409, 1252+ END+END++#endif // English (United States) resources+/////////////////////////////////////////////////////////////////////////////++++#ifndef APSTUDIO_INVOKED+/////////////////////////////////////////////////////////////////////////////+//+// Generated from the TEXTINCLUDE 3 resource.+//+++/////////////////////////////////////////////////////////////////////////////+#endif // not APSTUDIO_INVOKEDdiff --git a/mobile/apps/locker/windows/runner/flutter_window.cpp b/mobile/apps/locker/windows/runner/flutter_window.cppnew file mode 100644index 0000000000..955ee3038f--- /dev/null+++ b/mobile/apps/locker/windows/runner/flutter_window.cpp@@ -0,0 +1,71 @@+#include "flutter_window.h"++#include <optional>++#include "flutter/generated_plugin_registrant.h"++FlutterWindow::FlutterWindow(const flutter::DartProject& project)+ : project_(project) {}++FlutterWindow::~FlutterWindow() {}++bool FlutterWindow::OnCreate() {+ if (!Win32Window::OnCreate()) {+ return false;+ }++ RECT frame = GetClientArea();++ // The size here must match the window dimensions to avoid unnecessary surface+ // creation / destruction in the startup path.+ flutter_controller_ = std::make_unique<flutter::FlutterViewController>(+ frame.right - frame.left, frame.bottom - frame.top, project_);+ // Ensure that basic setup of the controller was successful.+ if (!flutter_controller_->engine() || !flutter_controller_->view()) {+ return false;+ }+ RegisterPlugins(flutter_controller_->engine());+ SetChildContent(flutter_controller_->view()->GetNativeWindow());++ flutter_controller_->engine()->SetNextFrameCallback([&]() {+ this->Show();+ });++ // Flutter can complete the first frame before the "show window" callback is+ // registered. The following call ensures a frame is pending to ensure the+ // window is shown. It is a no-op if the first frame hasn't completed yet.+ flutter_controller_->ForceRedraw();++ return true;+}++void FlutterWindow::OnDestroy() {+ if (flutter_controller_) {+ flutter_controller_ = nullptr;+ }++ Win32Window::OnDestroy();+}++LRESULT+FlutterWindow::MessageHandler(HWND hwnd, UINT const message,+ WPARAM const wparam,+ LPARAM const lparam) noexcept {+ // Give Flutter, including plugins, an opportunity to handle window messages.+ if (flutter_controller_) {+ std::optional<LRESULT> result =+ flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,+ lparam);+ if (result) {+ return *result;+ }+ }++ switch (message) {+ case WM_FONTCHANGE:+ flutter_controller_->engine()->ReloadSystemFonts();+ break;+ }++ return Win32Window::MessageHandler(hwnd, message, wparam, lparam);+}diff --git a/mobile/apps/locker/windows/runner/flutter_window.h b/mobile/apps/locker/windows/runner/flutter_window.hnew file mode 100644index 0000000000..6da0652f05--- /dev/null+++ b/mobile/apps/locker/windows/runner/flutter_window.h@@ -0,0 +1,33 @@+#ifndef RUNNER_FLUTTER_WINDOW_H_+#define RUNNER_FLUTTER_WINDOW_H_++#include <flutter/dart_project.h>+#include <flutter/flutter_view_controller.h>++#include <memory>++#include "win32_window.h"++// A window that does nothing but host a Flutter view.+class FlutterWindow : public Win32Window {+ public:+ // Creates a new FlutterWindow hosting a Flutter view running |project|.+ explicit FlutterWindow(const flutter::DartProject& project);+ virtual ~FlutterWindow();++ protected:+ // Win32Window:+ bool OnCreate() override;+ void OnDestroy() override;+ LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,+ LPARAM const lparam) noexcept override;++ private:+ // The project to run.+ flutter::DartProject project_;++ // The Flutter instance hosted by this window.+ std::unique_ptr<flutter::FlutterViewController> flutter_controller_;+};++#endif // RUNNER_FLUTTER_WINDOW_H_diff --git a/mobile/apps/locker/windows/runner/main.cpp b/mobile/apps/locker/windows/runner/main.cppnew file mode 100644index 0000000000..aa0a106057--- /dev/null+++ b/mobile/apps/locker/windows/runner/main.cpp@@ -0,0 +1,43 @@+#include <flutter/dart_project.h>+#include <flutter/flutter_view_controller.h>+#include <windows.h>++#include "flutter_window.h"+#include "utils.h"++int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,+ _In_ wchar_t *command_line, _In_ int show_command) {+ // Attach to console when present (e.g., 'flutter run') or create a+ // new console when running with a debugger.+ if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {+ CreateAndAttachConsole();+ }++ // Initialize COM, so that it is available for use in the library and/or+ // plugins.+ ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);++ flutter::DartProject project(L"data");++ std::vector<std::string> command_line_arguments =+ GetCommandLineArguments();++ project.set_dart_entrypoint_arguments(std::move(command_line_arguments));++ FlutterWindow window(project);+ Win32Window::Point origin(10, 10);+ Win32Window::Size size(1280, 720);+ if (!window.Create(L"locker", origin, size)) {+ return EXIT_FAILURE;+ }+ window.SetQuitOnClose(true);++ ::MSG msg;+ while (::GetMessage(&msg, nullptr, 0, 0)) {+ ::TranslateMessage(&msg);+ ::DispatchMessage(&msg);+ }++ ::CoUninitialize();+ return EXIT_SUCCESS;+}diff --git a/mobile/apps/locker/windows/runner/resource.h b/mobile/apps/locker/windows/runner/resource.hnew file mode 100644index 0000000000..66a65d1e4a--- /dev/null+++ b/mobile/apps/locker/windows/runner/resource.h@@ -0,0 +1,16 @@+//{{NO_DEPENDENCIES}}+// Microsoft Visual C++ generated include file.+// Used by Runner.rc+//+#define IDI_APP_ICON 101++// Next default values for new objects+//+#ifdef APSTUDIO_INVOKED+#ifndef APSTUDIO_READONLY_SYMBOLS+#define _APS_NEXT_RESOURCE_VALUE 102+#define _APS_NEXT_COMMAND_VALUE 40001+#define _APS_NEXT_CONTROL_VALUE 1001+#define _APS_NEXT_SYMED_VALUE 101+#endif+#endifdiff --git a/mobile/apps/locker/windows/runner/resources/app_icon.ico b/mobile/apps/locker/windows/runner/resources/app_icon.iconew file mode 100644index 0000000000..c04e20caf6Binary files /dev/null and b/mobile/apps/locker/windows/runner/resources/app_icon.ico differdiff --git a/mobile/apps/locker/windows/runner/runner.exe.manifest b/mobile/apps/locker/windows/runner/runner.exe.manifestnew file mode 100644index 0000000000..153653e8d6--- /dev/null+++ b/mobile/apps/locker/windows/runner/runner.exe.manifest@@ -0,0 +1,14 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">+ <application xmlns="urn:schemas-microsoft-com:asm.v3">+ <windowsSettings>+ <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>+ </windowsSettings>+ </application>+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">+ <application>+ <!-- Windows 10 and Windows 11 -->+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>+ </application>+ </compatibility>+</assembly>diff --git a/mobile/apps/locker/windows/runner/utils.cpp b/mobile/apps/locker/windows/runner/utils.cppnew file mode 100644index 0000000000..3a0b46511a--- /dev/null+++ b/mobile/apps/locker/windows/runner/utils.cpp@@ -0,0 +1,65 @@+#include "utils.h"++#include <flutter_windows.h>+#include <io.h>+#include <stdio.h>+#include <windows.h>++#include <iostream>++void CreateAndAttachConsole() {+ if (::AllocConsole()) {+ FILE *unused;+ if (freopen_s(&unused, "CONOUT$", "w", stdout)) {+ _dup2(_fileno(stdout), 1);+ }+ if (freopen_s(&unused, "CONOUT$", "w", stderr)) {+ _dup2(_fileno(stdout), 2);+ }+ std::ios::sync_with_stdio();+ FlutterDesktopResyncOutputStreams();+ }+}++std::vector<std::string> GetCommandLineArguments() {+ // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.+ int argc;+ wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);+ if (argv == nullptr) {+ return std::vector<std::string>();+ }++ std::vector<std::string> command_line_arguments;++ // Skip the first argument as it's the binary name.+ for (int i = 1; i < argc; i++) {+ command_line_arguments.push_back(Utf8FromUtf16(argv[i]));+ }++ ::LocalFree(argv);++ return command_line_arguments;+}++std::string Utf8FromUtf16(const wchar_t* utf16_string) {+ if (utf16_string == nullptr) {+ return std::string();+ }+ unsigned int target_length = ::WideCharToMultiByte(+ CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,+ -1, nullptr, 0, nullptr, nullptr)+ -1; // remove the trailing null character+ int input_length = (int)wcslen(utf16_string);+ std::string utf8_string;+ if (target_length == 0 || target_length > utf8_string.max_size()) {+ return utf8_string;+ }+ utf8_string.resize(target_length);+ int converted_length = ::WideCharToMultiByte(+ CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,+ input_length, utf8_string.data(), target_length, nullptr, nullptr);+ if (converted_length == 0) {+ return std::string();+ }+ return utf8_string;+}diff --git a/mobile/apps/locker/windows/runner/utils.h b/mobile/apps/locker/windows/runner/utils.hnew file mode 100644index 0000000000..3879d54755--- /dev/null+++ b/mobile/apps/locker/windows/runner/utils.h@@ -0,0 +1,19 @@+#ifndef RUNNER_UTILS_H_+#define RUNNER_UTILS_H_++#include <string>+#include <vector>++// Creates a console for the process, and redirects stdout and stderr to+// it for both the runner and the Flutter library.+void CreateAndAttachConsole();++// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string+// encoded in UTF-8. Returns an empty std::string on failure.+std::string Utf8FromUtf16(const wchar_t* utf16_string);++// Gets the command line arguments passed in as a std::vector<std::string>,+// encoded in UTF-8. Returns an empty std::vector<std::string> on failure.+std::vector<std::string> GetCommandLineArguments();++#endif // RUNNER_UTILS_H_diff --git a/mobile/apps/locker/windows/runner/win32_window.cpp b/mobile/apps/locker/windows/runner/win32_window.cppnew file mode 100644index 0000000000..60608d0fe5--- /dev/null+++ b/mobile/apps/locker/windows/runner/win32_window.cpp@@ -0,0 +1,288 @@+#include "win32_window.h"++#include <dwmapi.h>+#include <flutter_windows.h>++#include "resource.h"++namespace {++/// Window attribute that enables dark mode window decorations.+///+/// Redefined in case the developer's machine has a Windows SDK older than+/// version 10.0.22000.0.+/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute+#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE+#define DWMWA_USE_IMMERSIVE_DARK_MODE 20+#endif++constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";++/// Registry key for app theme preference.+///+/// A value of 0 indicates apps should use dark mode. A non-zero or missing+/// value indicates apps should use light mode.+constexpr const wchar_t kGetPreferredBrightnessRegKey[] =+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";+constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme";++// The number of Win32Window objects that currently exist.+static int g_active_window_count = 0;++using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);++// Scale helper to convert logical scaler values to physical using passed in+// scale factor+int Scale(int source, double scale_factor) {+ return static_cast<int>(source * scale_factor);+}++// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.+// This API is only needed for PerMonitor V1 awareness mode.+void EnableFullDpiSupportIfAvailable(HWND hwnd) {+ HMODULE user32_module = LoadLibraryA("User32.dll");+ if (!user32_module) {+ return;+ }+ auto enable_non_client_dpi_scaling =+ reinterpret_cast<EnableNonClientDpiScaling*>(+ GetProcAddress(user32_module, "EnableNonClientDpiScaling"));+ if (enable_non_client_dpi_scaling != nullptr) {+ enable_non_client_dpi_scaling(hwnd);+ }+ FreeLibrary(user32_module);+}++} // namespace++// Manages the Win32Window's window class registration.+class WindowClassRegistrar {+ public:+ ~WindowClassRegistrar() = default;++ // Returns the singleton registrar instance.+ static WindowClassRegistrar* GetInstance() {+ if (!instance_) {+ instance_ = new WindowClassRegistrar();+ }+ return instance_;+ }++ // Returns the name of the window class, registering the class if it hasn't+ // previously been registered.+ const wchar_t* GetWindowClass();++ // Unregisters the window class. Should only be called if there are no+ // instances of the window.+ void UnregisterWindowClass();++ private:+ WindowClassRegistrar() = default;++ static WindowClassRegistrar* instance_;++ bool class_registered_ = false;+};++WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;++const wchar_t* WindowClassRegistrar::GetWindowClass() {+ if (!class_registered_) {+ WNDCLASS window_class{};+ window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);+ window_class.lpszClassName = kWindowClassName;+ window_class.style = CS_HREDRAW | CS_VREDRAW;+ window_class.cbClsExtra = 0;+ window_class.cbWndExtra = 0;+ window_class.hInstance = GetModuleHandle(nullptr);+ window_class.hIcon =+ LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));+ window_class.hbrBackground = 0;+ window_class.lpszMenuName = nullptr;+ window_class.lpfnWndProc = Win32Window::WndProc;+ RegisterClass(&window_class);+ class_registered_ = true;+ }+ return kWindowClassName;+}++void WindowClassRegistrar::UnregisterWindowClass() {+ UnregisterClass(kWindowClassName, nullptr);+ class_registered_ = false;+}++Win32Window::Win32Window() {+ ++g_active_window_count;+}++Win32Window::~Win32Window() {+ --g_active_window_count;+ Destroy();+}++bool Win32Window::Create(const std::wstring& title,+ const Point& origin,+ const Size& size) {+ Destroy();++ const wchar_t* window_class =+ WindowClassRegistrar::GetInstance()->GetWindowClass();++ const POINT target_point = {static_cast<LONG>(origin.x),+ static_cast<LONG>(origin.y)};+ HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);+ UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);+ double scale_factor = dpi / 96.0;++ HWND window = CreateWindow(+ window_class, title.c_str(), WS_OVERLAPPEDWINDOW,+ Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),+ Scale(size.width, scale_factor), Scale(size.height, scale_factor),+ nullptr, nullptr, GetModuleHandle(nullptr), this);++ if (!window) {+ return false;+ }++ UpdateTheme(window);++ return OnCreate();+}++bool Win32Window::Show() {+ return ShowWindow(window_handle_, SW_SHOWNORMAL);+}++// static+LRESULT CALLBACK Win32Window::WndProc(HWND const window,+ UINT const message,+ WPARAM const wparam,+ LPARAM const lparam) noexcept {+ if (message == WM_NCCREATE) {+ auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam);+ SetWindowLongPtr(window, GWLP_USERDATA,+ reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams));++ auto that = static_cast<Win32Window*>(window_struct->lpCreateParams);+ EnableFullDpiSupportIfAvailable(window);+ that->window_handle_ = window;+ } else if (Win32Window* that = GetThisFromHandle(window)) {+ return that->MessageHandler(window, message, wparam, lparam);+ }++ return DefWindowProc(window, message, wparam, lparam);+}++LRESULT+Win32Window::MessageHandler(HWND hwnd,+ UINT const message,+ WPARAM const wparam,+ LPARAM const lparam) noexcept {+ switch (message) {+ case WM_DESTROY:+ window_handle_ = nullptr;+ Destroy();+ if (quit_on_close_) {+ PostQuitMessage(0);+ }+ return 0;++ case WM_DPICHANGED: {+ auto newRectSize = reinterpret_cast<RECT*>(lparam);+ LONG newWidth = newRectSize->right - newRectSize->left;+ LONG newHeight = newRectSize->bottom - newRectSize->top;++ SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,+ newHeight, SWP_NOZORDER | SWP_NOACTIVATE);++ return 0;+ }+ case WM_SIZE: {+ RECT rect = GetClientArea();+ if (child_content_ != nullptr) {+ // Size and position the child window.+ MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,+ rect.bottom - rect.top, TRUE);+ }+ return 0;+ }++ case WM_ACTIVATE:+ if (child_content_ != nullptr) {+ SetFocus(child_content_);+ }+ return 0;++ case WM_DWMCOLORIZATIONCOLORCHANGED:+ UpdateTheme(hwnd);+ return 0;+ }++ return DefWindowProc(window_handle_, message, wparam, lparam);+}++void Win32Window::Destroy() {+ OnDestroy();++ if (window_handle_) {+ DestroyWindow(window_handle_);+ window_handle_ = nullptr;+ }+ if (g_active_window_count == 0) {+ WindowClassRegistrar::GetInstance()->UnregisterWindowClass();+ }+}++Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {+ return reinterpret_cast<Win32Window*>(+ GetWindowLongPtr(window, GWLP_USERDATA));+}++void Win32Window::SetChildContent(HWND content) {+ child_content_ = content;+ SetParent(content, window_handle_);+ RECT frame = GetClientArea();++ MoveWindow(content, frame.left, frame.top, frame.right - frame.left,+ frame.bottom - frame.top, true);++ SetFocus(child_content_);+}++RECT Win32Window::GetClientArea() {+ RECT frame;+ GetClientRect(window_handle_, &frame);+ return frame;+}++HWND Win32Window::GetHandle() {+ return window_handle_;+}++void Win32Window::SetQuitOnClose(bool quit_on_close) {+ quit_on_close_ = quit_on_close;+}++bool Win32Window::OnCreate() {+ // No-op; provided for subclasses.+ return true;+}++void Win32Window::OnDestroy() {+ // No-op; provided for subclasses.+}++void Win32Window::UpdateTheme(HWND const window) {+ DWORD light_mode;+ DWORD light_mode_size = sizeof(light_mode);+ LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey,+ kGetPreferredBrightnessRegValue,+ RRF_RT_REG_DWORD, nullptr, &light_mode,+ &light_mode_size);++ if (result == ERROR_SUCCESS) {+ BOOL enable_dark_mode = light_mode == 0;+ DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE,+ &enable_dark_mode, sizeof(enable_dark_mode));+ }+}diff --git a/mobile/apps/locker/windows/runner/win32_window.h b/mobile/apps/locker/windows/runner/win32_window.hnew file mode 100644index 0000000000..e901dde684--- /dev/null+++ b/mobile/apps/locker/windows/runner/win32_window.h@@ -0,0 +1,102 @@+#ifndef RUNNER_WIN32_WINDOW_H_+#define RUNNER_WIN32_WINDOW_H_++#include <windows.h>++#include <functional>+#include <memory>+#include <string>++// A class abstraction for a high DPI-aware Win32 Window. Intended to be+// inherited from by classes that wish to specialize with custom+// rendering and input handling+class Win32Window {+ public:+ struct Point {+ unsigned int x;+ unsigned int y;+ Point(unsigned int x, unsigned int y) : x(x), y(y) {}+ };++ struct Size {+ unsigned int width;+ unsigned int height;+ Size(unsigned int width, unsigned int height)+ : width(width), height(height) {}+ };++ Win32Window();+ virtual ~Win32Window();++ // Creates a win32 window with |title| that is positioned and sized using+ // |origin| and |size|. New windows are created on the default monitor. Window+ // sizes are specified to the OS in physical pixels, hence to ensure a+ // consistent size this function will scale the inputted width and height as+ // as appropriate for the default monitor. The window is invisible until+ // |Show| is called. Returns true if the window was created successfully.+ bool Create(const std::wstring& title, const Point& origin, const Size& size);++ // Show the current window. Returns true if the window was successfully shown.+ bool Show();++ // Release OS resources associated with window.+ void Destroy();++ // Inserts |content| into the window tree.+ void SetChildContent(HWND content);++ // Returns the backing Window handle to enable clients to set icon and other+ // window properties. Returns nullptr if the window has been destroyed.+ HWND GetHandle();++ // If true, closing this window will quit the application.+ void SetQuitOnClose(bool quit_on_close);++ // Return a RECT representing the bounds of the current client area.+ RECT GetClientArea();++ protected:+ // Processes and route salient window messages for mouse handling,+ // size change and DPI. Delegates handling of these to member overloads that+ // inheriting classes can handle.+ virtual LRESULT MessageHandler(HWND window,+ UINT const message,+ WPARAM const wparam,+ LPARAM const lparam) noexcept;++ // Called when CreateAndShow is called, allowing subclass window-related+ // setup. Subclasses should return false if setup fails.+ virtual bool OnCreate();++ // Called when Destroy is called.+ virtual void OnDestroy();++ private:+ friend class WindowClassRegistrar;++ // OS callback called by message pump. Handles the WM_NCCREATE message which+ // is passed when the non-client area is being created and enables automatic+ // non-client DPI scaling so that the non-client area automatically+ // responds to changes in DPI. All other messages are handled by+ // MessageHandler.+ static LRESULT CALLBACK WndProc(HWND const window,+ UINT const message,+ WPARAM const wparam,+ LPARAM const lparam) noexcept;++ // Retrieves a class instance pointer for |window|+ static Win32Window* GetThisFromHandle(HWND const window) noexcept;++ // Update the window frame's theme to match the system theme.+ static void UpdateTheme(HWND const window);++ bool quit_on_close_ = false;++ // window handle for top level window.+ HWND window_handle_ = nullptr;++ // window handle for hosted content.+ HWND child_content_ = nullptr;+};++#endif // RUNNER_WIN32_WINDOW_H_