device_helper asked AMDeviceNotificationSubscribeWithOptions for the RemoteXPC transport next to the USB mux. On macOS 27 (26A5388g) that replaces the mux transport instead of extending it: a cable-connected, paired iPhone fired no connected callback at all, only detach callbacks with a NULL device.
device_helper list therefore printed [], so the device check showed "No iPhone found. Please connect via USB." and the scanner reported "iPhone not found. Reconnect it via USB." A direct usbmuxd ListDevices call, ioreg and devicectl all listed the same device, and the same subscription without the option returned it immediately.
Move the options into Sources/device_discovery.h so the transport set is testable, and add tests/test_device_discovery.py, which fails if RemoteXPC is requested again.
Validated on macOS 27.0 (26A5388g) with an iPhone 16 Pro on iOS 27.0 (24A5370h): list, probe and syslog all reach the device. See docs/device-detection.md.
Track a SHA-256 of each card's assigned skin and remember, per device,
which skin was last flashed successfully. Flash Skins now writes only
changed cards; when nothing changed it offers Re-flash All.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Python backend lives inside the bundle, so Python writes __pycache__ into
Contents/Resources the first time the app talks to it, and the bundle no longer
matches what was signed:
before: build/AirCard.app: valid on disk
after: build/AirCard.app: a sealed resource is missing or invalid
Ad-hoc that is mostly untidy, but for a Developer ID build it means a signature
that stops verifying as soon as someone uses the app. Setting
PYTHONDONTWRITEBYTECODE for the backend keeps the bundle as it was signed;
losing the .pyc cache costs a few milliseconds on scripts this size.
Prepared images went to /tmp/aircard_prep_<index>.png, a fixed path reused on
every run. Neither the Swift preparation nor the Python fallback reports whether
it worked, and nothing checked the file afterwards, so an image the app could
not read left the previous run's file sitting at that path and it was flashed
onto the card instead. The run then reported Complete, because the backend write
itself had succeeded.
Each run now prepares into its own directory, which is removed afterwards, and
the prepared file is checked before anything is written to the device. A card
whose artwork cannot be prepared is skipped and the run reports as failed rather
than putting the wrong picture on someone's card.
There is no Swift test target in the repo, so this is a compile and a read of
the loop rather than a test.
The helpers are compiled with no minimum version, so they inherit whatever
macOS produced them. Built here they come out at macOS 27, while Info.plist
promises 12.0 and the Swift binary is compiled for 14.0. Anyone below the build
machine's version downloads an app that cannot talk to a device at all.
The Swift really does need 14: onChange(of:initial:) is 14+ and fontWeight is
13+, so 12.0 was never true. The plist now says 14.0, the helpers are built for
14.0, and the build checks the binaries against that claim afterwards rather
than trusting it. Verified the check fails when the minimum is removed again.
Lowering the whole thing to 12.0 instead would mean rewriting those SwiftUI
calls, which seemed like a separate decision to make.
errorMessage is set in thirteen places and no view ever read it. Every one of
those messages — no iPhone connected, no skin assigned, the theme could not be
packaged — was written and thrown away, so an action would simply do nothing
with no explanation. It is bound to an alert now, and cleared when dismissed.
Device detection also reported a backend that could not run as "No iPhone
found. Please connect via USB.", which sends people to replug a phone that was
never the problem. That path now says detection could not run, and puts the raw
output in the log.
While here: a passcode flash judged success on exitCode == 0 && errorMessage ==
nil. Since nothing ever cleared errorMessage, one earlier failure made every
later successful flash report as failed. Success now depends on the exit code of
the run that just happened.