revert changes to android vpn service
This commit is contained in:
@@ -129,13 +129,11 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
|
|||||||
if (Settings.perAppProxyMode == PerAppProxyMode.INCLUDE) {
|
if (Settings.perAppProxyMode == PerAppProxyMode.INCLUDE) {
|
||||||
appList.forEach {
|
appList.forEach {
|
||||||
try {
|
try {
|
||||||
if (it != packageName)
|
builder.addAllowedApplication(it)
|
||||||
builder.addAllowedApplication(it)
|
|
||||||
} catch (_: NameNotFoundException) {
|
} catch (_: NameNotFoundException) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
builder.addAllowedApplication(packageName)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
appList.forEach {
|
appList.forEach {
|
||||||
try {
|
try {
|
||||||
@@ -143,38 +141,26 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
|
|||||||
} catch (_: NameNotFoundException) {
|
} catch (_: NameNotFoundException) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
builder.addDisallowedApplication(packageName)
|
|
||||||
} catch (_: NameNotFoundException) {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val includePackage = options.includePackage
|
val includePackage = options.includePackage
|
||||||
if (includePackage.hasNext()) {
|
if (includePackage.hasNext()) {
|
||||||
while (includePackage.hasNext()) {
|
while (includePackage.hasNext()) {
|
||||||
try {
|
try {
|
||||||
val it = includePackage.next()
|
builder.addAllowedApplication(includePackage.next())
|
||||||
if (it != packageName)
|
|
||||||
builder.addAllowedApplication(it)
|
|
||||||
} catch (_: NameNotFoundException) {
|
} catch (_: NameNotFoundException) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
val excludePackage = options.excludePackage
|
val excludePackage = options.excludePackage
|
||||||
if (excludePackage.hasNext()) {
|
if (excludePackage.hasNext()) {
|
||||||
while (excludePackage.hasNext()) {
|
while (excludePackage.hasNext()) {
|
||||||
try {
|
try {
|
||||||
builder.addDisallowedApplication(excludePackage.next())
|
builder.addDisallowedApplication(excludePackage.next())
|
||||||
} catch (_: NameNotFoundException) {
|
} catch (_: NameNotFoundException) {
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
builder.addDisallowedApplication(packageName)
|
|
||||||
} catch (_: NameNotFoundException) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user