@@ -97,7 +97,7 @@ namespace Shadowsocks.Controller | |||||
Error?.Invoke(null, new ErrorEventArgs(ex)); | Error?.Invoke(null, new ErrorEventArgs(ex)); | ||||
} | } | ||||
}; | }; | ||||
http.DownloadStringAsync(new Uri(gfwListUrl)); | |||||
http.DownloadDataAsync(new Uri(gfwListUrl)); | |||||
} | } | ||||
@@ -42,7 +42,7 @@ namespace Shadowsocks.Controller | |||||
{ | { | ||||
if (!File.Exists(PAC_FILE)) | if (!File.Exists(PAC_FILE)) | ||||
{ | { | ||||
File.WriteAllText(PAC_FILE, Resources.default_abp_rule + Resources.abp_js); | |||||
GeositeUpdater.MergeAndWritePACFile(); | |||||
} | } | ||||
return PAC_FILE; | return PAC_FILE; | ||||
} | } | ||||
@@ -58,14 +58,11 @@ namespace Shadowsocks.Controller | |||||
internal string GetPACContent() | internal string GetPACContent() | ||||
{ | { | ||||
if (File.Exists(PAC_FILE)) | |||||
{ | |||||
return File.ReadAllText(PAC_FILE, Encoding.UTF8); | |||||
} | |||||
else | |||||
if (!File.Exists(PAC_FILE)) | |||||
{ | { | ||||
return Resources.default_abp_rule + Resources.abp_js; | |||||
GeositeUpdater.MergeAndWritePACFile(); | |||||
} | } | ||||
return File.ReadAllText(PAC_FILE, Encoding.UTF8); | |||||
} | } | ||||
@@ -622,14 +622,7 @@ namespace Shadowsocks.Controller | |||||
private static readonly IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' }; | private static readonly IEnumerable<char> IgnoredLineBegins = new[] { '!', '[' }; | ||||
private void PacDaemon_UserRuleFileChanged(object sender, EventArgs e) | private void PacDaemon_UserRuleFileChanged(object sender, EventArgs e) | ||||
{ | { | ||||
if (!File.Exists(Utils.GetTempPath("gfwlist.txt"))) | |||||
{ | |||||
UpdatePACFromGFWList(); | |||||
} | |||||
else | |||||
{ | |||||
GeositeUpdater.MergeAndWritePACFile(); | |||||
} | |||||
GeositeUpdater.MergeAndWritePACFile(); | |||||
UpdateSystemProxy(); | UpdateSystemProxy(); | ||||
} | } | ||||
@@ -84,36 +84,6 @@ namespace Shadowsocks.Properties { | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 查找类似 var __USERRULES__ = []; | |||||
///var __RULES__ = [ | |||||
/// "|http://85.17.73.31/", | |||||
/// "||agnesb.fr", | |||||
/// "||akiba-web.com", | |||||
/// "||altrec.com", | |||||
/// "||angela-merkel.de", | |||||
/// "||angola.org", | |||||
/// "||apartmentratings.com", | |||||
/// "||apartments.com", | |||||
/// "||arena.taipei", | |||||
/// "||asianspiss.com", | |||||
/// "||assimp.org", | |||||
/// "||athenaeizou.com", | |||||
/// "||azubu.tv", | |||||
/// "||bankmobilevibe.com", | |||||
/// "||banorte.com", | |||||
/// "||bash-hackers.org", | |||||
/// "||beeg.com", | |||||
/// "||global.bing.com", | |||||
/// "||bloombergview.com", | |||||
/// " [字符串的其余部分被截断]"; 的本地化字符串。 | |||||
/// </summary> | |||||
internal static string default_abp_rule { | |||||
get { | |||||
return ResourceManager.GetString("default_abp_rule", resourceCulture); | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 查找 System.Byte[] 类型的本地化资源。 | /// 查找 System.Byte[] 类型的本地化资源。 | ||||
/// </summary> | /// </summary> | ||||
@@ -121,9 +121,6 @@ | |||||
<data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms"> | <data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms"> | ||||
<value>..\Data\abp.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value> | <value>..\Data\abp.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value> | ||||
</data> | </data> | ||||
<data name="default_abp_rule" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||||
<value>..\Data\default-abp-rule.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> | |||||
</data> | |||||
<data name="dlc_dat" type="System.Resources.ResXFileRef, System.Windows.Forms"> | <data name="dlc_dat" type="System.Resources.ResXFileRef, System.Windows.Forms"> | ||||
<value>..\data\dlc.dat;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | <value>..\data\dlc.dat;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||||
</data> | </data> | ||||
@@ -302,7 +302,6 @@ | |||||
</None> | </None> | ||||
<None Include="Resources\ssw128.png" /> | <None Include="Resources\ssw128.png" /> | ||||
<Content Include="Data\abp.js" /> | <Content Include="Data\abp.js" /> | ||||
<Content Include="Data\default-abp-rule.js" /> | |||||
<Content Include="Data\privoxy_conf.txt" /> | <Content Include="Data\privoxy_conf.txt" /> | ||||
<Content Include="Data\user-rule.txt" /> | <Content Include="Data\user-rule.txt" /> | ||||
<None Include="FodyWeavers.xml"> | <None Include="FodyWeavers.xml"> | ||||