refine dns black list

This commit is contained in:
Max Lv
2014-12-26 17:30:20 +08:00
parent a28303ee76
commit d1d135ccdd
4 changed files with 20 additions and 2 deletions
@@ -161,6 +161,8 @@ object ConfigUtils {
| reject = %s;
| reject_policy = fail;
| reject_recursively = on;
| exclude = %s;
| policy = included;
| uptest = none;
| preset = on;
|}
@@ -173,6 +175,8 @@ object ConfigUtils {
| reject = %s;
| reject_policy = fail;
| reject_recursively = on;
| exclude = %s;
| policy = included;
| uptest = none;
| preset = on;
|}
@@ -218,6 +222,17 @@ object ConfigUtils {
}
}
def getBlackList(context: Context, app: ShadowsocksApplication): String = {
val default = context.getString(R.string.black_list)
try {
val container = app.containerHolder.getContainer
val update = container.getString("black_list")
if (update == null || update.isEmpty) default else update
} catch {
case ex: Exception => default
}
}
def getPublicConfig(context: Context, container: Container, config: Config): Config = {
val url = container.getString("proxy_url")
val sig = Utils.getSignature(context)