Allow Ethernet on-demand on all platforms (#1012)

Fixes #1010
This commit is contained in:
Davide 2024-12-14 21:59:25 +01:00 committed by GitHub
parent b9353a6b02
commit a04c1072c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 9 deletions

View File

@ -41,8 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : {
"revision" : "234a709bfd18f5b31fdf0b44f0f09c84f9c76581",
"version" : "0.13.0"
"revision" : "a08e04fccde51d92d5bed3fbe1880c4225f18618"
}
},
{

View File

@ -64,8 +64,8 @@ let package = Package(
)
],
dependencies: [
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.13.0"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "406712a60faf8208a15c4ffaf286b1c71df7c6d2"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", from: "0.13.0"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source", revision: "a08e04fccde51d92d5bed3fbe1880c4225f18618"),
// .package(path: "../../passepartoutkit-source"),
.package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", from: "0.13.0"),
// .package(url: "git@github.com:passepartoutvpn/passepartoutkit-source-openvpn-openssl", revision: "031863a1cd683962a7dfe68e20b91fa820a1ecce"),

View File

@ -124,7 +124,8 @@ private extension OnDemandView {
Group {
if Utils.hasCellularData() {
Toggle(Strings.Modules.OnDemand.mobile, isOn: draft.withMobileNetwork)
} else if Utils.hasEthernet() {
}
if Utils.hasEthernet() {
Toggle(Strings.Modules.OnDemand.ethernet, isOn: draft.withEthernetNetwork)
}
}

View File

@ -36,6 +36,7 @@ extension Utils {
true
}
#else
// TODO: ###, move this check to kit, and try something similar for Ethernet
public static func hasCellularData() -> Bool {
var addrs: UnsafeMutablePointer<ifaddrs>?
guard getifaddrs(&addrs) == 0 else {
@ -57,11 +58,7 @@ extension Utils {
#endif
public static func hasEthernet() -> Bool {
#if os(macOS)
true
#else
false
#endif
}
public static func currentWifiSSID() async -> String? {