oncall-mobile-android/.envrc
Mikael Hugo 6d389ea6af sms: relay inbound SMS to centralcloud-ops (Phase 2)
Whitelisted incoming SMS are forwarded to the centralcloud-ops
phone-relay endpoint as a redundant inbound path alongside Twilio.

  io.heckel.ntfy.sms.SmsRelayPreferences
    SharedPreferences-backed config — enabled flag, base URL, device id,
    sender whitelist (Set<String>). Strict opt-in: forward nothing unless
    explicitly enabled AND a non-empty whitelist matches the sender.

  io.heckel.ntfy.sms.SmsRelayReceiver
    BroadcastReceiver bound to SMS_RECEIVED_ACTION. Extracts the sender +
    concatenated body of multi-part SMS, applies the whitelist, and
    enqueues a OneTimeWorkRequest for forwarding. Wraps everything in
    try/catch so a failure on this hot path can never crash the device's
    SMS handling.

  io.heckel.ntfy.sms.SmsForwardWorker
    CoroutineWorker that POSTs to {baseUrl}/api/sms/inbound/phone-relay
    with X-Device-Id auth. Uses HttpUtil.defaultClient and JSONObject
    (no new deps). 4xx -> permanent drop, 5xx/network -> WorkManager
    exponential backoff retry. WorkManager constraints require a
    connected network so retries don't fire while offline.

  Manifest registration (uses-permission RECEIVE_SMS / READ_SMS, receiver
  declaration) is left as WIP in the working tree pending the broader
  managed-config / branding changes also in progress on the manifest.
  Commit those together (or in a follow-up) to make the receiver actually
  bind.

  No settings UI yet — set values via SharedPreferences directly or wait
  for the Phase 2.1 settings screen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:34:31 +02:00

1 line
10 B
Bash