@@ -100,30 +100,31 @@ - (void)bssidDidChangeForWiFiInterfaceWithName:(NSString*)interfaceName {
100100 return ;
101101 }
102102
103+ logger.debug () << " WiFi interface:" << [interface interfaceName ];
103104 if (![interface powerOn ]) {
104105 logger.debug () << " The interface is off" ;
105106 return ;
106107 }
107108
108- NSString * ssidNS = [interface ssid ];
109- if (!ssidNS) {
109+ if ([interface activePHYMode ] == kCWPHYModeNone ) {
110110 logger.debug () << " WiFi is not in used" ;
111111 return ;
112112 }
113113
114- QString ssid = QString::fromNSString (ssidNS);
115- if (ssid.isEmpty ()) {
116- logger.debug () << " WiFi doesn't have a valid SSID" ;
114+ CWSecurity security = [interface security ];
115+ if (security != kCWSecurityNone && security != kCWSecurityWEP ) {
116+ // WiFi network appears to be reasonably secured.
117+ logger.debug () << " Secure WiFi interface" ;
117118 return ;
118119 }
120+ logger.debug () << " Unsecured network found!" ;
119121
120- CWSecurity security = [interface security ] ;
121- if (security == kCWSecurityNone || security == kCWSecurityWEP ) {
122- logger. debug () << " Unsecured network found! " ;
123- emit unsecuredNetwork (ssid, ssid);
124- return ;
122+ QString ssid = QString::fromNSString ( [interface ssid ]) ;
123+ if (ssid. isEmpty () ) {
124+ // Note: Starting with macOS 14, retrieving the SSID requires location
125+ // permissions for the application, which we are unlikely to be granted.
126+ logger. debug () << " Unable to fetch WiFi SSID " ;
125127 }
126128
127- logger. debug () << " Secure WiFi interface " ;
129+ emit unsecuredNetwork (ssid) ;
128130}
129-
0 commit comments