Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajhilje committed Dec 5, 2023
2 parents f27c4fa + de05246 commit 44c7985
Show file tree
Hide file tree
Showing 18 changed files with 232 additions and 116 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## 2.11.1 - 2023-12-05

[NEW] Option to Block LAN traffic when connected to an untrusted network
[NEW] Option to turn off the prompt when connecting or disconnecting VPN from the Widget
[FIXED] Control panel not rendering when launching the app in landscape mode on iPad
[FIXED] Removed redundant entitlements for V2Ray connections
[FIXED] Minor UI fixes and improvements

## 2.11.0 - 2023-11-16

[NEW] Obfuscation with V2Ray for WireGuard connections
Expand Down
18 changes: 18 additions & 0 deletions IVPNClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ class AppDelegate: UIResponder {

switch endpoint {
case Config.urlTypeConnect:
guard !UserDefaults.shared.disableWidgetPrompt else {
if UserDefaults.shared.networkProtectionEnabled {
Application.shared.connectionManager.resetRulesAndConnectShortcut(closeApp: true, actionType: .connect)
return
}
Application.shared.connectionManager.connectShortcut(closeApp: true, actionType: .connect)
return
}

viewController.showActionAlert(title: "Please confirm", message: "Do you want to connect to VPN?", action: "Connect", actionHandler: { _ in
if UserDefaults.shared.networkProtectionEnabled {
Application.shared.connectionManager.resetRulesAndConnectShortcut(closeApp: true, actionType: .connect)
Expand All @@ -154,6 +163,15 @@ class AppDelegate: UIResponder {
Application.shared.connectionManager.connectShortcut(closeApp: true, actionType: .connect)
})
case Config.urlTypeDisconnect:
guard !UserDefaults.shared.disableWidgetPrompt else {
if UserDefaults.shared.networkProtectionEnabled {
Application.shared.connectionManager.resetRulesAndDisconnectShortcut(closeApp: true, actionType: .disconnect)
return
}
Application.shared.connectionManager.disconnectShortcut(closeApp: true, actionType: .disconnect)
return
}

viewController.showActionAlert(title: "Please confirm", message: "Do you want to disconnect from VPN?", action: "Disconnect", actionHandler: { _ in
if UserDefaults.shared.networkProtectionEnabled {
Application.shared.connectionManager.resetRulesAndDisconnectShortcut(closeApp: true, actionType: .disconnect)
Expand Down
2 changes: 0 additions & 2 deletions IVPNClient/IVPNClient.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>packet-tunnel-provider</string>
</array>
<key>com.apple.developer.networking.vpn.api</key>
Expand Down
2 changes: 1 addition & 1 deletion IVPNClient/Managers/AppKeyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class AppKeyManager {
return TimeInterval(10)
}

return TimeInterval(60 * 60)
return TimeInterval(60 * 10)
}

static var regenerationInterval: TimeInterval {
Expand Down
6 changes: 6 additions & 0 deletions IVPNClient/Managers/VPNManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@ class VPNManager {
self.disable(tunnelType: .wireguard) { _ in
self.setup(settings: settings, accessDetails: accessDetails, status: .disconnected) { _ in
self.disconnect(tunnelType: .ipsec)
// Fix for iOS 16+ bug where VPN status is .disconnecting for active on-demand rules and disconnected VPN
DispatchQueue.delay(1) {
self.ipsecManager?.connection.stopVPNTunnel()
}
}
}
}
case .openvpn:
disable(tunnelType: .ipsec) { _ in
self.disable(tunnelType: .wireguard) { _ in
self.setup(settings: settings, accessDetails: accessDetails, status: .disconnected) { _ in
// Fix for iOS 16+ bug where VPN status is .disconnecting for active on-demand rules and disconnected VPN
DispatchQueue.delay(1) {
self.openvpnManager?.connection.stopVPNTunnel()
}
Expand All @@ -253,6 +258,7 @@ class VPNManager {
disable(tunnelType: .ipsec) { _ in
self.disable(tunnelType: .openvpn) { _ in
self.setup(settings: settings, accessDetails: accessDetails, status: .disconnected) { _ in
// Fix for iOS 16+ bug where VPN status is .disconnecting for active on-demand rules and disconnected VPN
DispatchQueue.delay(1) {
self.wireguardManager?.connection.stopVPNTunnel()
}
Expand Down
Loading

0 comments on commit 44c7985

Please sign in to comment.