@@ -69,7 +69,7 @@ namespace Shadowsocks.Controller | |||
} | |||
else | |||
{ | |||
abpContent = Resources.abp_js; | |||
abpContent = File.ReadAllText(Utils.GetDataPath("abp.js")); | |||
} | |||
List<string> userruleLines = new List<string>(); | |||
@@ -39,7 +39,9 @@ namespace Shadowsocks.Controller | |||
{ | |||
if (!File.Exists(PAC_FILE)) | |||
{ | |||
File.WriteAllText(PAC_FILE, Resources.default_abp_rule + Resources.abp_js); | |||
string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js")); | |||
string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js")); | |||
File.WriteAllText(PAC_FILE, defaultRule + abpJs); | |||
} | |||
return PAC_FILE; | |||
} | |||
@@ -48,21 +50,20 @@ namespace Shadowsocks.Controller | |||
{ | |||
if (!File.Exists(USER_RULE_FILE)) | |||
{ | |||
File.WriteAllText(USER_RULE_FILE, Resources.user_rule); | |||
File.WriteAllText(USER_RULE_FILE, Utils.GetDataPath("user-rule.txt")); | |||
} | |||
return USER_RULE_FILE; | |||
} | |||
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; | |||
string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js")); | |||
string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js")); | |||
File.WriteAllText(PAC_FILE, defaultRule + abpJs); | |||
} | |||
return File.ReadAllText(PAC_FILE, Encoding.UTF8); | |||
} | |||
@@ -60,60 +60,6 @@ namespace Shadowsocks.Properties { | |||
} | |||
} | |||
/// <summary> | |||
/// 查找类似 /* eslint-disable */ | |||
///// Was generated by gfwlist2pac in precise mode | |||
///// https://github.com/clowwindy/gfwlist2pac | |||
/// | |||
///// 2019-10-06: More 'javascript' way to interaction with main program | |||
///// 2019-02-08: Updated to support shadowsocks-windows user rules. | |||
/// | |||
///var proxy = __PROXY__; | |||
///var userrules = __USERRULES__; | |||
///var rules = __RULES__; | |||
/// | |||
////* | |||
///* This file is part of Adblock Plus <http://adblockplus.org/>, | |||
///* Copyright (C) 2006-2014 Eyeo GmbH | |||
///* | |||
///* Adblock Plus is free software: you can redistribute it and/or [字符串的其余部分被截断]"; 的本地化字符串。 | |||
/// </summary> | |||
internal static string abp_js { | |||
get { | |||
return ResourceManager.GetString("abp_js", resourceCulture); | |||
} | |||
} | |||
/// <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> | |||
/// 查找 System.Byte[] 类型的本地化资源。 | |||
/// </summary> | |||
@@ -200,16 +146,5 @@ namespace Shadowsocks.Properties { | |||
return ((System.Drawing.Bitmap)(obj)); | |||
} | |||
} | |||
/// <summary> | |||
/// 查找类似 ! Put user rules line by line in this file. | |||
///! See https://adblockplus.org/en/filter-cheatsheet | |||
/// 的本地化字符串。 | |||
/// </summary> | |||
internal static string user_rule { | |||
get { | |||
return ResourceManager.GetString("user_rule", resourceCulture); | |||
} | |||
} | |||
} | |||
} |
@@ -118,12 +118,6 @@ | |||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</resheader> | |||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |||
<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> | |||
</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="libsscrypto" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||
<value>..\Data\libsscrypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
</data> | |||
@@ -148,7 +142,4 @@ | |||
<data name="ssw128" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||
<value>..\Resources\ssw128.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> | |||
</data> | |||
<data name="user_rule" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||
<value>..\data\user-rule.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> | |||
</data> | |||
</root> |