From 7957fa686eb6e8cf57bcb62ff4e6d2785693030b Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 10 Oct 2026 16:29:20 +0200 Subject: feat(android): back up WhatsApp's own chat backups, and its media if asked A WhatsApp section takes WhatsApp's folder through the picker, sends its encrypted Databases and Backups (not the dated copies of earlier weeks) into /-whatsapp, and names the restore set in the manifest. Co-Authored-By: Claude Opus 5.5 --- .../src/meshbay_hub/static/drive-sync.js | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js b/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js index 5ddf188..3887e4f 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/drive-sync.js @@ -1,4 +1,4 @@ -// Files backup: the folders the person chose through the system's picker, +// Files and WhatsApp backups: folders chosen through the system's picker, // sent into `/-drive//…` of the destination // every backup shares (sync-destination.js), once a day, on an unmetered // network, like photos (docs/MESHBAY_DESIGN.md §9.13). @@ -23,7 +23,26 @@ const drive = createBackup({ say: (code) => t('phonesync.notice', { what: t('drivesync.heading'), reason: failureText(code) }), }); -export const startDriveSync = (context) => drive.start(context); -export const stopDriveSync = () => drive.stop(); +// WhatsApp's own folder: the same runner over its bridge, into +// `/-whatsapp/` (DriveKind.kt says what is sent). +const whatsapp = createBackup({ + name: 'WhatsApp', + sync: platform.whatsappSync, + configured: (status) => Boolean(status.on) && (status.folders || []).length > 0, + progress: 'whatsappsync.notif_progress', + failures: LASTING, + say: (code) => t('phonesync.notice', { what: t('whatsappsync.heading'), reason: failureText(code) }), +}); + +export function startDriveSync(context) { + drive.start(context); + whatsapp.start(context); +} +export function stopDriveSync() { + drive.stop(); + whatsapp.stop(); +} export const runDriveSync = (opts) => drive.run(opts); export const subscribe = (fn) => drive.subscribe(fn); +export const runWhatsAppSync = (opts) => whatsapp.run(opts); +export const subscribeWhatsApp = (fn) => whatsapp.subscribe(fn); -- cgit v1.2.3