Private
Public Access
1
0

Kordophone Monorepo

Kordophone is an iMessage bridge: a lightweight server runs on a Mac and exposes an HTTP API so nonApple devices can send/receive iMessages. A set of clients (Android, Linux GTK, macOS Cocoa) talk to that API. A shared Rust library powers most clients, and a mock server helps local testing.

Important: Interfacing with iMessage on macOS involves private APIs and restricted entitlements. See server/README.md for details and safety notes.

Repository Layout

Toplevel projects in this monorepo:

  • server/ — macOS daemon that bridges to iMessage and exposes an HTTP REST API. Written in ObjectiveC/Cocoa. See server/README.md.
  • core/ — Rust workspace with the shared Kordophone client library and related tooling. Used by gtk/ and osx/.
  • gtk/ — GTK4/Libadwaita Linux desktop client built on the Rust core library.
  • osx/ — macOS Cocoa client that uses the Rust core library and talks to the local Kordophone client daemon via XPC.
  • android/ — Android client. Currently implements its own API client (does not use the Rust library yet).
  • mock/ — Gobased mock server that emulates a Mac running the Kordophone server, for local development and tests.

Quick links:

  • Server (mac daemon): server/
  • Core (Rust workspace): core/
  • GTK client (Linux): gtk/
  • macOS client (Cocoa): osx/
  • Android client: android/
  • Mock server (Go): mock/

How It Works

  1. The macOS Kordophone Server (server/) runs on a Mac with iMessage and exposes an HTTP/JSON API and a WebSocket/updates channel.
  2. Clients connect to that server to list conversations, fetch/send messages, upload/download attachments, and receive live updates.
  3. A Rust library in core/kordophone implements the wire protocol and client behaviors. Linux/macOS clients use this library directly; Android currently ships a native Kotlin client.
  4. The Rust client daemon (core/kordophoned) provides local caching and IPC (DBus on Linux, XPC on macOS) for GUI apps.
  5. The mock/ server simulates the server API for local development without a Mac.

Getting Started

You can try the clients quickly against the mock server.

  1. Run the mock server (no auth):
cd mock
go run ./...               # or: make; ./kordophone-mock

The mock server listens on http://localhost:5738.

  1. Point a client at the mock server:
  • Android: open Settings in the app and set the server host to http://10.0.2.2:5738 (Android emulator) or http://<your-host-ip>:5738 if running on device. Disable auth unless you started the mock with --auth.
  • GTK (Linux): build and run the GTK app from gtk/ (see its README) and configure it to use the local daemon backed by the server URL.
  • macOS (Cocoa): build the app in osx/ (see osx/README.md).

To use a real Mac server instead, set your clients server URL to the host running server/ with the correct scheme/port and authentication.

Building

Below are brief notes. Each subprojects README has more detail.

  • Server (macOS): open server/MessagesBridge.xcodeproj in Xcode. See server/README.md for entitlements, SSL, and running.
  • Core (Rust): install Rust (stable) and run cargo build inside core/. See core/README.md.
  • GTK (Linux): see gtk/README.md for RPM build via rpmbuild -ba dist/rpm/kordophone.spec.
  • macOS (Cocoa): open osx/kordophone2.xcodeproj in Xcode. See osx/README.md.
  • Android: open android/ in Android Studio and build. See android/README.md for configuration.
  • Mock server (Go): cd mock && go run ./... or make.

Security and Entitlements

The macOS server uses private APIs and restricted entitlements. On production macOS builds, processes with restricted entitlements can be killed by the kernel; development requires workarounds (e.g., swizzling, hooking imagent) and careful code signing. See server/README.md for instructions and caveats.

Status

  • Android client: ships its own API client (not yet using Rust core).
  • GTK + macOS clients: use the Rust core library and integrate with the kordophoned client daemon for caching/IPC.
  • Mock server: useful for development; implements common endpoints and WebSocket updates.

Contributing

Issues and PRs are welcome. If you add a new client or endpoint, please update relevant READMEs and link it from this root README. Prefer small, focused changes and keep style consistent with the existing code.

Description
The Kordophone monorepo.
Readme 24 MiB
2025-09-08 01:20:24 +00:00
Languages
Objective-C 38.8%
Rust 29.5%
Kotlin 11.9%
Vala 8.3%
Swift 5.8%
Other 5.5%