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

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