diff --git a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs index 8b2ddae6..0629f98f 100644 --- a/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GfwListUpdater.cs @@ -69,7 +69,7 @@ namespace Shadowsocks.Controller } else { - abpContent = File.ReadAllText(Utils.GetDataPath("abp.js")); + abpContent = File.ReadAllText("abp.js"); } List userruleLines = new List(); diff --git a/shadowsocks-csharp/Controller/Service/PACDaemon.cs b/shadowsocks-csharp/Controller/Service/PACDaemon.cs index 01cc5b62..c7ad9b3f 100644 --- a/shadowsocks-csharp/Controller/Service/PACDaemon.cs +++ b/shadowsocks-csharp/Controller/Service/PACDaemon.cs @@ -39,8 +39,8 @@ namespace Shadowsocks.Controller { if (!File.Exists(PAC_FILE)) { - string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js")); - string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js")); + string defaultRule = File.ReadAllText("default-abp-rule.js"); + string abpJs = File.ReadAllText("abp.js"); File.WriteAllText(PAC_FILE, defaultRule + abpJs); } return PAC_FILE; @@ -50,7 +50,7 @@ namespace Shadowsocks.Controller { if (!File.Exists(USER_RULE_FILE)) { - File.WriteAllText(USER_RULE_FILE, Utils.GetDataPath("user-rule.txt")); + File.WriteAllText(USER_RULE_FILE, "user-rule.txt"); } return USER_RULE_FILE; } @@ -59,8 +59,8 @@ namespace Shadowsocks.Controller { if (!File.Exists(PAC_FILE)) { - string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js")); - string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js")); + string defaultRule = File.ReadAllText("default-abp-rule.js"); + string abpJs = File.ReadAllText("abp.js"); File.WriteAllText(PAC_FILE, defaultRule + abpJs); } return File.ReadAllText(PAC_FILE, Encoding.UTF8); diff --git a/shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs b/shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs index c0b4d6a7..34ff929b 100644 --- a/shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs +++ b/shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs @@ -27,7 +27,7 @@ namespace Shadowsocks.Controller _uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance. _uniqueConfigFile = $"privoxy_{_uid}.conf"; _privoxyJob = new Job(); - File.Copy(Utils.GetDataPath("privoxy.exe"), Utils.GetTempPath("ss_privoxy.exe")); + File.Copy("privoxy.exe", Utils.GetTempPath("ss_privoxy.exe")); } catch (IOException e) { @@ -46,7 +46,7 @@ namespace Shadowsocks.Controller { KillProcess(p); } - string privoxyConfig = File.ReadAllText(Utils.GetDataPath("privoxy_conf.txt")); + string privoxyConfig = File.ReadAllText("privoxy_conf.txt"); _runningPort = GetFreePort(configuration.isIPv6Enabled); privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", configuration.localPort.ToString()); privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", _runningPort.ToString()); diff --git a/shadowsocks-csharp/Util/Util.cs b/shadowsocks-csharp/Util/Util.cs index 3d8efe92..6cd693f3 100755 --- a/shadowsocks-csharp/Util/Util.cs +++ b/shadowsocks-csharp/Util/Util.cs @@ -55,16 +55,6 @@ namespace Shadowsocks.Util return _tempPath; } - public static string GetDataPath() - { - return Path.Combine(Directory.GetCurrentDirectory(), "Data"); - } - - public static string GetDataPath(string filename) - { - return Path.Combine(GetDataPath(), filename); - } - public enum WindowsThemeMode { Dark, Light } // Support on Windows 10 1903+ diff --git a/shadowsocks-csharp/shadowsocks-csharp.csproj b/shadowsocks-csharp/shadowsocks-csharp.csproj index 36f0a9fb..fd1ee531 100644 --- a/shadowsocks-csharp/shadowsocks-csharp.csproj +++ b/shadowsocks-csharp/shadowsocks-csharp.csproj @@ -264,37 +264,41 @@ Settings.Designer.cs - + PreserveNewest - - + abp.js + + + PreserveNewest + default-abp-rule.js + + PreserveNewest - + i18n.csv + PreserveNewest libsscrypto.dll - + PreserveNewest - - + privoxy.exe + + PreserveNewest - + privoxy_conf.txt + PreserveNewest sysproxy.exe - + PreserveNewest sysproxy64.exe - + PreserveNewest user-rule.txt - - - i18n.csv - PreserveNewest Designer