Skip to content

Commit 2dc2268

Browse files
committed
Finish 4.9.2
fix icon issue small fix
2 parents bffa164 + e61fe58 commit 2dc2268

11 files changed

+1805
-1708
lines changed

shadowsocks-csharp/Controller/UpdateChecker.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public class UpdateChecker
2020
public event EventHandler NewVersionFound;
2121

2222
public const string Name = "ShadowsocksR";
23-
public const string Copyright = "Copyright © BreakWa11 2017. Fork from Shadowsocks by clowwindy";
24-
public const string Version = "4.9.0";
23+
public const string Copyright = "Copyright © Akkariiin 2019 & BreakWa11 2017. Fork from Shadowsocks by clowwindy";
24+
public const string Version = "4.9.2";
2525
#if !_DOTNET_4_0
2626
public const string NetVer = "2.0";
2727
#elif !_CONSOLE
+150-143
Original file line numberDiff line numberDiff line change
@@ -1,148 +1,155 @@
1-
using Shadowsocks.Model;
2-
using System;
3-
using System.Collections;
4-
using System.Collections.Generic;
5-
using System.Net;
6-
using System.Reflection;
7-
using System.Text;
8-
using System.Text.RegularExpressions;
9-
using System.Xml;
10-
using System.Windows.Forms;
11-
12-
namespace Shadowsocks.Controller
13-
{
14-
public class UpdateFreeNode
15-
{
16-
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";
17-
18-
public event EventHandler NewFreeNodeFound;
19-
public string FreeNodeResult;
20-
public ServerSubscribe subscribeTask;
1+
using Shadowsocks.Model;
2+
using System;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Net;
6+
using System.Reflection;
7+
using System.Text;
8+
using System.Text.RegularExpressions;
9+
using System.Xml;
10+
using System.Windows.Forms;
11+
12+
namespace Shadowsocks.Controller
13+
{
14+
public class UpdateFreeNode
15+
{
16+
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";
17+
18+
public event EventHandler NewFreeNodeFound;
19+
public string FreeNodeResult;
20+
public ServerSubscribe subscribeTask;
2121
public bool noitify;
22-
23-
public const string Name = "ShadowsocksR";
24-
25-
public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify)
26-
{
27-
FreeNodeResult = null;
28-
this.noitify = noitify;
29-
try
30-
{
31-
WebClient http = new WebClient();
22+
23+
public const string Name = "ShadowsocksR";
24+
25+
public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify)
26+
{
27+
FreeNodeResult = null;
28+
this.noitify = noitify;
29+
try
30+
{
31+
WebClient http = new WebClient();
3232
http.Headers.Add("User-Agent",
3333
String.IsNullOrEmpty(config.proxyUserAgent) ?
3434
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36"
35-
: config.proxyUserAgent);
36-
http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString();
37-
if (use_proxy)
38-
{
39-
WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort);
40-
if (!string.IsNullOrEmpty(config.authPass))
41-
{
42-
proxy.Credentials = new NetworkCredential(config.authUser, config.authPass);
43-
}
44-
http.Proxy = proxy;
45-
}
46-
else
47-
{
48-
http.Proxy = null;
49-
}
50-
//UseProxy = !UseProxy;
51-
this.subscribeTask = subscribeTask;
52-
string URL = subscribeTask.URL;
53-
http.DownloadStringCompleted += http_DownloadStringCompleted;
54-
http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL));
55-
}
56-
catch (Exception e)
57-
{
58-
Logging.LogUsefulException(e);
59-
}
60-
}
61-
62-
private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
63-
{
64-
try
65-
{
66-
string response = e.Result;
67-
FreeNodeResult = response;
68-
69-
if (NewFreeNodeFound != null)
70-
{
71-
NewFreeNodeFound(this, new EventArgs());
72-
}
73-
}
74-
catch (Exception ex)
75-
{
76-
if (e.Error != null)
77-
{
78-
Logging.Debug(e.Error.ToString());
79-
}
80-
Logging.Debug(ex.ToString());
81-
if (NewFreeNodeFound != null)
82-
{
83-
NewFreeNodeFound(this, new EventArgs());
84-
}
85-
return;
86-
}
87-
}
88-
}
89-
90-
public class UpdateSubscribeManager
91-
{
92-
private Configuration _config;
93-
private List<ServerSubscribe> _serverSubscribes;
94-
private UpdateFreeNode _updater;
95-
private string _URL;
96-
private bool _use_proxy;
35+
: config.proxyUserAgent);
36+
http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString();
37+
if (use_proxy)
38+
{
39+
WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort);
40+
if (!string.IsNullOrEmpty(config.authPass))
41+
{
42+
proxy.Credentials = new NetworkCredential(config.authUser, config.authPass);
43+
}
44+
http.Proxy = proxy;
45+
}
46+
else
47+
{
48+
http.Proxy = null;
49+
}
50+
//UseProxy = !UseProxy;
51+
this.subscribeTask = subscribeTask;
52+
string URL = subscribeTask.URL;
53+
54+
//add support for tls1.2+
55+
if (URL.StartsWith("https", StringComparison.OrdinalIgnoreCase))
56+
{
57+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | (SecurityProtocolType)3072 | SecurityProtocolType.Tls;
58+
}
59+
60+
http.DownloadStringCompleted += http_DownloadStringCompleted;
61+
http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL));
62+
}
63+
catch (Exception e)
64+
{
65+
Logging.LogUsefulException(e);
66+
}
67+
}
68+
69+
private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
70+
{
71+
try
72+
{
73+
string response = e.Result;
74+
FreeNodeResult = response;
75+
76+
if (NewFreeNodeFound != null)
77+
{
78+
NewFreeNodeFound(this, new EventArgs());
79+
}
80+
}
81+
catch (Exception ex)
82+
{
83+
if (e.Error != null)
84+
{
85+
Logging.Debug(e.Error.ToString());
86+
}
87+
Logging.Debug(ex.ToString());
88+
if (NewFreeNodeFound != null)
89+
{
90+
NewFreeNodeFound(this, new EventArgs());
91+
}
92+
return;
93+
}
94+
}
95+
}
96+
97+
public class UpdateSubscribeManager
98+
{
99+
private Configuration _config;
100+
private List<ServerSubscribe> _serverSubscribes;
101+
private UpdateFreeNode _updater;
102+
private string _URL;
103+
private bool _use_proxy;
97104
public bool _noitify;
98-
99-
public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify)
100-
{
101-
if (_config == null)
102-
{
103-
_config = config;
104-
_updater = updater;
105-
_use_proxy = use_proxy;
106-
_noitify = noitify;
107-
if (index < 0)
108-
{
109-
_serverSubscribes = new List<ServerSubscribe>();
110-
for (int i = 0; i < config.serverSubscribes.Count; ++i)
111-
{
112-
_serverSubscribes.Add(config.serverSubscribes[i]);
113-
}
114-
}
115-
else if (index < _config.serverSubscribes.Count)
116-
{
117-
_serverSubscribes = new List<ServerSubscribe>();
118-
_serverSubscribes.Add(config.serverSubscribes[index]);
119-
}
120-
Next();
121-
}
122-
}
123-
124-
public bool Next()
125-
{
126-
if (_serverSubscribes.Count == 0)
127-
{
128-
_config = null;
129-
return false;
130-
}
131-
else
132-
{
133-
_URL = _serverSubscribes[0].URL;
134-
_updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify);
135-
_serverSubscribes.RemoveAt(0);
136-
return true;
137-
}
138-
}
139-
140-
public string URL
141-
{
142-
get
143-
{
144-
return _URL;
145-
}
146-
}
147-
}
148-
}
105+
106+
public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify)
107+
{
108+
if (_config == null)
109+
{
110+
_config = config;
111+
_updater = updater;
112+
_use_proxy = use_proxy;
113+
_noitify = noitify;
114+
if (index < 0)
115+
{
116+
_serverSubscribes = new List<ServerSubscribe>();
117+
for (int i = 0; i < config.serverSubscribes.Count; ++i)
118+
{
119+
_serverSubscribes.Add(config.serverSubscribes[i]);
120+
}
121+
}
122+
else if (index < _config.serverSubscribes.Count)
123+
{
124+
_serverSubscribes = new List<ServerSubscribe>();
125+
_serverSubscribes.Add(config.serverSubscribes[index]);
126+
}
127+
Next();
128+
}
129+
}
130+
131+
public bool Next()
132+
{
133+
if (_serverSubscribes.Count == 0)
134+
{
135+
_config = null;
136+
return false;
137+
}
138+
else
139+
{
140+
_URL = _serverSubscribes[0].URL;
141+
_updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify);
142+
_serverSubscribes.RemoveAt(0);
143+
return true;
144+
}
145+
}
146+
147+
public string URL
148+
{
149+
get
150+
{
151+
return _URL;
152+
}
153+
}
154+
}
155+
}

shadowsocks-csharp/Data/cn.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Global Settings=选项设置
6464
Up=上移
6565
Down=下移
6666
Verion=版本
67-
local=本地端口
67+
Any=任意地址
68+
Local=本机地址
6869
New server=未配置的服务器
6970

7071
Server=服务器(截图打码)
@@ -74,6 +75,7 @@ UDP Port=UDP端口
7475
Password=密码
7576
Encryption=加密
7677
Remarks=备注
78+
Group=群组名
7779

7880
Adv. Setting=高级选项
7981
Obfs UDP=混淆UDP协议
@@ -88,6 +90,7 @@ Obfs param=混淆参数
8890
SSR Link=SSR链接
8991
Original=原版
9092
Verify all=校验所有数据
93+
Click the 'Link' text box=点击“SSR链接”文本框
9194

9295
Balance=负载均衡
9396
OneByOne=按次序
@@ -99,6 +102,8 @@ SelectedFirst=选中优先
99102
Timer=定时切换
100103
Balance in group=所选组切换
101104
AutoBan=自动禁用出错服务器
105+
Logging=日志记录
106+
Enable Log=开启日志
102107

103108
Remote proxy=二级(前置)代理
104109
Proxy On=开启代理
@@ -107,11 +112,13 @@ Socks5(support UDP)=Socks5(支持UDP)
107112
Http tunnel=Http隧道
108113
TCP Port tunnel=TCP端口转发(需要相关混淆插件)
109114
Username=用户名
115+
User Agent=用户代理
110116

111117
Local proxy=本地代理
112118
Build-in http proxy=内置http代理(目前有bug)
113119
Proxy Port=本地端口
114120
Set Default=重置默认值
121+
Local Dns=递归DNS
115122
Reconnect Times=重连次数
116123
ConnectTimeout=连接超时
117124
TTL=空闲断开秒数
@@ -244,4 +251,4 @@ Running: Port {0}=正在运行:端口 {0}
244251
Password NOT match=密码不匹配
245252
Update subscribe {0} success=服务器订阅 {0} 更新成功
246253
Update subscribe {0} failure=服务器订阅 {0} 更新失败
247-
Success=成功
254+
Success=成功

0 commit comments

Comments
 (0)