Compare commits
335
Commits
compare_crypto
...
rm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c688584d48 | ||
|
|
31f98d01b7 | ||
|
|
3e16978968 | ||
|
|
28887b9896 | ||
|
|
d4d3e804cb | ||
|
|
336e0368a1 | ||
|
|
138e4f0715 | ||
|
|
dbaa2372e2 | ||
|
|
19370a88c5 | ||
|
|
fbc33ad337 | ||
|
|
ec5cf089c1 | ||
|
|
7dca90aef5 | ||
|
|
5eaa1b9e2b | ||
|
|
700cd3a7e7 | ||
|
|
7cb863b0c2 | ||
|
|
2d18d8306f | ||
|
|
f4007b685b | ||
|
|
01f033225b | ||
|
|
d3365a8fa4 | ||
|
|
09d57ef0c0 | ||
|
|
b6f1def40f | ||
|
|
7918cb4bd2 | ||
|
|
ce53273f33 | ||
|
|
b7611a7db7 | ||
|
|
b57edeb082 | ||
|
|
fe991db6da | ||
|
|
25386c2f8c | ||
|
|
24e5235d59 | ||
|
|
1a0f4807c2 | ||
|
|
3a34bad62f | ||
|
|
b2b11bb97b | ||
|
|
5463b2859a | ||
|
|
8c8c947356 | ||
|
|
3e56b3d3a4 | ||
|
|
5aa2822904 | ||
|
|
43a952d3d7 | ||
|
|
65f0257e6d | ||
|
|
18e6daf47d | ||
|
|
788d74cefd | ||
|
|
edde91c17d | ||
|
|
e81b87e7df | ||
|
|
aa6c38ece3 | ||
|
|
444fabaa79 | ||
|
|
42c3776aa5 | ||
|
|
fb51f30fd9 | ||
|
|
d4bdd2e598 | ||
|
|
3064314a23 | ||
|
|
32941478d7 | ||
|
|
3aa325edec | ||
|
|
1bf0c8bd46 | ||
|
|
0040972886 | ||
|
|
15f57a4d04 | ||
|
|
5cfb870bbc | ||
|
|
a231cba73b | ||
|
|
40aded9571 | ||
|
|
38c597ba0c | ||
|
|
4dae44c59b | ||
|
|
179eb818a7 | ||
|
|
1b38b9060d | ||
|
|
ef74cd497c | ||
|
|
794c8bb080 | ||
|
|
25c133070f | ||
|
|
c2f7145980 | ||
|
|
b8fbc20858 | ||
|
|
49d04316cd | ||
|
|
dce38883a5 | ||
|
|
0f1aff24a5 | ||
|
|
d995169fec | ||
|
|
de0f752cc8 | ||
|
|
e878b41519 | ||
|
|
f6939f1119 | ||
|
|
7927811ba3 | ||
|
|
418941cb75 | ||
|
|
70d7e813a4 | ||
|
|
797bd863aa | ||
|
|
b9b9202cde | ||
|
|
a0a5cafe3d | ||
|
|
6192e09970 | ||
|
|
082494d587 | ||
|
|
b3e83bbe57 | ||
|
|
075069ef16 | ||
|
|
b646b41c81 | ||
|
|
a984014267 | ||
|
|
1d21f2504d | ||
|
|
4860d5b32a | ||
|
|
77aa5e8280 | ||
|
|
74c61ca76a | ||
|
|
45d4667aa9 | ||
|
|
d4f2ea6765 | ||
|
|
c24c1d44b7 | ||
|
|
8a1ea1eee4 | ||
|
|
dd00516587 | ||
|
|
d93adb16c4 | ||
|
|
78c58b3a23 | ||
|
|
b7a8360449 | ||
|
|
a2f3116ca8 | ||
|
|
a984e90727 | ||
|
|
f1c821a9cd | ||
|
|
b10d06dd4b | ||
|
|
1c5fcbc137 | ||
|
|
1d8c414c9f | ||
|
|
aa8a816f9f | ||
|
|
4856b1c74a | ||
|
|
988bf98fed | ||
|
|
431b638feb | ||
|
|
0e152d56ab | ||
|
|
25b8ef7166 | ||
|
|
604feb76d4 | ||
|
|
7002a666a7 | ||
|
|
73d32b0dc7 | ||
|
|
3da1e7f95b | ||
|
|
3f87ab6bfb | ||
|
|
e26a63737d | ||
|
|
bff33ae5c8 | ||
|
|
db6701b1b2 | ||
|
|
5010a01d14 | ||
|
|
07dc69fbc9 | ||
|
|
e4b66928f1 | ||
|
|
a9aede0bad | ||
|
|
13968bbf45 | ||
|
|
fa82d6b93d | ||
|
|
ba353a5062 | ||
|
|
8043f34d3c | ||
|
|
20023339d3 | ||
|
|
d6ef6ba917 | ||
|
|
f97f38bc46 | ||
|
|
076fbd9626 | ||
|
|
456bffc76c | ||
|
|
42f976cdc6 | ||
|
|
1b126fa78e | ||
|
|
e4e56f8f26 | ||
|
|
5d194b42bc | ||
|
|
8c59f4eea0 | ||
|
|
b2c01254bc | ||
|
|
f339acf380 | ||
|
|
bcdbcae305 | ||
|
|
06b92a3c0a | ||
|
|
ba95aab7f5 | ||
|
|
a2cc753d5a | ||
|
|
c40e908d05 | ||
|
|
e943247150 | ||
|
|
eaaacd398d | ||
|
|
52ca609e3e | ||
|
|
254f0ef622 | ||
|
|
41850e2931 | ||
|
|
58f51fcfe9 | ||
|
|
cdac52c19c | ||
|
|
7122f82f0b | ||
|
|
e53873276f | ||
|
|
d94d3074ec | ||
|
|
ecdb36ff3b | ||
|
|
41329ff712 | ||
|
|
3a0cf596e8 | ||
|
|
fab822c8bb | ||
|
|
2b6a86d04a | ||
|
|
ebcb5e08f1 | ||
|
|
c1c29da664 | ||
|
|
5ed49ac6b6 | ||
|
|
c65efc17fc | ||
|
|
3fff8220e6 | ||
|
|
104a401b63 | ||
|
|
639b6b20ee | ||
|
|
05d8d5f6dc | ||
|
|
34b9e2e08a | ||
|
|
b30bb7ef5e | ||
|
|
12047ca70b | ||
|
|
f0920098ad | ||
|
|
f62c0b92bb | ||
|
|
ee7056c080 | ||
|
|
3e70289944 | ||
|
|
58e0bdba28 | ||
|
|
a8f2435c89 | ||
|
|
3b5c09907d | ||
|
|
e13d2287aa | ||
|
|
506721435d | ||
|
|
9c3471a303 | ||
|
|
68f7e3cc9f | ||
|
|
05caa5c8c3 | ||
|
|
cdcb9897f9 | ||
|
|
12f418a009 | ||
|
|
09ad2ca272 | ||
|
|
919f9b5ce3 | ||
|
|
f88b086322 | ||
|
|
ccea7a4f3e | ||
|
|
59976979bd | ||
|
|
f968870414 | ||
|
|
58d1091ccc | ||
|
|
d121215c8e | ||
|
|
ca0774ddb3 | ||
|
|
a63ba03a2f | ||
|
|
7f76141ca2 | ||
|
|
88b4eac850 | ||
|
|
3d7b820d3e | ||
|
|
0d78051318 | ||
|
|
b8252d11e4 | ||
|
|
7626d07ad8 | ||
|
|
cec8378fea | ||
|
|
b2e066a888 | ||
|
|
2fc3cb920d | ||
|
|
078ae6c032 | ||
|
|
3b5777d830 | ||
|
|
ef050cd3c3 | ||
|
|
a65cdd913d | ||
|
|
3d4262d11d | ||
|
|
c75941fe14 | ||
|
|
8c90452b90 | ||
|
|
6f358c74be | ||
|
|
58ba4e28e7 | ||
|
|
ed2722a993 | ||
|
|
519232211c | ||
|
|
aa8e6558d5 | ||
|
|
bbbde8a64d | ||
|
|
1defa4a59a | ||
|
|
acf2f807a8 | ||
|
|
87ec8147d9 | ||
|
|
b538a89fdf | ||
|
|
afc5137355 | ||
|
|
61c17f65b9 | ||
|
|
5cf800729e | ||
|
|
b6da609cff | ||
|
|
5c2a93e901 | ||
|
|
0461e2ca89 | ||
|
|
8d9375ac11 | ||
|
|
1297af77fc | ||
|
|
a46b7d90c9 | ||
|
|
71b8a2817a | ||
|
|
ac4748d6bf | ||
|
|
2477fb816a | ||
|
|
1ecd7daac8 | ||
|
|
3b2976950a | ||
|
|
cfb56c22ae | ||
|
|
e0780c0ff8 | ||
|
|
0bcf4324d2 | ||
|
|
08ee6172bd | ||
|
|
212cf6b11a | ||
|
|
40efee471d | ||
|
|
7faf2c992b | ||
|
|
59502c1984 | ||
|
|
e4ff27a1fc | ||
|
|
492869fd5c | ||
|
|
1f92b48eaf | ||
|
|
6f35577feb | ||
|
|
7d8f50bb3f | ||
|
|
1c763cba6e | ||
|
|
6c861d455c | ||
|
|
165f016a82 | ||
|
|
5253cc3ca5 | ||
|
|
d28e646ec7 | ||
|
|
2585f4d615 | ||
|
|
f67413bdc6 | ||
|
|
0bdd5d298b | ||
|
|
0bf26002e4 | ||
|
|
b9bfbe0522 | ||
|
|
262791228d | ||
|
|
efefe274a6 | ||
|
|
fc53a07203 | ||
|
|
9f50a5a34b | ||
|
|
b5eac341b3 | ||
|
|
24614ba2a7 | ||
|
|
ac21a0960f | ||
|
|
2ce10ace53 | ||
|
|
8327c0f289 | ||
|
|
97eac82c89 | ||
|
|
3932c4a393 | ||
|
|
772f591633 | ||
|
|
c76ffce3ab | ||
|
|
22a7457c3a | ||
|
|
f1872e6c79 | ||
|
|
040ae7981c | ||
|
|
ddc6183e49 | ||
|
|
8288b4eda3 | ||
|
|
243984efd4 | ||
|
|
435ab2fbbf | ||
|
|
a2863f1413 | ||
|
|
2dd2e239f5 | ||
|
|
2a270445b9 | ||
|
|
c26c1dddd4 | ||
|
|
a37d21db69 | ||
|
|
b976699172 | ||
|
|
2a1bdae258 | ||
|
|
4f50dae77e | ||
|
|
3a5d46d909 | ||
|
|
197ddd3d78 | ||
|
|
1c0bbfd1ab | ||
|
|
3d6ee55f5a | ||
|
|
bed6a6f29c | ||
|
|
17791d5451 | ||
|
|
f0b2cb49a4 | ||
|
|
53dab0a049 | ||
|
|
f34a4d7784 | ||
|
|
00b535b112 | ||
|
|
23adfd28c7 | ||
|
|
3be33f7630 | ||
|
|
a56b6013be | ||
|
|
508d163d01 | ||
|
|
cc2ce94598 | ||
|
|
47edb40ba5 | ||
|
|
691e4c4573 | ||
|
|
5f1e348a16 | ||
|
|
afa46b63b7 | ||
|
|
ac1172c3ec | ||
|
|
366d08c3db | ||
|
|
4c7f393003 | ||
|
|
fe6c48bdef | ||
|
|
d2a2731887 | ||
|
|
17e71c590b | ||
|
|
3d5af1c6d8 | ||
|
|
80ec2787a0 | ||
|
|
719afc5817 | ||
|
|
04a4427cff | ||
|
|
28b582590a | ||
|
|
22f2a43281 | ||
|
|
0a21d8a4ae | ||
|
|
0eb0e8c9e6 | ||
|
|
97accf0be8 | ||
|
|
9269ea2d9b | ||
|
|
39f11b364e | ||
|
|
085532e8fa | ||
|
|
ce6d4964be | ||
|
|
d4c3a4c331 | ||
|
|
8c09e4a9a5 | ||
|
|
32cadc3c18 | ||
|
|
b3164e5553 | ||
|
|
edd0021a03 | ||
|
|
68246e2653 | ||
|
|
0859d03f4d | ||
|
|
1de2d001d7 | ||
|
|
aa105ccfe3 | ||
|
|
27aa95f432 | ||
|
|
6044af4962 | ||
|
|
53401a4b9b | ||
|
|
17765a772f | ||
|
|
56365fdf96 | ||
|
|
5f56ee2d2c | ||
|
|
d185481726 |
@@ -1,3 +0,0 @@
|
||||
[submodule "shadowsocks-csharp/simple-json"]
|
||||
path = shadowsocks-csharp/simple-json
|
||||
url = git@github.com:facebook-csharp-sdk/simple-json.git
|
||||
@@ -1,24 +0,0 @@
|
||||
shadowsocks-csharp
|
||||
|
||||
Copyright (c) 2013 clowwindy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
shadowsocks-csharp
|
||||
===========
|
||||
|
||||
This is C# version of shadowsocks.
|
||||
|
||||
In progress.
|
||||
Removed according to regulations.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shadowsocks-csharp", "shadowsocks-csharp\shadowsocks-csharp.csproj", "{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Debug|x86.Build.0 = Debug|x86
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Release|x86.ActiveCfg = Release|x86
|
||||
{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,86 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using SimpleJson;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
[Serializable]
|
||||
public class Config
|
||||
{
|
||||
public bool enabled;
|
||||
public string server;
|
||||
public int server_port;
|
||||
public int local_port;
|
||||
public string password;
|
||||
public string method;
|
||||
|
||||
public bool isDefault;
|
||||
|
||||
private static void assert(bool condition)
|
||||
{
|
||||
if(!condition)
|
||||
{
|
||||
throw new Exception("assertion failure");
|
||||
}
|
||||
}
|
||||
|
||||
public static Config Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(File.OpenRead(@"config.json")))
|
||||
{
|
||||
Config config = SimpleJson.SimpleJson.DeserializeObject<Config>(sr.ReadToEnd());
|
||||
assert(!string.IsNullOrEmpty(config.server));
|
||||
assert(!string.IsNullOrEmpty(config.password));
|
||||
assert(config.local_port > 0);
|
||||
assert(config.server_port > 0);
|
||||
config.isDefault = false;
|
||||
return config;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
return new Config
|
||||
{
|
||||
server = "127.0.0.1",
|
||||
server_port = 8388,
|
||||
local_port = 1080,
|
||||
password = "barfoo!",
|
||||
method = "table",
|
||||
enabled = true,
|
||||
isDefault = true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(Config config)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(File.Open(@"config.json", FileMode.Create)))
|
||||
{
|
||||
string jsonString = SimpleJson.SimpleJson.SerializeObject(new
|
||||
{
|
||||
server = config.server,
|
||||
server_port = config.server_port,
|
||||
local_port = config.local_port,
|
||||
password = config.password,
|
||||
method = config.method,
|
||||
enabled = config.enabled
|
||||
});
|
||||
sw.Write(jsonString);
|
||||
sw.Flush();
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Console.Error.WriteLine(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public abstract class EncryptorBase
|
||||
: IEncryptor
|
||||
{
|
||||
protected EncryptorBase(string method, string password)
|
||||
{
|
||||
Method = method;
|
||||
Password = password;
|
||||
}
|
||||
|
||||
protected string Method;
|
||||
protected string Password;
|
||||
|
||||
protected byte[] GetPasswordHash()
|
||||
{
|
||||
byte[] inputBytes = Encoding.UTF8.GetBytes(Password);
|
||||
byte[] hash = MD5.Create().ComputeHash(inputBytes);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public abstract void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength);
|
||||
|
||||
public abstract void Decrypt(byte[] buf, int length, byte[] outbuf, out int outlength);
|
||||
|
||||
public abstract void Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public static class EncryptorFactory
|
||||
{
|
||||
public static IEncryptor GetEncryptor(string method, string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(method) || method.ToLowerInvariant() == "table")
|
||||
{
|
||||
return new TableEncryptor(method, password);
|
||||
}
|
||||
|
||||
return new PolarSSLEncryptor(method, password);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public interface IEncryptor : IDisposable
|
||||
{
|
||||
void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength);
|
||||
void Decrypt(byte[] buf, int length, byte[] outbuf, out int outlength);
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.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);
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.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
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public class PolarSSL
|
||||
{
|
||||
const string DLLNAME = "polarssl";
|
||||
|
||||
public const int AES_CTX_SIZE = 8 + 4 * 68;
|
||||
public const int AES_ENCRYPT = 1;
|
||||
public const int AES_DECRYPT = 0;
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static void aes_init(byte[] ctx);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static void aes_free(byte[] ctx);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static int aes_setkey_enc(byte[] ctx, byte[] key, int keysize);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static int aes_crypt_cfb128(byte[] ctx, int mode, int length, ref int iv_off, byte[] iv, byte[] input, byte[] output);
|
||||
|
||||
|
||||
public const int ARC4_CTX_SIZE = 264;
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static void arc4_init(byte[] ctx);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static void arc4_free(byte[] ctx);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static void arc4_setup(byte[] ctx, byte[] key, int keysize);
|
||||
|
||||
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
|
||||
public extern static int arc4_crypt(byte[] ctx, int length, byte[] input, byte[] output);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public class PolarSSLEncryptor
|
||||
: EncryptorBase, IDisposable
|
||||
{
|
||||
const int CIPHER_AES = 1;
|
||||
const int CIPHER_RC4 = 2;
|
||||
const int CIPHER_BF = 3;
|
||||
|
||||
static Dictionary<string, int[]> ciphers = new Dictionary<string, int[]> {
|
||||
{"aes-128-cfb", new int[]{16, 16, CIPHER_AES, PolarSSL.AES_CTX_SIZE}},
|
||||
{"aes-192-cfb", new int[]{24, 16, CIPHER_AES, PolarSSL.AES_CTX_SIZE}},
|
||||
{"aes-256-cfb", new int[]{32, 16, CIPHER_AES, PolarSSL.AES_CTX_SIZE}},
|
||||
//{"bf-cfb", new int[]{16, 8, CIPHER_BF, PolarSSL.BF_CTX_SIZE}},
|
||||
{"rc4", new int[]{16, 0, CIPHER_RC4, PolarSSL.ARC4_CTX_SIZE}},
|
||||
{"rc4-md5", new int[]{16, 16, CIPHER_RC4, PolarSSL.ARC4_CTX_SIZE}},
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, byte[]> CachedKeys = new Dictionary<string, byte[]>();
|
||||
private int _cipher;
|
||||
private int[] _cipherInfo;
|
||||
private byte[] _key;
|
||||
private byte[] _encryptCtx;
|
||||
private byte[] _decryptCtx;
|
||||
private byte[] _encryptIV;
|
||||
private byte[] _decryptIV;
|
||||
private int _encryptIVOffset;
|
||||
private int _decryptIVOffset;
|
||||
private string _method;
|
||||
private int keyLen;
|
||||
private int ivLen;
|
||||
|
||||
public PolarSSLEncryptor(string method, string password)
|
||||
: base(method, password)
|
||||
{
|
||||
InitKey(method, password);
|
||||
}
|
||||
|
||||
private static void randBytes(byte[] buf, int length)
|
||||
{
|
||||
byte[] temp = new byte[length];
|
||||
new Random().NextBytes(temp);
|
||||
temp.CopyTo(buf, 0);
|
||||
}
|
||||
|
||||
private void bytesToKey(byte[] password, byte[] key)
|
||||
{
|
||||
byte[] result = new byte[password.Length + 16];
|
||||
int i = 0;
|
||||
byte[] md5sum = null;
|
||||
while (i < key.Length)
|
||||
{
|
||||
MD5 md5 = MD5.Create();
|
||||
if (i == 0)
|
||||
{
|
||||
md5sum = md5.ComputeHash(password);
|
||||
}
|
||||
else
|
||||
{
|
||||
md5sum.CopyTo(result, 0);
|
||||
password.CopyTo(result, md5sum.Length);
|
||||
md5sum = md5.ComputeHash(result);
|
||||
}
|
||||
md5sum.CopyTo(key, i);
|
||||
i += md5sum.Length;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitKey(string method, string password)
|
||||
{
|
||||
method = method.ToLower();
|
||||
_method = method;
|
||||
string k = method + ":" + password;
|
||||
_cipherInfo = ciphers[_method];
|
||||
_cipher = _cipherInfo[2];
|
||||
if (_cipher == 0)
|
||||
{
|
||||
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];
|
||||
bytesToKey(passbuf, _key);
|
||||
CachedKeys[k] = _key;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCipher(ref byte[] ctx, byte[] iv, bool isCipher)
|
||||
{
|
||||
ctx = new byte[_cipherInfo[3]];
|
||||
byte[] realkey;
|
||||
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);
|
||||
realkey = MD5.Create().ComputeHash(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
realkey = _key;
|
||||
}
|
||||
if (_cipher == CIPHER_AES)
|
||||
{
|
||||
PolarSSL.aes_init(ctx);
|
||||
if (isCipher)
|
||||
{
|
||||
// PolarSSL takes key length by bit
|
||||
PolarSSL.aes_setkey_enc(ctx, realkey, keyLen * 8);
|
||||
_encryptIV = new byte[ivLen];
|
||||
Array.Copy(iv, _encryptIV, ivLen);
|
||||
}
|
||||
else
|
||||
{
|
||||
// PolarSSL takes key length by bit
|
||||
// since we'll use CFB mode, here we also do enc, not dec
|
||||
PolarSSL.aes_setkey_enc(ctx, realkey, keyLen * 8);
|
||||
_decryptIV = new byte[ivLen];
|
||||
Array.Copy(iv, _decryptIV, ivLen);
|
||||
}
|
||||
}
|
||||
else if (_cipher == CIPHER_RC4)
|
||||
{
|
||||
PolarSSL.arc4_init(ctx);
|
||||
PolarSSL.arc4_setup(ctx, realkey, keyLen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static byte[] tempbuf = new byte[32768];
|
||||
|
||||
public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
|
||||
{
|
||||
if (_encryptCtx == null)
|
||||
{
|
||||
randBytes(outbuf, ivLen);
|
||||
InitCipher(ref _encryptCtx, outbuf, true);
|
||||
outlength = length + ivLen;
|
||||
switch (_cipher)
|
||||
{
|
||||
case CIPHER_AES:
|
||||
PolarSSL.aes_crypt_cfb128(_encryptCtx, PolarSSL.AES_ENCRYPT, length, ref _encryptIVOffset, _encryptIV, buf, tempbuf);
|
||||
break;
|
||||
case CIPHER_RC4:
|
||||
PolarSSL.arc4_crypt(_encryptCtx, length, buf, tempbuf);
|
||||
break;
|
||||
}
|
||||
outlength = length + ivLen;
|
||||
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, outlength);
|
||||
}
|
||||
else
|
||||
{
|
||||
outlength = length;
|
||||
switch (_cipher)
|
||||
{
|
||||
case CIPHER_AES:
|
||||
PolarSSL.aes_crypt_cfb128(_encryptCtx, PolarSSL.AES_ENCRYPT, length, ref _encryptIVOffset, _encryptIV, buf, outbuf);
|
||||
break;
|
||||
case CIPHER_RC4:
|
||||
PolarSSL.arc4_crypt(_encryptCtx, length, buf, outbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
|
||||
{
|
||||
if (_decryptCtx == null)
|
||||
{
|
||||
InitCipher(ref _decryptCtx, buf, false);
|
||||
outlength = length - ivLen;
|
||||
Buffer.BlockCopy(buf, ivLen, tempbuf, 0, length - ivLen);
|
||||
switch (_cipher)
|
||||
{
|
||||
case CIPHER_AES:
|
||||
PolarSSL.aes_crypt_cfb128(_decryptCtx, PolarSSL.AES_DECRYPT, length - ivLen, ref _decryptIVOffset, _decryptIV, tempbuf, outbuf);
|
||||
break;
|
||||
case CIPHER_RC4:
|
||||
PolarSSL.arc4_crypt(_decryptCtx, length - ivLen, tempbuf, outbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outlength = length;
|
||||
switch (_cipher)
|
||||
{
|
||||
case CIPHER_AES:
|
||||
PolarSSL.aes_crypt_cfb128(_decryptCtx, PolarSSL.AES_DECRYPT, length, ref _decryptIVOffset, _decryptIV, buf, outbuf);
|
||||
break;
|
||||
case CIPHER_RC4:
|
||||
PolarSSL.arc4_crypt(_decryptCtx, length, buf, outbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace shadowsocks_csharp.Encrypt
|
||||
{
|
||||
public class TableEncryptor
|
||||
: EncryptorBase
|
||||
{
|
||||
public TableEncryptor(string method, string password)
|
||||
: base(method, password)
|
||||
{
|
||||
byte[] hash = GetPasswordHash();
|
||||
// TODO endian
|
||||
ulong a = BitConverter.ToUInt64(hash, 0);
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
_encryptTable[i] = (byte)i;
|
||||
}
|
||||
for (int i = 1; i < 1024; i++)
|
||||
{
|
||||
_encryptTable = MergeSort(_encryptTable, a, i);
|
||||
}
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
_decryptTable[_encryptTable[i]] = (byte)i;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
|
||||
{
|
||||
byte[] result = new byte[length];
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
outbuf[i] = _encryptTable[buf[i]];
|
||||
}
|
||||
outlength = length;
|
||||
}
|
||||
|
||||
|
||||
public override void Decrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
|
||||
{
|
||||
byte[] result = new byte[length];
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
outbuf[i] = _decryptTable[buf[i]];
|
||||
}
|
||||
outlength = length;
|
||||
}
|
||||
|
||||
private readonly byte[] _encryptTable = new byte[256];
|
||||
private readonly byte[] _decryptTable = new byte[256];
|
||||
|
||||
private static long Compare(byte x, byte y, ulong a, int i)
|
||||
{
|
||||
return (long)(a % (ulong)(x + i)) - (long)(a % (ulong)(y + i));
|
||||
}
|
||||
|
||||
private byte[] MergeSort(byte[] array, ulong a, int j)
|
||||
{
|
||||
if (array.Length == 1)
|
||||
{
|
||||
return array;
|
||||
}
|
||||
int middle = array.Length / 2;
|
||||
byte[] left = new byte[middle];
|
||||
for (int i = 0; i < middle; i++)
|
||||
{
|
||||
left[i] = array[i];
|
||||
}
|
||||
byte[] right = new byte[array.Length - middle];
|
||||
for (int i = 0; i < array.Length - middle; i++)
|
||||
{
|
||||
right[i] = array[i + middle];
|
||||
}
|
||||
left = MergeSort(left, a, j);
|
||||
right = MergeSort(right, a, j);
|
||||
|
||||
int leftptr = 0;
|
||||
int rightptr = 0;
|
||||
|
||||
byte[] sorted = new byte[array.Length];
|
||||
for (int k = 0; k < array.Length; k++)
|
||||
{
|
||||
if (rightptr == right.Length || ((leftptr < left.Length) && (Compare(left[leftptr], right[rightptr], a, j) <= 0)))
|
||||
{
|
||||
sorted[k] = left[leftptr];
|
||||
leftptr++;
|
||||
}
|
||||
else if (leftptr == left.Length || ((rightptr < right.Length) && (Compare(right[rightptr], left[leftptr], a, j)) <= 0))
|
||||
{
|
||||
sorted[k] = right[rightptr];
|
||||
rightptr++;
|
||||
}
|
||||
}
|
||||
return sorted;
|
||||
}
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-333
@@ -1,333 +0,0 @@
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows 窗体设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.contextMenu1 = new System.Windows.Forms.ContextMenu();
|
||||
this.enableItem = new System.Windows.Forms.MenuItem();
|
||||
this.aboutItem = new System.Windows.Forms.MenuItem();
|
||||
this.menuItem3 = new System.Windows.Forms.MenuItem();
|
||||
this.quitItem = new System.Windows.Forms.MenuItem();
|
||||
this.configItem = new System.Windows.Forms.MenuItem();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.AutoSize = true;
|
||||
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox2, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox3, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox4, 1, 3);
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(22, 12);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 5;
|
||||
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.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(196, 131);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(11, 111);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(52, 13);
|
||||
this.label5.TabIndex = 8;
|
||||
this.label5.Text = "Encryptor";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 6);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(51, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Server IP";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 32);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(60, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Server Port";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.comboBox1.ItemHeight = 13;
|
||||
this.comboBox1.Items.AddRange(new object[] {
|
||||
"table",
|
||||
"rc4-md5",
|
||||
"aes-256-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-128-cfb",
|
||||
"bf-cfb",
|
||||
"rc4"});
|
||||
this.comboBox1.Location = new System.Drawing.Point(69, 107);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(124, 21);
|
||||
this.comboBox1.TabIndex = 9;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(10, 58);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "Password";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(8, 84);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(55, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Proxy Port";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.textBox1.Location = new System.Drawing.Point(69, 3);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(124, 20);
|
||||
this.textBox1.TabIndex = 4;
|
||||
this.textBox1.WordWrap = false;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.textBox2.Location = new System.Drawing.Point(69, 29);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(124, 20);
|
||||
this.textBox2.TabIndex = 5;
|
||||
this.textBox2.WordWrap = false;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.textBox3.Location = new System.Drawing.Point(69, 55);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(124, 20);
|
||||
this.textBox3.TabIndex = 6;
|
||||
this.textBox3.WordWrap = false;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.textBox4.Location = new System.Drawing.Point(69, 81);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(124, 20);
|
||||
this.textBox4.TabIndex = 7;
|
||||
this.textBox4.WordWrap = false;
|
||||
//
|
||||
// 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
|
||||
//
|
||||
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(61, 175);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(0, 0);
|
||||
this.panel2.TabIndex = 1;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button1.Location = new System.Drawing.Point(4, 4);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "OK";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button2.Location = new System.Drawing.Point(86, 4);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Cancel";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
||||
this.panel1.AutoSize = true;
|
||||
this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.panel1.Controls.Add(this.button2);
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Location = new System.Drawing.Point(61, 153);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(164, 30);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// contextMenu1
|
||||
//
|
||||
this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
|
||||
this.enableItem,
|
||||
this.configItem,
|
||||
this.aboutItem,
|
||||
this.menuItem3,
|
||||
this.quitItem});
|
||||
//
|
||||
// enableItem
|
||||
//
|
||||
this.enableItem.Index = 0;
|
||||
this.enableItem.Text = "Enable";
|
||||
this.enableItem.Click += new System.EventHandler(this.EnableItem_Click);
|
||||
//
|
||||
// aboutItem
|
||||
//
|
||||
this.aboutItem.Index = 2;
|
||||
this.aboutItem.Text = "About";
|
||||
this.aboutItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
// menuItem3
|
||||
//
|
||||
this.menuItem3.Index = 3;
|
||||
this.menuItem3.Text = "-";
|
||||
//
|
||||
// quitItem
|
||||
//
|
||||
this.quitItem.Index = 4;
|
||||
this.quitItem.Text = "Quit";
|
||||
this.quitItem.Click += new System.EventHandler(this.Quit_Click);
|
||||
//
|
||||
// configItem
|
||||
//
|
||||
this.configItem.Index = 1;
|
||||
this.configItem.Text = "Options...";
|
||||
this.configItem.Click += new System.EventHandler(this.Config_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AcceptButton = this.button1;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.CancelButton = this.button2;
|
||||
this.ClientSize = new System.Drawing.Size(282, 206);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "Form1";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Shadowsocks";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.NotifyIcon notifyIcon1;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.ContextMenu contextMenu1;
|
||||
private System.Windows.Forms.MenuItem enableItem;
|
||||
private System.Windows.Forms.MenuItem aboutItem;
|
||||
private System.Windows.Forms.MenuItem menuItem3;
|
||||
private System.Windows.Forms.MenuItem quitItem;
|
||||
private System.Windows.Forms.MenuItem configItem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
Local local;
|
||||
PACServer pacServer;
|
||||
Config config;
|
||||
PolipoRunner polipoRunner;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
config = Config.Load();
|
||||
InitializeComponent();
|
||||
notifyIcon1.ContextMenu = contextMenu1;
|
||||
enableItem.Checked = config.enabled;
|
||||
configToTextBox();
|
||||
}
|
||||
|
||||
private void showWindow()
|
||||
{
|
||||
this.Opacity = 1;
|
||||
this.Show();
|
||||
}
|
||||
|
||||
private void configToTextBox()
|
||||
{
|
||||
textBox1.Text = config.server;
|
||||
textBox2.Text = config.server_port.ToString();
|
||||
textBox3.Text = config.password;
|
||||
textBox4.Text = config.local_port.ToString();
|
||||
comboBox1.Text = config.method == null ? "table" : config.method;
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!config.isDefault)
|
||||
{
|
||||
this.Opacity = 0;
|
||||
reload(config); BeginInvoke(new MethodInvoker(delegate
|
||||
{
|
||||
this.Hide();
|
||||
}));
|
||||
}
|
||||
pacServer = new PACServer();
|
||||
pacServer.Start();
|
||||
updateSystemProxy();
|
||||
}
|
||||
|
||||
private void reload(Config config)
|
||||
{
|
||||
if (local != null)
|
||||
{
|
||||
local.Stop();
|
||||
if (polipoRunner != null)
|
||||
{
|
||||
polipoRunner.Stop();
|
||||
}
|
||||
}
|
||||
if (polipoRunner == null)
|
||||
{
|
||||
polipoRunner = new PolipoRunner();
|
||||
}
|
||||
polipoRunner.Start(config);
|
||||
|
||||
local = new Local(config);
|
||||
local.Start();
|
||||
|
||||
}
|
||||
|
||||
private void Config_Click(object sender, EventArgs e)
|
||||
{
|
||||
showWindow();
|
||||
}
|
||||
|
||||
private void Quit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void OKButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Config config = new Config
|
||||
{
|
||||
server = textBox1.Text,
|
||||
server_port = int.Parse(textBox2.Text),
|
||||
password = textBox3.Text,
|
||||
local_port = int.Parse(textBox4.Text),
|
||||
method = comboBox1.Text,
|
||||
isDefault = false
|
||||
};
|
||||
Config.Save(config);
|
||||
this.config = config;
|
||||
reload(config);
|
||||
this.Hide();
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
MessageBox.Show("there is format problem");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Hide();
|
||||
configToTextBox();
|
||||
}
|
||||
|
||||
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
if (local != null) local.Stop();
|
||||
if (polipoRunner != null) polipoRunner.Stop();
|
||||
if (config.enabled)
|
||||
{
|
||||
SystemProxy.Disable();
|
||||
}
|
||||
}
|
||||
|
||||
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start("https://github.com/clowwindy/shadowsocks-csharp");
|
||||
}
|
||||
|
||||
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
showWindow();
|
||||
}
|
||||
|
||||
private void updateSystemProxy()
|
||||
{
|
||||
if (config.enabled)
|
||||
{
|
||||
SystemProxy.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemProxy.Disable();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnableItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
enableItem.Checked = !enableItem.Checked;
|
||||
config.enabled = enableItem.Checked;
|
||||
Config.Save(config);
|
||||
updateSystemProxy();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,380 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using shadowsocks_csharp.Encrypt;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
|
||||
|
||||
class Local
|
||||
{
|
||||
private Config config;
|
||||
//private Encryptor encryptor;
|
||||
Socket listener;
|
||||
public Local(Config config)
|
||||
{
|
||||
this.config = config;
|
||||
//this.encryptor = new Encryptor(config.method, config.password);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
// Create a TCP/IP socket.
|
||||
listener = new Socket(AddressFamily.InterNetwork,
|
||||
SocketType.Stream, ProtocolType.Tcp);
|
||||
IPEndPoint localEndPoint = new IPEndPoint(0, config.local_port);
|
||||
|
||||
// Bind the socket to the local endpoint and listen for incoming connections.
|
||||
listener.Bind(localEndPoint);
|
||||
listener.Listen(100);
|
||||
|
||||
|
||||
// Start an asynchronous socket to listen for connections.
|
||||
Console.WriteLine("Waiting for a connection...");
|
||||
listener.BeginAccept(
|
||||
new AsyncCallback(AcceptCallback),
|
||||
listener);
|
||||
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
listener.Close();
|
||||
}
|
||||
|
||||
|
||||
public void AcceptCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// Get the socket that handles the client request.
|
||||
Socket listener = (Socket)ar.AsyncState;
|
||||
//if (!listener.Connected)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
listener.BeginAccept(
|
||||
new AsyncCallback(AcceptCallback),
|
||||
listener);
|
||||
|
||||
Socket conn = listener.EndAccept(ar);
|
||||
|
||||
// Create the state object.
|
||||
Handler handler = new Handler();
|
||||
handler.connection = conn;
|
||||
//if (encryptor.method == "table")
|
||||
//{
|
||||
// handler.encryptor = encryptor;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// handler.encryptor = new Encryptor(config.method, config.password);
|
||||
//}
|
||||
handler.encryptor = EncryptorFactory.GetEncryptor(config.method, config.password);
|
||||
handler.config = config;
|
||||
|
||||
handler.Start();
|
||||
//handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
|
||||
// new AsyncCallback(ReadCallback), state);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Handler
|
||||
{
|
||||
//public Encryptor encryptor;
|
||||
public IEncryptor encryptor;
|
||||
public Config config;
|
||||
// Client socket.
|
||||
public Socket remote;
|
||||
public Socket connection;
|
||||
// Size of receive buffer.
|
||||
public const int RecvSize = 16384;
|
||||
public const int BufferSize = RecvSize + 32;
|
||||
// remote receive buffer
|
||||
public byte[] remoteRecvBuffer = new byte[RecvSize];
|
||||
// remote send buffer
|
||||
public byte[] remoteSendBuffer = new byte[BufferSize];
|
||||
// connection receive buffer
|
||||
public byte[] connetionRecvBuffer = new byte[RecvSize];
|
||||
// connection send buffer
|
||||
public byte[] connetionSendBuffer = new byte[BufferSize];
|
||||
// Received data string.
|
||||
public StringBuilder sb = new StringBuilder();
|
||||
|
||||
public void Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
// TODO async resolving
|
||||
IPAddress ipAddress;
|
||||
bool parsed = IPAddress.TryParse(config.server, out ipAddress);
|
||||
if (!parsed)
|
||||
{
|
||||
IPHostEntry ipHostInfo = Dns.GetHostEntry(config.server);
|
||||
ipAddress = ipHostInfo.AddressList[0];
|
||||
}
|
||||
IPEndPoint remoteEP = new IPEndPoint(ipAddress, config.server_port);
|
||||
|
||||
|
||||
remote = new Socket(ipAddress.AddressFamily,
|
||||
SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
// Connect to the remote endpoint.
|
||||
remote.BeginConnect(remoteEP,
|
||||
new AsyncCallback(connectCallback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.Shutdown(SocketShutdown.Send);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
if (remote != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
remote.Shutdown(SocketShutdown.Send);
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
((IDisposable)encryptor).Dispose();
|
||||
}
|
||||
|
||||
private void connectCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Complete the connection.
|
||||
remote.EndConnect(ar);
|
||||
|
||||
Console.WriteLine("Socket connected to {0}",
|
||||
remote.RemoteEndPoint.ToString());
|
||||
|
||||
handshakeReceive();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void handshakeReceive()
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.BeginReceive(connetionRecvBuffer, 0, 256, 0,
|
||||
new AsyncCallback(handshakeReceiveCallback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void handshakeReceiveCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
int bytesRead = connection.EndReceive(ar);
|
||||
|
||||
if (bytesRead > 1)
|
||||
{
|
||||
byte[] response = { 5, 0 };
|
||||
if (connetionRecvBuffer[0] != 5)
|
||||
{
|
||||
// reject socks 4
|
||||
response = new byte[]{ 0, 91 };
|
||||
}
|
||||
connection.BeginSend(response, 0, response.Length, 0, new AsyncCallback(handshakeSendCallback), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void handshakeSendCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.EndSend(ar);
|
||||
|
||||
// +----+-----+-------+------+----------+----------+
|
||||
// |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
|
||||
// +----+-----+-------+------+----------+----------+
|
||||
// | 1 | 1 | X'00' | 1 | Variable | 2 |
|
||||
// +----+-----+-------+------+----------+----------+
|
||||
// Skip first 3 bytes
|
||||
// TODO validate
|
||||
connection.BeginReceive(connetionRecvBuffer, 0, 3, 0,
|
||||
new AsyncCallback(handshakeReceive2Callback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void handshakeReceive2Callback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
int bytesRead = connection.EndReceive(ar);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
byte[] response = { 5, 0, 0, 1, 0, 0, 0, 0, 0, 0 };
|
||||
connection.BeginSend(response, 0, response.Length, 0, new AsyncCallback(startPipe), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void startPipe(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.EndReceive(ar);
|
||||
remote.BeginReceive(remoteRecvBuffer, 0, RecvSize, 0,
|
||||
new AsyncCallback(pipeRemoteReceiveCallback), null);
|
||||
connection.BeginReceive(connetionRecvBuffer, 0, RecvSize, 0,
|
||||
new AsyncCallback(pipeConnectionReceiveCallback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void pipeRemoteReceiveCallback(IAsyncResult ar)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
int bytesRead = remote.EndReceive(ar);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
int bytesToSend;
|
||||
encryptor.Decrypt(remoteRecvBuffer, bytesRead, remoteSendBuffer, out bytesToSend);
|
||||
connection.BeginSend(remoteSendBuffer, 0, bytesToSend, 0, new AsyncCallback(pipeConnectionSendCallback), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("bytesRead: " + bytesRead.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void pipeConnectionReceiveCallback(IAsyncResult ar)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
int bytesRead = connection.EndReceive(ar);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
int bytesToSend;
|
||||
encryptor.Encrypt(connetionRecvBuffer, bytesRead, connetionSendBuffer, out bytesToSend);
|
||||
remote.BeginSend(connetionSendBuffer, 0, bytesToSend, 0, new AsyncCallback(pipeRemoteSendCallback), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("bytesRead: " + bytesRead.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void pipeRemoteSendCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
remote.EndSend(ar);
|
||||
connection.BeginReceive(this.connetionRecvBuffer, 0, RecvSize, 0,
|
||||
new AsyncCallback(pipeConnectionReceiveCallback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void pipeConnectionSendCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.EndSend(ar);
|
||||
remote.BeginReceive(this.remoteRecvBuffer, 0, RecvSize, 0,
|
||||
new AsyncCallback(pipeRemoteReceiveCallback), null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
using shadowsocks_csharp.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
class PACServer
|
||||
{
|
||||
Socket listener;
|
||||
public void Start()
|
||||
{
|
||||
// Create a TCP/IP socket.
|
||||
listener = new Socket(AddressFamily.InterNetwork,
|
||||
SocketType.Stream, ProtocolType.Tcp);
|
||||
IPEndPoint localEndPoint = new IPEndPoint(0, 8090);
|
||||
|
||||
// Bind the socket to the local endpoint and listen for incoming connections.
|
||||
listener.Bind(localEndPoint);
|
||||
listener.Listen(100);
|
||||
|
||||
listener.BeginAccept(
|
||||
new AsyncCallback(AcceptCallback),
|
||||
listener);
|
||||
}
|
||||
|
||||
|
||||
public void AcceptCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
Socket listener = (Socket)ar.AsyncState;
|
||||
listener.BeginAccept(
|
||||
new AsyncCallback(AcceptCallback),
|
||||
listener);
|
||||
Socket conn = listener.EndAccept(ar);
|
||||
|
||||
conn.BeginReceive(new byte[1024], 0, 256, 0,
|
||||
new AsyncCallback(receiveCallback), conn);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string getPACContent()
|
||||
{
|
||||
// TODO try pac.txt in current directory
|
||||
byte[] pacGZ = Resources.proxy_pac_txt;
|
||||
|
||||
byte[] buffer = new byte[1024 * 1024]; // builtin pac gzip size: maximum 1M
|
||||
int n;
|
||||
|
||||
using (GZipStream input = new GZipStream(new MemoryStream(pacGZ),
|
||||
CompressionMode.Decompress, false))
|
||||
{
|
||||
n = input.Read(buffer, 0, buffer.Length);
|
||||
if (n == 0)
|
||||
{
|
||||
throw new IOException("can not decompress pac");
|
||||
}
|
||||
return System.Text.Encoding.UTF8.GetString(buffer, 0, n);
|
||||
}
|
||||
}
|
||||
|
||||
private void receiveCallback(IAsyncResult ar)
|
||||
{
|
||||
Socket conn = (Socket)ar.AsyncState;
|
||||
try
|
||||
{
|
||||
int bytesRead = conn.EndReceive(ar);
|
||||
|
||||
string pac = getPACContent();
|
||||
|
||||
string proxy = "PROXY 127.0.0.1:8123; DIRECT;";
|
||||
|
||||
pac = pac.Replace("__PROXY__", proxy);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
string text = String.Format(@"HTTP/1.1 200 OK
|
||||
Server: Shadowsocks
|
||||
Content-Type: application/x-ns-proxy-autoconfig
|
||||
Content-Length: {0}
|
||||
Connection: Close
|
||||
|
||||
", System.Text.Encoding.UTF8.GetBytes(pac).Length) + pac;
|
||||
byte[] response = System.Text.Encoding.UTF8.GetBytes(text);
|
||||
conn.BeginSend(response, 0, response.Length, 0, new AsyncCallback(sendCallback), conn);
|
||||
}
|
||||
else
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void sendCallback(IAsyncResult ar)
|
||||
{
|
||||
Socket conn = (Socket)ar.AsyncState;
|
||||
conn.Shutdown(SocketShutdown.Send);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
using shadowsocks_csharp.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
class PolipoRunner
|
||||
{
|
||||
private Process process;
|
||||
private bool ByteArrayToFile(string fileName, byte[] content)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.FileStream _FileStream =
|
||||
new System.IO.FileStream(fileName, System.IO.FileMode.Create,
|
||||
System.IO.FileAccess.Write);
|
||||
_FileStream.Write(content, 0, content.Length);
|
||||
_FileStream.Close();
|
||||
return true;
|
||||
}
|
||||
catch (Exception _Exception)
|
||||
{
|
||||
Console.WriteLine("Exception caught in process: {0}",
|
||||
_Exception.ToString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void UncompressFile(string fileName, byte[] content)
|
||||
{
|
||||
FileStream destinationFile = File.Create(fileName);
|
||||
|
||||
// Because the uncompressed size of the file is unknown,
|
||||
// we are using an arbitrary buffer size.
|
||||
byte[] buffer = new byte[4096];
|
||||
int n;
|
||||
|
||||
using (GZipStream input = new GZipStream(new MemoryStream(content),
|
||||
CompressionMode.Decompress, false))
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
n = input.Read(buffer, 0, buffer.Length);
|
||||
if (n == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
destinationFile.Write(buffer, 0, n);
|
||||
}
|
||||
}
|
||||
destinationFile.Close();
|
||||
}
|
||||
|
||||
public void Start(Config config)
|
||||
{
|
||||
if (process == null)
|
||||
{
|
||||
Process[] existingPolipo = Process.GetProcessesByName("ss_polipo");
|
||||
foreach (Process p in existingPolipo)
|
||||
{
|
||||
p.Kill();
|
||||
p.WaitForExit();
|
||||
}
|
||||
string temppath = Path.GetTempPath();
|
||||
string polipoConfig = Resources.polipo_config;
|
||||
polipoConfig = polipoConfig.Replace("__SOCKS_PORT__", config.local_port.ToString());
|
||||
ByteArrayToFile(temppath + "/polipo.conf", System.Text.Encoding.UTF8.GetBytes(polipoConfig));
|
||||
UncompressFile(temppath + "/ss_polipo.exe", Resources.polipo_exe);
|
||||
|
||||
process = new Process();
|
||||
// Configure the process using the StartInfo properties.
|
||||
process.StartInfo.FileName = temppath + "/ss_polipo.exe";
|
||||
process.StartInfo.Arguments = "-c \"" + temppath + "/polipo.conf\"";
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.RedirectStandardError = true;
|
||||
//process.StandardOutput
|
||||
process.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
process = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
FileStream fs = new FileStream("shadowsocks.log", FileMode.Append);
|
||||
TextWriter tmp = Console.Out;
|
||||
StreamWriter sw = new StreamWriter(fs);
|
||||
sw.AutoFlush = true;
|
||||
Console.SetOut(sw);
|
||||
Console.SetError(sw);
|
||||
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过下列属性集
|
||||
// 控制。更改这些属性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("shadowsocks-csharp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("clowwindy")]
|
||||
[assembly: AssemblyProduct("shadowsocks-csharp")]
|
||||
[assembly: AssemblyCopyright("Copyright © clowwindy 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 属性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("f8334709-4309-436a-8bbd-6165dcf4a660")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1.2")]
|
||||
[assembly: AssemblyFileVersion("1.1.2")]
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace shadowsocks_csharp.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("shadowsocks_csharp.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to # Sample configuration file for Polipo. -*-sh-*-
|
||||
///
|
||||
///# You should not need to use a configuration file; all configuration
|
||||
///# variables have reasonable defaults. If you want to use one, you
|
||||
///# can copy this to /etc/polipo/config or to ~/.polipo and modify.
|
||||
///
|
||||
///# This file only contains some of the configuration variables; see the
|
||||
///# list given by ``polipo -v'' and the manual for more.
|
||||
///
|
||||
///
|
||||
///### Basic configuration
|
||||
///### *******************
|
||||
///
|
||||
///# Uncomment one of these if you want to allow remote clients to
|
||||
///# connect:
|
||||
///
|
||||
///# prox [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string polipo_config {
|
||||
get {
|
||||
return ResourceManager.GetString("polipo_config", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] polipo_exe {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("polipo_exe", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] proxy_pac_txt {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("proxy_pac_txt", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<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="polipo_config" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\config.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
|
||||
</data>
|
||||
<data name="polipo_exe" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\polipo.exe.gz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="proxy_pac_txt" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\proxy.pac.txt.gz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace shadowsocks_csharp.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,44 +0,0 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace shadowsocks_csharp
|
||||
{
|
||||
class SystemProxy
|
||||
{
|
||||
|
||||
[DllImport("wininet.dll")]
|
||||
public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);
|
||||
public const int INTERNET_OPTION_SETTINGS_CHANGED = 39;
|
||||
public const int INTERNET_OPTION_REFRESH = 37;
|
||||
static bool settingsReturn, refreshReturn;
|
||||
|
||||
public static void NotifyIE()
|
||||
{
|
||||
// These lines implement the Interface in the beginning of program
|
||||
// They cause the OS to refresh the settings, causing IP to realy update
|
||||
settingsReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
|
||||
refreshReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
|
||||
}
|
||||
|
||||
public static void Enable()
|
||||
{
|
||||
RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
|
||||
registry.SetValue("ProxyEnable", 0);
|
||||
registry.SetValue("ProxyServer", "");
|
||||
registry.SetValue("AutoConfigURL", "http://127.0.0.1:8090/pac");
|
||||
SystemProxy.NotifyIE();
|
||||
}
|
||||
|
||||
public static void Disable()
|
||||
{
|
||||
RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
|
||||
registry.SetValue("ProxyEnable", 0);
|
||||
registry.SetValue("ProxyServer", "");
|
||||
registry.SetValue("AutoConfigURL", "");
|
||||
SystemProxy.NotifyIE();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
|
||||
@@ -1,161 +0,0 @@
|
||||
# Sample configuration file for Polipo. -*-sh-*-
|
||||
|
||||
# You should not need to use a configuration file; all configuration
|
||||
# variables have reasonable defaults. If you want to use one, you
|
||||
# can copy this to /etc/polipo/config or to ~/.polipo and modify.
|
||||
|
||||
# This file only contains some of the configuration variables; see the
|
||||
# list given by ``polipo -v'' and the manual for more.
|
||||
|
||||
|
||||
### Basic configuration
|
||||
### *******************
|
||||
|
||||
# Uncomment one of these if you want to allow remote clients to
|
||||
# connect:
|
||||
|
||||
# proxyAddress = "::0" # both IPv4 and IPv6
|
||||
# proxyAddress = "0.0.0.0" # IPv4 only
|
||||
|
||||
# If you do that, you'll want to restrict the set of hosts allowed to
|
||||
# connect:
|
||||
|
||||
# allowedClients = 127.0.0.1, 134.157.168.57
|
||||
# allowedClients = 127.0.0.1, 134.157.168.0/24
|
||||
|
||||
# Uncomment this if you want your Polipo to identify itself by
|
||||
# something else than the host name:
|
||||
|
||||
# proxyName = "polipo.example.org"
|
||||
|
||||
# Uncomment this if there's only one user using this instance of Polipo:
|
||||
|
||||
# cacheIsShared = false
|
||||
|
||||
# Uncomment this if you want to use a parent proxy:
|
||||
|
||||
# parentProxy = "squid.example.org:3128"
|
||||
|
||||
# Uncomment this if you want to use a parent SOCKS proxy:
|
||||
|
||||
socksParentProxy = "127.0.0.1:__SOCKS_PORT__"
|
||||
socksProxyType = socks5
|
||||
|
||||
# Uncomment this if you want to scrub private information from the log:
|
||||
|
||||
# scrubLogs = true
|
||||
|
||||
|
||||
### Memory
|
||||
### ******
|
||||
|
||||
# Uncomment this if you want Polipo to use a ridiculously small amount
|
||||
# of memory (a hundred C-64 worth or so):
|
||||
|
||||
# chunkHighMark = 819200
|
||||
# objectHighMark = 128
|
||||
|
||||
# Uncomment this if you've got plenty of memory:
|
||||
|
||||
# chunkHighMark = 50331648
|
||||
# objectHighMark = 16384
|
||||
|
||||
|
||||
### On-disk data
|
||||
### ************
|
||||
|
||||
# Uncomment this if you want to disable the on-disk cache:
|
||||
|
||||
diskCacheRoot = ""
|
||||
|
||||
# Uncomment this if you want to put the on-disk cache in a
|
||||
# non-standard location:
|
||||
|
||||
# diskCacheRoot = "~/.polipo-cache/"
|
||||
|
||||
# Uncomment this if you want to disable the local web server:
|
||||
|
||||
localDocumentRoot = ""
|
||||
|
||||
# Uncomment this if you want to enable the pages under /polipo/index?
|
||||
# and /polipo/servers?. This is a serious privacy leak if your proxy
|
||||
# is shared.
|
||||
|
||||
# disableIndexing = false
|
||||
# disableServersList = false
|
||||
|
||||
|
||||
### Domain Name System
|
||||
### ******************
|
||||
|
||||
# Uncomment this if you want to contact IPv4 hosts only (and make DNS
|
||||
# queries somewhat faster):
|
||||
|
||||
# dnsQueryIPv6 = no
|
||||
|
||||
# Uncomment this if you want Polipo to prefer IPv4 to IPv6 for
|
||||
# double-stack hosts:
|
||||
|
||||
# dnsQueryIPv6 = reluctantly
|
||||
|
||||
# Uncomment this to disable Polipo's DNS resolver and use the system's
|
||||
# default resolver instead. If you do that, Polipo will freeze during
|
||||
# every DNS query:
|
||||
|
||||
# dnsUseGethostbyname = yes
|
||||
|
||||
|
||||
### HTTP
|
||||
### ****
|
||||
|
||||
# Uncomment this if you want to enable detection of proxy loops.
|
||||
# This will cause your hostname (or whatever you put into proxyName
|
||||
# above) to be included in every request:
|
||||
|
||||
# disableVia=false
|
||||
|
||||
# Uncomment this if you want to slightly reduce the amount of
|
||||
# information that you leak about yourself:
|
||||
|
||||
# censoredHeaders = from, accept-language
|
||||
# censorReferer = maybe
|
||||
|
||||
# Uncomment this if you're paranoid. This will break a lot of sites,
|
||||
# though:
|
||||
|
||||
# censoredHeaders = set-cookie, cookie, cookie2, from, accept-language
|
||||
# censorReferer = true
|
||||
|
||||
# Uncomment this if you want to use Poor Man's Multiplexing; increase
|
||||
# the sizes if you're on a fast line. They should each amount to a few
|
||||
# seconds' worth of transfer; if pmmSize is small, you'll want
|
||||
# pmmFirstSize to be larger.
|
||||
|
||||
# Note that PMM is somewhat unreliable.
|
||||
|
||||
# pmmFirstSize = 16384
|
||||
# pmmSize = 8192
|
||||
|
||||
# Uncomment this if your user-agent does something reasonable with
|
||||
# Warning headers (most don't):
|
||||
|
||||
# relaxTransparency = maybe
|
||||
|
||||
# Uncomment this if you never want to revalidate instances for which
|
||||
# data is available (this is not a good idea):
|
||||
|
||||
# relaxTransparency = yes
|
||||
|
||||
# Uncomment this if you have no network:
|
||||
|
||||
# proxyOffline = yes
|
||||
|
||||
# Uncomment this if you want to avoid revalidating instances with a
|
||||
# Vary header (this is not a good idea):
|
||||
|
||||
# mindlesslyCacheVary = true
|
||||
|
||||
# Uncomment this if you want to add a no-transform directive to all
|
||||
# outgoing requests.
|
||||
|
||||
# alwaysAddNoTransform = true
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 97 KiB |
Binary file not shown.
Binary file not shown.
@@ -1,178 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8C02D2F7-7CDB-4D55-9F25-CD03EF4AA062}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>shadowsocks_csharp</RootNamespace>
|
||||
<AssemblyName>Shadowsocks</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<ApplicationIcon>icon144.ico</ApplicationIcon>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SIMPLE_JSON_NO_LINQ_EXPRESSION</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;SIMPLE_JSON_NO_LINQ_EXPRESSION</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SIMPLE_JSON_NO_LINQ_EXPRESSION</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;SIMPLE_JSON_NO_LINQ_EXPRESSION</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
<Compile Include="Encrypt\IEncryptor.cs" />
|
||||
<Compile Include="PACServer.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Local.cs" />
|
||||
<Compile Include="PolipoRunner.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SystemProxy.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="polipo.exe.gz" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="simple-json\src\SimpleJson\SimpleJson.cs" />
|
||||
<None Include="proxy.pac.txt.gz" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="config.txt" />
|
||||
<Content Include="icon144.ico" />
|
||||
<None Include="proxy.pac.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Submodule shadowsocks-csharp/simple-json deleted from 8ef093ac7b
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user