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

Allow Ethernet on-demand on all platforms #1012

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Library/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"kind" : "remoteSourceControl",
"location" : "git@github.com:passepartoutvpn/passepartoutkit-source",
"state" : {
"revision" : "234a709bfd18f5b31fdf0b44f0f09c84f9c76581",
"version" : "0.13.0"
"revision" : "a08e04fccde51d92d5bed3fbe1880c4225f18618"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Library/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
3 changes: 2 additions & 1 deletion Library/Sources/AppUIMain/Views/Modules/OnDemandView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
5 changes: 1 addition & 4 deletions Library/Sources/CommonUtils/Extensions/Utils+Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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? {
Expand Down