r/PinoyProgrammer • u/Able-Cauliflower-920 • 12d ago
Show Case [Project] 2nd-year CS student here, I reverse-engineered Samsung's Continuity protocol in Rust so Galaxy Buds Auto Switch works on Linux
Enable HLS to view with audio, or disable this notification
GitHub (v1.0.0, GPLv3): https://github.com/Eddie02345/seuil
I'm a 2nd-year BSCS student daily-driving Arch Linux (Hyprland), and one annoyance I kept running into while studying was having to manually disconnect and reconnect my Galaxy Buds every time I switched between my laptop and my phone. Samsung locks Auto Switch to One UI devices and Windows Galaxy Books, so Linux gets left out.
I ended up spending a few weeks sniffing Bluetooth traffic and Android logs to figure out how Samsung's Continuity service (`mcfds`) coordinates the switch, then wrote seuil, a Rust daemon that lets Linux act like a supported peer.
How it works:
- When PipeWire detects an active audio stream or MPRIS reports playback on Linux, `seuil` opens an authenticated L2CAP CoC channel (PSM 128) to the phone and sends the switch command. The phone pauses its media and releases the Buds, and BlueZ pulls the A2DP connection to the laptop.
- When media starts or a call comes in on the phone, `seuil` updates its BLE `0x0075` manufacturer advertisement to yield ownership, pauses Linux playback via MPRIS, and drops the audio link with a 5-second cooldown to prevent ping-ponging.
This was my first time working this close to the Linux Bluetooth and audio stack (`bluer`, D-Bus, PipeWire, P-256 ECDH + AES-256-GCM/CBC framing, and rotating 12-hour XOR advertisement keys). I also set up GitHub Actions to build `.pkg.tar.zst` packages for Arch alongside tarballs for Debian/Ubuntu and Fedora.
For transparency: I used OpenCode to help scaffold parts of the Rust codebase, unit tests, and protocol documentation. I did the reverse engineering, packet captures, and live hardware debugging myself on a Galaxy A57 and Galaxy Buds Core.
Would appreciate any feedback on the Rust code, Linux packaging, or how to frame low-level projects like this on a resume. If anyone here uses Linux with Galaxy Buds, feel free to try it out and open an issue if anything breaks.
4
u/Goldillux 12d ago
windows when 👉🏻👈🏻
6
u/VenAlexxanderson 12d ago
holy shit, cool REA project bro! I use Galaxy Buds but I switched out of the Samsung ecosystem a few years back so I wasn't aware that they have their own continuity protocol. I'm not familiar with the tech but I wanna ask, would this also be possible in windows theoretically?
3
u/ChrisPugsworth 12d ago
good work but have you heard of REA by morluto? you couldve used that to spend more time in the other aspect of your project and less more on the reverse engineering aspect of it
35
u/norwegian 12d ago
This is next level, even with ai. Much further ahead than I was in my second year.
16
u/yevelnad 12d ago
Even if I don't like AI but it is a cool project. Bro kids these days are on another level. Keep it up.
3
u/dexc_draws 12d ago
Galing
3
u/DeonHolo 12d ago
This is the type of REA projects I have been waiting for, small niche tools that fixes a specific problem.
1
u/OldAd8949 9d ago
Wtf my huawei buds does this? The other brands doesnt? LOL
1
u/maubrick 8d ago
Nice way to Rick Roll us