diff --git a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs index 38044315..8b2ddae6 100644 --- a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs @@ -69,7 +69,7 @@ namespace Shadowsocks.Controller } else { - abpContent = Resources.abp_js; + abpContent = File.ReadAllText(Utils.GetDataPath("abp.js")); } List userruleLines = new List(); diff --git a/shadowsocks-csharp/Controller/Service/PACDaemon.cs b/shadowsocks-csharp/Controller/Service/PACDaemon.cs index 11dc18b4..01cc5b62 100644 --- a/shadowsocks-csharp/Controller/Service/PACDaemon.cs +++ b/shadowsocks-csharp/Controller/Service/PACDaemon.cs @@ -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); } diff --git a/shadowsocks-csharp/Properties/Resources.Designer.cs b/shadowsocks-csharp/Properties/Resources.Designer.cs index 86f61dba..39b87370 100644 --- a/shadowsocks-csharp/Properties/Resources.Designer.cs +++ b/shadowsocks-csharp/Properties/Resources.Designer.cs @@ -60,60 +60,6 @@ namespace Shadowsocks.Properties { } } - /// - /// 查找类似 /* 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 [字符串的其余部分被截断]"; 的本地化字符串。 - /// - internal static string abp_js { - get { - return ResourceManager.GetString("abp_js", resourceCulture); - } - } - - /// - /// 查找类似 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", - /// " [字符串的其余部分被截断]"; 的本地化字符串。 - /// - internal static string default_abp_rule { - get { - return ResourceManager.GetString("default_abp_rule", resourceCulture); - } - } - /// /// 查找 System.Byte[] 类型的本地化资源。 /// @@ -200,16 +146,5 @@ namespace Shadowsocks.Properties { return ((System.Drawing.Bitmap)(obj)); } } - - /// - /// 查找类似 ! Put user rules line by line in this file. - ///! See https://adblockplus.org/en/filter-cheatsheet - /// 的本地化字符串。 - /// - internal static string user_rule { - get { - return ResourceManager.GetString("user_rule", resourceCulture); - } - } } } diff --git a/shadowsocks-csharp/Properties/Resources.resx b/shadowsocks-csharp/Properties/Resources.resx index fcf1c322..1842f535 100755 --- a/shadowsocks-csharp/Properties/Resources.resx +++ b/shadowsocks-csharp/Properties/Resources.resx @@ -118,12 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Data\abp.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312 - - - ..\Data\default-abp-rule.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - ..\Data\libsscrypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -148,7 +142,4 @@ ..\Resources\ssw128.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\data\user-rule.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - \ No newline at end of file diff --git a/shadowsocks-csharp/libsscrypto.dll b/shadowsocks-csharp/libsscrypto.dll new file mode 100644 index 00000000..1cfd85c8 Binary files /dev/null and b/shadowsocks-csharp/libsscrypto.dll differ