remove default disallow package

This commit is contained in:
Kr328 committed 2020-02-26 14:53:30 +08:00
1 parent 568f1f12e7
commit 8bf908b731
2 files changed
+3 -15

No files matched your search

@@ -153,16 +153,9 @@ class TunService : VpnService(), CoroutineScope by MainScope() {
private fun Builder.addBypassApplications(): Builder {
when (settings.get(ServiceSettings.ACCESS_CONTROL_MODE)) {
ServiceSettings.ACCESS_CONTROL_MODE_ALL -> {
for (app in resources.getStringArray(R.array.default_disallow_application)) {
runCatching {
addDisallowedApplication(app)
}
}
}
ServiceSettings.ACCESS_CONTROL_MODE_ALL -> {}
ServiceSettings.ACCESS_CONTROL_MODE_WHITELIST -> {
for (app in settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES).toSet() -
resources.getStringArray(R.array.default_disallow_application)) {
for (app in settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES).toSet()) {
runCatching {
addAllowedApplication(app)
}.onFailure {
@@ -171,8 +164,7 @@ class TunService : VpnService(), CoroutineScope by MainScope() {
}
}
ServiceSettings.ACCESS_CONTROL_MODE_BLACKLIST -> {
for (app in settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES).toSet() +
resources.getStringArray(R.array.default_disallow_application)) {
for (app in settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES).toSet()) {
runCatching {
addDisallowedApplication(app)
}.onFailure {
-4
View File
@@ -68,8 +68,4 @@
<item>255.255.255.254/32</item>
<item>172.31.255.252/30</item> <!-- tun device address -->
</string-array>
<string-array name="default_disallow_application">
<item>com.android.networkstack</item>
</string-array>
</resources>