Browse Source

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

tags/3.0
kimw 8 years ago
parent
commit
d2bb2c4a7d
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      shadowsocks-csharp/Controller/ShadowsocksController.cs

+ 10
- 2
shadowsocks-csharp/Controller/ShadowsocksController.cs View File

@@ -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);


Loading…
Cancel
Save