π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
ensu: disable sign-in and developer tools on android and iOS
Prateek Sunal846924e61d90
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.ktindex 73f24cb99c..ef8d299faa 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeNavigation.kt@@ -35,6 +35,7 @@ import io.ente.ensu.modelsettings.ModelSettingsScreenimport io.ente.ensu.settings.DeveloperSettingsScreenimport io.ente.ensu.settings.LogViewerScreenimport io.ente.ensu.settings.SettingsScreen+import io.ente.ensu.utils.EnsuFeatureFlagsimport kotlinx.coroutines.flow.Flow@Composable@@ -68,6 +69,7 @@ internal fun HomeNavigation(sessionTitle = currentSession?.title,showBrand = appState.chat.messages.isEmpty(),isLoggedIn = appState.auth.isLoggedIn,+ signInEnabled = EnsuFeatureFlags.enableSignIn,attachmentDownloads = appState.chat.attachmentDownloads,attachmentDownloadProgress = appState.chat.attachmentDownloadProgress,modelDownloadStatus = appState.chat.downloadStatus,diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeTopBars.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeTopBars.ktindex bddd4d1e7e..352cc6f340 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeTopBars.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeTopBars.kt@@ -36,6 +36,7 @@ internal fun EnsuTopBar(sessionTitle: String?,showBrand: Boolean,isLoggedIn: Boolean,+ signInEnabled: Boolean,attachmentDownloads: List<AttachmentDownloadItem>,attachmentDownloadProgress: Int?,modelDownloadStatus: String?,@@ -71,7 +72,7 @@ internal fun EnsuTopBar(val isLoading = modelDownloadStatus?.contains("Loading", ignoreCase = true) == trueval showModelProgress = isLoading- if (!isLoggedIn) {+ if (!isLoggedIn && signInEnabled) {if (showModelProgress) {ModelProgressIndicator(isLoading = isLoading,diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.ktindex ad37b5affe..81882e46a5 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/HomeView.kt@@ -103,16 +103,13 @@ fun HomeView(var lastDeveloperTapAt by remember { mutableStateOf<Long?>(null) }var showDeveloperDialog by remember { mutableStateOf(false) }- val handleSignInRequest: () -> Unit = {- if (EnsuFeatureFlags.enableSignIn) {- isShowingAuth = true- } else {- showSignInComingSoon = true- }+ val handleSignInRequest: () -> Unit = handle@{+ if (!EnsuFeatureFlags.enableSignIn) return@handle+ isShowingAuth = true}val handleDeveloperTap: () -> Unit = handle@{- if (!EnsuFeatureFlags.enableSignIn) return@handle+ if (!EnsuFeatureFlags.enableDeveloperTools) return@handle// Don't allow switching endpoints for logged-in users.if (appState.auth.isLoggedIn) return@handlediff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/SettingsScreen.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/SettingsScreen.ktindex eca4721e1c..435d1389af 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/SettingsScreen.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/SettingsScreen.kt@@ -33,6 +33,7 @@ import io.ente.ensu.designsystem.EnsuCornerRadiusimport io.ente.ensu.designsystem.EnsuSpacingimport io.ente.ensu.designsystem.EnsuTypographyimport io.ente.ensu.designsystem.HugeIcons+import io.ente.ensu.utils.EnsuFeatureFlags@Composablefun SettingsScreen(@@ -70,7 +71,7 @@ fun SettingsScreen(onClick = onSignOut))- } else {+ } else if (EnsuFeatureFlags.enableSignIn) {add(SettingsItem(title = "Sign In to Backup",diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/utils/FeatureFlags.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/utils/FeatureFlags.ktindex 0df2984034..507271977a 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/utils/FeatureFlags.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/utils/FeatureFlags.kt@@ -1,7 +1,8 @@package io.ente.ensu.utilsobject EnsuFeatureFlags {- const val enableSignIn = true+ const val enableSignIn = false+ const val enableDeveloperTools = falseconst val enableImageUploads = trueconst val enableModelSettings = false}diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swiftindex 2fc53f62b6..400b596040 100644--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/ChatView.swift@@ -242,7 +242,7 @@ struct ChatView: View {ChatAppBar(sessionTitle: viewModel.currentSessionId.map { viewModel.sessionTitle(for: $0) } ?? "New chat",showBrand: viewModel.messages.isEmpty,- showSignIn: !appState.isLoggedIn,+ showSignIn: EnsuFeatureFlags.enableSignIn && !appState.isLoggedIn,showsMenuButton: showsMenuButton,attachmentDownloadSummary: viewModel.attachmentDownloadSummary,modelDownloadState: viewModel.downloadToast,@@ -482,7 +482,7 @@ struct ChatView: View {}private func handleDeveloperTap() {- guard EnsuFeatureFlags.enableSignIn else { return }+ guard EnsuFeatureFlags.enableDeveloperTools else { return }// Don't allow switching endpoints for logged-in users.guard !appState.isLoggedIn else { return }diff --git a/mobile/native/darwin/Apps/ensu/ensu/FeatureFlags.swift b/mobile/native/darwin/Apps/ensu/ensu/FeatureFlags.swiftindex 7095322899..6b5c85fe1a 100644--- a/mobile/native/darwin/Apps/ensu/ensu/FeatureFlags.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/FeatureFlags.swift@@ -2,7 +2,8 @@import Foundationenum EnsuFeatureFlags {- static let enableSignIn = true+ static let enableSignIn = false+ static let enableDeveloperTools = falsestatic let enableImageUploads = truestatic let enableModelSettings = false}diff --git a/mobile/native/darwin/Apps/ensu/ensu/Settings/SettingsView.swift b/mobile/native/darwin/Apps/ensu/ensu/Settings/SettingsView.swiftindex 65f14c6ff2..284d715994 100644--- a/mobile/native/darwin/Apps/ensu/ensu/Settings/SettingsView.swift+++ b/mobile/native/darwin/Apps/ensu/ensu/Settings/SettingsView.swift@@ -73,7 +73,7 @@ struct SettingsView: View {Button("Close") { dismiss() }}}- .alert("Sign out of Ente SU?", isPresented: $showSignOutConfirm) {+ .alert("Sign out of Ensu?", isPresented: $showSignOutConfirm) {Button("Sign Out", role: .destructive) {onSignOut()}@@ -117,6 +117,7 @@ struct SettingsView: View {}private var shouldShowSignInRow: Bool {+ guard EnsuFeatureFlags.enableSignIn else { return false }guard !isLoggedIn else { return false }guard !trimmedQuery.isEmpty else { return true }let q = trimmedQuery.lowercased()