Skip to content

Commit ec598db

Browse files
committed
4.0.1
1 parent aabd2ca commit ec598db

24 files changed

+243
-163
lines changed

shadowsocks-csharp/Controller/AutoStartup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static bool Set(bool enabled)
1313
RegistryKey runKey = null;
1414
try
1515
{
16-
string path = Application.ExecutablePath;
16+
string path = Util.Utils.GetExecutablePath();
1717
runKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
1818
if (enabled)
1919
{
@@ -52,7 +52,7 @@ public static bool Check()
5252
RegistryKey runKey = null;
5353
try
5454
{
55-
string path = Application.ExecutablePath;
55+
string path = Util.Utils.GetExecutablePath();
5656
runKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
5757
string[] runList = runKey.GetValueNames();
5858
runKey.Close();

shadowsocks-csharp/Controller/BinChecker.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Net;
55
using System.Text;
6+
using System.Windows.Forms;
67
using Shadowsocks.Encryption;
78
using Shadowsocks.Model;
89

@@ -35,8 +36,8 @@ public static bool CheckBin()
3536
{
3637
}
3738

38-
string filePath = System.Windows.Forms.Application.ExecutablePath + "_sign";
39-
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
39+
string filePath = Util.Utils.GetExecutablePath() + "_sign";
40+
using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
4041
{
4142
using (StreamReader r = new StreamReader(fs))
4243
{
@@ -45,8 +46,9 @@ public static bool CheckBin()
4546
}
4647
}
4748
}
48-
catch
49+
catch (Exception e)
4950
{
51+
MessageBox.Show(e != null ? e.ToString() : "", e.Message);
5052
return false;
5153
}
5254
}

shadowsocks-csharp/Controller/HttpProxyRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class HttpProxyRunner
2424
static HttpProxyRunner()
2525
{
2626
runningPath = Path.Combine(System.Windows.Forms.Application.StartupPath, _subPath);
27-
_exeNameNoExt = System.IO.Path.GetFileNameWithoutExtension(System.Windows.Forms.Application.ExecutablePath);
27+
_exeNameNoExt = System.IO.Path.GetFileNameWithoutExtension(Util.Utils.GetExecutablePath());
2828
_exeName = @"/" + _exeNameNoExt + @".exe";
2929
if (!Directory.Exists(runningPath))
3030
{

shadowsocks-csharp/Controller/ProxyAuth.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ private void RspHttpHandshakeReceive()
407407
{
408408
command = 1;
409409
}
410-
if (Util.Utils.isMatchSubNet(((IPEndPoint)_connection.RemoteEndPoint).Address, "127.0.0.0/8"))
411-
{
412-
httpProxyState.httpAuthUser = "";
413-
httpProxyState.httpAuthPass = "";
414-
}
415-
else
410+
//if (Util.Utils.isMatchSubNet(((IPEndPoint)_connection.RemoteEndPoint).Address, "127.0.0.0/8"))
411+
//{
412+
// httpProxyState.httpAuthUser = "";
413+
// httpProxyState.httpAuthPass = "";
414+
//}
415+
//else
416416
{
417417
httpProxyState.httpAuthUser = _config.authUser;
418418
httpProxyState.httpAuthPass = _config.authPass;

shadowsocks-csharp/Controller/ShadowsocksController.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -417,51 +417,6 @@ public void TouchUserRuleFile()
417417
}
418418
}
419419

420-
protected string GetObfsPartOfSSLink(Server server)
421-
{
422-
string parts = server.method + ":" + server.password + "@" + server.server + ":" + server.server_port;
423-
return parts;
424-
}
425-
426-
public string GetSSLinkForCurrentServer()
427-
{
428-
Server server = GetCurrentServer();
429-
string parts = GetObfsPartOfSSLink(server);
430-
string base64 = Util.Utils.EncodeUrlSafeBase64(parts).Replace("=", "");
431-
return "ss://" + base64;
432-
}
433-
434-
public string GetSSLinkForServer(Server server)
435-
{
436-
string parts = GetObfsPartOfSSLink(server);
437-
string base64 = Util.Utils.EncodeUrlSafeBase64(parts).Replace("=", "");
438-
return "ss://" + base64;
439-
}
440-
441-
public string GetSSRRemarksLinkForServer(Server server)
442-
{
443-
string main_part = server.server + ":" + server.server_port + ":" + server.protocol + ":" + server.method + ":" + server.obfs + ":" + Util.Utils.EncodeUrlSafeBase64(server.password).Replace("=", "");
444-
string param_str = "obfsparam=" + Util.Utils.EncodeUrlSafeBase64(server.obfsparam??"").Replace("=", "");
445-
if (server.remarks != null && server.remarks.Length > 0)
446-
{
447-
param_str += "&remarks=" + Util.Utils.EncodeUrlSafeBase64(server.remarks).Replace("=", "");
448-
}
449-
if (server.group != null && server.group.Length > 0)
450-
{
451-
param_str += "&group=" + Util.Utils.EncodeUrlSafeBase64(server.group).Replace("=", "");
452-
}
453-
if (server.udp_over_tcp)
454-
{
455-
param_str += "&uot=" + "1";
456-
}
457-
if (server.server_udp_port > 0)
458-
{
459-
param_str += "&udpport=" + server.server_udp_port.ToString();
460-
}
461-
string base64 = Util.Utils.EncodeUrlSafeBase64(main_part + "/?" + param_str).Replace("=", "");
462-
return "ssr://" + base64;
463-
}
464-
465420
public void UpdatePACFromGFWList()
466421
{
467422
if (gfwListUpdater != null)

shadowsocks-csharp/Controller/UpdateChecker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class UpdateChecker
2121

2222
public const string Name = "ShadowsocksR";
2323
public const string Copyright = "Copyright © BreakWall 2016. Fork from Shadowsocks by clowwindy";
24-
public const string Version = "4.0.0";
24+
public const string Version = "4.0.1";
2525
#if !_DOTNET_4_0
2626
public const string NetVer = "2.0";
2727
#elif !_CONSOLE

shadowsocks-csharp/Data/cn.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Show logs...=显示日志...
4545
Open wiki...=打开Wiki文档...
4646
Feedback...=问题反馈...
4747
Gen custom QRCode...=自定义生成二维码
48+
Reset password...=设置客户端密码...
4849
About...=关于...
50+
Donate...=捐助...
4951
Quit=退出
5052
Edit Servers=编辑服务器
5153
Global Settings=选项设置
@@ -68,8 +70,6 @@ Encryption=加密
6870
Remarks=备注
6971

7072
Adv. Setting=高级选项
71-
TCPoverUDP=TCP over UDP
72-
UDPoverTCP=UDP over TCP
7373
Obfs UDP=混淆UDP协议
7474
NOT all server support belows=以下选项不是所有服务端都支持
7575
TCP over TCP if not checked=不打钩使用原生 TCP(暂不能用)
@@ -80,7 +80,6 @@ Obfs=混淆
8080
Obfs param=混淆参数
8181
SSR Link=SSR链接
8282
Original=原版
83-
Verify header=校验头部(新TCP协议)
8483
Verify all=校验所有数据
8584

8685
Balance=负载均衡
-1.7 KB
Binary file not shown.
77.2 KB
Binary file not shown.

shadowsocks-csharp/Data/zh-tw.txt

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Mode=系統代理模式
99
PAC=PAC 模式
1010
Global=全局模式
1111
Proxy rule=代理規則
12-
Bypass LAN=绕过區域網路
13-
Bypass LAN && China=绕过區域網路和大陸
14-
Bypass LAN && not China=绕过區域網路和非大陸
12+
Bypass LAN=繞過區域網路
13+
Bypass LAN && China=繞過區域網路和大陸
14+
Bypass LAN && not China=繞過區域網路和非大陸
1515
Disable bypass=全局
1616
Servers=伺服器
1717
Edit servers...=編輯伺服器...
@@ -35,7 +35,7 @@ Edit user rule for GFWList...=編輯 GFWList 的用戶規則...
3535
Show QRCode...=顯示 QR 碼...
3636
Scan QRCode from screen...=QR 碼掃描...
3737
Copy address from clipboard...=從剪貼板複製位址...
38-
Port settings...=端口設置...
38+
Port settings...=連接埠設置...
3939
Server statistic...=伺服器連接統計...
4040
Disconnect current=斷開當前所有連接
4141
New version {0} {1} available=【點擊下載新版本{0} {1}】
@@ -45,7 +45,9 @@ Show logs...=顯示日誌...
4545
Open wiki...=打開Wiki文檔...
4646
Feedback...=問題反饋...
4747
Gen custom QRCode...=自定義生成 QR 碼
48+
Reset password...=設置客戶端密碼...
4849
About...=關於...
50+
Donate...=捐助...
4951
Quit=退出
5052
Edit Servers=編輯伺服器
5153
Global Settings=選項設置
@@ -61,26 +63,23 @@ New server=未配置的伺服器
6163

6264
Server=伺服器(截圖注意打碼)
6365
Server IP=伺服器 IP
64-
Server Port=伺服器端口
65-
UDP Port=UDP端口
66+
Server Port=伺服器連接埠
67+
UDP Port=UDP連接埠
6668
Password=密碼
6769
Encryption=加密
6870
Remarks=備註
6971

7072
Adv. Setting=高級選項
71-
TCPoverUDP=TCP over UDP
72-
UDPoverTCP=UDP over TCP
7373
Obfs UDP=混淆UDP協議
74-
NOT all server support belows=以下選項不是所有伺服端都支持
75-
TCP over TCP if not checked=不打鉤使用原生 TCP(暫不能用)
76-
UDP over UDP if not checked=不打鉤使用原生 UDP
74+
NOT all server support belows=以下選項不是所有伺服器都支持
75+
TCP over TCP if not checked=不打勾使用原生 TCP(暫不能用)
76+
UDP over UDP if not checked=不打勾使用原生 UDP
7777
Recommend checked=保留功能
7878
Protocol=協議
7979
Obfs=混淆
8080
Obfs param=混淆參數
81-
SSR Link=SSR鏈接
81+
SSR Link=SSR連結
8282
Original=原版
83-
Verify header=校驗頭部(新TCP協議)
8483
Verify all=校驗所有數據
8584

8685
Balance=負載均衡
@@ -95,18 +94,18 @@ AutoBan=自動禁用出錯伺服器
9594

9695
Remote proxy=二級(前置)代理
9796
Proxy On=開啟代理
98-
PAC "direct" return this proxy=PAC“直連”使用二級代理
97+
PAC "direct" return this proxy=PAC“直接連接”使用二級代理
9998
Socks5(support UDP)=Socks5(支持UDP)
10099
Http tunnel=Http隧道
101-
TCP Port tunnel=TCP端口轉發(需要相關混淆插件)
100+
TCP Port tunnel=TCP連接埠轉發(需要相關混淆插件)
102101
Username=用戶名
103102

104103
Local proxy=本地代理
105104
Build-in http proxy=內置http代理(目前有bug)
106-
Proxy Port=本地端口
105+
Proxy Port=本地連接埠
107106
Reconnect Times=重連次數
108107
Timeout=連接超時
109-
TTL=空閑斷開秒數
108+
TTL=空閒斷開秒數
110109

111110
OK=確定
112111
Cancel=取消
@@ -115,15 +114,15 @@ Cancel=取消
115114

116115
ServerLog=伺服器記錄
117116
&Control=操作(&C)
118-
&Disconnect All=断开当前所有连接(&D)
117+
&Disconnect All=斷開當前所有連接(&D)
119118
Clear &MaxSpeed=重置歷史最高(&M)
120119
&Clear=清空(&C)
121120
Clear &Selected Total=清空選中節點歷史流量(&S)
122121
Clear &Total=清空所有歷史流量(&T)
123-
C&opy=复制(&O)
124-
Copy current link=複製選中鏈接
125-
Copy all enable links=複製所有開啟節點鏈接
126-
Copy all links=複製所有節點鏈接
122+
C&opy=複製(&O)
123+
Copy current link=複製選中連結
124+
Copy all enable links=複製所有開啟節點連結
125+
Copy all links=複製所有節點連結
127126
&Window=窗口(&W)
128127
Auto &size=自動調整大小(&S)
129128
Always On &Top=窗口置頂(&T)
@@ -157,15 +156,15 @@ Please input PAC Url=請輸入 PAC 網址
157156
# Messages
158157

159158
Shadowsocks Error: {0}=Shadowsocks 錯誤: {0}
160-
Port already in use=端口已被占用
161-
Illegal port number format=非法端口格式
159+
Port already in use=連接埠已被占用
160+
Illegal port number format=非法連接埠格式
162161
Please add at least one server=請添加至少一個伺服器
163162
Server IP can not be blank=伺服器 IP 不能為空
164163
Password can not be blank=密碼不能為空
165-
Port out of range=端口超出範圍
164+
Port out of range=連接埠超出範圍
166165
{0} {1} Update Found={0} {1} 更新
167166
Click menu to download=點擊菜單項下載
168-
ShadowsocksR is here=ShadowsocksR 在這裏
167+
ShadowsocksR is here=ShadowsocksR 在這裡
169168
You can turn on/off ShadowsocksR in the context menu=可以在右鍵菜單中開關 ShadowsocksR
170169
System Proxy Enabled=系統代理已啟用
171170
System Proxy Disabled=系統代理未啟用
@@ -175,9 +174,9 @@ Domain white list list updated=更新域名白名單成功
175174
No updates found. Please report to GFWList if you have problems with it.=未發現更新。如有問題請提交給 GFWList。
176175
No QRCode found. Try to zoom in or move it to the center of the screen.=未發現 QR 碼,嘗試把它放大或移動到靠近屏幕中間的位置
177176
ShadowsocksR is already running.=ShadowsocksR 已經在運行。
178-
Find Shadowsocks icon in your notify tray.=請在工作列裏尋找 ShadowsocksR 圖標。
179-
If you want to start multiple Shadowsocks, make a copy in another directory.=如果想啟動多份,可以另外復制一份到別的目錄
177+
Find Shadowsocks icon in your notify tray.=請在工作列裡尋找 ShadowsocksR 圖標。
178+
If you want to start multiple Shadowsocks, make a copy in another directory.=如果想啟動多份,可以另外複製一份到別的目錄
180179
Failed to decode QRCode=無法解析 QR 碼
181180
Failed to update registry=無法修改註冊表\n解決方案見https://github.com/shadowsocks/shadowsocks-windows/issues/253
182181
System Proxy On: =系統代理已啟用:
183-
Running: Port {0}=正在運行:端口 {0}
182+
Running: Port {0}=正在運行:連接埠 {0}

0 commit comments

Comments
 (0)