Refine #1489
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user