@@ -76,7 +76,7 @@ namespace Shadowsocks.Controller | |||||
static I18N() | static I18N() | ||||
{ | { | ||||
string locale = CultureInfo.CurrentCulture.Name; | string locale = CultureInfo.CurrentCulture.Name; | ||||
string i18n = File.ReadAllText(Utils.GetDataPath(I18N_FILE), Encoding.UTF8); | |||||
string i18n = File.ReadAllText(I18N_FILE, Encoding.UTF8); | |||||
Logging.Info("Current language is: " + locale); | Logging.Info("Current language is: " + locale); | ||||
Init(i18n, locale); | Init(i18n, locale); | ||||
} | } | ||||
@@ -7,7 +7,6 @@ using System.Net.Sockets; | |||||
using System.Text; | using System.Text; | ||||
using System.Windows.Forms; | using System.Windows.Forms; | ||||
using Shadowsocks.Model; | using Shadowsocks.Model; | ||||
using Shadowsocks.Properties; | |||||
using Shadowsocks.Util; | using Shadowsocks.Util; | ||||
using Shadowsocks.Util.ProcessManagement; | using Shadowsocks.Util.ProcessManagement; | ||||
@@ -16,7 +16,7 @@ namespace Shadowsocks.Encryption | |||||
static MbedTLS() | static MbedTLS() | ||||
{ | { | ||||
LoadLibrary(Utils.GetDataPath(DLLNAME)); | |||||
LoadLibrary(DLLNAME); | |||||
} | } | ||||
public static byte[] MD5(byte[] input) | public static byte[] MD5(byte[] input) | ||||
@@ -24,7 +24,7 @@ namespace Shadowsocks.Encryption | |||||
static OpenSSL() | static OpenSSL() | ||||
{ | { | ||||
LoadLibrary(Utils.GetDataPath(DLLNAME)); | |||||
LoadLibrary(DLLNAME); | |||||
} | } | ||||
public static IntPtr GetCipherInfo(string cipherName) | public static IntPtr GetCipherInfo(string cipherName) | ||||
@@ -18,7 +18,7 @@ namespace Shadowsocks.Encryption | |||||
static Sodium() | static Sodium() | ||||
{ | { | ||||
LoadLibrary(Utils.GetDataPath(DLLNAME)); | |||||
LoadLibrary(DLLNAME); | |||||
lock (_initLock) | lock (_initLock) | ||||
{ | { | ||||
@@ -150,9 +150,9 @@ namespace Shadowsocks.Util.SystemProxy | |||||
using (var process = new Process()) | using (var process = new Process()) | ||||
{ | { | ||||
// Configure the process using the StartInfo properties. | // Configure the process using the StartInfo properties. | ||||
process.StartInfo.FileName = Utils.GetDataPath(SysproxyName); | |||||
process.StartInfo.FileName = SysproxyName; | |||||
process.StartInfo.Arguments = arguments; | process.StartInfo.Arguments = arguments; | ||||
process.StartInfo.WorkingDirectory = Utils.GetDataPath(); | |||||
process.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory(); | |||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; | process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; | ||||
process.StartInfo.UseShellExecute = false; | process.StartInfo.UseShellExecute = false; | ||||
process.StartInfo.RedirectStandardError = true; | process.StartInfo.RedirectStandardError = true; | ||||
@@ -139,25 +139,6 @@ namespace Shadowsocks.Util | |||||
} | } | ||||
} | } | ||||
public static string UnGzip(byte[] buf) | |||||
{ | |||||
byte[] buffer = new byte[1024]; | |||||
int n; | |||||
using (MemoryStream sb = new MemoryStream()) | |||||
{ | |||||
using (GZipStream input = new GZipStream(new MemoryStream(buf), | |||||
CompressionMode.Decompress, | |||||
false)) | |||||
{ | |||||
while ((n = input.Read(buffer, 0, buffer.Length)) > 0) | |||||
{ | |||||
sb.Write(buffer, 0, n); | |||||
} | |||||
} | |||||
return System.Text.Encoding.UTF8.GetString(sb.ToArray()); | |||||
} | |||||
} | |||||
public static string FormatBandwidth(long n) | public static string FormatBandwidth(long n) | ||||
{ | { | ||||
var result = GetBandwidthScale(n); | var result = GetBandwidthScale(n); | ||||
@@ -255,9 +255,6 @@ | |||||
<None Include="app.manifest"> | <None Include="app.manifest"> | ||||
<SubType>Designer</SubType> | <SubType>Designer</SubType> | ||||
</None> | </None> | ||||
<None Include="Data\i18n.csv"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</None> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<None Include="packages.config" /> | <None Include="packages.config" /> | ||||
@@ -273,24 +270,32 @@ | |||||
<Content Include="Data\default-abp-rule.js"> | <Content Include="Data\default-abp-rule.js"> | ||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | </Content> | ||||
<Content Include="Data\libsscrypto.dll"> | |||||
<ContentWithTargetPath Include="Data\libsscrypto.dll"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | |||||
<TargetPath>libsscrypto.dll</TargetPath> | |||||
</ContentWithTargetPath > | |||||
<Content Include="Data\privoxy.exe"> | <Content Include="Data\privoxy.exe"> | ||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | </Content> | ||||
<Content Include="Data\privoxy_conf.txt"> | <Content Include="Data\privoxy_conf.txt"> | ||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | </Content> | ||||
<Content Include="Data\sysproxy.exe"> | |||||
<ContentWithTargetPath Include="Data\sysproxy.exe"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | |||||
<Content Include="Data\sysproxy64.exe"> | |||||
<TargetPath>sysproxy.exe</TargetPath> | |||||
</ContentWithTargetPath> | |||||
<ContentWithTargetPath Include="Data\sysproxy64.exe"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | |||||
<Content Include="Data\user-rule.txt"> | |||||
<TargetPath>sysproxy64.exe</TargetPath> | |||||
</ContentWithTargetPath> | |||||
<ContentWithTargetPath Include="Data\user-rule.txt"> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
</Content> | |||||
<TargetPath>user-rule.txt</TargetPath> | |||||
</ContentWithTargetPath> | |||||
<ContentWithTargetPath Include="Data\i18n.csv"> | |||||
<TargetPath>i18n.csv</TargetPath> | |||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||||
</ContentWithTargetPath > | |||||
<None Include="FodyWeavers.xml"> | <None Include="FodyWeavers.xml"> | ||||
<SubType>Designer</SubType> | <SubType>Designer</SubType> | ||||
</None> | </None> | ||||