Browse Source

Merge pull request #4 from clowwindy/master

Merge with upstream
pull/146/head
Sharuru 10 years ago
parent
commit
be6fb0bf53
22 changed files with 429 additions and 185 deletions
  1. +6
    -0
      CHANGES
  2. +8
    -7
      shadowsocks-csharp/Controller/Local.cs
  3. +2
    -2
      shadowsocks-csharp/Controller/PolipoRunner.cs
  4. BIN
      shadowsocks-csharp/Data/libeay32.dll.gz
  5. BIN
      shadowsocks-csharp/Data/ss32.ico
  6. +1
    -1
      shadowsocks-csharp/Encrypt/EncryptorFactory.cs
  7. +45
    -0
      shadowsocks-csharp/Encrypt/OpenSSL.cs
  8. +170
    -0
      shadowsocks-csharp/Encrypt/OpenSSLEncryptor.cs
  9. +4
    -2
      shadowsocks-csharp/Program.cs
  10. +1
    -1
      shadowsocks-csharp/Properties/AssemblyInfo.cs
  11. +50
    -0
      shadowsocks-csharp/Properties/Resources.Designer.cs
  12. +15
    -0
      shadowsocks-csharp/Properties/Resources.resx
  13. BIN
      shadowsocks-csharp/Resources/ss16.png
  14. BIN
      shadowsocks-csharp/Resources/ss20.png
  15. BIN
      shadowsocks-csharp/Resources/ss24.png
  16. BIN
      shadowsocks-csharp/Resources/ssw128.png
  17. +70
    -52
      shadowsocks-csharp/View/ConfigForm.Designer.cs
  18. +28
    -0
      shadowsocks-csharp/View/ConfigForm.cs
  19. +0
    -120
      shadowsocks-csharp/View/ConfigForm.resx
  20. +16
    -0
      shadowsocks-csharp/app.manifest
  21. +13
    -0
      shadowsocks-csharp/shadowsocks-csharp.csproj
  22. BIN
      shadowsocks-csharp/ssnoti.ico

+ 6
- 0
CHANGES View File

@@ -1,3 +1,9 @@
2.0.7 2014-11-11
- Use OpenSSL for now

2.0.6 2014-11-10
- Minor bug fixes

2.0.5 2014-11-09
- Fix QRCode size
- Share over LAN option


+ 8
- 7
shadowsocks-csharp/Controller/Local.cs View File

@@ -70,7 +70,7 @@ namespace Shadowsocks.Controller
{
Socket listener = (Socket)ar.AsyncState;
Socket conn = listener.EndAccept(ar);
conn.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true);
conn.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true);
listener.BeginAccept(
new AsyncCallback(AcceptCallback),
@@ -103,15 +103,14 @@ namespace Shadowsocks.Controller
public const int RecvSize = 16384;
public const int BufferSize = RecvSize + 32;
// remote receive buffer
public byte[] remoteRecvBuffer = new byte[RecvSize];
private byte[] remoteRecvBuffer = new byte[RecvSize];
// remote send buffer
public byte[] remoteSendBuffer = new byte[BufferSize];
private byte[] remoteSendBuffer = new byte[BufferSize];
// connection receive buffer
public byte[] connetionRecvBuffer = new byte[RecvSize];
private byte[] connetionRecvBuffer = new byte[RecvSize];
// connection send buffer
public byte[] connetionSendBuffer = new byte[BufferSize];
private byte[] connetionSendBuffer = new byte[BufferSize];
// Received data string.
public StringBuilder sb = new StringBuilder();
private bool connectionShutdown = false;
private bool remoteShutdown = false;
@@ -134,7 +133,7 @@ namespace Shadowsocks.Controller
remote = new Socket(ipAddress.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);
remote.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true);
remote.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true);
// Connect to the remote endpoint.
remote.BeginConnect(remoteEP,
@@ -238,6 +237,7 @@ namespace Shadowsocks.Controller
{
// reject socks 4
response = new byte[]{ 0, 91 };
Console.WriteLine("socks 5 protocol error");
}
connection.BeginSend(response, 0, response.Length, 0, new AsyncCallback(HandshakeSendCallback), null);
}
@@ -289,6 +289,7 @@ namespace Shadowsocks.Controller
}
else
{
Console.WriteLine("failed to recv data in handshakeReceive2Callback");
this.Close();
}
}


+ 2
- 2
shadowsocks-csharp/Controller/PolipoRunner.cs View File

@@ -60,9 +60,9 @@ namespace Shadowsocks.Controller
_process.Kill();
_process.WaitForExit();
}
catch (InvalidOperationException)
catch (Exception e)
{
// do nothing
Console.WriteLine(e.ToString());
}
_process = null;
}


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


BIN
shadowsocks-csharp/Data/ss32.ico View File

Before After

+ 1
- 1
shadowsocks-csharp/Encrypt/EncryptorFactory.cs View File

@@ -10,7 +10,7 @@ namespace Shadowsocks.Encrypt
return new TableEncryptor(method, password);
}
return new PolarSSLEncryptor(method, password);
return new OpenSSLEncryptor(method, password);
}
}
}

+ 45
- 0
shadowsocks-csharp/Encrypt/OpenSSL.cs View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace Shadowsocks.Encrypt
{
public class OpenSSL
{
const string DLLNAME = "libeay32";
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static void OpenSSL_add_all_ciphers();
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr EVP_md5();
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int EVP_BytesToKey(IntPtr type, IntPtr md, IntPtr salt, byte[] data, int datal, int count, byte[] key, byte[] iv);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int RAND_bytes(byte[] buf, int num);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr EVP_get_cipherbyname(byte[] name);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr EVP_CIPHER_CTX_new();
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int EVP_CipherInit_ex(IntPtr ctx, IntPtr type, IntPtr impl, byte[] key, byte[] iv, int enc);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int EVP_CIPHER_CTX_cleanup(IntPtr a);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int EVP_CIPHER_CTX_free(IntPtr a);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int EVP_CipherUpdate(IntPtr ctx, byte[] outb, out int outl, byte[] inb, int inl);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static IntPtr MD5(byte[] d, long n, byte[] md);
}
}

+ 170
- 0
shadowsocks-csharp/Encrypt/OpenSSLEncryptor.cs View File

@@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace Shadowsocks.Encrypt
{
public class OpenSSLEncryptor
: EncryptorBase, IDisposable
{
static Dictionary<string, int[]> ciphers = new Dictionary<string, int[]> {
{"aes-128-cfb", new int[]{16, 16}},
{"aes-192-cfb", new int[]{24, 16}},
{"aes-256-cfb", new int[]{32, 16}},
{"bf-cfb", new int[]{16, 8}},
{"rc4", new int[]{16, 0}},
{"rc4-md5", new int[]{16, 16}},
};
static OpenSSLEncryptor()
{
OpenSSL.OpenSSL_add_all_ciphers();
}
public OpenSSLEncryptor(string method, string password)
: base(method, password)
{
InitKey(method, password);
}
static byte[] tempbuf = new byte[32768];
public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
{
if (_encryptCtx == IntPtr.Zero)
{
OpenSSL.RAND_bytes(outbuf, ivLen);
InitCipher(ref _encryptCtx, outbuf, true);
outlength = length + ivLen;
OpenSSL.EVP_CipherUpdate(_encryptCtx, tempbuf, out outlength, buf, length);
outlength = length + ivLen;
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, outlength);
}
else
{
outlength = length;
OpenSSL.EVP_CipherUpdate(_encryptCtx, outbuf, out outlength, buf, length);
}
}
public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
{
if (_decryptCtx == IntPtr.Zero)
{
InitCipher(ref _decryptCtx, buf, false);
outlength = length - ivLen;
Buffer.BlockCopy(buf, ivLen, tempbuf, 0, length - ivLen);
OpenSSL.EVP_CipherUpdate(_decryptCtx, outbuf, out outlength, tempbuf, length - ivLen);
}
else
{
outlength = length;
OpenSSL.EVP_CipherUpdate(_decryptCtx, outbuf, out outlength, buf, length);
}
}
private static readonly Dictionary<string, byte[]> CachedKeys = new Dictionary<string, byte[]>();
private byte[] _key;
private IntPtr _encryptCtx;
private IntPtr _decryptCtx;
private IntPtr _cipher;
private string _method;
private int keyLen;
private int ivLen;
private void InitKey(string method, string password)
{
method = method.ToLower();
_method = method;
string k = method + ":" + password;
if (method == "rc4-md5")
{
method = "rc4";
}
_cipher = OpenSSL.EVP_get_cipherbyname(System.Text.Encoding.UTF8.GetBytes(method));
if (_cipher == null)
{
throw new Exception("method not found");
}
keyLen = ciphers[_method][0];
ivLen = ciphers[_method][1];
if (CachedKeys.ContainsKey(k))
{
_key = CachedKeys[k];
}
else
{
byte[] passbuf = Encoding.UTF8.GetBytes(password);
_key = new byte[32];
byte[] iv = new byte[16];
OpenSSL.EVP_BytesToKey(_cipher, OpenSSL.EVP_md5(), IntPtr.Zero, passbuf, passbuf.Length, 1, _key, iv);
CachedKeys[k] = _key;
}
}
private void InitCipher(ref IntPtr ctx, byte[] iv, bool isCipher)
{
ctx = OpenSSL.EVP_CIPHER_CTX_new();
int enc = isCipher ? 1 : 0;
byte[] realkey;
IntPtr r = IntPtr.Zero;
if (_method == "rc4-md5")
{
byte[] temp = new byte[keyLen + ivLen];
realkey = new byte[keyLen];
Array.Copy(_key, 0, temp, 0, keyLen);
Array.Copy(iv, 0, temp, keyLen, ivLen);
r = OpenSSL.MD5(temp, keyLen + ivLen, null);
Marshal.Copy(r, realkey, 0, keyLen);
}
else
{
realkey = _key;
}
OpenSSL.EVP_CipherInit_ex(ctx, _cipher, IntPtr.Zero, realkey, iv, enc);
}
#region IDisposable
private bool _disposed;
public override void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
~OpenSSLEncryptor()
{
Dispose(false);
}
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
}
if (_encryptCtx.ToInt64() != 0)
{
OpenSSL.EVP_CIPHER_CTX_cleanup(_encryptCtx);
OpenSSL.EVP_CIPHER_CTX_free(_encryptCtx);
_encryptCtx = IntPtr.Zero;
}
if (_decryptCtx.ToInt64() != 0)
{
OpenSSL.EVP_CIPHER_CTX_cleanup(_decryptCtx);
OpenSSL.EVP_CIPHER_CTX_free(_decryptCtx);
_decryptCtx = IntPtr.Zero;
}
_disposed = true;
}
}
#endregion
}
}

+ 4
- 2
shadowsocks-csharp/Program.cs View File

@@ -36,10 +36,10 @@ namespace Shadowsocks
return;
}
string tempPath = Path.GetTempPath();
string dllPath = tempPath + "/polarssl.dll";
string dllPath = tempPath + "/libeay32.dll";
try
{
FileManager.UncompressFile(dllPath, Resources.polarssl_dll);
FileManager.UncompressFile(dllPath, Resources.libeay32_dll);
}
catch (IOException e)
{
@@ -47,7 +47,9 @@ namespace Shadowsocks
}
LoadLibrary(dllPath);
#if !DEBUG
Logging.OpenLogFile();
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ShadowsocksController controller = new ShadowsocksController();


+ 1
- 1
shadowsocks-csharp/Properties/AssemblyInfo.cs View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.6")]
[assembly: AssemblyVersion("2.0.7")]
// [assembly: AssemblyFileVersion("2.0.0")]

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

@@ -63,6 +63,16 @@ namespace Shadowsocks.Properties {
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] libeay32_dll {
get {
object obj = ResourceManager.GetObject("libeay32_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] polarssl_dll {
get {
object obj = ResourceManager.GetObject("polarssl_dll", resourceCulture);
@@ -104,5 +114,45 @@ namespace Shadowsocks.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ss16 {
get {
object obj = ResourceManager.GetObject("ss16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ss20 {
get {
object obj = ResourceManager.GetObject("ss20", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ss24 {
get {
object obj = ResourceManager.GetObject("ss24", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ssw128 {
get {
object obj = ResourceManager.GetObject("ssw128", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

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

@@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="libeay32_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\libeay32.dll.gz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="polarssl_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\polarssl.dll.gz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@@ -130,4 +133,16 @@
<data name="proxy_pac_txt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\proxy.pac.txt.gz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ss16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ss16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ss20" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ss20.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ss24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ss24.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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>
</root>

BIN
shadowsocks-csharp/Resources/ss16.png View File

Before After
Width: 16  |  Height: 16  |  Size: 376 B

BIN
shadowsocks-csharp/Resources/ss20.png View File

Before After
Width: 20  |  Height: 20  |  Size: 411 B

BIN
shadowsocks-csharp/Resources/ss24.png View File

Before After
Width: 24  |  Height: 24  |  Size: 492 B

BIN
shadowsocks-csharp/Resources/ssw128.png View File

Before After
Width: 128  |  Height: 128  |  Size: 1.7 kB

+ 70
- 52
shadowsocks-csharp/View/ConfigForm.Designer.cs View File

@@ -29,7 +29,6 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigForm));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.RemarksTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@@ -91,10 +90,10 @@
this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 3);
this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 21);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(5);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 31);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(5);
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
@@ -102,15 +101,16 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(242, 167);
this.tableLayoutPanel1.Size = new System.Drawing.Size(360, 232);
this.tableLayoutPanel1.TabIndex = 0;
//
// RemarksTextBox
//
this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.RemarksTextBox.Location = new System.Drawing.Point(74, 139);
this.RemarksTextBox.Location = new System.Drawing.Point(110, 194);
this.RemarksTextBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.RemarksTextBox.Name = "RemarksTextBox";
this.RemarksTextBox.Size = new System.Drawing.Size(160, 20);
this.RemarksTextBox.Size = new System.Drawing.Size(238, 26);
this.RemarksTextBox.TabIndex = 10;
this.RemarksTextBox.WordWrap = false;
//
@@ -118,9 +118,10 @@
//
this.label6.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(19, 142);
this.label6.Location = new System.Drawing.Point(27, 197);
this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(49, 13);
this.label6.Size = new System.Drawing.Size(73, 20);
this.label6.TabIndex = 9;
this.label6.Text = "Remarks";
//
@@ -128,9 +129,10 @@
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(17, 11);
this.label1.Location = new System.Drawing.Point(26, 15);
this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(51, 13);
this.label1.Size = new System.Drawing.Size(74, 20);
this.label1.TabIndex = 0;
this.label1.Text = "Server IP";
//
@@ -138,18 +140,20 @@
//
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(8, 37);
this.label2.Location = new System.Drawing.Point(12, 51);
this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 13);
this.label2.Size = new System.Drawing.Size(88, 20);
this.label2.TabIndex = 1;
this.label2.Text = "Server Port";
//
// ProxyPortTextBox
//
this.ProxyPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.ProxyPortTextBox.Location = new System.Drawing.Point(74, 113);
this.ProxyPortTextBox.Location = new System.Drawing.Point(110, 158);
this.ProxyPortTextBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ProxyPortTextBox.Name = "ProxyPortTextBox";
this.ProxyPortTextBox.Size = new System.Drawing.Size(160, 20);
this.ProxyPortTextBox.Size = new System.Drawing.Size(238, 26);
this.ProxyPortTextBox.TabIndex = 4;
this.ProxyPortTextBox.WordWrap = false;
//
@@ -157,9 +161,10 @@
//
this.label4.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(13, 116);
this.label4.Location = new System.Drawing.Point(20, 161);
this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(55, 13);
this.label4.Size = new System.Drawing.Size(80, 20);
this.label4.TabIndex = 3;
this.label4.Text = "Proxy Port";
//
@@ -167,37 +172,41 @@
//
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(15, 63);
this.label3.Location = new System.Drawing.Point(22, 87);
this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 13);
this.label3.Size = new System.Drawing.Size(78, 20);
this.label3.TabIndex = 2;
this.label3.Text = "Password";
//
// IPTextBox
//
this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.IPTextBox.Location = new System.Drawing.Point(74, 8);
this.IPTextBox.Location = new System.Drawing.Point(110, 12);
this.IPTextBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.IPTextBox.Name = "IPTextBox";
this.IPTextBox.Size = new System.Drawing.Size(160, 20);
this.IPTextBox.Size = new System.Drawing.Size(238, 26);
this.IPTextBox.TabIndex = 0;
this.IPTextBox.WordWrap = false;
//
// ServerPortTextBox
//
this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.ServerPortTextBox.Location = new System.Drawing.Point(74, 34);
this.ServerPortTextBox.Location = new System.Drawing.Point(110, 48);
this.ServerPortTextBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ServerPortTextBox.Name = "ServerPortTextBox";
this.ServerPortTextBox.Size = new System.Drawing.Size(160, 20);
this.ServerPortTextBox.Size = new System.Drawing.Size(238, 26);
this.ServerPortTextBox.TabIndex = 1;
this.ServerPortTextBox.WordWrap = false;
//
// PasswordTextBox
//
this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.PasswordTextBox.Location = new System.Drawing.Point(74, 60);
this.PasswordTextBox.Location = new System.Drawing.Point(110, 84);
this.PasswordTextBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.PasswordTextBox.Name = "PasswordTextBox";
this.PasswordTextBox.PasswordChar = '*';
this.PasswordTextBox.Size = new System.Drawing.Size(160, 20);
this.PasswordTextBox.Size = new System.Drawing.Size(238, 26);
this.PasswordTextBox.TabIndex = 2;
this.PasswordTextBox.WordWrap = false;
//
@@ -205,9 +214,10 @@
//
this.label5.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(11, 90);
this.label5.Location = new System.Drawing.Point(16, 124);
this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(57, 13);
this.label5.Size = new System.Drawing.Size(84, 20);
this.label5.TabIndex = 8;
this.label5.Text = "Encryption";
//
@@ -218,7 +228,7 @@
this.EncryptionSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.EncryptionSelect.FormattingEnabled = true;
this.EncryptionSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.EncryptionSelect.ItemHeight = 13;
this.EncryptionSelect.ItemHeight = 20;
this.EncryptionSelect.Items.AddRange(new object[] {
"table",
"rc4-md5",
@@ -227,16 +237,15 @@
"aes-128-cfb",
"bf-cfb",
"rc4"});
this.EncryptionSelect.Location = new System.Drawing.Point(74, 86);
this.EncryptionSelect.Location = new System.Drawing.Point(110, 120);
this.EncryptionSelect.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.EncryptionSelect.Name = "EncryptionSelect";
this.EncryptionSelect.Size = new System.Drawing.Size(160, 21);
this.EncryptionSelect.Size = new System.Drawing.Size(238, 28);
this.EncryptionSelect.TabIndex = 3;
//
// notifyIcon1
//
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "Shadowsocks";
this.notifyIcon1.Visible = true;
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
// panel2
@@ -244,7 +253,8 @@
this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.panel2.AutoSize = true;
this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.panel2.Location = new System.Drawing.Point(164, 175);
this.panel2.Location = new System.Drawing.Point(246, 263);
this.panel2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(0, 0);
this.panel2.TabIndex = 1;
@@ -252,9 +262,10 @@
// OKButton
//
this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OKButton.Location = new System.Drawing.Point(4, 4);
this.OKButton.Location = new System.Drawing.Point(6, 6);
this.OKButton.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.OKButton.Name = "OKButton";
this.OKButton.Size = new System.Drawing.Size(75, 23);
this.OKButton.Size = new System.Drawing.Size(113, 35);
this.OKButton.TabIndex = 8;
this.OKButton.Text = "OK";
this.OKButton.UseVisualStyleBackColor = true;
@@ -263,9 +274,10 @@
// MyCancelButton
//
this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.MyCancelButton.Location = new System.Drawing.Point(86, 4);
this.MyCancelButton.Location = new System.Drawing.Point(130, 6);
this.MyCancelButton.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.MyCancelButton.Name = "MyCancelButton";
this.MyCancelButton.Size = new System.Drawing.Size(75, 23);
this.MyCancelButton.Size = new System.Drawing.Size(113, 35);
this.MyCancelButton.TabIndex = 9;
this.MyCancelButton.Text = "Cancel";
this.MyCancelButton.UseVisualStyleBackColor = true;
@@ -277,10 +289,10 @@
this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.panel1.Controls.Add(this.MyCancelButton);
this.panel1.Controls.Add(this.OKButton);
this.panel1.Location = new System.Drawing.Point(313, 247);
this.panel1.Location = new System.Drawing.Point(469, 371);
this.panel1.Margin = new System.Windows.Forms.Padding(0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(164, 30);
this.panel1.Size = new System.Drawing.Size(248, 46);
this.panel1.TabIndex = 1;
//
// contextMenu1
@@ -373,17 +385,18 @@
this.panel3.AutoSize = true;
this.panel3.Controls.Add(this.DeleteButton);
this.panel3.Controls.Add(this.AddButton);
this.panel3.Location = new System.Drawing.Point(12, 220);
this.panel3.Location = new System.Drawing.Point(18, 330);
this.panel3.Margin = new System.Windows.Forms.Padding(0);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(192, 30);
this.panel3.Size = new System.Drawing.Size(288, 46);
this.panel3.TabIndex = 5;
//
// DeleteButton
//
this.DeleteButton.Location = new System.Drawing.Point(100, 4);
this.DeleteButton.Location = new System.Drawing.Point(150, 6);
this.DeleteButton.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.DeleteButton.Name = "DeleteButton";
this.DeleteButton.Size = new System.Drawing.Size(89, 23);
this.DeleteButton.Size = new System.Drawing.Size(133, 35);
this.DeleteButton.TabIndex = 7;
this.DeleteButton.Text = "&Delete";
this.DeleteButton.UseVisualStyleBackColor = true;
@@ -391,9 +404,10 @@
//
// AddButton
//
this.AddButton.Location = new System.Drawing.Point(4, 4);
this.AddButton.Location = new System.Drawing.Point(6, 6);
this.AddButton.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.AddButton.Name = "AddButton";
this.AddButton.Size = new System.Drawing.Size(89, 23);
this.AddButton.Size = new System.Drawing.Size(133, 35);
this.AddButton.TabIndex = 6;
this.AddButton.Text = "&Add";
this.AddButton.UseVisualStyleBackColor = true;
@@ -402,9 +416,11 @@
// ServerGroupBox
//
this.ServerGroupBox.Controls.Add(this.tableLayoutPanel1);
this.ServerGroupBox.Location = new System.Drawing.Point(222, 12);
this.ServerGroupBox.Location = new System.Drawing.Point(334, 18);
this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ServerGroupBox.Name = "ServerGroupBox";
this.ServerGroupBox.Size = new System.Drawing.Size(255, 205);
this.ServerGroupBox.Padding = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ServerGroupBox.Size = new System.Drawing.Size(383, 307);
this.ServerGroupBox.TabIndex = 6;
this.ServerGroupBox.TabStop = false;
this.ServerGroupBox.Text = "Server";
@@ -412,27 +428,29 @@
// ServersListBox
//
this.ServersListBox.FormattingEnabled = true;
this.ServersListBox.Location = new System.Drawing.Point(12, 12);
this.ServersListBox.ItemHeight = 20;
this.ServersListBox.Location = new System.Drawing.Point(18, 18);
this.ServersListBox.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.ServersListBox.Name = "ServersListBox";
this.ServersListBox.Size = new System.Drawing.Size(192, 186);
this.ServersListBox.Size = new System.Drawing.Size(286, 264);
this.ServersListBox.TabIndex = 5;
this.ServersListBox.SelectedIndexChanged += new System.EventHandler(this.ServersListBox_SelectedIndexChanged);
//
// ConfigForm
//
this.AcceptButton = this.OKButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoSize = true;
this.CancelButton = this.MyCancelButton;
this.ClientSize = new System.Drawing.Size(489, 286);
this.ClientSize = new System.Drawing.Size(733, 430);
this.Controls.Add(this.ServersListBox);
this.Controls.Add(this.ServerGroupBox);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ConfigForm";


+ 28
- 0
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -7,6 +7,7 @@ using System.Windows.Forms;
using System.Diagnostics;
using Shadowsocks.Controller;
using Shadowsocks.Model;
using Shadowsocks.Properties;
namespace Shadowsocks.View
{
@@ -23,6 +24,7 @@ namespace Shadowsocks.View
public ConfigForm(ShadowsocksController controller)
{
InitializeComponent();
LoadTrayIcon();
notifyIcon1.ContextMenu = contextMenu1;
this.controller = controller;
@@ -37,6 +39,32 @@ namespace Shadowsocks.View
LoadCurrentConfiguration();
}
private void LoadTrayIcon()
{
int dpi;
Graphics graphics = this.CreateGraphics();
dpi = (int)graphics.DpiX;
graphics.Dispose();
Bitmap icon = null;
if (dpi < 97)
{
// dpi = 96;
icon = Resources.ss16;
}
else if (dpi < 121)
{
// dpi = 120;
icon = Resources.ss20;
}
else
{
icon = Resources.ss24;
}
notifyIcon1.Icon = Icon.FromHandle(icon.GetHicon());
notifyIcon1.Visible = true;
this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());
}
private void controller_ConfigChanged(object sender, EventArgs e)
{
LoadCurrentConfiguration();


+ 0
- 120
shadowsocks-csharp/View/ConfigForm.resx View File

@@ -120,127 +120,7 @@
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="notifyIcon1.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
AAD///8B////Af///wH///8B////Af///wH///8BBAQIcf///wH///8B////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////ARQUF/8EBAgx////Af///wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wFycnT/Kysuz////wH///8B////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BUlJV/zY2Oe8EBAgx////AQQE
CFEEBAifBAQIMf///wH///8B////Af///wH///8B////Af///wH///8B////AQQECGEEBAhhMjI1r3Jy
dP+xsbL/4ODg/wQECIH///8B////Af///wH///8B////Af///wEEBAgxBAQIcQQECCEVFRjv0NDR////
//////////////////8yMjWv////Af///wH///8BBAQIIQQECI9eXmDfoaGi/8DAwf8XFxvPBAQIQWJi
Zf//////////////////////aGhr7////wH///8BBAQIgTMzNv/g4OD/////////////////7+/w/z4+
Qc8EBAiPoaGi/////////////////6Ghov8EBAgx////Af///wEEBAhBLi4xv6Ghov//////////////
///v7/D/WFha7wQECL/AwMH////////////g4OD/BAQIcf///wH///8B////Af///wEEBAhBLi4xv6Gh
ov////////////////9ycnT/FBQX/9DQ0f///////////zIyNa////8B////Af///wH///8B////Af//
/wEEBAhBLi4xv6Ghov///////////6Ghov8jIyf/7+/w//////9YWFrv////Af///wH///8B////Af//
/wH///8B////Af///wEEBAhBLi4xv6Ghov//////wMDB/2JiZf//////kZGT/wQECCH///8B////Af//
/wH///8B////Af///wH///8B////Af///wEEBAhBLi4xv6Ghov///////////9DQ0f8EBAhh////Af//
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wEEBAhBLi4xv6Ghov//////HR0hn///
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEEBAhBLi4xvygo
K9////8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
/wEEBAhBAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//w==
</value>
</data>
<metadata name="contextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>146, 19</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAE
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANaragwAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCgySL165vBAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwH8cv8OG
KXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMKD
I7jDhSej6NGuAwAAAADPnVMTxYowX925hAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AADgwZEGzJdHJMOFKHLBgiLAwH8c/L99Gf/HjTU4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA06ZhB8yX
RysAAAAAxYkvhb99Gv+/fRn/v30Z/799Gf+/fRn/w4YpdwAAAAAAAAAAAAAAAOHClALHjTVDwoQlncCA
HvDAfhv8xYkub9CgVgvBgiHOv30Z/799Gf+/fRn/v30Z/8KCI7MAAAAAAAAAAM2ZSxnChCXMv30Z/799
Gf+/fRn/v30Z/799Gf/EhyuXzptOIsGAH+e/fRn/v30Z/799Gf/AgB7u69e3AgAAAAAAAAAA161uDMWK
MHjBgSDrv30Z/799Gf+/fRn/v30Z/8KEJbrKk0FIwH8c9r99Gf+/fRn/v30Z/8qTQ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////w////8H////Dwf//3gH///
AB///AAf/4wAD/wGAA/gAwAPgACAD4AAQAfgAAAH+AAAB/4AAAf/gAAD/+AAA//4AAP//gAD//+AA///
4AH///gB///+Af///4H////g////+P////7/////
</value>
</data>
</root>

+ 16
- 0
shadowsocks-csharp/app.manifest View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

+ 13
- 0
shadowsocks-csharp/shadowsocks-csharp.csproj View File

@@ -58,6 +58,9 @@
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -73,6 +76,8 @@
<Compile Include="Controller\UpdateChecker.cs" />
<Compile Include="Encrypt\EncryptorBase.cs" />
<Compile Include="Encrypt\EncryptorFactory.cs" />
<Compile Include="Encrypt\OpenSSL.cs" />
<Compile Include="Encrypt\OpenSSLEncryptor.cs" />
<Compile Include="Encrypt\PolarSSL.cs" />
<Compile Include="Encrypt\PolarSSLEncryptor.cs" />
<Compile Include="Encrypt\TableEncryptor.cs" />
@@ -116,6 +121,10 @@
<DependentUpon>QRCodeForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="Data\libeay32.dll.gz" />
<None Include="Data\polarssl.dll.gz" />
<None Include="Data\polipo.exe.gz" />
<None Include="Properties\Settings.settings">
@@ -130,6 +139,10 @@
<None Include="Data\proxy.pac.txt.gz" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ss20.png" />
<None Include="Resources\ss16.png" />
<None Include="Resources\ss24.png" />
<None Include="Resources\ssw128.png" />
<Content Include="shadowsocks.ico" />
<None Include="Data\polipo_config.txt" />
</ItemGroup>


BIN
shadowsocks-csharp/ssnoti.ico View File

Before After

Loading…
Cancel
Save