How cr-zhichen/djonehubnative works
DJOneHub is a native macOS manager for DJI’s first-generation 4G module. A user works through SwiftUI screens; app stores make requests over a Unix-domain-socket HTTP API, whose Go backend coordinates module operations and returns status or operation results. The product spans device/network status, SMS, eSIM profiles, calls/audio, and traffic routing, with diagnostics and a CLI as additional access paths. The README documents these capabilities; sampled excerpts support selected routing, eSIM, modem, and CLI details, so uncertain internal wiring is omitted.
Main entry points: APIClient.swift API client · main.go HTTP API · CallView.swift Call screen · HomeView.swift Home and status
Components 25
macOS app
- Home and status
app/Sources/Views/HomeView.swift - Dashboard state
app/Sources/DashboardStore.swift - SMS screen
app/Sources/Views/SMSView.swift - SMS state
app/Sources/SMSStore.swift - eSIM screen
app/Sources/Views/ESIMView.swift - eSIM state
app/Sources/ESIMStore.swift - Call screen
app/Sources/Views/CallView.swift - Incoming call
app/Sources/AttentionStore.swift - Audio bridge
app/Sources/AudioBridge.swift - API client
app/Sources/APIClient.swift - Backend process
app/Sources/BackendProcess.swift - Routing screen
app/Sources/Views/TrafficRoutingView.swift - Routing state
app/Sources/RoutingStore.swift - Diagnostics screen
app/Sources/Views/DiagnosticsView.swift
Backend API
- HTTP API
backend/cmd/djonehub-macos/main.go - SMS archive
backend/cmd/djonehub-macos/main.go
Module operations
- Modem control
backend/internal/modem/manager.go - eSIM manager
backend/internal/esim/manager.go
Traffic routing
- Routing manager
backend/cmd/djonehub-macos/network_routing.go - Privileged service
backend/cmd/djonehub-routing-helper/main.go
Additional access
- CLI client
backend/cmd/djonehub-cli/client.go - CLI access setup
app/Sources/CLIIntegrationManager.swift
Other components
- Mac user
- DJI 4G module
- Network core
Connections 31
- Mac user → Home and status: views status
- Home and status → Dashboard state: updates state
- Dashboard state → API client: requests data
- Mac user → SMS screen: manages messages
- SMS screen → SMS state: updates state
- SMS state → API client: requests SMS
- Mac user → eSIM screen: manages profiles
- eSIM screen → eSIM state: updates state
- eSIM state → API client: requests profiles
- Mac user → Call screen: controls calls
- Call screen → API client: sends call actions
- Incoming call → API client: fetches call state
- Call screen → Audio bridge: bridges voice
- Backend process → HTTP API: starts process
- API client → HTTP API: Unix socket HTTP
- HTTP API → Modem control: controls module
- HTTP API → eSIM manager: manages profiles
- Modem control → DJI 4G module: sends modem commands
- eSIM manager → DJI 4G module: uses card channel
- HTTP API → SMS archive: persists archive
- Mac user → Routing screen: configures routing
- Routing screen → Routing state: updates state
- Routing state → API client: reads and configures
- HTTP API → Routing manager: dispatches routing
- Routing manager → Privileged service: controls privileged core
- Privileged service → Network core: starts core
- Mac user → Diagnostics screen: runs diagnostics
- Diagnostics screen → API client: requests diagnostics
- Mac user → CLI client: runs commands
- CLI client → HTTP API: Unix socket HTTP
- Mac user → CLI access setup: enables CLI access