From be34c03d2070b82169541c41e6dd3ef03781dbf4 Mon Sep 17 00:00:00 2001 From: "Bat.bat" Date: Tue, 2 Feb 2021 23:48:41 +0800 Subject: [PATCH] Only retrieve autoJoin info in Release builds, fix swiftlint warnings --- HeliPort/Appearance/StatusMenu.swift | 2 ++ HeliPort/NetworkManager.swift | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HeliPort/Appearance/StatusMenu.swift b/HeliPort/Appearance/StatusMenu.swift index 77ed4fc5..bafacf88 100644 --- a/HeliPort/Appearance/StatusMenu.swift +++ b/HeliPort/Appearance/StatusMenu.swift @@ -494,7 +494,9 @@ final class StatusMenu: NSMenu, NSMenuDelegate { var entity: NetworkInfoStorageEntity? var hideDisconnect = true if self.status == ITL80211_S_RUN && get_station_info(&staInfo) == KERN_SUCCESS { + #if !DEBUG entity = CredentialsManager.instance.getStorageFromSsid(String(cString: &staInfo.ssid.0)) + #endif hideDisconnect = entity?.autoJoin ?? false self.isNetworkConnected = true let bsd = String(self.bsdItem.title).replacingOccurrences(of: String.interfaceName, with: "", diff --git a/HeliPort/NetworkManager.swift b/HeliPort/NetworkManager.swift index 99e216df..5198ee18 100644 --- a/HeliPort/NetworkManager.swift +++ b/HeliPort/NetworkManager.swift @@ -256,7 +256,7 @@ final class NetworkManager { class func getSecurityType(_ info: ioctl_network_info) -> itl80211_security { if info.supported_rsnprotos & ITL80211_PROTO_RSN.rawValue != 0 { - //wpa2 + // WPA2 if info.rsn_akms & ITL80211_AKM_8021X.rawValue != 0 { if info.supported_rsnprotos & ITL80211_PROTO_WPA.rawValue != 0 { return ITL80211_SECURITY_WPA_ENTERPRISE_MIXED @@ -273,7 +273,7 @@ final class NetworkManager { return ITL80211_SECURITY_PERSONAL } } else if info.supported_rsnprotos & ITL80211_PROTO_WPA.rawValue != 0 { - //wpa + // WPA if info.rsn_akms & ITL80211_AKM_8021X.rawValue != 0 { return ITL80211_SECURITY_WPA_ENTERPRISE } else if info.rsn_akms & ITL80211_AKM_PSK.rawValue != 0 { @@ -286,7 +286,6 @@ final class NetworkManager { } else if info.supported_rsnprotos == 0 { return ITL80211_SECURITY_NONE } - //TODO wpa3 return ITL80211_SECURITY_UNKNOWN } }