Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifi_change event does not supply the SSID on Sonoma #407

Closed
FelixKratz opened this issue Oct 5, 2023 · 6 comments
Closed

wifi_change event does not supply the SSID on Sonoma #407

FelixKratz opened this issue Oct 5, 2023 · 6 comments
Labels
documentation Improvements or additions to documentation macOS version specific Problems that arise on certain macOS versions but not others

Comments

@FelixKratz
Copy link
Owner

This is a privacy protecting measure by apple, since the SSID could be used by a rouge application to reveal your location. This is why they decided to make the SSID only available if the app requesting it has location permissions. I don't want to ask for location permissions for this feature, so it would probably be best to just remove the $INFO field for this event, or replace it by something else instead.

Although there are other ways to retrieve the SSID for now, this is clearly unwanted and likely to break in future updates.

@FelixKratz FelixKratz added the macOS version specific Problems that arise on certain macOS versions but not others label Oct 9, 2023
@bustinbung
Copy link

Quick search gave me this answer. I modified wifi.sh in the plugins directory to change $INFO to the output of the command, and that fixed it for me without asking for location permissions. However, I'm not sure if this only works because I have SIP disabled or not, or because I have admin rights on this computer.

INFO="$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I  | awk -F' SSID: '  '/ SSID: / {print $2}')"

@FelixKratz FelixKratz added the documentation Improvements or additions to documentation label Oct 11, 2023
@FelixKratz
Copy link
Owner Author

I have added a note to the docs that this event is somewhat broken on Sonoma.

@FelixKratz FelixKratz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
@bustinbung

This comment was marked as outdated.

@FelixKratz

This comment was marked as outdated.

@bustinbung
Copy link

bustinbung commented Oct 13, 2023

Updating to HEAD did fix the event firing issue, modification to the plugin script works really well. Not sure how you could implement those shell script commands into C (if you even want to), but I appreciate the work. Been having fun messing around with this!

@tonnylou44853
Copy link

The command above stopped working for me after upgrading my system to Sonoma 14.4:

$ /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I
WARNING: The airport command line tool is deprecated and will be removed in a future release.
For diagnosing Wi-Fi related issues, use the Wireless Diagnostics app or wdutil command line tool.

and wdutil is not an option for me since it requires sudo.

In case anyone had a similar problem as above, here is a simple fix that I found: https://stackoverflow.com/a/8542420

TL;DR:

Use

INFO="$(networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -getairportnetwork | sed "s/Current Wi-Fi Network: //")"

if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I no longer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation macOS version specific Problems that arise on certain macOS versions but not others
Projects
None yet
Development

No branches or pull requests

3 participants