diff --git a/src/app/global/local_account_sensitive_settings.nim b/src/app/global/local_account_sensitive_settings.nim index f81d71b54c5..761d40c4cbd 100644 --- a/src/app/global/local_account_sensitive_settings.nim +++ b/src/app/global/local_account_sensitive_settings.nim @@ -595,6 +595,9 @@ QtObject: proc getLocalBackupChosenPath*(self: LocalAccountSensitiveSettings): string {.slot.} = let setting = self.getLocalBackupChosenPathSetting() if setting == "": + when defined(android): + # Return an empty string to make it clear to users that without permissisons we cannot access any path + return "" return DEFAULT_BACKUP_DIR return setting diff --git a/src/app_service/service/devices/service.nim b/src/app_service/service/devices/service.nim index 9e1eac8b741..b14d5a1eddc 100644 --- a/src/app_service/service/devices/service.nim +++ b/src/app_service/service/devices/service.nim @@ -124,7 +124,6 @@ QtObject: let backupPath = singletonInstance.localAccountSensitiveSettings.getLocalBackupChosenPath() - if backupPath.len == 0 or not backupPath.startsWith("content://"): raise newException(CatchableError, "invalid backup path for SAF copy") diff --git a/src/app_service/service/settings/service.nim b/src/app_service/service/settings/service.nim index 6cf7d6e8c67..4d5ddb5339b 100644 --- a/src/app_service/service/settings/service.nim +++ b/src/app_service/service/settings/service.nim @@ -159,6 +159,9 @@ QtObject: # New local setting needs to be initialized from old setting value # TODO remove this migration in 2.37 (one release cycle interval) proc migrateBackupPath*(self: Service) = + when defined(android): + # On Android we cannot use arbitrary paths without requesting storage permissions + return if singletonInstance.localAccountSensitiveSettings.getLocalBackupChosenPathSetting().len == 0 and self.settings.backupPath.len > 0: singletonInstance.localAccountSensitiveSettings.setLocalBackupChosenPath(self.settings.backupPath) diff --git a/ui/StatusQ/src/assets/png/backup-popup.png b/ui/StatusQ/src/assets/png/backup-popup.png new file mode 100644 index 00000000000..840b0ac6916 Binary files /dev/null and b/ui/StatusQ/src/assets/png/backup-popup.png differ diff --git a/ui/StatusQ/src/assets/png/png.qrc b/ui/StatusQ/src/assets/png/png.qrc index 78ee056d3d6..721e81d6bf2 100644 --- a/ui/StatusQ/src/assets/png/png.qrc +++ b/ui/StatusQ/src/assets/png/png.qrc @@ -1,5 +1,6 @@ + backup-popup.png browser/chooseBrowserImage@2x.png browser/pepehand.png community/airdrops8_1.png diff --git a/ui/app/AppLayouts/Profile/stores/DevicesStore.qml b/ui/app/AppLayouts/Profile/stores/DevicesStore.qml index f044ce6dae0..37279bfc5bf 100644 --- a/ui/app/AppLayouts/Profile/stores/DevicesStore.qml +++ b/ui/app/AppLayouts/Profile/stores/DevicesStore.qml @@ -27,7 +27,12 @@ QtObject { readonly property int backupDataState: syncModule ? syncModule.backupDataState : 0 readonly property string backupImportError: syncModule ? syncModule.backupImportError : "" readonly property string backupDataError: syncModule ? syncModule.backupDataError : "" - readonly property url backupPath: toFileUri(d.localAccountSensitiveSettingsInst.localBackupChosenPath) + readonly property url backupPath: { + if (!d.localAccountSensitiveSettingsInst.localBackupChosenPath) { + return "" + } + return toFileUri(d.localAccountSensitiveSettingsInst.localBackupChosenPath) + } readonly property bool messagesBackupEnabled: d.appSettingsInst.messagesBackupEnabled readonly property QtObject _d: StatusQUtils.QObject { diff --git a/ui/app/AppLayouts/Profile/views/BackupView.qml b/ui/app/AppLayouts/Profile/views/BackupView.qml index fae961be859..1672f39a491 100644 --- a/ui/app/AppLayouts/Profile/views/BackupView.qml +++ b/ui/app/AppLayouts/Profile/views/BackupView.qml @@ -3,9 +3,10 @@ import QtQuick.Controls import QtQuick.Layouts import StatusQ -import StatusQ.Core import StatusQ.Controls +import StatusQ.Core import StatusQ.Core.Theme +import StatusQ.Core.Utils as SQUtils import StatusQ.Popups.Dialog import utils @@ -132,7 +133,13 @@ SettingsContentBase { Layout.fillWidth: true Layout.leftMargin: Theme.padding wrapMode: Text.Wrap - text: qsTr("Choose a folder to store your backup files or use the default one.") + text: { + if (SQUtils.Utils.isAndroid) { + // We cannot use arbitrary paths on Android without requesting storage permissions + return qsTr("Choose a folder to store your backup files in.") + } + return qsTr("Choose a folder to store your backup files or use the default one.") + } color: Theme.palette.baseColor1 } diff --git a/ui/i18n/qml_base_en.ts b/ui/i18n/qml_base_en.ts index 4205ce78268..1b1b45f999d 100644 --- a/ui/i18n/qml_base_en.ts +++ b/ui/i18n/qml_base_en.ts @@ -2479,6 +2479,10 @@ To backup you recovery phrase, write it down and store it securely in a safe pla Backups are automatic (every 30 mins), secure (encrypted with your profile private key), and private (your data is stored <b>only</b> on your device). + + Choose a folder to store your backup files in. + + BalanceExceeded @@ -6761,11 +6765,23 @@ Remember your password and don't share it with anyone. - On-device backups are:<br>Automatic – every 30 minutes<br>Secure – encrypted with your profile private key<br>Private – stored only on your device + Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> - Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> + Enable on-device backup? + + + + On-device backups are:<br><b>Automatic</b> – created every 30 minutes<br><b>Secure</b> – encrypted with your profile’s private key<br><b>Private</b> – stored only on your device + + + + To enable backups, choose a folder to store your backup files under the <b>Backup location</b> setting.<br><br>You can also <b>optionally</b> back up your <b>1-on-1, group, and community messages</b> by turning on the <b>Backup your messages</b> toggle under the <b>Backup data</b> setting. + + + + Go to settings diff --git a/ui/i18n/qml_base_lokalise_en.ts b/ui/i18n/qml_base_lokalise_en.ts index f773e333bc0..8c889478dd1 100644 --- a/ui/i18n/qml_base_lokalise_en.ts +++ b/ui/i18n/qml_base_lokalise_en.ts @@ -3040,6 +3040,11 @@ BackupView Backups are automatic (every 30 mins), secure (encrypted with your profile private key), and private (your data is stored <b>only</b> on your device). + + Choose a folder to store your backup files in. + BackupView + Choose a folder to store your backup files in. + BalanceExceeded @@ -8256,14 +8261,29 @@ Enable on-device message backup? - On-device backups are:<br>Automatic – every 30 minutes<br>Secure – encrypted with your profile private key<br>Private – stored only on your device + Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> EnableMessageBackupPopup - On-device backups are:<br>Automatic – every 30 minutes<br>Secure – encrypted with your profile private key<br>Private – stored only on your device + Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> - Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> + Enable on-device backup? EnableMessageBackupPopup - Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> + Enable on-device backup? + + + On-device backups are:<br><b>Automatic</b> – created every 30 minutes<br><b>Secure</b> – encrypted with your profile’s private key<br><b>Private</b> – stored only on your device + EnableMessageBackupPopup + On-device backups are:<br><b>Automatic</b> – created every 30 minutes<br><b>Secure</b> – encrypted with your profile’s private key<br><b>Private</b> – stored only on your device + + + To enable backups, choose a folder to store your backup files under the <b>Backup location</b> setting.<br><br>You can also <b>optionally</b> back up your <b>1-on-1, group, and community messages</b> by turning on the <b>Backup your messages</b> toggle under the <b>Backup data</b> setting. + EnableMessageBackupPopup + To enable backups, choose a folder to store your backup files under the <b>Backup location</b> setting.<br><br>You can also <b>optionally</b> back up your <b>1-on-1, group, and community messages</b> by turning on the <b>Backup your messages</b> toggle under the <b>Backup data</b> setting. + + + Go to settings + EnableMessageBackupPopup + Go to settings diff --git a/ui/i18n/qml_cs.ts b/ui/i18n/qml_cs.ts index 8feb873c2a7..4399d6422c9 100644 --- a/ui/i18n/qml_cs.ts +++ b/ui/i18n/qml_cs.ts @@ -2486,6 +2486,10 @@ To backup you recovery phrase, write it down and store it securely in a safe pla Backups are automatic (every 30 mins), secure (encrypted with your profile private key), and private (your data is stored <b>only</b> on your device). + + Choose a folder to store your backup files in. + + BalanceExceeded @@ -6785,11 +6789,23 @@ Remember your password and don't share it with anyone. - On-device backups are:<br>Automatic – every 30 minutes<br>Secure – encrypted with your profile private key<br>Private – stored only on your device + Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> - Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> + Enable on-device backup? + + + + On-device backups are:<br><b>Automatic</b> – created every 30 minutes<br><b>Secure</b> – encrypted with your profile’s private key<br><b>Private</b> – stored only on your device + + + + To enable backups, choose a folder to store your backup files under the <b>Backup location</b> setting.<br><br>You can also <b>optionally</b> back up your <b>1-on-1, group, and community messages</b> by turning on the <b>Backup your messages</b> toggle under the <b>Backup data</b> setting. + + + + Go to settings diff --git a/ui/i18n/qml_es.ts b/ui/i18n/qml_es.ts index b19aa7d1b4f..188e8624630 100644 --- a/ui/i18n/qml_es.ts +++ b/ui/i18n/qml_es.ts @@ -2482,6 +2482,10 @@ Para respaldar tu frase de recuperación, escríbela y guárdala de forma segura Supported backup formats (%1) + + Choose a folder to store your backup files in. + + BalanceExceeded @@ -6765,10 +6769,6 @@ Recuerda tu contraseña y no la compartas con nadie. Enable on-device message backup? ¿Habilitar backup de mensajes en el dispositivo? - - On-device backups are:<br>Automatic – every 30 minutes<br>Secure – encrypted with your profile private key<br>Private – stored only on your device - Los backups en el dispositivo son:<br>Automáticos: cada 30 minutos<br>Seguros: cifrados con tu clave privada del perfil<br>Privados: almacenados solo en tu dispositivo - Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: <i>Settings > On-device backup > Backup data</i> Los backups te permiten restaurar tus mensajes 1 a 1, grupales y de comunidad si necesitas reinstalar la app o cambiar de dispositivo. Puedes omitir este paso ahora y habilitarlo en cualquier momento en: <i>Configuración > Respaldo en el dispositivo > Datos de backup</i> @@ -6781,6 +6781,22 @@ Recuerda tu contraseña y no la compartas con nadie. Enable Habilitar + + Enable on-device backup? + + + + On-device backups are:<br><b>Automatic</b> – created every 30 minutes<br><b>Secure</b> – encrypted with your profile’s private key<br><b>Private</b> – stored only on your device + + + + To enable backups, choose a folder to store your backup files under the <b>Backup location</b> setting.<br><br>You can also <b>optionally</b> back up your <b>1-on-1, group, and community messages</b> by turning on the <b>Backup your messages</b> toggle under the <b>Backup data</b> setting. + + + + Go to settings + + EnableShardingPopup diff --git a/ui/imports/shared/popups/EnableMessageBackupPopup.qml b/ui/imports/shared/popups/EnableMessageBackupPopup.qml index 01d410f3e71..59c43f9be25 100644 --- a/ui/imports/shared/popups/EnableMessageBackupPopup.qml +++ b/ui/imports/shared/popups/EnableMessageBackupPopup.qml @@ -2,15 +2,25 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import StatusQ.Components import StatusQ.Core import StatusQ.Core.Theme +import StatusQ.Core.Utils as SQUtils import StatusQ.Controls import StatusQ.Popups.Dialog +import utils + StatusDialog { id: root - title: qsTr("Enable on-device message backup?") + title: { + if (SQUtils.Utils.isAndroid) { + // Android needs specific wording because it requires user permission to access storage + return qsTr("Enable on-device backup?") + } + return qsTr("Enable on-device message backup?") + } padding: 20 width: 480 @@ -19,15 +29,27 @@ StatusDialog { contentItem: ColumnLayout { spacing: Theme.padding + StatusImage { + Layout.alignment: Qt.AlignHCenter + Layout.preferredWidth: Math.min(496, parent.width) + source: Theme.png("backup-popup") + mipmap: true + } + StatusBaseText { Layout.fillWidth: true wrapMode: Text.Wrap - text: qsTr("On-device backups are:
Automatic – every 30 minutes
Secure – encrypted with your profile private key
Private – stored only on your device") + text: qsTr("On-device backups are:
Automatic – created every 30 minutes
Secure – encrypted with your profile’s private key
Private – stored only on your device") } StatusBaseText { Layout.fillWidth: true wrapMode: Text.Wrap - text: qsTr("Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: Settings > On-device backup > Backup data") + text: { + if (SQUtils.Utils.isAndroid) { + return qsTr("To enable backups, choose a folder to store your backup files under the Backup location setting.

You can also optionally back up your 1-on-1, group, and community messages by turning on the Backup your messages toggle under the Backup data setting.") + } + return qsTr("Backups let you restore your 1-on-1, group, and community messages if you need to reinstall the app or switch devices. You can skip this step now and enable it anytime under: Settings > On-device backup > Backup data") + } } } @@ -42,8 +64,15 @@ StatusDialog { rightButtons: ObjectModel { StatusButton { objectName: "backupMessageEnableStatusFlatButton" - text: qsTr("Enable") - onClicked: root.accept() + text: SQUtils.Utils.isAndroid ? qsTr("Go to settings") : qsTr("Enable") + onClicked: { + if (SQUtils.Utils.isAndroid) { + Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.backupSettings) + root.close() + return + } + root.accept() + } } } } diff --git a/vendor/status-go b/vendor/status-go index 2beb7b905d3..074b5d78de6 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 2beb7b905d317a2d09205e4af16a55420afb5221 +Subproject commit 074b5d78de6024a5b056a97bf40d9fb0511c8013