I Built a Rust-Powered Diff Sync Engine to Fix Android↔Mac Sync [Mac Only]
<p><a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qvxtn2g8vw6femmqj07.png" class="article-body-image-wrapper"><img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3qvxtn2g8vw6femmqj07.png" alt=" "></a><br> <a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyj95pja7wu2aw33a3ki6.png" class="article-body-image-wrapper"><img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravit
Why I Built This
You get back from a trip and try to back up your photos from Android to Mac.
When did I last back up? How far did I get?
You don't know, so you send everything. Duplicates pile up. Storage gets wasted. You do it all again next time...
Sound familiar?
-
"I have no idea what's already backed up, so I just send everything every time"
-
"I used a sync tool and accidentally deleted an entire folder of important files"
-
"I transferred hundreds of photos and half of them were already on my Mac"
"Never transfer the same file twice. Build a tool that does exactly that." — that's where this project started.
What I Built
Hiyoko Sync — a Mac-only Android differential sync app.
https://hiyokoko.gumroad.com/l/HiyokoSync
30-day money-back guarantee, no questions asked.
Key Features
The core is a differential sync engine that compares file size and modification date, and transfers only what's new or changed.
Sync
-
Differential sync engine: Compares file size and modification date — already transferred files are automatically skipped
-
Multiple sync jobs: Create named rules like "Photos → Mac" or "Music → Android" and run them all in one click
-
DCIM mode: One-click backup of your entire Android camera folder to Mac — perfect after a trip
-
Auto-sync on connect: Plug in the cable and sync starts automatically. No button pressing required
-
Conflict resolution dashboard: Files with the same name but different content are listed before anything is moved. Choose Ask / Overwrite / Skip / Auto-Rename
-
Exclusion rules: Automatically skip system noise like .DS_Store. Add your own patterns too
-
System path protection: Writing to critical macOS directories (~/Library, ~/.ssh, etc.) is blocked at the app level
Review & Logs
-
Pre-flight review: Before any files move, a summary shows exactly how many will be added, skipped, or overwritten. You decide when to proceed
-
Sync history log: Full transfer history, exportable as CSV
-
Real-time progress: Live speed graph and ETA
System Requirements
-
macOS 13 Ventura or later
-
Intel Mac / Apple Silicon (Universal Binary)
-
Android 10–16
Verified Devices
Physically tested — confirmed working
-
Xiaomi: Redmi K70, Mi 11 Lite 5G, Xiaomi Pad 5, Redmi 12 5G
-
POCO: X7 Pro, F6
-
Rakuten: Rakuten Mini
Expected to work — not yet physically tested
- Samsung / Google Pixel / Xperia / Huawei / Motorola and other major Android brands
Roadmap
v1 focuses on one-way sync (Android → Mac) and core reliability.
Feature v1 v2
One-way sync ✅ ✅
Bidirectional sync — ✅
Scheduled / automatic sync — ✅
Advanced exclusion rule patterns — ✅
Try It Out
🐤 Hiyoko Sync
https://hiyokoko.gumroad.com/l/HiyokoSync
-
🎉 Early bird $10 (reg. $12) — 2 weeks only
-
One-time purchase
-
30-day money-back guarantee, no questions asked
-
Bug reports & feature requests:
🇯🇵 Japanese form: https://forms.gle/cEDCJScbarfEcnHU8
🇺🇸 English form: https://docs.google.com/forms/d/e/1FAIpQLSe68YFnPtm1JVXN4GpUDRHvkuhaw9l-QGSlXT4GD_qeeuOe5w/viewform
- Official X: https://x.com/hiyoyok
Hope it reaches someone with the same frustration! 🐤
The rest is technical detail for engineers. Feel free to skip if you just want to use the app!
Tech Stack
Technology Role
Rust Diff engine & MTP stack
Tauri Desktop app framework
React UI
nusb Rust-native USB library, direct IOKit access
Tokio Async runtime
Why Rust + Tauri?
Both diff detection reliability and MTP transfer stability come down to memory safety and concurrency. With Rust, there's no risk of crashing mid-comparison on a large file tree, and diffing thousands of files is fast.
Tauri was chosen over Electron for its lighter footprint and closer-to-native macOS feel.
Technical Deep Dive
How the Diff Engine Works
Before moving a single byte, Hiyoko Sync builds a virtual file tree of both your Mac and Android folders. It compares file size and modification date to identify exactly what needs to be transferred.
1. Build Mac file tree 2. Build Android file tree (via MTP) 3. Diff by size + modification date 4. Queue only changed files for transfer 5. Show pre-flight review 6. Transfer after user confirmation1. Build Mac file tree 2. Build Android file tree (via MTP) 3. Diff by size + modification date 4. Queue only changed files for transfer 5. Show pre-flight review 6. Transfer after user confirmationEnter fullscreen mode
Exit fullscreen mode
This eliminates "send everything every time" at the root level.
The MTP Timestamp Problem
Due to MTP protocol constraints, file timestamps can be reset to the transfer time after syncing.
This creates a nasty loop with diff detection: "this file was already transferred, but the timestamp changed, so let's transfer it again."
To prevent this, file size is treated as the primary key and modification date as secondary — if the size matches, the file is considered identical.
Why I Switched from libmtp to nusb
libmtp was the starting point, but device recognition on macOS was broken.
libmtp was designed for Linux, where USB device handling works differently at a fundamental level.
libmtp (Linux-designed) ↓ libusb ↓ macOS IOKit ← conflict happens herelibmtp (Linux-designed) ↓ libusb ↓ macOS IOKit ← conflict happens hereEnter fullscreen mode
Exit fullscreen mode
The fix was switching to nusb.
Custom MTP stack (Rust) ↓ nusb (Rust-native, calls IOKit directly) ↓ macOS IOKit ← no conflict!Custom MTP stack (Rust) ↓ nusb (Rust-native, calls IOKit directly) ↓ macOS IOKit ← no conflict!Enter fullscreen mode
Exit fullscreen mode
nusb is a Rust-native USB library that calls IOKit directly on macOS. This same stack was proven in Hiyoko MTP and carried over to Sync as-is.
The Philosophy Behind Conflict Resolution
The scariest thing is an app that quietly decides to overwrite files on its own. If it overwrites a photo you can't get back, there's no undo.
In Hiyoko Sync, conflicting files are always listed before anything is touched. You decide how to handle each one. "APPLY TO ALL" is available for bulk decisions, but the default is always "Ask."
System Path Protection
Regardless of how a sync job is configured, writing to critical macOS paths like ~/Library or ~/.ssh is blocked at the app level. This prevents accidental system damage from misconfigured jobs.
What I Learned Shipping This
MTP's limitations are the app's problem to solve
MTP timestamp behavior varies wildly between devices. I could have documented it as "expected behavior" and moved on — but that breaks the user experience. Protocol limitations have to be absorbed in app logic. That was the key lesson here.
"Safe" means different things to different people
Early on I thought "please back up your data before using" was enough. But real safety is a design that doesn't break even if you make a mistake. The pre-flight review and system path protection both came from that realization.
The relationship between Hiyoko Sync and Hiyoko MTP
Hiyoko Sync reuses the MTP stack from Hiyoko MTP — the nusb-based protocol implementation, auto-reconnect logic, and transfer queue are essentially unchanged.
"Transfer-focused MTP" and "sync-focused Sync" — pick whichever fits your workflow. 🐤
Hope it reaches someone with the same frustration! 🐤
🐤 Check out Hiyoko MTP → https://hiyokoko.gumroad.com/l/HiyokoMTP
DEV Community
https://dev.to/hiyoyok/i-built-a-rust-powered-diff-sync-engine-to-fix-android-mac-sync-mac-only-5affSign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
availablefeaturereport
Microsoft to Invest $10 Billion in Japan on AI Infrastructure, Cybersecurity - WSJ
Microsoft to Invest $10 Billion in Japan on AI Infrastructure, Cybersecurity WSJ Microsoft to invest $10 billion in Japan for AI and cyber defence expansion Reuters Microsoft Drafts $10 Billion Investment Plan in AI-Hungry Japan Bloomberg.com Japan's Sakura Internet jumps 20% as Microsoft plans $10 billion AI push with SoftBank CNBC Microsoft deepens its commitment to Japan with $10 billion investment in AI infrastructure, cybersecurity, and workforce Microsoft Source Microsoft to invest $10 bil for Japan AI data centers Japan Today Microsoft to pour $10bn into Japan data centers, work with SoftBank on AI Nikkei Asia Microsoft to make $10 billion AI-related investment in Japan Japan Wire by Kyodo News
![Ml project user give dataset and I give best model [D] [P]](https://d2xsxph8kpxj0f.cloudfront.net/310419663032563854/konzwo8nGf8Z4uZsMefwMr/default-img-graph-nodes-a2pnJLpyKmDnxKWLd5BEAb.webp)
Ml project user give dataset and I give best model [D] [P]
Tl,dr : suggest me a solution to create a ai ml project where user will give his dataset as input and the project should give best model for the given dataset for the user. so that user can just use that model and train it using the dataset he have. hey so I work as a apprentice in a company, now mentor told me to build a project where use will give his dataset and I have to suggest a best model for that dataset. now what I started with was just taking data running in on multiple ml models and then suggesting the best performance model. but yes the models were few then from only those model suggestions will.be made. I told this approach to my mentor, she told no this is bad idea that everytime training ml models that to multiple and the suggesting the best model. she told me to make a data
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.

![I Built a Rust-Powered Diff Sync Engine to Fix Android↔Mac Sync [Mac Only]](https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8mtzfa7487k057dmbd5.png)



Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!