Browse Source

no longer pack privoxy and libsscrypto in exe

tags/4.1.9.2-nbbnu
Student Main 5 years ago
parent
commit
3184de18f2
6 changed files with 5 additions and 88 deletions
  1. +2
    -3
      shadowsocks-csharp/Controller/Service/PrivoxyRunner.cs
  2. +1
    -13
      shadowsocks-csharp/Encryption/MbedTLS.cs
  3. +1
    -13
      shadowsocks-csharp/Encryption/OpenSSL.cs
  4. +1
    -13
      shadowsocks-csharp/Encryption/Sodium.cs
  5. +0
    -37
      shadowsocks-csharp/Properties/Resources.Designer.cs
  6. +0
    -9
      shadowsocks-csharp/Properties/Resources.resx

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

@@ -28,8 +28,7 @@ namespace Shadowsocks.Controller
_uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance. _uid = Application.StartupPath.GetHashCode(); // Currently we use ss's StartupPath to identify different Privoxy instance.
_uniqueConfigFile = $"privoxy_{_uid}.conf"; _uniqueConfigFile = $"privoxy_{_uid}.conf";
_privoxyJob = new Job(); _privoxyJob = new Job();
FileManager.ByteArrayToFile(Utils.GetTempPath("ss_privoxy.exe"), Resources.privoxy);
File.Copy(Utils.GetDataPath("privoxy.exe"), Utils.GetTempPath("ss_privoxy.exe"));
} }
catch (IOException e) catch (IOException e)
{ {
@@ -48,7 +47,7 @@ namespace Shadowsocks.Controller
{ {
KillProcess(p); KillProcess(p);
} }
string privoxyConfig = Resources.privoxy_conf;
string privoxyConfig = File.ReadAllText(Utils.GetDataPath("privoxy_conf.txt"));
_runningPort = GetFreePort(configuration.isIPv6Enabled); _runningPort = GetFreePort(configuration.isIPv6Enabled);
privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", configuration.localPort.ToString()); privoxyConfig = privoxyConfig.Replace("__SOCKS_PORT__", configuration.localPort.ToString());
privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", _runningPort.ToString()); privoxyConfig = privoxyConfig.Replace("__PRIVOXY_BIND_PORT__", _runningPort.ToString());


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

@@ -16,19 +16,7 @@ namespace Shadowsocks.Encryption
static MbedTLS() static MbedTLS()
{ {
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{
}
catch (System.Exception e)
{
Logging.LogUsefulException(e);
}
LoadLibrary(dllPath);
LoadLibrary(Utils.GetDataPath(DLLNAME));
} }
public static byte[] MD5(byte[] input) public static byte[] MD5(byte[] input)


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

@@ -24,19 +24,7 @@ namespace Shadowsocks.Encryption
static OpenSSL() static OpenSSL()
{ {
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{
}
catch (System.Exception e)
{
Logging.LogUsefulException(e);
}
LoadLibrary(dllPath);
LoadLibrary(Utils.GetDataPath(DLLNAME));
} }
public static IntPtr GetCipherInfo(string cipherName) public static IntPtr GetCipherInfo(string cipherName)


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

@@ -18,19 +18,7 @@ namespace Shadowsocks.Encryption
static Sodium() static Sodium()
{ {
string dllPath = Utils.GetTempPath(DLLNAME);
try
{
FileManager.ByteArrayToFile(dllPath, Resources.libsscrypto);
}
catch (IOException)
{
}
catch (System.Exception e)
{
Logging.LogUsefulException(e);
}
LoadLibrary(dllPath);
LoadLibrary(Utils.GetDataPath(DLLNAME));
lock (_initLock) lock (_initLock)
{ {


+ 0
- 37
shadowsocks-csharp/Properties/Resources.Designer.cs View File

@@ -60,43 +60,6 @@ namespace Shadowsocks.Properties {
} }
} }
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
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("privoxy", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找类似 listen-address __PRIVOXY_BIND_IP__:__PRIVOXY_BIND_PORT__
///toggle 0
///logfile ss_privoxy.log
///show-on-task-bar 0
///activity-animation 0
///forward-socks5 / __SOCKS_HOST__:__SOCKS_PORT__ .
///max-client-connections 2048
///hide-console
/// 的本地化字符串。
/// </summary>
internal static string privoxy_conf {
get {
return ResourceManager.GetString("privoxy_conf", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary> /// </summary>


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

@@ -118,15 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<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="ss32Fill" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\ss32Fill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>


Loading…
Cancel
Save