fix: vpn service issue

This commit is contained in:
hiddify-com
2024-08-05 15:17:10 +02:00
parent fc5aae7e81
commit 8f0063d324
3 changed files with 21 additions and 13 deletions

View File

@@ -64,19 +64,19 @@ jobs:
os: ubuntu-latest os: ubuntu-latest
targets: apk targets: apk
- platform: android-aab # - platform: android-aab
os: ubuntu-latest # os: ubuntu-latest
targets: aab # targets: aab
- platform: windows # - platform: windows
os: windows-2019 # os: windows-2019
aarch: amd64 # aarch: amd64
targets: exe,msix # targets: exe,msix
- platform: linux # - platform: linux
os: ubuntu-22.04 # os: ubuntu-22.04
aarch: amd64 # aarch: amd64
targets: AppImage,deb,rpm # targets: AppImage,deb,rpm
- platform: macos - platform: macos
os: macos-13 os: macos-13

View File

@@ -133,7 +133,7 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
} catch (_: NameNotFoundException) { } catch (_: NameNotFoundException) {
} }
} }
builder.addAllowedApplication(packageName) //builder.addAllowedApplication(packageName)
} else { } else {
appList.forEach { appList.forEach {
try { try {
@@ -141,6 +141,10 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
} catch (_: NameNotFoundException) { } catch (_: NameNotFoundException) {
} }
} }
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}
} }
} else { } else {
val includePackage = options.includePackage val includePackage = options.includePackage
@@ -152,7 +156,6 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
} }
} }
} }
val excludePackage = options.excludePackage val excludePackage = options.excludePackage
if (excludePackage.hasNext()) { if (excludePackage.hasNext()) {
while (excludePackage.hasNext()) { while (excludePackage.hasNext()) {
@@ -162,6 +165,10 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
} }
} }
} }
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}
} }
} }

View File

@@ -1,6 +1,7 @@
import Cocoa import Cocoa
import FlutterMacOS import FlutterMacOS
import UserNotifications
@NSApplicationMain @NSApplicationMain
class AppDelegate: FlutterAppDelegate { class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {