Skip to content

Commit

Permalink
revert changes to android vpn service
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Aug 5, 2024
1 parent 53aa0e4 commit fc5aae7
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions android/app/src/main/kotlin/com/hiddify/hiddify/bg/VPNService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,52 +129,38 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
if (Settings.perAppProxyMode == PerAppProxyMode.INCLUDE) {
appList.forEach {
try {
if (it != packageName)
builder.addAllowedApplication(it)
builder.addAllowedApplication(it)
} catch (_: NameNotFoundException) {
}
}


builder.addAllowedApplication(packageName)
} else {
appList.forEach {
try {
builder.addDisallowedApplication(it)
} catch (_: NameNotFoundException) {
}
}
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}

}
} else {
val includePackage = options.includePackage
if (includePackage.hasNext()) {
while (includePackage.hasNext()) {
try {
val it = includePackage.next()
if (it != packageName)
builder.addAllowedApplication(it)
builder.addAllowedApplication(includePackage.next())
} catch (_: NameNotFoundException) {
}
}
} else {
}

val excludePackage = options.excludePackage
if (excludePackage.hasNext()) {
while (excludePackage.hasNext()) {
try {
builder.addDisallowedApplication(excludePackage.next())
} catch (_: NameNotFoundException) {
}
val excludePackage = options.excludePackage
if (excludePackage.hasNext()) {
while (excludePackage.hasNext()) {
try {
builder.addDisallowedApplication(excludePackage.next())
} catch (_: NameNotFoundException) {
}
}
try {
builder.addDisallowedApplication(packageName)
} catch (_: NameNotFoundException) {
}
}
}
}
Expand Down

0 comments on commit fc5aae7

Please sign in to comment.