Under the hood
The technical story for the curious: how your devices pair, how every byte is encrypted, and how ClipSync keeps the network, not the app, as the only limit on speed.
The shape of it
- The Mac is the hub. It advertises itself on your local network over Bonjour, accepts connections from paired phones over WebSocket, and handles pairing.
- The phone is the client. It finds the Mac and connects, and reconnects on its own after sleep, network changes or app restarts.
- Everything is local. There's no relay server, no account and no internet requirement.
Pairing (one time)
- The Mac shows a QR code. It holds the Mac's id and name and a one-time 256-bit pairing key, plus optionally the Mac's address for networks where discovery is blocked. The code is valid for 2 minutes, for one use.
- The phone scans it and connects in pairing mode, sending a pairing request encrypted with that one-time key.
- The Mac asks you: "Pair with “Pixel 8”?"
- On Allow, the Mac generates a fresh 256-bit device key for this pair and sends it over the encrypted channel. The Mac stores it in the macOS Keychain; the phone stores it wrapped by the Android Keystore. The pairing key is discarded.
- From then on the phone connects as itself, and the Mac refuses any device it doesn't know.
Encryption
Every frame is encrypted with AES-256-GCM using the pair's device key. That covers both control messages and file data.
- Tampering: a modified frame fails authentication and the connection is closed.
- Replays: every message carries a unique id and a timestamp. Messages more than two minutes off, or already seen, are dropped.
- Hello check: after connecting, both sides exchange a hello naming the device and protocol version. A mismatch is refused.
- Implementation: on the Mac, encryption uses
ringwith the CPU's AES hardware instructions.
Every feature is switchable
- Clipboard, Files and Fast transfer are separate features, plus any extensions you add.
- On connect, both sides list what they have enabled. Only the features both sides have on are active.
- Turning a feature off on either side switches it off for that pair instantly, without reconnecting.
- Extensions are separate programs in any language that talk to the app with JSON over stdin/stdout. If one crashes, the app restarts it with backoff. It can never take the app down.
Clipboard sync
- The Mac checks the pasteboard's change counter: a cheap check that only runs while a phone is connected.
- New text goes to every connected device, never back to where it came from.
- Text that apps mark as concealed or transient (password managers) is never read or sent.
- Android doesn't let apps read the clipboard in the background, so phone → Mac is a deliberate tap: a Quick Settings tile, a notification button, the share sheet, or automatically while ClipSync is on screen.
- Limit: 1 MB of text.
File transfer
- Offer: the sender announces the name, size and type.
- Accept: the receiver accepts automatically or after asking you, and opens a temporary file.
- Stream: the data flows as 64 KB encrypted chunks with strictly increasing sequence numbers.
- Done: the sender sends the SHA-256 of the whole file. The receiver checks the size and hash, syncs to disk, and renames to the final name, never overwriting an existing file. A mismatch means the file is discarded and you're told.
- Either side can cancel at any time. A dropped connection cleans up the partial file, and the phone offers the file again after reconnecting.
Why it's fast
- A pipeline. One thread does large 1 MB disk reads and the SHA-256, another encrypts, and an I/O stage batches many frames into each network write. All three run at the same time.
- Zero-copy buffers and bounded queues. Memory stays flat for multi-GB files, and a slow receiver slows the sender down (backpressure) instead of piling up data.
- Hardware-accelerated encryption. The Mac's engine moves about 1.0–1.2 GB/s in loopback benchmarks, encryption included, so the network is the limit, never the app.
- On Android, reading and sending overlap the same way, the socket keeps up to 4 MB queued to keep fast Wi-Fi busy, and received files are written by a separate thread so the network never waits on the disk.
Fast transfer (direct link for big files)
The problem: through a home router, each byte crosses the air twice: phone → router → Mac. On a 2.4 GHz network that can mean only a few MB/s.
Why not AirDrop's method: AirDrop uses Apple's AWDL radio protocol, which Android can't speak, and macOS doesn't offer Wi-Fi Direct to apps.
ClipSync's answer, for files of 100 MB or more:
- The phone starts a Wi-Fi Direct group: a temporary private WPA2 network with a random name and password, new each session. It tries 5 GHz first, then specific 5 GHz channels, then any band. If Wi-Fi Direct can't start, it falls back to Android's local-only hotspot.
- The phone sends the credentials to the Mac over the existing encrypted link.
- The Mac joins it as a normal Wi-Fi client and announces itself with an encrypted beacon, sealed with the pair's key, so only your paired phone can read or trust it.
- The phone connects to the Mac over the direct link, and transfers run there.
- When both sides are idle, the phone closes the network. The Mac forgets it and macOS reconnects to your usual Wi-Fi.
Safety nets on the Mac
- The phone never connects within 30 seconds → back to your usual network.
- The direct network disappears, or the link drops for 10 seconds → back.
- 60 seconds with no traffic → back.
- Your usual network isn't back within 20 seconds → Wi-Fi is power-cycled once.
If anything prevents a direct link, the transfer continues over your normal Wi-Fi and a notification explains why in plain words. The trade-off: a Mac has one Wi-Fi radio, so its internet pauses for the duration. That's shown in a notification, and the feature can be turned off.
The Mac joins networks with the system's own tools, which need no Location permission. That matters because recent macOS hides Wi-Fi network names from apps without it.
Discovery and reconnection
- The Mac advertises itself over Bonjour/mDNS with its id and name. The phone only connects to Macs it has paired with.
- Keep-alive: one WebSocket ping every 60 seconds, chosen for battery. Two missed replies means the connection is dead.
- The Mac notices sleep, wake and network changes and announces itself again.
- If two connections from the same phone overlap (say, after a network switch), the newest one wins.
- Router blocking discovery? Connect by IP address instead.
Low power by design
- No polling timers while idle, apart from the 60-second keep-alive and a 30-second network check.
- The clipboard watcher only runs while a phone is connected, at low priority.
- macOS App Nap is allowed while idle. A keep-awake assertion is held only during transfers, so they run at full speed and the Mac doesn't sleep mid-transfer.
- On Android, discovery runs in short bursts that back off while the app is closed, reconnects back off from 1 second to 5 minutes, and wake and Wi-Fi locks are held only during transfers.
Tech stack
| Mac | Android | |
|---|---|---|
| Language | Rust core with no UI dependency, Tauri 2 shell | Kotlin, Jetpack Compose (Material You) |
| Networking | tokio, tokio-tungstenite, mdns-sd | WebSocket client, Android NSD |
| Crypto | ring (AES-256-GCM, SHA-256) | AES-256-GCM, key wrapped by Android Keystore |
| Key storage | macOS Keychain | Android Keystore, excluded from cloud backup |
| Requires | macOS 13 Ventura or later | Android 10 or newer (Fast transfer: 13+) |