gzl.dev/blog
field notes, mostly
18 posts
August 27, 2026
7 min
Nine ways to say yes
I taught a Light Phone to speak an Oura ring's protocol over BLE. Then I spent a week failing to tap a button that doesn't exist.
Light PhoneBrightOuraBluetoothAndroid
August 21, 2026
6 min
Field notes on LightOS
What the Light Phone III's OS actually is underneath: Android with the Google removed, hardware that talks in key events, and conventions nobody voted on.
Light PhoneLightOSAndroid
August 21, 2026
1 min
A tape recorder, not a voice recorder
BrightRecorder: clips named for where and when, tapes that are just folders of WAVs, and the wheel finally doing the job it was born for.
Light PhoneBrightRecorder
August 18, 2026
2 min
Why I put an app store on a phone designed to have none
Yes, I see the irony. The argument for building it, why there's no server behind it, and the afternoon I accidentally dropped everyone's apps from the index.
Light PhoneBrightMarket
August 14, 2026
2 min
A good fork says thank you
A lot of what I ship is other people's work with my name nearer the top than it deserves. Some rules I try to fork by.
Light Phoneopen source
August 11, 2026
2 min
My bug reports file themselves
Shake the phone three times and the app files its own GitHub issue. Then an AI triages the queue every hour — under strict instructions that guessing is worse than waiting.
Light PhoneAItooling
August 8, 2026
2 min
Fifteen copies of the same file
The least interesting code I maintain is the code I'd save first in a fire. On finally building the shared library.
Light PhoneKotlin
August 8, 2026
2 min
BrightMarket is out
The app store ships: browse on a desktop, install by QR, track updates on the phone, and get your own app into the catalog.
Light PhoneBrightMarket
August 7, 2026
2 min
One column of scores
Twenty-two leagues from four keyless public APIs, in one grayscale column. How BrightSports gets scores with no account and no push.
Light PhoneBrightSports
August 6, 2026
3 min
The MetroCard inside my phone
I dissolved a transit card in acetone and moved its nervous system into the battery compartment. Tap-to-pay is back, sort of.
Light PhonehardwareNFC
August 6, 2026
2 min
Every button does what you tell it to
The follow-up to the keylayout post: BrightControl itself, why the defaults took longer than the code, and the trust problem with accessibility services.
Light PhoneBrightControldesign
August 5, 2026
1 min
Roll is out
The camera app ships: a filter wheel on real hardware, purikura with four-shot strips, date backs, and a privacy lesson from launch day.
Light PhoneRoll
August 4, 2026
2 min
The keylayout file Light left behind
The scroll wheel is just key events. Everything I learned reading Generic.kl off the phone, and the accessibility service that became BrightControl.
Light PhoneAndroid
August 2, 2026
3 min
Rewriting the camera
Roll's whole design is one gesture, stolen from a contact sheet. Plus the filters that got away from me — purikura on a monochrome phone, and datamoshing experiments that mostly produce mud.
Light Phonedesign
July 29, 2026
1 min
A QR scanner, and its desktop twin
The modern world hands you addresses as QR codes and the Light Phone couldn't read them. A scanner for the phone, a generator page for every other screen.
Light PhoneLightQR
March 22, 2026
1 min
BasilNet, a year later
What broke, what I'd trim, and how the media server quietly became infrastructure for everything else I build.
Dockerhomelabself-hosting
March 8, 2026
1 min
I built a bad DSLR on purpose
It took worse pictures than my phone. It's one of the most useful things I've ever built.
hardwarephotography
January 10, 2025
1 min
Building BasilNet: My Home Server Stack
How I built a 15-service media server with Docker Compose, Gluetun VPN, and Home Assistant integrations.
Dockerhomelabself-hosting
← all posts
August 8, 2026 · 2 min

Fifteen copies of the same file

Light PhoneKotlin

This is a post about the least interesting code I maintain, which is also the code I’d save first in a fire.

At some point I looked up and had a lot of Light Phone apps. Every one of them needs the same plumbing: handle the hardware keys, drive the scroll wheel, draw text in the phone’s type and color system, run the shake-to-report machinery. And every one of them had its own copy. LightKeys.kt was byte-identical in fifteen repos. The wheel handling existed in about ten variants across twenty — not because ten variants were needed, but because each copy drifted a little after it was pasted.

You can guess the failure mode. A fix to the wheel meant twenty edits, so the fix got made once, in whichever app I happened to be in, and the other nineteen kept the bug. Multiply by every shared component and the collection was slowly turning into an archaeology site where you could date each app by which bugs it still had.

The part that actually convinced me

Tidiness alone never gets me to do a refactor this dull. What did it was porting the report module into the older apps by hand — the same feature, wired into ten repos by pattern-matching against a reference implementation. Eight of the ten ended up subtly wrong. Not broken-wrong, CI-catches-it-eventually wrong. Same feature, ten bespoke wirings, eight quiet mistakes.

That’s not a tidiness problem, that’s a correctness problem. Copy-paste isn’t just harder to maintain; it’s a machine for manufacturing bugs that all look slightly different.

So the shared pieces moved into one library, published to GitHub Packages, and every app pulls it in as a dependency like anything else.

Small design notes from a small library

A couple of decisions I’d defend:

One call, no partial states. LightReport.install(...) sets up reporting and arms the crash handler. There’s no way to end up with an app where shake-to-report works but crash capture doesn’t, because there’s no second call to forget.

Inert by default. Skip the install call entirely and the whole feature is dead weight — the overlay renders nothing, nothing is queued. An app can adopt the library without adopting every feature in it.

The overlay is a sibling, not a wrapper. It draws in its own window, so it doesn’t care what layout it’s called from, and adopting it doesn’t mean restructuring your UI tree.

One honest annoyance for anyone tempted to do the same: GitHub Packages requires authentication even for public packages. There’s no anonymous read. Every consumer needs a token with read:packages, which for a hobby ecosystem is pure friction with no upside I can find.

None of this is novel. Shared libraries are the oldest idea in software, and “don’t repeat yourself” is on the first page of every book. But there’s a difference between knowing the advice and watching eight hand-ports go subtly wrong in one afternoon. Now a wheel fix is one edit and a version bump, and the apps stopped drifting apart. Boring work. Recommend it.