Browse Source

no longer gzip resource

tags/4.1.9.2-nbbnu
Student Main 5 years ago
parent
commit
2f4f302207
17 changed files with 59 additions and 65 deletions
  1. +0
    -18
      shadowsocks-csharp/Controller/FileManager.cs
  2. +1
    -1
      shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs
  3. BIN
      shadowsocks-csharp/Data/libsscrypto.dll
  4. BIN
      shadowsocks-csharp/Data/libsscrypto.dll.gz
  5. BIN
      shadowsocks-csharp/Data/privoxy.exe
  6. BIN
      shadowsocks-csharp/Data/privoxy.exe.gz
  7. BIN
      shadowsocks-csharp/Data/sysproxy.exe
  8. BIN
      shadowsocks-csharp/Data/sysproxy.exe.gz
  9. BIN
      shadowsocks-csharp/Data/sysproxy64.exe
  10. BIN
      shadowsocks-csharp/Data/sysproxy64.exe.gz
  11. +1
    -1
      shadowsocks-csharp/Encryption/MbedTLS.cs
  12. +1
    -1
      shadowsocks-csharp/Encryption/OpenSSL.cs
  13. +1
    -1
      shadowsocks-csharp/Encryption/Sodium.cs
  14. +25
    -23
      shadowsocks-csharp/Properties/Resources.Designer.cs
  15. +9
    -9
      shadowsocks-csharp/Properties/Resources.resx
  16. +2
    -2
      shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs
  17. +19
    -9
      shadowsocks-csharp/shadowsocks-csharp.csproj

+ 0
- 18
shadowsocks-csharp/Controller/FileManager.cs View File

@@ -22,24 +22,6 @@ namespace Shadowsocks.Controller
return false;
}
public static void UncompressFile(string fileName, byte[] content)
{
// Because the uncompressed size of the file is unknown,
// we are using an arbitrary buffer size.
byte[] buffer = new byte[4096];
int n;
using(var fs = File.Create(fileName))
using (var input = new GZipStream(new MemoryStream(content),
CompressionMode.Decompress, false))
{
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
{
fs.Write(buffer, 0, n);
}
}
}
public static string NonExclusiveReadAllText(string path)
{
return NonExclusiveReadAllText(path, Encoding.Default);


+ 1
- 1
shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs View File

@@ -29,7 +29,7 @@ namespace Shadowsocks.Controller
_uniqueConfigFile = $"privoxy_{_uid}.conf";
_privoxyJob = new Job();
FileManager.UncompressFile(Utils.GetTempPath("ss_privoxy.exe"), Resources.privoxy_exe);
FileManager.ByteArrayToFile(Utils.GetTempPath("ss_privoxy.exe"), Resources.privoxy);
}
catch (IOException e)
{


BIN
shadowsocks-csharp/Data/libsscrypto.dll View File


BIN
shadowsocks-csharp/Data/libsscrypto.dll.gz View File


BIN
shadowsocks-csharp/Data/privoxy.exe View File


BIN
shadowsocks-csharp/Data/privoxy.exe.gz View File


BIN
shadowsocks-csharp/Data/sysproxy.exe View File


BIN
shadowsocks-csharp/Data/sysproxy.exe.gz View File


BIN
shadowsocks-csharp/Data/sysproxy64.exe View File


BIN
shadowsocks-csharp/Data/sysproxy64.exe.gz View File


+ 1
- 1
shadowsocks-csharp/Encryption/MbedTLS.cs View File

@@ -19,7 +19,7 @@ namespace Shadowsocks.Encryption
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll);
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{


+ 1
- 1
shadowsocks-csharp/Encryption/OpenSSL.cs View File

@@ -27,7 +27,7 @@ namespace Shadowsocks.Encryption
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll);
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{


+ 1
- 1
shadowsocks-csharp/Encryption/Sodium.cs View File

@@ -21,7 +21,7 @@ namespace Shadowsocks.Encryption
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.UncompressFile(dllPath, Resources.libsscrypto_dll);
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{


+ 25
- 23
shadowsocks-csharp/Properties/Resources.Designer.cs View File

@@ -116,21 +116,23 @@ namespace Shadowsocks.Properties {
/// <summary>
/// 查找类似 en,zh-CN,zh-TW,ja
///#Restart program to apply translation,,,
///#This is comment line,,,
///#Always keep language name at head of file,,,
///#Language name is output in log,,,
///&quot;#You can find it by search &quot;&quot;Current language is:&quot;&quot;&quot;,,,
///#Please use UTF-8 with BOM encoding so we can edit it in Excel,,,
///,,,
///Shadowsocks,Shadowsocks,Shadowsocks,Shadowsocks
///,,,
///#Menu,,,
///,,,
///System Proxy,系统代理,系統代理,システムプロキシ
///Disable,禁用,禁用,無効
///PAC,PAC 模式,PAC 模式,PAC
///Global,全局模式,全局模式,全般
///Servers,服务器,伺服器,サーバー
///Edit Servers...,编辑服务器...,編輯伺服器...,サーバーの編集...
///Statistics Config...,统计配置...,統計設定檔...,統計情報の設定...
///Start on Boot,开机启动,開機啟動,システムと同時に起動
///Forward Proxy...,正向代理设置...,正向 Proxy 設定...,フォワードプロキシの設定...
///Allow other Devices to connect,允许其他设备连入,允許其他裝置連入,他のデバイスからの接続を許可する
///Local PAC,使用本地 PAC,使用本機 PAC,ローカル PAC
///Online PAC,使用在线 PAC,使 [字符串的其余部分被截断]&quot;; 的本地化字符串。
///Edit Servers...,编辑服务器...,編 [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string i18n_csv {
get {
@@ -141,9 +143,19 @@ namespace Shadowsocks.Properties {
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] libsscrypto_dll {
internal static byte[] libsscrypto {
get {
object obj = ResourceManager.GetObject("libsscrypto", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] privoxy {
get {
object obj = ResourceManager.GetObject("libsscrypto_dll", resourceCulture);
object obj = ResourceManager.GetObject("privoxy", resourceCulture);
return ((byte[])(obj));
}
}
@@ -165,16 +177,6 @@ namespace Shadowsocks.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] privoxy_exe {
get {
object obj = ResourceManager.GetObject("privoxy_exe", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@@ -228,9 +230,9 @@ namespace Shadowsocks.Properties {
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy_exe {
internal static byte[] sysproxy {
get {
object obj = ResourceManager.GetObject("sysproxy_exe", resourceCulture);
object obj = ResourceManager.GetObject("sysproxy", resourceCulture);
return ((byte[])(obj));
}
}
@@ -238,9 +240,9 @@ namespace Shadowsocks.Properties {
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] sysproxy64_exe {
internal static byte[] sysproxy64 {
get {
object obj = ResourceManager.GetObject("sysproxy64_exe", resourceCulture);
object obj = ResourceManager.GetObject("sysproxy64", resourceCulture);
return ((byte[])(obj));
}
}


+ 9
- 9
shadowsocks-csharp/Properties/Resources.resx View File

@@ -127,15 +127,15 @@
<data name="i18n_csv" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\i18n.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="libsscrypto_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\libsscrypto.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<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>
<data name="privoxy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\privoxy.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="privoxy_conf" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\data\privoxy_conf.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="privoxy_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\data\privoxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ss32Fill" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ss32Fill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -151,11 +151,11 @@
<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="sysproxy64_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\sysproxy64.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="sysproxy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\sysproxy.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="sysproxy_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\sysproxy.exe.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="sysproxy64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\sysproxy64.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</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>


+ 2
- 2
shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs View File

@@ -65,8 +65,8 @@ namespace Shadowsocks.Util.SystemProxy
{
try
{
FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"),
Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe);
FileManager.ByteArrayToFile(Utils.GetTempPath("sysproxy.exe"),
Environment.Is64BitOperatingSystem ? Resources.sysproxy64 : Resources.sysproxy);
}
catch (IOException e)
{


+ 19
- 9
shadowsocks-csharp/shadowsocks-csharp.csproj View File

@@ -255,13 +255,11 @@
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Data\i18n.csv" />
<None Include="Data\libsscrypto.dll.gz" />
<None Include="Data\privoxy.exe.gz" />
<None Include="Data\i18n.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="Data\sysproxy.exe.gz" />
<None Include="Data\sysproxy64.exe.gz" />
<None Include="packages.config" />
<None Include="Properties\DataSources\Shadowsocks.Model.StatisticsStrategyConfiguration.datasource" />
<None Include="Properties\Settings.settings">
@@ -269,10 +267,22 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Resources\ssw128.png" />
<Content Include="Data\abp.js" />
<Content Include="Data\default-abp-rule.js" />
<Content Include="Data\privoxy_conf.txt" />
<Content Include="Data\user-rule.txt" />
<Content Include="Data\abp.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\default-abp-rule.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\libsscrypto.dll" />
<Content Include="Data\privoxy.exe" />
<Content Include="Data\privoxy_conf.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\sysproxy.exe" />
<Content Include="Data\sysproxy64.exe" />
<Content Include="Data\user-rule.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="FodyWeavers.xml">
<SubType>Designer</SubType>
</None>


Loading…
Cancel
Save