diff --git a/service/src/main/java/com/github/kr328/clash/service/TunService.kt b/service/src/main/java/com/github/kr328/clash/service/TunService.kt index 881e19f..1b48ab1 100644 --- a/service/src/main/java/com/github/kr328/clash/service/TunService.kt +++ b/service/src/main/java/com/github/kr328/clash/service/TunService.kt @@ -134,17 +134,17 @@ class TunService : VpnService(), CoroutineScope by MainScope() { get() = PRIVATE_VLAN_DNS override val dnsHijacking: Boolean get() = settings.get(ServiceSettings.DNS_HIJACKING) - override val allowApplications: List + override val allowApplications: Collection get() { return if (settings.get(ServiceSettings.ACCESS_CONTROL_MODE) == ServiceSettings.ACCESS_CONTROL_MODE_WHITELIST) { - (settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES) + packageName).toList() - } else emptyList() + (settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES) + packageName) + } else emptySet() } - override val disallowApplication: List + override val disallowApplication: Collection get() { return if (settings.get(ServiceSettings.ACCESS_CONTROL_MODE) == ServiceSettings.ACCESS_CONTROL_MODE_BLACKLIST) { - (settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES) - packageName).toList() - } else emptyList() + (settings.get(ServiceSettings.ACCESS_CONTROL_PACKAGES) - packageName) + } else emptySet() } override fun onCreateTunFailure() { diff --git a/service/src/main/java/com/github/kr328/clash/service/clash/module/TunModule.kt b/service/src/main/java/com/github/kr328/clash/service/clash/module/TunModule.kt index 0c9003c..9a9004f 100644 --- a/service/src/main/java/com/github/kr328/clash/service/clash/module/TunModule.kt +++ b/service/src/main/java/com/github/kr328/clash/service/clash/module/TunModule.kt @@ -1,7 +1,6 @@ package com.github.kr328.clash.service.clash.module import android.app.PendingIntent -import android.content.Intent import android.net.VpnService import android.os.Build import com.github.kr328.clash.common.Global @@ -20,8 +19,8 @@ class TunModule(private val service: VpnService) : Module() { val route: List val dnsAddress: String val dnsHijacking: Boolean - val allowApplications: List - val disallowApplication: List + val allowApplications: Collection + val disallowApplication: Collection fun onCreateTunFailure() }