Problem
The Mac app re-prompts for admin credentials repeatedly instead of authorizing once and running for months. Also, the prompt is password-only (no TouchID).
Root cause (audited 2026-08-22)
- Install path uses
osascript "do shell script ... with administrator privileges" (PrivilegeHelperClient.swift installHelper()). osascript admin prompts are password-only - macOS never offers TouchID for them - and the admin auth cache expires ~5 minutes per process.
installationIsComplete has no version awareness: it checks reachability + file existence. Any app rebuild ships a new helper binary; if the installed daemon's protocol handshake fails (or binaries drift), the app reinstalls = new prompt. Dev builds are ad-hoc signed, so macOS treats every build as a different app.
- The helper daemon itself is stable (launchd shows running-since-boot, never exited) - the daemon architecture is fine; only the install/authorization flow needs work.
Fix plan
- Migrate to
SMAppService.daemon.register() (macOS 13+; we require newer anyway). The system remembers the approval keyed to code signature, and the authorization dialog supports TouchID.
- Stable code signing: sign app + helpers with the Apple Development identity in
build.sh instead of ad-hoc, so updates keep the same identity and approvals persist across versions.
- Version-stamped install handshake: helper writes protocolVersion + build hash to disk at install; app reinstalls only when actually incompatible (not on every rebuild).
- Scheduled auto-scans already run through the root helper via LaunchAgent, so once 1-3 land: one TouchID approval, then months of silent operation.
Current working state (for reference)
- Daemon active:
com.techmore.nmapui.nmap-helper (running since boot, 0 crashes)
- Root nmap copy:
/Library/PrivilegedHelperTools/com.techmore.nmapui.nmap
- XPC contract: protocolVersion 4
Problem
The Mac app re-prompts for admin credentials repeatedly instead of authorizing once and running for months. Also, the prompt is password-only (no TouchID).
Root cause (audited 2026-08-22)
osascript "do shell script ... with administrator privileges"(PrivilegeHelperClient.swiftinstallHelper()). osascript admin prompts are password-only - macOS never offers TouchID for them - and the admin auth cache expires ~5 minutes per process.installationIsCompletehas no version awareness: it checks reachability + file existence. Any app rebuild ships a new helper binary; if the installed daemon's protocol handshake fails (or binaries drift), the app reinstalls = new prompt. Dev builds are ad-hoc signed, so macOS treats every build as a different app.Fix plan
SMAppService.daemon.register()(macOS 13+; we require newer anyway). The system remembers the approval keyed to code signature, and the authorization dialog supports TouchID.build.shinstead of ad-hoc, so updates keep the same identity and approvals persist across versions.Current working state (for reference)
com.techmore.nmapui.nmap-helper(running since boot, 0 crashes)/Library/PrivilegedHelperTools/com.techmore.nmapui.nmap