Skip to content
Back to the list

monorepo: ESP32 · Node · Android

BankBridge

A self-hosted ANCS-to-dashboard bridge for bank balance alerts

A self-hosted alternative to paid reconciliation services. iOS will not let an app read another app's notifications, so an ESP32 reads them over Apple's ANCS profile on BLE; on Android the companion app reads them directly. Both sources feed one Node server.

Installed software — no public demo.

  • ESP32-S3
  • PlatformIO
  • Node.js
  • Socket.IO
  • SQLite
  • Kotlin

§ 01Algorithm

server/parser.js — mô hình tin cậy 3 lớp
# Vấn đề: vùng "nội dung chuyển khoản" do NGƯỜI GỬI tự ghi.
# Kẻ xấu ghi được chuỗi giả dạng số tiền vào đó.

L1  trust(notif):
      package ∈ bank_apps            → 'verified'   # package Android không giả được
      package == com.zing.zalo       → chỉ tin nếu OA ∈ whitelist
                                       (OA và tin nhắn cá nhân DÙNG CHUNG package)
      bundle_id (ANCS/iOS)           → map riêng, khác package Android

L2  amount(text):
      i ← index_of(text, /ND:|Nội dung:|Content:/)
      return parse_money(text[0 .. i])   # CHỈ vùng ngân hàng kiểm soát

L3  dedup(notif):
      key ← notif.reference ?? (bank, amount, direction) trong cửa sổ Δt
      nếu đã thấy key: is_duplicate ← 1   # giữ bản ghi, loại khỏi tổng hợp

# iOS khoá quyền đọc thông báo của app khác
#   → ESP32 đọc qua chuẩn ANCS của Apple trên BLE
# Android cho phép → app đọc trực tiếp

§ 02Highlights

  • Parser covering ~22 Vietnamese banks and wallets: amount, direction, note, balance, reference
  • Amount taken only from the bank-controlled region, before the note marker
  • Trust by Android package; Zalo needs a whitelist because official accounts share its package
  • Deduplication by transaction reference, falling back to a time window
  • ESP32 reads ANCS over BLE for iPhone — nothing to install on the phone
  • First-run setup over a hotspot, stored in NVS; no hardcoded WiFi or token

§ 03Screens

BankBridge01