From b88f83661626a2f81b6a3b4e5626031dafbbdf48 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Wed, 13 Dec 2017 23:35:10 +0800 Subject: [PATCH] Refine #1489 --- .../overture/src/github.com/shadowsocks/overture | 2 +- .../com/github/shadowsocks/bg/BaseService.kt | 16 ---------------- .../com/github/shadowsocks/bg/LocalDnsService.kt | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/core/src/overture/src/github.com/shadowsocks/overture b/core/src/overture/src/github.com/shadowsocks/overture index c8ec480c..6904e8d4 160000 --- a/core/src/overture/src/github.com/shadowsocks/overture +++ b/core/src/overture/src/github.com/shadowsocks/overture @@ -1 +1 @@ -Subproject commit c8ec480cf716be70bc3cae2c4cd7f2733901ab09 +Subproject commit 6904e8d435ddfb9424b3ed1995208318434f1ae3 diff --git a/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt b/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt index d0676073..65895f72 100644 --- a/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt +++ b/mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt @@ -238,22 +238,6 @@ object BaseService { Acl.getFile(if (route == Acl.CUSTOM_RULES) Acl.CUSTOM_RULES_FLATTENED else route) } - fun getListFile(): File? { - val aclFile = getAclFile() ?: return null - val listFile = File(aclFile.absolutePath + ".lst") - val list = StringBuilder() - aclFile.bufferedReader().useLines { - for (line in it) { - if (line.startsWith("^(.*\\.)?")) { - list.append(line.substring(8).replace("\\","").replace("$","")) - list.append("\n") - } - } - } - listFile.bufferedWriter().use { it.write(list.toString()) } - return listFile - } - fun createNotification(): ServiceNotification fun startRunner() { diff --git a/mobile/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt b/mobile/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt index 0df77ac4..5de7aabc 100644 --- a/mobile/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt +++ b/mobile/src/main/java/com/github/shadowsocks/bg/LocalDnsService.kt @@ -89,7 +89,7 @@ object LocalDnsService { .put("PrimaryDNS", localDns) .put("AlternativeDNS", remoteDns) .put("IPNetworkFile", "china_ip_list.txt") - .put("DomainFile", getListFile()!!.absolutePath) + .put("DomainFile", getAclFile()!!.absolutePath) Acl.CHINALIST -> config .put("PrimaryDNS", localDns) .put("AlternativeDNS", remoteDns)