v0.5.0: bubble for Android 0.5.0 — text from the Rabbit's SIM on the desktop, and chat names and read status sync, through jai

A relay on jai (server/bubble_relay.py, stdlib + SQLite, tailscale address
only, bearer token) carries sealed blobs between the desktop and the Rabbit:
AES-256-GCM with a key the desktop makes and hands over USB (Sync to Rabbit),
so jai can neither read nor forge anything. It deletes what's been picked up,
and anything after 14 days.

- Desktop (src/main/relay.ts): "Rabbit SIM" is a number to text from, groups
  included; the SIM's history and new texts arrive; older photos are fetched
  when shown; names and read/unread/archived go both ways. Settings → Rabbit
  relay connects it.
- Rabbit (Relay.java, RelayJob): no timer of its own for the battery; it rides
  along with the background checks, plus one network job after a text, a send
  or a swipe. Each send from the desktop goes out at most once and not after a
  day. Plain http only to jai and localhost (network_security_config).
- scripts/deploy-jai.sh; tests: server unit tests, an end-to-end relay test,
  and DEVICE=1 relay.device.test.ts against the dev app.
This commit is contained in:
2026-11-06 17:35:00 -08:00
parent ec9e472265
commit 950b8ce067
41 changed files with 1646 additions and 53 deletions
@@ -53,6 +53,9 @@ final class Config {
final List<Did> dids = new CopyOnWriteArrayList<>();
private boolean hasSim;
String defaultDid;
/** The relay through jai (Relay.java): address, bearer token, and the 32-byte key that seals everything. */
String relayUrl, relayToken;
byte[] relayKey;
/** Made-up data for testing (android/tools/push_sandbox.py): never goes online. */
boolean sandbox;
private final File file;
@@ -120,6 +123,17 @@ final class Config {
}
if (cfg.gvNumber != null && !cfg.gvNumber.isEmpty()) cfg.dids.add(new Did(cfg.gvNumber, "Google Voice", true));
cfg.defaultDid = o.optString("defaultDid", null);
JSONObject r = o.optJSONObject("relay");
if (r != null) {
String url = r.optString("url", ""), token = r.optString("token", "");
byte[] key = android.util.Base64.decode(r.optString("key", ""), android.util.Base64.DEFAULT);
// Only the addresses network_security_config lets through, and a real key.
if (url.matches("http://(100\\.\\d+\\.\\d+\\.\\d+|127\\.0\\.0\\.1)(:\\d+)?|https://[^/]+") && !token.isEmpty() && key.length == 32) {
cfg.relayUrl = url;
cfg.relayToken = token;
cfg.relayKey = key;
}
}
cfg.sandbox = o.optBoolean("sandbox", false);
} catch (IOException | JSONException e) {
cfg.raw = new JSONObject();