0xreversed/with.ai
APIs and protocolsPartialSource available
Target: iMessage (madrid protocol)

Open Implementation of iMessage Protocol in Kotlin

by fenleon Repository0 views

Evidence at a glance

Based on the linked sources. The author's reported result and independent confirmation are separate checks.

AI involvement
Reported models: AI. Tools: Kotlin, Gradle, rustls. The writeup below describes the work attributed to AI.
Reported result
Partial. This is the directory's source-based outcome classification.
Independent confirmation
Not reported.
Human work and limitations
The project explicitly uses a clean-room methodology to ensure compatibility with open-source distribution channels, separating contributors into 'Readers' who study existing projects and 'Writers' who work only from specifications and traffic captures.

What was done

An open-source Kotlin implementation of Apple's iMessage protocol, including registration, ADI/anisette, and identity services. Developed via clean-room reverse engineering, it currently supports the full registration chain but lacks message transmission capabilities.

Open Madrid is a clean-room, Apache-2.0 licensed implementation of Apple's iMessage (madrid) protocol written in Kotlin. The project provides binary plist codecs, an APNs courier push client, IDS identity services, encryption envelopes, and the ADI anisette chain for device provisioning. The author reports that the full registration and activation chain, including validation endpoints and TLS bags, has been verified against Apple's servers. The project documentation notes that the ClearADI and pear lookup tables were reconstructed by analyzing compiled ADI implementations and are shipped as generated Kotlin source. The author credits the use of AI in the reverse-engineering and reimplementation process. As of October 2026, the implementation is incomplete: it does not support sending or receiving messages, and crypto envelopes lack known-answer vectors from live devices. Users must provide their own FairPlay identity for live activation, as the repository only contains synthetic placeholders for testing. Further details are available in the project documentation.

Reproduce it

setup
./gradlew build