Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Oct 31, 2024
1 parent 5392154 commit 18bbb6a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 1 addition & 3 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,6 @@
7B25FE322AD12C990012AFAB /* NetworkProtectionMac */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = NetworkProtectionMac; sourceTree = "<group>"; };
7B2DDCF72A93A8BB0039D884 /* NetworkProtectionAppEvents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionAppEvents.swift; sourceTree = "<group>"; };
7B2E52242A5FEC09000C6D39 /* NetworkProtectionAgentNotificationsPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionAgentNotificationsPresenter.swift; sourceTree = "<group>"; };
7B35BF1F2CD1091600879773 /* BrowserServicesKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = BrowserServicesKit; path = ../BrowserServicesKit; sourceTree = SOURCE_ROOT; };
7B3618C12ADE75C8000D6154 /* NetworkProtectionNavBarPopoverManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionNavBarPopoverManager.swift; sourceTree = "<group>"; };
7B430EA02A71411A00BAC4A1 /* NetworkProtectionSimulateFailureMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionSimulateFailureMenu.swift; sourceTree = "<group>"; };
7B4C5CF42BE51D640007A164 /* VPNUninstallerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNUninstallerTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5576,7 +5575,6 @@
378E279C2970217400FCADA2 /* LocalPackages */ = {
isa = PBXGroup;
children = (
7B35BF1F2CD1091600879773 /* BrowserServicesKit */,
9D9DE5712C63A96400D20B15 /* AppKitExtensions */,
7B9167A82C09E88800322310 /* AppLauncher */,
378E279D2970217400FCADA2 /* BuildToolPlugins */,
Expand Down Expand Up @@ -14428,7 +14426,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = revision;
revision = a817b6e2c205f56b4b1e86c5db27a75a44029101;
revision = 828754049a7115e0a607fb552d738e85ddc2124a;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
"version" : "3.0.0"
}
},
{
"identity" : "browserserviceskit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "a817b6e2c205f56b4b1e86c5db27a75a44029101"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
}

private func handleSetExcludeLocalNetworks(_ excludeLocalNetworks: Bool) async throws {
guard let tunnelManager = await manager,
tunnelManager.protocolConfiguration?.excludeLocalNetworks == !excludeLocalNetworks else {
guard let tunnelManager = await manager else {
return
}

Expand Down Expand Up @@ -361,10 +360,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
// this setting breaks Connection Tester
protocolConfiguration.includeAllNetworks = settings.includeAllNetworks

// This is intentionally not used but left here for documentation purposes.
// The reason for this is that we want to have full control of the routes that
// are excluded, so instead of using this setting we're just configuring the
// excluded routes through our VPNSettings class, which our extension reads directly.
// This messes up the routing, so please keep it always disabled
protocolConfiguration.excludeLocalNetworks = false

return protocolConfiguration
Expand Down
8 changes: 6 additions & 2 deletions DuckDuckGo/Preferences/Model/VPNPreferencesModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ final class VPNPreferencesModel: ObservableObject {
@Published var excludeLocalNetworks: Bool {
didSet {
settings.excludeLocalNetworks = excludeLocalNetworks
/*Task {

Task {
// We need to allow some time for the setting to propagate
// But ultimately this should actually be a user choice
try await Task.sleep(interval: 0.1)
try await vpnXPCClient.command(.restartAdapter)
}*/
}
}
}

Expand Down

0 comments on commit 18bbb6a

Please sign in to comment.