aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-10 14:40:05 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-10 14:40:05 +0200
commitaed32f20625a6206628b577d743d96552f81e91a (patch)
treeaf2eaf3336804f2e4af37445326e52a19b2af169 /packages/meshbay-hub/src
parent2f2a9a6542d2194e50ffba6f382e4fdffd481838 (diff)
downloadmeshbay-aed32f20625a6206628b577d743d96552f81e91a.tar.gz
feat(android): back text messages up, in a build Play does not get
A Messages section sends the SMS added since the last copy, as restorable <smses> XML, into <folder>/<account>-messages/YYYY. A play flavor has neither READ_SMS nor the code that reads messages; full is the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/app.js8
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/de.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/en.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/es.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/it.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/phone-sync-settings.js12
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/phone-sync.js8
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js4
14 files changed, 51 insertions, 11 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js
index 12b48a7..41cc5f2 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js
@@ -944,9 +944,11 @@ function App() {
return () => { gone = true; if (stop) stop(); };
}, [syncAccount]);
- // Contacts backup (§9.13), the same way.
+ // Contacts and messages backup (§9.13), the same way.
useEffect(() => {
- if (!syncAccount || !platform.contactSync.available) return undefined;
+ if (!syncAccount || !(platform.contactSync.available || platform.messageSync.available)) {
+ return undefined;
+ }
let stop = null;
let gone = false;
import('./phone-sync.js').then((m) => {
@@ -962,7 +964,7 @@ function App() {
},
});
stop = m.stopPhoneSync;
- }).catch((e) => console.warn('[MeshBay] contacts backup did not load:', e.message));
+ }).catch((e) => console.warn('[MeshBay] contacts and messages backup did not load:', e.message));
return () => { gone = true; if (stop) stop(); };
}, [syncAccount]);
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js
index d83d0c0..086f3a9 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js
@@ -1340,6 +1340,9 @@ export default {
'contactsync.heading': "Kontakte-Sicherung",
'contactsync.intro': "Einmal täglich, wenn sie sich geändert haben, eine Kopie der Kontakte dieses Telefons senden. Jede Kopie ist eine .vcf-Datei, die jedes Telefon importieren kann.",
'contactsync.permission_needed': "MeshBay braucht Zugriff auf die Kontakte dieses Telefons.",
+ 'messagesync.heading': "SMS-Sicherung",
+ 'messagesync.intro': "Die SMS dieses Telefons einmal täglich senden: Die erste Kopie enthält alle, jede weitere nur die neuen. Die Dateien sind im XML-Format, das SMS-Sicherungs-Apps wiederherstellen können. MMS sind nicht enthalten.",
+ 'messagesync.permission_needed': "MeshBay braucht Zugriff auf die SMS dieses Telefons.",
'phonesync.state_sending': "Wird gesendet…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Gesendete Kopien: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js
index aa25258..66cd23b 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js
@@ -1321,6 +1321,9 @@ export default {
'contactsync.heading': "Contacts backup",
'contactsync.intro': "Send a copy of this phone's contacts once a day when they have changed. Each copy is a .vcf file any phone can import.",
'contactsync.permission_needed': "MeshBay needs access to this phone's contacts.",
+ 'messagesync.heading': "Messages backup",
+ 'messagesync.intro': "Send the text messages on this phone once a day: the first copy holds them all, each next one only the new ones. The files are in the XML format SMS backup applications restore. Multimedia messages are not included.",
+ 'messagesync.permission_needed': "MeshBay needs access to this phone's text messages.",
'phonesync.state_sending': "Sending…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Copies sent: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js
index 8a483e4..c53e3e4 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js
@@ -1334,6 +1334,9 @@ export default {
'contactsync.heading': "Copia de seguridad de contactos",
'contactsync.intro': "Enviar una copia de los contactos de este teléfono una vez al día si han cambiado. Cada copia es un archivo .vcf que cualquier teléfono puede importar.",
'contactsync.permission_needed': "MeshBay necesita acceso a los contactos de este teléfono.",
+ 'messagesync.heading': "Copia de seguridad de SMS",
+ 'messagesync.intro': "Enviar los SMS de este teléfono una vez al día: la primera copia los contiene todos y cada una de las siguientes solo los nuevos. Los archivos están en el formato XML que restauran las aplicaciones de copia de seguridad de SMS. Los MMS no se incluyen.",
+ 'messagesync.permission_needed': "MeshBay necesita acceso a los SMS de este teléfono.",
'phonesync.state_sending': "Enviando…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Copias enviadas: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js
index 7f15f05..52b40b0 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js
@@ -1349,6 +1349,9 @@ export default {
'contactsync.heading': "Sauvegarde des contacts",
'contactsync.intro': "Envoyer une copie des contacts de ce téléphone une fois par jour s'ils ont changé. Chaque copie est un fichier .vcf que tout téléphone sait importer.",
'contactsync.permission_needed': "MeshBay a besoin d'accéder aux contacts de ce téléphone.",
+ 'messagesync.heading': "Sauvegarde des SMS",
+ 'messagesync.intro': "Envoyer les SMS de ce téléphone une fois par jour : la première copie les contient tous, les suivantes seulement les nouveaux. Les fichiers sont au format XML que les applis de sauvegarde SMS savent restaurer. Les MMS ne sont pas inclus.",
+ 'messagesync.permission_needed': "MeshBay a besoin d'accéder aux SMS de ce téléphone.",
'phonesync.state_sending': "Envoi…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Copies envoyées : {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js
index d18c373..9387ddd 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js
@@ -1348,6 +1348,9 @@ export default {
'contactsync.heading': "Backup dei contatti",
'contactsync.intro': "Invia una copia dei contatti di questo telefono una volta al giorno se sono cambiati. Ogni copia è un file .vcf che qualsiasi telefono può importare.",
'contactsync.permission_needed': "MeshBay ha bisogno di accedere ai contatti di questo telefono.",
+ 'messagesync.heading': "Backup degli SMS",
+ 'messagesync.intro': "Invia gli SMS di questo telefono una volta al giorno: la prima copia li contiene tutti, le successive solo quelli nuovi. I file sono nel formato XML che le app di backup degli SMS sanno ripristinare. Gli MMS non sono inclusi.",
+ 'messagesync.permission_needed': "MeshBay ha bisogno di accedere agli SMS di questo telefono.",
'phonesync.state_sending': "Invio…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Copie inviate: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js
index 1ee0a81..29296d1 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js
@@ -1332,6 +1332,9 @@ export default {
'contactsync.heading': "連絡先のバックアップ",
'contactsync.intro': "このスマートフォンの連絡先のコピーを、変更があった日に1日1回送ります。各コピーはどのスマートフォンでも読み込める .vcf ファイルです。",
'contactsync.permission_needed': "MeshBay にこのスマートフォンの連絡先へのアクセスを許可してください。",
+ 'messagesync.heading': "SMS のバックアップ",
+ 'messagesync.intro': "このスマートフォンの SMS を1日1回送ります。最初のコピーにはすべてが含まれ、以降は新しいものだけが含まれます。ファイルは SMS バックアップアプリで復元できる XML 形式です。MMS は含まれません。",
+ 'messagesync.permission_needed': "MeshBay にこのスマートフォンの SMS へのアクセスを許可してください。",
'phonesync.state_sending': "送信中…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "送信したコピー: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js
index ec7be69..ada6813 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js
@@ -1350,6 +1350,9 @@ export default {
'contactsync.heading': "Back-up van contacten",
'contactsync.intro': "Stuur eenmaal per dag, als ze veranderd zijn, een kopie van de contacten op deze telefoon. Elke kopie is een .vcf-bestand dat elke telefoon kan importeren.",
'contactsync.permission_needed': "MeshBay heeft toegang nodig tot de contacten op deze telefoon.",
+ 'messagesync.heading': "Back-up van sms'jes",
+ 'messagesync.intro': "Stuur de sms'jes op deze telefoon eenmaal per dag: de eerste kopie bevat ze allemaal, elke volgende alleen de nieuwe. De bestanden zijn in het XML-formaat dat sms-back-upapps kunnen terugzetten. Mms'jes zijn niet inbegrepen.",
+ 'messagesync.permission_needed': "MeshBay heeft toegang nodig tot de sms'jes op deze telefoon.",
'phonesync.state_sending': "Bezig met verzenden…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Verzonden kopieën: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js
index 96da817..3e712bb 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js
@@ -1376,6 +1376,9 @@ export default {
'contactsync.heading': "Kopia kontaktów",
'contactsync.intro': "Wysyłaj kopię kontaktów z tego telefonu raz dziennie, jeśli się zmieniły. Każda kopia to plik .vcf, który zaimportuje każdy telefon.",
'contactsync.permission_needed': "MeshBay potrzebuje dostępu do kontaktów w tym telefonie.",
+ 'messagesync.heading': "Kopia SMS-ów",
+ 'messagesync.intro': "Wysyłaj SMS-y z tego telefonu raz dziennie: pierwsza kopia zawiera wszystkie, każda kolejna tylko nowe. Pliki są w formacie XML, który przywracają aplikacje do kopii SMS-ów. MMS-y nie są uwzględniane.",
+ 'messagesync.permission_needed': "MeshBay potrzebuje dostępu do SMS-ów w tym telefonie.",
'phonesync.state_sending': "Wysyłanie…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Wysłane kopie: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js
index cec9604..8fe39e5 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js
@@ -1335,6 +1335,9 @@ export default {
'contactsync.heading': "Backup de contatos",
'contactsync.intro': "Enviar uma cópia dos contatos deste celular uma vez por dia se tiverem mudado. Cada cópia é um arquivo .vcf que qualquer celular consegue importar.",
'contactsync.permission_needed': "O MeshBay precisa de acesso aos contatos deste celular.",
+ 'messagesync.heading': "Backup de SMS",
+ 'messagesync.intro': "Enviar os SMS deste celular uma vez por dia: a primeira cópia contém todos, cada uma das seguintes só os novos. Os arquivos estão no formato XML que os apps de backup de SMS conseguem restaurar. MMS não são incluídos.",
+ 'messagesync.permission_needed': "O MeshBay precisa de acesso aos SMS deste celular.",
'phonesync.state_sending': "Enviando…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "Cópias enviadas: {n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js
index 212bc5d..e294fe5 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js
@@ -1321,6 +1321,9 @@ export default {
'contactsync.heading': "联系人备份",
'contactsync.intro': "在联系人有变动的日子里,每天一次发送本机联系人的副本。每份副本都是任何手机都能导入的 .vcf 文件。",
'contactsync.permission_needed': "MeshBay 需要访问本机的联系人。",
+ 'messagesync.heading': "短信备份",
+ 'messagesync.intro': "每天一次发送本机的短信:第一份副本包含全部短信,之后每份只包含新短信。文件采用短信备份应用可以恢复的 XML 格式。不包括彩信。",
+ 'messagesync.permission_needed': "MeshBay 需要访问本机的短信。",
'phonesync.state_sending': "正在发送…",
'phonesync.summary': "{group} → {dir}",
'phonesync.copies_sent': "已发送副本:{n}",
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/phone-sync-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/phone-sync-settings.js
index cec8b43..0602e54 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/phone-sync-settings.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/phone-sync-settings.js
@@ -1,7 +1,7 @@
-// The contacts section of the Android Sync page, on the Android application
-// only (docs/MESHBAY_DESIGN.md §9.13). Loaded on demand: no other client has
-// it. Where the copies go is the page's destination section; this one only
-// turns the backup on or off.
+// The contacts and messages sections of the Android Sync page, on the Android
+// application only (docs/MESHBAY_DESIGN.md §9.13). Loaded on demand: no other
+// client has it. Where the copies go is the page's destination section; these
+// only turn each backup on or off.
import { html, useState, useEffect, useCallback } from './vendor/htm-preact.js';
import { t } from './i18n.js';
@@ -13,6 +13,10 @@ const TEXT = {
intro: 'contactsync.intro',
permission: 'contactsync.permission_needed',
},
+ messages: {
+ intro: 'messagesync.intro',
+ permission: 'messagesync.permission_needed',
+ },
};
function stateLine(st, status) {
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/phone-sync.js b/packages/meshbay-hub/src/meshbay_hub/static/phone-sync.js
index b9db9f7..2c34af0 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/phone-sync.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/phone-sync.js
@@ -1,6 +1,7 @@
-// Contacts backup: a copy of this phone's address book sent to
-// `<folder>/<account>-contacts` of the destination every backup shares
-// (sync-destination.js), once a day when it changed (docs/MESHBAY_DESIGN.md §9.13).
+// Contacts and messages backup: a copy of this phone's address book, and the
+// text messages added since the last copy, sent to `<folder>/<account>-contacts`
+// and `-messages` of the destination every backup shares (sync-destination.js),
+// once a day when there is something new (docs/MESHBAY_DESIGN.md §9.13).
//
// The same split as photos (photo-sync.js): the phone writes what is new into
// one file and remembers what the node took; this module decides when a run
@@ -29,6 +30,7 @@ const RETRY_MS = 15 * 60 * 1000;
*/
export const KINDS = {
contacts: { sync: platform.contactSync, heading: 'contactsync.heading', suffix: 'contacts' },
+ messages: { sync: platform.messageSync, heading: 'messagesync.heading', suffix: 'messages' },
};
// Refusals that will hold at the next run too: said once (a notification,
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index 148b2eb..4b507dc 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -267,7 +267,7 @@ export const phoneSync = {
};
/**
- * Backing up one kind of this phone's data (the contacts) to the destination
+ * Backing up one kind of this phone's data (contacts, messages) to the destination
* every kind shares (docs/MESHBAY_DESIGN.md §9.13). Android only, like
* `photoSync`. See phone-sync.js.
*/
@@ -292,6 +292,8 @@ function docSync(name) {
}
export const contactSync = docSync('contactSync');
+/** Absent from the Play build, whose policy keeps text messages from it. */
+export const messageSync = docSync('messageSync');
/** Pick a directory to add as a group root. Returns { path, name } or null. */
export const rootPicker = {