fixed don't update abp rules while event user-rule file changed. in fact, the PAC will overwrite with gfwlist & use-rule but abp.

This commit is contained in:
kimw
2016-01-05 03:48:55 +08:00
parent c2095b5ad7
commit d2bb2c4a7d
@@ -462,8 +462,16 @@ namespace Shadowsocks.Controller
lines.Add(rule);
}
}
string abpContent = Utils.UnGzip(Resources.abp_js);
abpContent = abpContent.Replace("__RULES__", SimpleJson.SimpleJson.SerializeObject(lines));
string abpContent;
if (File.Exists(PACServer.USER_ABP_FILE))
{
abpContent = File.ReadAllText(PACServer.USER_ABP_FILE, Encoding.UTF8);
}
else
{
abpContent = Utils.UnGzip(Resources.abp_js);
}
abpContent = abpContent.Replace("__RULES__", JsonConvert.SerializeObject(lines, Formatting.Indented));
if (File.Exists(PACServer.PAC_FILE))
{
string original = File.ReadAllText(PACServer.PAC_FILE, Encoding.UTF8);