Skip to content

Commit

Permalink
Finish 4.9.2
Browse files Browse the repository at this point in the history
fix icon issue
small fix
  • Loading branch information
Akkariiin committed Apr 21, 2019
2 parents bffa164 + e61fe58 commit 2dc2268
Show file tree
Hide file tree
Showing 11 changed files with 1,805 additions and 1,708 deletions.
4 changes: 2 additions & 2 deletions shadowsocks-csharp/Controller/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class UpdateChecker
public event EventHandler NewVersionFound;

public const string Name = "ShadowsocksR";
public const string Copyright = "Copyright © BreakWa11 2017. Fork from Shadowsocks by clowwindy";
public const string Version = "4.9.0";
public const string Copyright = "Copyright © Akkariiin 2019 & BreakWa11 2017. Fork from Shadowsocks by clowwindy";
public const string Version = "4.9.2";
#if !_DOTNET_4_0
public const string NetVer = "2.0";
#elif !_CONSOLE
Expand Down
293 changes: 150 additions & 143 deletions shadowsocks-csharp/Controller/UpdateFreeNode.cs
Original file line number Diff line number Diff line change
@@ -1,148 +1,155 @@
using Shadowsocks.Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Windows.Forms;

namespace Shadowsocks.Controller
{
public class UpdateFreeNode
{
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";

public event EventHandler NewFreeNodeFound;
public string FreeNodeResult;
public ServerSubscribe subscribeTask;
using Shadowsocks.Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Windows.Forms;

namespace Shadowsocks.Controller
{
public class UpdateFreeNode
{
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";

public event EventHandler NewFreeNodeFound;
public string FreeNodeResult;
public ServerSubscribe subscribeTask;
public bool noitify;

public const string Name = "ShadowsocksR";

public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify)
{
FreeNodeResult = null;
this.noitify = noitify;
try
{
WebClient http = new WebClient();

public const string Name = "ShadowsocksR";

public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify)
{
FreeNodeResult = null;
this.noitify = noitify;
try
{
WebClient http = new WebClient();
http.Headers.Add("User-Agent",
String.IsNullOrEmpty(config.proxyUserAgent) ?
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36"
: config.proxyUserAgent);
http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString();
if (use_proxy)
{
WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort);
if (!string.IsNullOrEmpty(config.authPass))
{
proxy.Credentials = new NetworkCredential(config.authUser, config.authPass);
}
http.Proxy = proxy;
}
else
{
http.Proxy = null;
}
//UseProxy = !UseProxy;
this.subscribeTask = subscribeTask;
string URL = subscribeTask.URL;
http.DownloadStringCompleted += http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL));
}
catch (Exception e)
{
Logging.LogUsefulException(e);
}
}

private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
string response = e.Result;
FreeNodeResult = response;

if (NewFreeNodeFound != null)
{
NewFreeNodeFound(this, new EventArgs());
}
}
catch (Exception ex)
{
if (e.Error != null)
{
Logging.Debug(e.Error.ToString());
}
Logging.Debug(ex.ToString());
if (NewFreeNodeFound != null)
{
NewFreeNodeFound(this, new EventArgs());
}
return;
}
}
}

public class UpdateSubscribeManager
{
private Configuration _config;
private List<ServerSubscribe> _serverSubscribes;
private UpdateFreeNode _updater;
private string _URL;
private bool _use_proxy;
: config.proxyUserAgent);
http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString();
if (use_proxy)
{
WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort);
if (!string.IsNullOrEmpty(config.authPass))
{
proxy.Credentials = new NetworkCredential(config.authUser, config.authPass);
}
http.Proxy = proxy;
}
else
{
http.Proxy = null;
}
//UseProxy = !UseProxy;
this.subscribeTask = subscribeTask;
string URL = subscribeTask.URL;

//add support for tls1.2+
if (URL.StartsWith("https", StringComparison.OrdinalIgnoreCase))
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | (SecurityProtocolType)3072 | SecurityProtocolType.Tls;
}

http.DownloadStringCompleted += http_DownloadStringCompleted;
http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL));
}
catch (Exception e)
{
Logging.LogUsefulException(e);
}
}

private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
try
{
string response = e.Result;
FreeNodeResult = response;

if (NewFreeNodeFound != null)
{
NewFreeNodeFound(this, new EventArgs());
}
}
catch (Exception ex)
{
if (e.Error != null)
{
Logging.Debug(e.Error.ToString());
}
Logging.Debug(ex.ToString());
if (NewFreeNodeFound != null)
{
NewFreeNodeFound(this, new EventArgs());
}
return;
}
}
}

public class UpdateSubscribeManager
{
private Configuration _config;
private List<ServerSubscribe> _serverSubscribes;
private UpdateFreeNode _updater;
private string _URL;
private bool _use_proxy;
public bool _noitify;

public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify)
{
if (_config == null)
{
_config = config;
_updater = updater;
_use_proxy = use_proxy;
_noitify = noitify;
if (index < 0)
{
_serverSubscribes = new List<ServerSubscribe>();
for (int i = 0; i < config.serverSubscribes.Count; ++i)
{
_serverSubscribes.Add(config.serverSubscribes[i]);
}
}
else if (index < _config.serverSubscribes.Count)
{
_serverSubscribes = new List<ServerSubscribe>();
_serverSubscribes.Add(config.serverSubscribes[index]);
}
Next();
}
}

public bool Next()
{
if (_serverSubscribes.Count == 0)
{
_config = null;
return false;
}
else
{
_URL = _serverSubscribes[0].URL;
_updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify);
_serverSubscribes.RemoveAt(0);
return true;
}
}

public string URL
{
get
{
return _URL;
}
}
}
}

public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify)
{
if (_config == null)
{
_config = config;
_updater = updater;
_use_proxy = use_proxy;
_noitify = noitify;
if (index < 0)
{
_serverSubscribes = new List<ServerSubscribe>();
for (int i = 0; i < config.serverSubscribes.Count; ++i)
{
_serverSubscribes.Add(config.serverSubscribes[i]);
}
}
else if (index < _config.serverSubscribes.Count)
{
_serverSubscribes = new List<ServerSubscribe>();
_serverSubscribes.Add(config.serverSubscribes[index]);
}
Next();
}
}

public bool Next()
{
if (_serverSubscribes.Count == 0)
{
_config = null;
return false;
}
else
{
_URL = _serverSubscribes[0].URL;
_updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify);
_serverSubscribes.RemoveAt(0);
return true;
}
}

public string URL
{
get
{
return _URL;
}
}
}
}
11 changes: 9 additions & 2 deletions shadowsocks-csharp/Data/cn.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ Global Settings=选项设置
Up=上移
Down=下移
Verion=版本
local=本地端口
Any=任意地址
Local=本机地址
New server=未配置的服务器

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

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

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

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

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

3 comments on commit 2dc2268

@wdzfj

This comment was marked as off-topic.

@wdzfj

This comment was marked as off-topic.

@CPCer
Copy link

@CPCer CPCer commented on 2dc2268 Sep 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すげぇ!

Please sign in to comment.