I’m going to do something different in this post. I typically have AI help write the blog post since writing isn't what I want to spend my time doing. But this weekend, I've been listening to a lot of Steve Yegge articles and in one of them he specified how he doesn't let AI write his blog posts since agents aren't that great at doing it. And I agree. The posts, that I've let AIs generate entirely, read like AI slop. I really should go back and rewrite them in my own words. I'll add a backlog item for that.
Step 1: Android AutoOTP
While working on the NCI Field Report website, I was having to copy a lot of one time passwords (OTPs) from Gmail to login. I eventually created a UI with password login so I could use auto fill, but this wasn’t part of the requirements, so it’s only accessible by route and requires an extra step when testing on mobile to type in this route, especially when you’re testing on Vercel preview environments. But this prompted me to think about how iPhones can copy OTPs from the mail app and auto fill them into the input. I also have an app called FilterBox that copies OTPs from Google Messages to clipboard. Although, it doesn't auto fill. So last weekend, I created an an Android app to copy OTPs from any notification. The app works by listening to notifications, reading the content, and copying 4-8 digit strings.

One of the edge cases I ran into right away was a Spotify notification containing a song that had 1007 in the title. My app would repeatedly copy 1007 to clipboard since Spotify notifications update every second. I initially considered just limiting it to Gmail, since that is the reason I built the app, but since software is so cheap to produce right now, I decided to try both approaches and stuck with the more complex approach of letting the user select which app they want to listen to for flexibility. Initially, all app and services are selected. I included options to clear all app selections or to select all at any point. I also included a search bar to filter app titles by keyword.
Step 2: Attempt at MacOS AutoOTP
The following weekend, I decided to create a native MacOS app that essentially does the same thing. Reads notifications and copies 4-8 digit strings from them. Unfortunately, on the later versions of MacOS, notifications aren't accessible by app or cli. After some research, I stumbled across a way to access just the notifications that are currently displayed by reading a sqlite db on the filesystem. But to get the OTP to display in a notification meant that I had to use the mail client since Gmail doesn't include the body in the browser notification. Also, Google Messages notifications are incredibly flaky and don't always come through. Probably doesn’t help that Arc sleeps bookmarks that aren’t being used often. I tried to access Mail directly like you can with iMessage data, but I couldn't find a way to do that. One pain point I found is that Mail notifications come 5-10 seconds after Gmail receives the email. So while you're waiting for an OTP and it would've been quicker to just open Gmail and manually copy the OTP, you think there has to be a better way. The MacOS app just wasn't going to do the trick. I also tried using other apps that have solved this problem in the past MessAuto and 2fhey. But they didn't work for my uses cases. So I started looking into other apps to see how they handle reading notifications. I specifically looked into Raycast and their extension marketplace to see if there were any notifications managers that I could read from.
Step 3: AirSync
That's when I discovered AirSync. AirSync connects your android device to your Mac and has all sorts of cool features like screen mirroring and media control. But one feature that caught my eye was a feature where it syncs Android notifications to Mac. Perfect! I could update my app to read these notifications instead of the Mac notifications. I also noticed a setting called Clipboard sync. Clipboard sync is the idea that you sync the clipboard on your Android device with the clipboard on your Mac. Any text you copy on your phone is paste-able on your Mac and vice versa. It's a revolutionary idea that would prevent the need to have a MacOS app at all for reading notifications since I have a perfectly good otp copying android app. Unfortunately, the setting in AirSync does not work. But this finding pushed me to search for other apps that did the same thing.
Step 4: ClipSync
That's when I discovered ClipSync. An app that was released 6 days ago. Man what a perfect time to be solving this problem. ClipSync is a system where you install an android app and a MacOS app then scan a QR code created by the MacOS app to create an end-to-end encrypted pairing that's stored in a Firestore. Now each time you copy text to your clipboard, the app saves that clipboard item to the Firestore and using a web socket connection, updates the clipboard on the other device. This approach worked well but I took a peek under the hood since the code was available on GitHub and found that they were using Firebase. I've heard horror stories of entire Firebase databases being leaked due to Firebase encouraging bad practices around security so for the sake of security and wanting to learn how the system works, I forked the project and rewrote it to use Convex instead. There were also some bugs and UI elements that didn't do anything, so I fixed these bugs and removed/replaced the UI elements. Now I have complete control over the database, backend, and client apps. There are still some bugs that I'll be working on to fix over the next few days but overall the app solves the problem I was having where I wanted OTPs to automatically save to my clipboard on both Android and MacOS.
Sources:
Steve Yegge’s articles: https://steve-yegge.medium.com/
Specific Yegge article where he discusses avoiding AI writing slop despite being heavily into AI coding: https://steve-yegge.medium.com/the-future-of-coding-agents-e9451a84207c
Android AutoOTP: https://github.com/kalenwallin/android-otp-copy
MessAuto: https://github.com/LeeeSe/MessAuto
My version of ClipSync called OTPSync can be found here: https://github.com/kalenwallin/OTPSync
