Skip to content

Commit 3678d9b

Browse files
committed
Finish 4.8.0
添加auth_chain_c/d 修正各个下载链接
2 parents 932b86e + 0bb1998 commit 3678d9b

File tree

8 files changed

+168
-14
lines changed

8 files changed

+168
-14
lines changed

shadowsocks-csharp/Controller/GfwListUpdater.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class GFWListUpdater
1414
{
1515
private const string GFWLIST_URL = "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt";
1616

17-
private const string GFWLIST_BACKUP_URL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/gfwlist.txt";
17+
private const string GFWLIST_BACKUP_URL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/gfwlist.txt";
1818

19-
private const string GFWLIST_TEMPLATE_URL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/ss_gfw.pac";
19+
private const string GFWLIST_TEMPLATE_URL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/ss_gfw.pac";
2020

2121
private static string PAC_FILE = PACServer.PAC_FILE;
2222

shadowsocks-csharp/Controller/UpdateChecker.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ namespace Shadowsocks.Controller
1313
{
1414
public class UpdateChecker
1515
{
16-
private const string UpdateURL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/update/ssr-win-4.0.xml";
16+
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/update/ssr-win-4.0.xml";
1717

1818
public string LatestVersionNumber;
1919
public string LatestVersionURL;
2020
public event EventHandler NewVersionFound;
2121

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

shadowsocks-csharp/Controller/UpdateFreeNode.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Shadowsocks.Controller
1313
{
1414
public class UpdateFreeNode
1515
{
16-
private const string UpdateURL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/free/freenodeplain.txt";
16+
private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";
1717

1818
public event EventHandler NewFreeNodeFound;
1919
public string FreeNodeResult;

shadowsocks-csharp/Model/Configuration.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public class PortMapConfigCache
6666
[Serializable]
6767
public class ServerSubscribe
6868
{
69-
private static string DEFAULT_FEED_URL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/free/freenodeplain.txt";
70-
//private static string OLD_DEFAULT_FEED_URL = "https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/free/freenode.txt";
69+
private static string DEFAULT_FEED_URL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt";
70+
//private static string OLD_DEFAULT_FEED_URL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenode.txt";
7171

7272
public string URL = DEFAULT_FEED_URL;
7373
public string Group;

shadowsocks-csharp/Obfs/AuthChain.cs

+144
Original file line numberDiff line numberDiff line change
@@ -658,4 +658,148 @@ protected override int GetRandLen(int datalength, xorshift128plus random, byte[]
658658
}
659659

660660
}
661+
662+
class AuthChain_c : AuthChain_b
663+
{
664+
public AuthChain_c(string method)
665+
: base(method)
666+
{
667+
668+
}
669+
670+
private static Dictionary<string, int[]> _obfs = new Dictionary<string, int[]> {
671+
{"auth_chain_c", new int[]{1, 0, 1}},
672+
};
673+
674+
protected int[] data_size_list0 = null;
675+
676+
public static new List<string> SupportedObfs()
677+
{
678+
return new List<string>(_obfs.Keys);
679+
}
680+
681+
public override Dictionary<string, int[]> GetObfs()
682+
{
683+
return _obfs;
684+
}
685+
686+
protected new void InitDataSizeList()
687+
{
688+
xorshift128plus random = new xorshift128plus();
689+
random.init_from_bin(Server.key);
690+
int len = (int)(random.next() % (8 + 16) + (4 + 8));
691+
List<int> data_list = new List<int>();
692+
for (int i = 0; i < len; ++i)
693+
{
694+
data_list.Add((int)(random.next() % 2340 % 2040 % 1440));
695+
}
696+
data_list.Sort();
697+
data_size_list0 = data_list.ToArray();
698+
}
699+
700+
public override void SetServerInfo(ServerInfo serverInfo)
701+
{
702+
Server = serverInfo;
703+
InitDataSizeList();
704+
}
705+
706+
protected override int GetRandLen(int datalength, xorshift128plus random, byte[] last_hash)
707+
{
708+
int other_data_size = datalength + Server.overhead;
709+
710+
// 一定要在random使用前初始化,以保证服务器与客户端同步,保证包大小验证结果正确
711+
random.init_from_bin(last_hash, datalength);
712+
if (other_data_size >= data_size_list0[data_size_list0.Length - 1])
713+
{
714+
if (datalength >= 1440)
715+
return 0;
716+
if (datalength > 1300)
717+
return (int)(random.next() % 31);
718+
if (datalength > 900)
719+
return (int)(random.next() % 127);
720+
if (datalength > 400)
721+
return (int)(random.next() % 521);
722+
return (int)(random.next() % 1021);
723+
}
724+
725+
int pos = FindPos(data_size_list0, other_data_size);
726+
int final_pos = pos + (int)(random.next() % (ulong)(data_size_list0.Length - pos));
727+
return data_size_list0[final_pos] - other_data_size;
728+
}
729+
730+
}
731+
732+
class AuthChain_d : AuthChain_c
733+
{
734+
public AuthChain_d(string method)
735+
: base(method)
736+
{
737+
738+
}
739+
740+
private static Dictionary<string, int[]> _obfs = new Dictionary<string, int[]> {
741+
{"auth_chain_d", new int[]{1, 0, 1}},
742+
};
743+
744+
public static new List<string> SupportedObfs()
745+
{
746+
return new List<string>(_obfs.Keys);
747+
}
748+
749+
public override Dictionary<string, int[]> GetObfs()
750+
{
751+
return _obfs;
752+
}
753+
754+
protected void CheckAndPatchDataSize(List<int> data_list, xorshift128plus random)
755+
{
756+
if (data_list[data_list.Count - 1] < 1300 && data_list.Count < 64)
757+
{
758+
data_list.Add((int)(random.next() % 2340 % 2040 % 1440));
759+
CheckAndPatchDataSize(data_list, random);
760+
}
761+
}
762+
763+
protected new void InitDataSizeList()
764+
{
765+
xorshift128plus random = new xorshift128plus();
766+
random.init_from_bin(Server.key);
767+
int len = (int)(random.next() % (8 + 16) + (4 + 8));
768+
List<int> data_list = new List<int>();
769+
for (int i = 0; i < len; ++i)
770+
{
771+
data_list.Add((int)(random.next() % 2340 % 2040 % 1440));
772+
}
773+
data_list.Sort();
774+
int old_len = data_list.Count;
775+
CheckAndPatchDataSize(data_list, random);
776+
if (old_len != data_list.Count)
777+
{
778+
data_list.Sort();
779+
}
780+
data_size_list0 = data_list.ToArray();
781+
}
782+
783+
public override void SetServerInfo(ServerInfo serverInfo)
784+
{
785+
Server = serverInfo;
786+
InitDataSizeList();
787+
}
788+
789+
protected override int GetRandLen(int datalength, xorshift128plus random, byte[] last_hash)
790+
{
791+
int other_data_size = datalength + Server.overhead;
792+
793+
if (other_data_size >= data_size_list0[data_size_list0.Length - 1])
794+
{
795+
return 0;
796+
}
797+
798+
random.init_from_bin(last_hash, datalength);
799+
int pos = FindPos(data_size_list0, other_data_size);
800+
int final_pos = pos + (int)(random.next() % (ulong)(data_size_list0.Length - pos));
801+
return data_size_list0[final_pos] - other_data_size;
802+
}
803+
804+
}
661805
}

shadowsocks-csharp/Obfs/ObfsFactory.cs

+8
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ static ObfsFactory()
5555
{
5656
_registeredObfs.Add(method, typeof(AuthChain_b));
5757
}
58+
foreach (string method in AuthChain_c.SupportedObfs())
59+
{
60+
_registeredObfs.Add(method, typeof(AuthChain_c));
61+
}
62+
foreach (string method in AuthChain_d.SupportedObfs())
63+
{
64+
_registeredObfs.Add(method, typeof(AuthChain_d));
65+
}
5866
}
5967

6068
public static IObfs GetObfs(string method)

shadowsocks-csharp/View/ConfigForm.Designer.cs

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shadowsocks-csharp/View/MenuViewController.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -909,12 +909,12 @@ private void Quit_Click(object sender, EventArgs e)
909909

910910
private void OpenWiki_Click(object sender, EventArgs e)
911911
{
912-
Process.Start("https://github.com/breakwa11/shadowsocks-rss/wiki");
912+
Process.Start("https://github.com/shadowsocksrr/shadowsocks-rss/wiki");
913913
}
914914

915915
private void FeedbackItem_Click(object sender, EventArgs e)
916916
{
917-
Process.Start("https://github.com/shadowsocksr/shadowsocksr-csharp/issues/new");
917+
Process.Start("https://github.com/shadowsocksrr/shadowsocksr-csharp/issues/new");
918918
}
919919

920920
private void ResetPasswordItem_Click(object sender, EventArgs e)
@@ -1051,22 +1051,22 @@ private void UpdatePACFromGFWListItem_Click(object sender, EventArgs e)
10511051

10521052
private void UpdatePACFromLanIPListItem_Click(object sender, EventArgs e)
10531053
{
1054-
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/ss_lanip.pac");
1054+
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/ss_lanip.pac");
10551055
}
10561056

10571057
private void UpdatePACFromCNWhiteListItem_Click(object sender, EventArgs e)
10581058
{
1059-
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/ss_white.pac");
1059+
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/ss_white.pac");
10601060
}
10611061

10621062
private void UpdatePACFromCNOnlyListItem_Click(object sender, EventArgs e)
10631063
{
1064-
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/ss_white_r.pac");
1064+
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/ss_white_r.pac");
10651065
}
10661066

10671067
private void UpdatePACFromCNIPListItem_Click(object sender, EventArgs e)
10681068
{
1069-
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/breakwa11/breakwa11.github.io/master/ssr/ss_cnip.pac");
1069+
controller.UpdatePACFromOnlinePac("https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/ssr/ss_cnip.pac");
10701070
}
10711071

10721072
private void EditUserRuleFileForGFWListItem_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)