Commit 497a7476 authored by Mygod's avatar Mygod

Refine #1489

parent a444d7cc
......@@ -221,10 +221,10 @@ object BaseService {
"-t", "600",
"-c", "shadowsocks.json"))
val route = data.profile!!.route
if (route != Acl.ALL) {
val acl = getAclFile()
if (acl != null) {
cmd += "--acl"
cmd += Acl.getFile(if (route == Acl.CUSTOM_RULES) Acl.CUSTOM_RULES_FLATTENED else route).absolutePath
cmd += acl.absolutePath
}
if (TcpFastOpen.sendEnabled) cmd += "--fast-open"
......@@ -232,6 +232,12 @@ object BaseService {
data.sslocalProcess = GuardedProcess(cmd).start()
}
fun getAclFile(): File? {
val route = data.profile!!.route
return if (route == Acl.ALL) null else
Acl.getFile(if (route == Acl.CUSTOM_RULES) Acl.CUSTOM_RULES_FLATTENED else route)
}
fun createNotification(): ServiceNotification
fun startRunner() {
......
......@@ -89,7 +89,7 @@ object LocalDnsService {
.put("PrimaryDNS", localDns)
.put("AlternativeDNS", remoteDns)
.put("IPNetworkFile", "china_ip_list.txt")
.put("DomainFile", app.filesDir.absolutePath + "/" + profile.route + ".acl")
.put("DomainFile", getAclFile()!!.absolutePath)
Acl.CHINALIST -> config
.put("PrimaryDNS", localDns)
.put("AlternativeDNS", remoteDns)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment