Skip to content

Commit

Permalink
Only retrieve autoJoin info in Release builds, fix swiftlint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
williambj1 committed Feb 2, 2021
1 parent 674b4d6 commit be34c03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions HeliPort/Appearance/StatusMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: "",
Expand Down
5 changes: 2 additions & 3 deletions HeliPort/NetworkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -286,7 +286,6 @@ final class NetworkManager {
} else if info.supported_rsnprotos == 0 {
return ITL80211_SECURITY_NONE
}
//TODO wpa3
return ITL80211_SECURITY_UNKNOWN
}
}

0 comments on commit be34c03

Please sign in to comment.