aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-10 14:41:02 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-10 14:41:02 +0200
commitbe8b7fcff56a1104e7cd974cc0f506d90f1299a8 (patch)
tree7bd1f987fd2890e6527a84b7b47018dc598675a6 /packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js
parentaed32f20625a6206628b577d743d96552f81e91a (diff)
downloadmeshbay-be8b7fcff56a1104e7cd974cc0f506d90f1299a8.tar.gz
feat(android): back up the personal profile only
A copy of the application inside a work profile offers no backup, and no source reads another profile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js')
-rw-r--r--packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js81
1 files changed, 43 insertions, 38 deletions
diff --git a/packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js b/packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js
index fb613a3..fc7231c 100644
--- a/packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js
+++ b/packages/meshbay-android/app/src/main/assets/bridge/meshbay-bridge.js
@@ -15,11 +15,12 @@
* that refuses: `platform.js` decides what to show from whether an object
* exists (`platform.node.available`, `platform.folder.available`, …).
*
- * `HUB_BASE`, `BINARY`, `CAST` and `MESSAGES` are prepended by the shell when
- * it injects this file: the interface asks for the hub while its modules load, before
- * anything can await; BINARY says whether the WebView carries ArrayBuffer
- * messages; CAST whether this device can cast at all; MESSAGES whether this
- * build backs text messages up (not the Play build).
+ * `HUB_BASE`, `BINARY`, `CAST`, `BACKUP` and `MESSAGES` are prepended by the
+ * shell when it injects this file: the interface asks for the hub while its
+ * modules load, before anything can await; BINARY says whether the WebView carries ArrayBuffer
+ * messages; CAST whether this device can cast at all; BACKUP whether this is
+ * the personal profile, the only one backed up; MESSAGES whether this build
+ * backs text messages up (not the Play build).
*/
(function () {
'use strict';
@@ -198,41 +199,45 @@
call('push:remember', subscription, account, secret, since),
},
- // Photo backup (§9.12): the phone lists its photos, keeps what was sent,
- // and hands each photo's bytes over at /photosync/<token> on this origin.
- // The page decides when and does the sending. Phone-only, like `push`.
- photoSync: {
- status: () => call('photosync:status'),
- permit: () => call('photosync:permit'),
- albums: () => call('photosync:albums'),
- configure: (settings) => call('photosync:configure', settings || null),
- estimate: (settings) => call('photosync:estimate', settings),
- plan: () => call('photosync:plan'),
- sent: (token, dir, name) => call('photosync:sent', token, dir, name),
- completed: () => call('photosync:completed'),
- failed: (code, text) => call('photosync:failed', code, text),
- keepAlive: (on, text) => call('photosync:keep-alive', on === true, text || ''),
- },
+ // Backups (§9.12, §9.13), of the personal profile only: a copy of the
+ // application inside a work profile has none of these (Profiles.kt).
+ ...(BACKUP ? {
+ // Photo backup (§9.12): the phone lists its photos, keeps what was sent,
+ // and hands each photo's bytes over at /photosync/<token> on this origin.
+ // The page decides when and does the sending. Phone-only, like `push`.
+ photoSync: {
+ status: () => call('photosync:status'),
+ permit: () => call('photosync:permit'),
+ albums: () => call('photosync:albums'),
+ configure: (settings) => call('photosync:configure', settings || null),
+ estimate: (settings) => call('photosync:estimate', settings),
+ plan: () => call('photosync:plan'),
+ sent: (token, dir, name) => call('photosync:sent', token, dir, name),
+ completed: () => call('photosync:completed'),
+ failed: (code, text) => call('photosync:failed', code, text),
+ keepAlive: (on, text) => call('photosync:keep-alive', on === true, text || ''),
+ },
- // Where every backup goes (§9.12): one folder of one group the account
- // owns and is alone in. Each kind goes into `<account>-<kind>` under it.
- phoneSync: {
- destination: () => call('phonesync:destination'),
- setDestination: (d) => call('phonesync:set-destination', d || null),
- },
+ // Where every backup goes (§9.12): one folder of one group the account
+ // owns and is alone in. Each kind goes into `<account>-<kind>` under it.
+ phoneSync: {
+ destination: () => call('phonesync:destination'),
+ setDestination: (d) => call('phonesync:set-destination', d || null),
+ },
- // Contacts backup (§9.13): the phone writes the address book into one
- // file, served at /phonesync/<token> on this origin, when it changed since
- // the last one sent. The page decides when and does the sending.
- contactSync: {
- status: () => call('contactsync:status'),
- permit: () => call('contactsync:permit'),
- configure: (settings) => call('contactsync:configure', settings || null),
- plan: () => call('contactsync:plan'),
- sent: (token, dir, name) => call('contactsync:sent', token, dir, name),
- completed: () => call('contactsync:completed'),
- failed: (code, text) => call('contactsync:failed', code, text),
- },
+ // Contacts backup (§9.13): the phone writes the address book into one
+ // file, served at /phonesync/<token> on this origin, when it changed since
+ // the last one sent. The page decides when and does the sending.
+ contactSync: {
+ status: () => call('contactsync:status'),
+ permit: () => call('contactsync:permit'),
+ configure: (settings) => call('contactsync:configure', settings || null),
+ plan: () => call('contactsync:plan'),
+ sent: (token, dir, name) => call('contactsync:sent', token, dir, name),
+ completed: () => call('contactsync:completed'),
+ failed: (code, text) => call('contactsync:failed', code, text),
+ },
+ } : {}),
// Messages backup (§9.13), the same way as contacts: the messages added
// since the last file the node took. Only in a build that may read them.