Skip to content

Commit

Permalink
fix: vpn service issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Aug 5, 2024
1 parent fc5aae7 commit 8f0063d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ jobs:
os: ubuntu-latest
targets: apk

- platform: android-aab
os: ubuntu-latest
targets: aab

- platform: windows
os: windows-2019
aarch: amd64
targets: exe,msix

- platform: linux
os: ubuntu-22.04
aarch: amd64
targets: AppImage,deb,rpm
# - platform: android-aab
# os: ubuntu-latest
# targets: aab

# - platform: windows
# os: windows-2019
# aarch: amd64
# targets: exe,msix

# - platform: linux
# os: ubuntu-22.04
# aarch: amd64
# targets: AppImage,deb,rpm

- platform: macos
os: macos-13
Expand Down
11 changes: 9 additions & 2 deletions android/app/src/main/kotlin/com/hiddify/hiddify/bg/VPNService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,18 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
} catch (_: NameNotFoundException) {
}
}
builder.addAllowedApplication(packageName)
//builder.addAllowedApplication(packageName)
} else {
appList.forEach {
try {
builder.addDisallowedApplication(it)
} catch (_: NameNotFoundException) {
}
}
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}
}
} else {
val includePackage = options.includePackage
Expand All @@ -152,7 +156,6 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
}
}
}

val excludePackage = options.excludePackage
if (excludePackage.hasNext()) {
while (excludePackage.hasNext()) {
Expand All @@ -162,6 +165,10 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
}
}
}
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}
}
}

Expand Down
1 change: 1 addition & 0 deletions macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Cocoa
import FlutterMacOS

import UserNotifications
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
Expand Down

0 comments on commit 8f0063d

Please sign in to comment.