π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile] Gate native background manager on internal-user flag in all builds
laurenspriem6c5b7b110b1f
diff --git a/mobile/apps/photos/android/app/build.gradle b/mobile/apps/photos/android/app/build.gradleindex c1faa29c0a..a963ffcb28 100644--- a/mobile/apps/photos/android/app/build.gradle+++ b/mobile/apps/photos/android/app/build.gradle@@ -56,9 +56,6 @@ configurations.configureEach {android {namespace = "io.ente.photos"- buildFeatures {- buildConfig = true- }compileOptions {coreLibraryDesugaringEnabled = truediff --git a/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/EnteApplication.kt b/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/EnteApplication.ktindex 25bc6c0742..9ef87aa840 100644--- a/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/EnteApplication.kt+++ b/mobile/apps/photos/android/app/src/main/kotlin/io/ente/photos/EnteApplication.kt@@ -23,12 +23,10 @@ class EnteApplication : Application() {BackgroundManagerPlugin.install(this) {val prefs = getSharedPreferences(FLUTTER_SHARED_PREFERENCES, Context.MODE_PRIVATE)!prefs.getBoolean(INTERNAL_USER_DISABLED_KEY, false) &&- (BuildConfig.DEBUG ||- runCatching {- JSONObject(prefs.getString(REMOTE_FLAGS_KEY, "{}") ?: "{}").opt("internalUser") ==- true- }- .getOrDefault(false))+ runCatching {+ JSONObject(prefs.getString(REMOTE_FLAGS_KEY, "{}") ?: "{}").opt("internalUser") == true+ }+ .getOrDefault(false)}}diff --git a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxprojindex 5ad7e6f5d0..bc5e0263ac 100644--- a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj+++ b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj@@ -1340,7 +1340,6 @@PRODUCT_BUNDLE_IDENTIFIER = io.ente.frame.debug;PRODUCT_NAME = "$(TARGET_NAME)";PROVISIONING_PROFILE_SPECIFIER = "";- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";SWIFT_ENABLE_EXPLICIT_MODULES = NO;SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";SWIFT_OPTIMIZATION_LEVEL = "-Onone";diff --git a/mobile/apps/photos/ios/Runner/AppDelegate.swift b/mobile/apps/photos/ios/Runner/AppDelegate.swiftindex 0fb4c63a5f..1a184813d8 100644--- a/mobile/apps/photos/ios/Runner/AppDelegate.swift+++ b/mobile/apps/photos/ios/Runner/AppDelegate.swift@@ -77,17 +77,13 @@ import workmanager_appleguard !defaults.bool(forKey: "flutter.ls.internal_user_disabled") else {return false}- #if DEBUG- return true- #else- guard let remoteFlags = defaults.string(forKey: "flutter.remote_flags"),- let data = remoteFlags.data(using: .utf8),- let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any]- else {- return false- }- return json["internalUser"] as? Bool ?? false- #endif+ guard let remoteFlags = defaults.string(forKey: "flutter.remote_flags"),+ let data = remoteFlags.data(using: .utf8),+ let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any]+ else {+ return false+ }+ return json["internalUser"] as? Bool ?? false}private func shouldEnableWorkmanagerDebugNotifications() -> Bool {diff --git a/mobile/apps/photos/lib/utils/background_tasks.dart b/mobile/apps/photos/lib/utils/background_tasks.dartindex 139b922afa..40901d27cd 100644--- a/mobile/apps/photos/lib/utils/background_tasks.dart+++ b/mobile/apps/photos/lib/utils/background_tasks.dart@@ -214,7 +214,7 @@ class BackgroundTasks {if (prefs.getBool("ls.internal_user_disabled") == true) {return false;}- return kDebugMode || _isRemoteInternalUser(prefs);+ return _isRemoteInternalUser(prefs);}static Future<bool> _acquirePipeline(BackgroundTask task) async {