Add macOS menu bar application support#11
Conversation
- Add macOS GUI with menu bar icon using pystray - Native AppleScript dialogs for settings (Tkinter threading workaround) - BLE device scanning with selection list - Build system: PyInstaller spec, entitlements, Info.plist - Build scripts: build.sh, notarize.sh for signing/notarization - CI/CD: PR build tests, release workflow with code signing - Documentation: MACOS_GUI.md user guide, build README - Update main README with macOS platform support Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: Add macOS Menu Bar Application SupportGreat addition overall — macOS parity with the Windows GUI is a meaningful feature, and the packaging (DMG, signing, notarization CI) is thorough. Several issues worth addressing before merge. Security: AppleScript Injection
User-controlled strings are interpolated directly into AppleScript via f-strings with no escaping. If a message or title contains double-quotes, the AppleScript string breaks. More critically, device names from BLE scan are inserted into AppleScript like this: A maliciously named BLE device could inject into the AppleScript string and potentially execute arbitrary shell commands via Fix: Sanitize all strings before AppleScript interpolation. At minimum escape backslashes and double-quotes before inserting any variable into an AppleScript string. Dead Code: SettingsDialog (Tkinter) Is Never Used
This is presumably because Tkinter needs the main thread, which pystray owns on macOS. Either remove Missing Cache Settings in AppleScript Flow
CI: Massive Duplication in
|
| Priority | Issue |
|---|---|
| High | AppleScript injection via unescaped user/device data |
| Medium | Dead code: Tkinter SettingsDialog is never shown |
| Medium | Cache settings not configurable through any live code path |
| Medium | ~250 line CI duplication; pyinstaller unpinned; action not SHA-pinned |
| Low | Redundant imports inside functions |
The core bridge logic and async architecture look solid. The injection risk in AppleScript interpolation is the main item to fix before merge.
Generated with Claude Code
Summary
Info.plist, entitlements, andbuild.sh/notarize.shfor codesigning + notarizationrelease-macos.ymlworkflow (signed/notarized releases) and extendstest.ymlwith macOS build checks; includesdocs/MACOS_GUI.mduser guideTest plan
build/macos/build.shproduces a working.appbundle0.0.0.0:4403notarize.shdry-run validates signing config (smoke test only unless creds available)🤖 Generated with Claude Code