fix(darwin): fall back when CoreWLAN lacks permission - #191
Conversation
|
@Herby9000 is the fallback only necessary for the scanning condition? Or is all the functionality by CoreWLAN more restrictive than our previous v0.13.0 tagged darwin backend implementation and we should revert the CoreWLAN changes? Can you do an analysis to see if CoreWLAN is worth it? What are the pros/cons? |
|
I compared the current backend, v0.13.0, and the live behavior on the same Apple Silicon/macOS 26.5.2 host. Scope: CoreWLAN is scan-onlyCoreWLAN is only used by
So the Location Services restriction does not affect joining, forgetting, toggling Wi-Fi, preferred-network enumeration, or keychain operations through CoreWLAN; those paths do not use CoreWLAN at all. The fallback only needs to replace visible-network scanning (and can supply active-state metadata when What CoreWLAN buys us
Costs / regressions
Live comparison (identifiers withheld)Three fresh runs each:
That confirms the hybrid's ~8s denied-path cost is almost entirely RecommendationI would not revert the broader Darwin/CoreWLAN changes. Keep CoreWLAN primary and retain the narrowly scoped I would also consider allowing the same profiler fallback for One nuance: this keeps CoreWLAN "worth it" primarily as the preferred long-term scanner and richer data source. For today's ad-hoc CLI binaries, the profiler fallback will likely be the common path until distribution provides a stable signing identity and location authorization flow. |
Summary
system_profiler SPAirPortDataTypeonly when CoreWLAN reports Location Services / permission denialnetworksetup -getairportnetworkis also unavailableWhy
On an ad-hoc-signed CLI on macOS 26.5.2, CoreWLAN scanning is denied/redacted because the calling binary has no stable TCC Location Services authorization. The previous
system_profilerbackend still returns visible and current-network information because it runs as an Apple platform binary.A CoreWLAN-only implementation therefore regresses from one active/visible network to none in the same execution context. A stable signed helper/app with an interactive location authorization flow could make pure CoreWLAN work, but that changes the project's distribution and UX. This patch keeps the fast native path for authorized callers while restoring compatibility for ordinary CLI builds.
Live verification
Apple Silicon, macOS 26.5.2, ad-hoc/linker-signed binary. SSIDs were redacted from the report:
The number of nearby networks varied during repeated scans, but active-state recovery and valid JSON output were stable.
Tests
Added coverage for:
errors.Isawdl, containing:, or matching profiler section labelsSecurityUnknownFollow-up to #190.