Refine black list
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -234,10 +234,9 @@ class ShadowsocksNatService extends BaseService {
|
||||
def startDnsDaemon() {
|
||||
|
||||
val conf = if (config.route == Route.BYPASS_CHN || config.route == Route.BYPASS_LAN_CHN) {
|
||||
val reject = ConfigUtils.getRejectList(this)
|
||||
val blackList = ConfigUtils.getBlackList(this)
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
"127.0.0.1", 8153, reject, blackList, 8163, "")
|
||||
"127.0.0.1", 8153, blackList, 8163, "")
|
||||
} else {
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
"127.0.0.1", 8153, 8163, "")
|
||||
|
||||
@@ -277,10 +277,9 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
val ipv6 = if (config.isIpv6) "" else "reject = ::/0;"
|
||||
val conf = {
|
||||
if (config.route == Route.BYPASS_CHN || config.route == Route.BYPASS_LAN_CHN) {
|
||||
val reject = ConfigUtils.getRejectList(this)
|
||||
val blackList = ConfigUtils.getBlackList(this)
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
"0.0.0.0", 8153, reject, blackList, 8163, ipv6)
|
||||
"0.0.0.0", 8153, blackList, 8163, ipv6)
|
||||
} else {
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
"0.0.0.0", 8153, 8163, ipv6)
|
||||
|
||||
@@ -116,9 +116,6 @@ object ConfigUtils {
|
||||
| label = "china-servers";
|
||||
| ip = 114.114.114.114, 112.124.47.27;
|
||||
| timeout = 4;
|
||||
| reject = %s;
|
||||
| reject_policy = fail;
|
||||
| reject_recursively = on;
|
||||
| exclude = %s;
|
||||
| policy = included;
|
||||
| uptest = none;
|
||||
@@ -157,17 +154,6 @@ object ConfigUtils {
|
||||
if (holder != null) holder.refresh()
|
||||
}
|
||||
|
||||
def getRejectList(context: Context): String = {
|
||||
val default = context.getString(R.string.reject)
|
||||
try {
|
||||
val container = app.containerHolder.getContainer
|
||||
val update = container.getString("reject")
|
||||
if (update == null || update.isEmpty) default else update
|
||||
} catch {
|
||||
case ex: Exception => default
|
||||
}
|
||||
}
|
||||
|
||||
def getBlackList(context: Context): String = {
|
||||
val default = context.getString(R.string.black_list)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user