Always proxy the app itself

No need to keep a confusing option. Fix #1484.
This commit is contained in:
Mygod
2017-12-08 17:37:11 -08:00
parent 497a74760d
commit 97e93552c6
2 changed files with 14 additions and 6 deletions
@@ -141,11 +141,18 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
}
if (Build.VERSION.SDK_INT >= 21 && profile.proxyApps) {
for (pkg in profile.individual.split('\n')) try {
if (profile.bypass) builder.addDisallowedApplication(pkg) else builder.addAllowedApplication(pkg)
} catch (ex: PackageManager.NameNotFoundException) {
Log.e(tag, "Invalid package name", ex)
}
val me = packageName
profile.individual.split('\n')
.filter { it != me }
.forEach {
try {
if (profile.bypass) builder.addDisallowedApplication(it)
else builder.addAllowedApplication(it)
} catch (ex: PackageManager.NameNotFoundException) {
Log.e(tag, "Invalid package name", ex)
}
}
builder.addAllowedApplication(me)
}
when (profile.route) {