Compare commits
31
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b3cfdca24 | ||
|
|
0099fdec8b | ||
|
|
0e4ed7f4fe | ||
|
|
a238800b32 | ||
|
|
0b2338e1c0 | ||
|
|
4129f72f39 | ||
|
|
bd10daeb8b | ||
|
|
dd994c5bc3 | ||
|
|
a3017bdd50 | ||
|
|
95ec0b839c | ||
|
|
a6d6e193c1 | ||
|
|
71987ec387 | ||
|
|
1eb80cc075 | ||
|
|
e4936b7fc8 | ||
|
|
0b635cb7a1 | ||
|
|
1106de26f2 | ||
|
|
50ff68b6ee | ||
|
|
5f68bb7267 | ||
|
|
09a46aa35c | ||
|
|
fcabae81e5 | ||
|
|
a2d8f7761e | ||
|
|
8927c5c59c | ||
|
|
4d0c15757d | ||
|
|
357a2312ce | ||
|
|
6d31a5585e | ||
|
|
2e2086e178 | ||
|
|
96c368dfd1 | ||
|
|
e1bceb06a3 | ||
|
|
94188a42c7 | ||
|
|
8c84feaa91 | ||
|
|
a2b8f764db |
@@ -6,3 +6,8 @@ dist/
|
||||
|
||||
# Android build output
|
||||
android/build/
|
||||
|
||||
# Local only
|
||||
CLAUDE.md
|
||||
android/*.keystore
|
||||
__pycache__/
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# bubble (voip.ms Messages)
|
||||
|
||||
Desktop SMS client (Electron, `src/`) plus its Rabbit R1 companion app
|
||||
(plain Java, `android/`, see `android/README.md`).
|
||||
|
||||
## trav's data is off limits
|
||||
|
||||
Never read trav's messages, contacts, accounts or anything the apps keep
|
||||
about him, and never screenshot the real app showing them. Standard:
|
||||
`~/Documents/shared-resources/privacy.html`. If reading it seems necessary,
|
||||
ask trav first, every time (what and why); one yes covers one look. No
|
||||
exceptions granted so far.
|
||||
|
||||
Where his data lives:
|
||||
|
||||
- Desktop: `~/.config/voip.ms Messages/` (Electron userData: the message
|
||||
database, settings, secrets, photo cache, ui-state.json).
|
||||
- Rabbit R1: the private storage of `me.teafry.voipmessages`
|
||||
(`files/messages.db`, `files/config.json`, `files/media/`,
|
||||
`files/state*.json`). Don't `run-as` into it, and don't screenshot that app.
|
||||
- Rabbit R1 SIM texts: Android's shared message store (`content://sms`,
|
||||
`content://mms`, the telephony provider), which bubble reads and writes as
|
||||
the default SMS app. Don't query it over adb, and don't make an app the
|
||||
default SMS app yourself (it hands that app his texts).
|
||||
- jai: `~/Documents/bubble-server/data/` (the relay's mailbox and token).
|
||||
Everything in relay.db is sealed, but it's still his messages: don't read
|
||||
it, and never print the token (`scripts/deploy-jai.sh --token` is for trav).
|
||||
The desktop keeps the relay's address, token and key in
|
||||
`~/.config/voip.ms Messages/relay.bin`.
|
||||
|
||||
Test with fake data only:
|
||||
|
||||
- Desktop: `VOIPMS_SANDBOX=/tmp/x npm run dev`.
|
||||
- Relay: `server/test_bubble_relay.py` and `test/relay.test.ts` run a throwaway
|
||||
local server; `DEVICE=1 npm test -- test/relay.device.test.ts` drives the dev
|
||||
app on a plugged-in Rabbit through `adb reverse`. Never test against jai's.
|
||||
- Android: the dev app `me.teafry.voipmessages.dev`
|
||||
(`python3 android/build.py --dev --install`, then
|
||||
`python3 android/tools/push_sandbox.py` for made-up conversations).
|
||||
Binary file not shown.
Binary file not shown.
+5
-5
@@ -3,16 +3,16 @@ import { charCount, formatNumber, normalizeNumber } from '@shared/phone'
|
||||
|
||||
describe('phone numbers', () => {
|
||||
it('normalizes NANP numbers to 10 digits', () => {
|
||||
expect(normalizeNumber('+1 (541) 280-2626')).toBe('5412802626')
|
||||
expect(normalizeNumber('15412802626')).toBe('5412802626')
|
||||
expect(normalizeNumber('541.280.2626')).toBe('5412802626')
|
||||
expect(normalizeNumber('tel:+15412802626')).toBe('5412802626')
|
||||
expect(normalizeNumber('+1 (541) 555-0142')).toBe('5415550142')
|
||||
expect(normalizeNumber('15415550142')).toBe('5415550142')
|
||||
expect(normalizeNumber('541.555.0142')).toBe('5415550142')
|
||||
expect(normalizeNumber('tel:+15415550142')).toBe('5415550142')
|
||||
})
|
||||
it('leaves short codes alone', () => {
|
||||
expect(normalizeNumber('72975')).toBe('72975')
|
||||
})
|
||||
it('formats', () => {
|
||||
expect(formatNumber('5412802626')).toBe('(541) 280-2626')
|
||||
expect(formatNumber('5415550142')).toBe('(541) 555-0142')
|
||||
expect(formatNumber('72975')).toBe('72975')
|
||||
})
|
||||
})
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ const raw = (id: number, date: string, type = '1'): RawSms => ({
|
||||
date: `${date} 12:00:00`,
|
||||
type,
|
||||
did: '15550001111',
|
||||
contact: '5412802626',
|
||||
contact: '5415550142',
|
||||
message: `m${id}`
|
||||
})
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('toNewMessage', () => {
|
||||
expect(toNewMessage(raw(7, '2024-02-03', '0'))).toEqual({
|
||||
id: 7,
|
||||
did: '5550001111',
|
||||
contact: '5412802626',
|
||||
contact: '5415550142',
|
||||
direction: 'out',
|
||||
body: 'm7',
|
||||
ts: Date.UTC(2024, 1, 3, 12)
|
||||
@@ -109,12 +109,12 @@ describe('SyncEngine poll', () => {
|
||||
const db = new MessageDb(path.join(dir, 'm.db'))
|
||||
db.set('backfill_done', '1')
|
||||
const sent = { ...raw(42, ymd(Date.now()), '0'), message: 'see you at 8' }
|
||||
const t = db.insertPending({ did: '5550001111', contact: '5412802626', direction: 'out', body: 'see you at 8', ts: toNewMessage(sent).ts })
|
||||
const t = db.insertPending({ did: '5550001111', contact: '5415550142', direction: 'out', body: 'see you at 8', ts: toNewMessage(sent).ts })
|
||||
db.markFailed(t, "voip.ms didn't respond in time.")
|
||||
const engine = new SyncEngine(db, fakeApi([sent]) as unknown as VoipMs, { pollSeconds: 3600, dids: [], backfillFloor: '2010-01-01' })
|
||||
await engine.pollNow()
|
||||
expect(db.getMessage(t)).toBeUndefined()
|
||||
expect(db.getConversationMessages('5550001111', '5412802626').map((m) => [m.id, m.status])).toEqual([[42, 'delivered']])
|
||||
expect(db.getConversationMessages('5550001111', '5415550142').map((m) => [m.id, m.status])).toEqual([[42, 'delivered']])
|
||||
db.close()
|
||||
fs.rmSync(dir, { recursive: true, force: true })
|
||||
})
|
||||
|
||||
+10
-10
@@ -6,19 +6,19 @@ describe('parseVCard', () => {
|
||||
const card = [
|
||||
'BEGIN:VCARD',
|
||||
'VERSION:3.0',
|
||||
'FN:Collette Shade',
|
||||
'N:Shade;Collette;;;',
|
||||
'TEL;X-EVOLUTION-E164=4434655721,;VALUE=UNKNOWN;TYPE=CELL:(443) 465-5721',
|
||||
'TEL;X-EVOLUTION-E164=5412802626,"+1";X-NC-SCOPE="v2-local";TYPE=VOICE:+1541',
|
||||
' 2802626',
|
||||
'FN:Alex Example',
|
||||
'N:Example;Alex;;;',
|
||||
'TEL;X-EVOLUTION-E164=4435550143,;VALUE=UNKNOWN;TYPE=CELL:(443) 555-0143',
|
||||
'TEL;X-EVOLUTION-E164=5415550142,"+1";X-NC-SCOPE="v2-local";TYPE=VOICE:+1541',
|
||||
' 5550142',
|
||||
'PHOTO;VALUE=BINARY:https://lh5.googleusercontent.com/-abc/photo.jpg',
|
||||
'END:VCARD'
|
||||
].join('\r\n')
|
||||
const c = parseVCard(card)
|
||||
expect(c.name).toBe('Collette Shade')
|
||||
expect(c.name).toBe('Alex Example')
|
||||
expect(c.tels).toEqual([
|
||||
{ number: '4434655721', label: 'cell' },
|
||||
{ number: '5412802626', label: undefined }
|
||||
{ number: '4435550143', label: 'cell' },
|
||||
{ number: '5415550142', label: undefined }
|
||||
])
|
||||
expect(c.photo).toEqual({ kind: 'url', url: 'https://lh5.googleusercontent.com/-abc/photo.jpg' })
|
||||
})
|
||||
@@ -40,8 +40,8 @@ describe('parseVCard', () => {
|
||||
})
|
||||
|
||||
it('handles grouped properties and escaped text', () => {
|
||||
const c = parseVCard('BEGIN:VCARD\nitem1.FN:Smith\\, John\nitem1.TEL;type=CELL:+1 541 280 2626\nEND:VCARD')
|
||||
const c = parseVCard('BEGIN:VCARD\nitem1.FN:Smith\\, John\nitem1.TEL;type=CELL:+1 541 555 0142\nEND:VCARD')
|
||||
expect(c.name).toBe('Smith, John')
|
||||
expect(c.tels[0]).toEqual({ number: '5412802626', label: 'cell' })
|
||||
expect(c.tels[0]).toEqual({ number: '5415550142', label: 'cell' })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user