From 2dcbcd1b163cd1d70e4302f4e301b61640ddae75 Mon Sep 17 00:00:00 2001 From: ProxySU Date: Sat, 7 Nov 2020 21:16:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Trojan=20over=20TCP=20with=20?= =?UTF-8?q?TLS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProxySU/MainWindow.xaml | 2 +- ProxySU/MainWindow.xaml.cs | 69 +++-- ProxySU/Properties/AssemblyInfo.cs | 4 +- ProxySU/ResultClientInformation.xaml | 58 +++-- ProxySU/ResultClientInformation.xaml.cs | 235 +++++++++++------- ProxySU/Translations/ProxySU.en-US.xaml | 3 +- ProxySU/Translations/ProxySU.zh-CN.xaml | 3 +- ProxySU/Translations/ProxySU.zh-TW.xaml | 3 +- ProxySU/V2RayTemplateWindow.xaml | 8 +- ProxySU/V2RayTemplateWindow.xaml.cs | 4 +- ProxySU/bin/Beta/Beta.zip | Bin 751481 -> 752718 bytes .../client/06_outbounds/trojan_tcp_tls.json | 23 ++ ...mess_xtls_tcp_websocket_server_config.json | 27 +- 13 files changed, 302 insertions(+), 137 deletions(-) create mode 100644 TemplateConfg/v2ray/client/06_outbounds/trojan_tcp_tls.json diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index ef57291..963e205 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ProxySU" mc:Ignorable="d" - Title="ProxySU - v2.4.20" Height="675" Width="650"> + Title="ProxySU - v2.4.21 Beta1" Height="675" Width="650"> diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index 9f64ef0..e2c6579 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -1316,7 +1316,7 @@ namespace ProxySU // SetUpProgressBarProcessing(40); // return true; //} - + //生成V2Ray服务端配置 44--46 //functionResult = GenerateServerConfiguration(client); //if (functionResult == false) { FunctionResultErr(); client.Disconnect(); return; } @@ -1538,8 +1538,7 @@ namespace ProxySU //设置VLESS协议的回落端口,指向Caddy if (String.Equals(ReceiveConfigurationParameters[0], "VlessTcpTlsWeb") == true - || String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true - || String.Equals(ReceiveConfigurationParameters[0], "VlessVmessXtlsTcpWebSocketWeb") == true) + || String.Equals(ReceiveConfigurationParameters[0], "VlessXtlsTcp") == true) { //设置Caddy随机监听的端口 randomCaddyListenPort = GetRandomPort(); @@ -1547,14 +1546,19 @@ namespace ProxySU //指向Caddy监听的随机端口 jObjectJson["inbounds"][0]["settings"]["fallbacks"][0]["dest"] = randomCaddyListenPort; } - - // + //设置VLESS+VMESS+Trojan+XTLS+TCP+WebSocket+Web协议 if (String.Equals(ReceiveConfigurationParameters[0], "VlessVmessXtlsTcpWebSocketWeb") == true) { + //设置Caddy随机监听的端口 + randomCaddyListenPort = GetRandomPort(); + + //指向Caddy监听的随机端口 + jObjectJson["inbounds"][1]["settings"]["fallbacks"][0]["dest"] = randomCaddyListenPort; //设置其他模式的UUID - jObjectJson["inbounds"][1]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; + jObjectJson["inbounds"][1]["settings"]["clients"][0]["password"] = ReceiveConfigurationParameters[2]; jObjectJson["inbounds"][2]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; jObjectJson["inbounds"][3]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; + jObjectJson["inbounds"][4]["settings"]["clients"][0]["id"] = ReceiveConfigurationParameters[2]; //设置Vless回落与分流的Path jObjectJson["inbounds"][0]["settings"]["fallbacks"][1]["path"] = ReceiveConfigurationParameters[3]; @@ -1939,8 +1943,8 @@ namespace ProxySU { //复合方案所需要的配置文件 //VLESS over TCP with XTLS模式 - string outboundsConfigJsonVlessXtls = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_xtls_client_config.json"; - using (StreamReader readerJson = File.OpenText(outboundsConfigJsonVlessXtls)) + string outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_xtls_client_config.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); @@ -1961,8 +1965,8 @@ namespace ProxySU } //VLESS over TCP with TLS模式 - string outboundsConfigJsonVlessTcpTls = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_tls_caddy_cilent_config.json"; - using (StreamReader readerJson = File.OpenText(outboundsConfigJsonVlessTcpTls)) + outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_tcp_tls_caddy_cilent_config.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); @@ -1983,8 +1987,8 @@ namespace ProxySU } //VLESS over WS with TLS 模式 - string outboundsConfigJsonVlessWsTls = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_ws_tls_client_config.json"; - using (StreamReader readerJson = File.OpenText(outboundsConfigJsonVlessWsTls)) + outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vless_ws_tls_client_config.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); @@ -2006,8 +2010,8 @@ namespace ProxySU } //VMess over TCP with TLS模式 - string outboundsConfigJsonVmessTcpTls = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vmess_tcp_tls_client_config.json"; - using (StreamReader readerJson = File.OpenText(outboundsConfigJsonVmessTcpTls)) + outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\vmess_tcp_tls_client_config.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); @@ -2029,8 +2033,8 @@ namespace ProxySU } //VMess over WS with TLS模式 - string outboundsConfigJsonVmessWsTls = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\WebSocketTLSWeb_client_config.json"; - using (StreamReader readerJson = File.OpenText(outboundsConfigJsonVmessWsTls)) + outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\WebSocketTLSWeb_client_config.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) { JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); @@ -2051,6 +2055,29 @@ namespace ProxySU } } + //Trojan over TCP with TLS模式 + outboundsConfigJsons = $"{pwdir}" + @"TemplateConfg\v2ray\client\06_outbounds\trojan_tcp_tls.json"; + using (StreamReader readerJson = File.OpenText(outboundsConfigJsons)) + { + JObject jObjectJson = (JObject)JToken.ReadFrom(new JsonTextReader(readerJson)); + + //设置客户端的地址/端口/id + jObjectJson["outbounds"][0]["settings"]["servers"][0]["address"] = ReceiveConfigurationParameters[4]; + jObjectJson["outbounds"][0]["settings"]["servers"][0]["port"] = int.Parse(ReceiveConfigurationParameters[1]); + jObjectJson["outbounds"][0]["settings"]["servers"][0]["password"] = ReceiveConfigurationParameters[2]; + jObjectJson["outbounds"][0]["streamSettings"]["tlsSettings"]["serverName"] = ReceiveConfigurationParameters[4]; + + clientJson["outbounds"] = jObjectJson["outbounds"]; + if (!Directory.Exists(@"v2ray_config\trojan_tcp_tls_client_config"))//如果不存在就创建file文件夹      + { + Directory.CreateDirectory(@"v2ray_config\trojan_tcp_tls_client_config");//创建该文件夹   + } + using (StreamWriter sw = new StreamWriter(@"v2ray_config\trojan_tcp_tls_client_config\config.json")) + { + sw.Write(clientJson.ToString()); + } + } + } } SetUpProgressBarProcessing(98); @@ -7282,8 +7309,8 @@ namespace ProxySU #region 测试用代码 private void Button_Click(object sender, RoutedEventArgs e) { - string host = ClassModel.DisguiseURLprocessing("www.google.com/accout/"); - MessageBox.Show(host); + //string host = ClassModel.DisguiseURLprocessing("www.google.com/accout/"); + //MessageBox.Show(host); //saveShellScriptFileName = GenerateRandomScriptFileName(GenerateRandomStr(10)); //saveShellScriptFileName = "tmp." + saveShellScriptFileName + ".sh"; //MessageBox.Show(saveShellScriptFileName); @@ -7293,9 +7320,9 @@ namespace ProxySU //string randStr = Convert.ToBase64String(bytes); //randStr = randStr.Replace("+","").Replace("/", "").Replace("=",""); //MessageBox.Show(randStr); - //proxyType = "TrojanGo"; - //ResultClientInformation resultClientInformation = new ResultClientInformation(); - //resultClientInformation.ShowDialog(); + proxyType = "V2Ray"; + ResultClientInformation resultClientInformation = new ResultClientInformation(); + resultClientInformation.ShowDialog(); //return; //string pwdir = AppDomain.CurrentDomain.BaseDirectory; //MessageBox.Show(pwdir); diff --git a/ProxySU/Properties/AssemblyInfo.cs b/ProxySU/Properties/AssemblyInfo.cs index fa165d0..eadfa78 100644 --- a/ProxySU/Properties/AssemblyInfo.cs +++ b/ProxySU/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.20.0")] -[assembly: AssemblyFileVersion("2.4.20.0")] +[assembly: AssemblyVersion("2.4.21.0")] +[assembly: AssemblyFileVersion("2.4.21.0")] diff --git a/ProxySU/ResultClientInformation.xaml b/ProxySU/ResultClientInformation.xaml index 90947c2..ca916fd 100644 --- a/ProxySU/ResultClientInformation.xaml +++ b/ProxySU/ResultClientInformation.xaml @@ -42,32 +42,44 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + - - - - - - + + + + - - - - - - - + + + + + @@ -81,12 +93,14 @@ + + diff --git a/ProxySU/ResultClientInformation.xaml.cs b/ProxySU/ResultClientInformation.xaml.cs index 67c7afb..7f19b00 100644 --- a/ProxySU/ResultClientInformation.xaml.cs +++ b/ProxySU/ResultClientInformation.xaml.cs @@ -56,7 +56,7 @@ namespace ProxySU TextBoxHostAddress.Text = MainWindow.ReceiveConfigurationParameters[4]; //主机端口 TextBoxPort.Text = MainWindow.ReceiveConfigurationParameters[1]; - //用户ID(uuid) + //用户ID(uuid)/Trojan密码 TextBoxUUID.Text = MainWindow.ReceiveConfigurationParameters[2]; //额外ID TextBoxUUIDextra.Text = "0"; @@ -79,6 +79,8 @@ namespace ProxySU //初始化时,隐藏多方案客户端选择面板 GroupBoxSelectVlessVmessXtlsTcpWs.Visibility = Visibility.Collapsed; + //显示非Trojan的所有参数 + GridNotTrojanParameters.Visibility = Visibility.Visible; if (String.Equals(MainWindow.ReceiveConfigurationParameters[0], "VlessVmessXtlsTcpWebSocketWeb") == false) { @@ -343,6 +345,7 @@ namespace ProxySU } else { + //显示多方案客户端选择面板 GroupBoxSelectVlessVmessXtlsTcpWs.Visibility = Visibility.Visible; string proxyfolder = CheckDir("v2ray_config"); @@ -363,6 +366,7 @@ namespace ProxySU V2raySetVmessWsTls(); GenerateV2rayVmessWsTlsShareQRcodeAndBase64Url(); + GenerateV2rayTrojanShareQRcodeAndBase64Url(); RadioButtonVlessTcpXtls.IsChecked = true; } @@ -688,6 +692,7 @@ namespace ProxySU //设置VLESS over TCP with XTLS private void V2raySetVlessTcpXtls() { + GridNotTrojanParameters.Visibility = Visibility.Visible; TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVless.Visibility = Visibility.Visible; //隐藏下面的二维码显示 @@ -709,6 +714,7 @@ namespace ProxySU //设置VLESS over TCP with TLS private void V2raySetVlessTcpTls() { + GridNotTrojanParameters.Visibility = Visibility.Visible; TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVless.Visibility = Visibility.Visible; //隐藏下面的二维码显示 @@ -729,6 +735,7 @@ namespace ProxySU //设置VLESS over WS with TLS private void V2raySetVlessWsTls() { + GridNotTrojanParameters.Visibility = Visibility.Visible; TextBlockVmessOrVless.Text = Application.Current.FindResource("TabItemHeaderV2RayVlessProtocol").ToString(); TextBlockVmessOrVless.Visibility = Visibility.Visible; //隐藏下面的二维码显示 @@ -750,6 +757,7 @@ namespace ProxySU //设置VMess over TCP with TLS private void V2raySetVmessTcpTls() { + GridNotTrojanParameters.Visibility = Visibility.Visible; TextBoxEncryption.Text = "none"; TextBoxTransmission.Text = "tcp"; TextBoxCamouflageType.Text = "http"; @@ -769,6 +777,7 @@ namespace ProxySU //设置VMess over WS with TLS private void V2raySetVmessWsTls() { + GridNotTrojanParameters.Visibility = Visibility.Visible; TextBoxEncryption.Text = "none"; TextBoxTransmission.Text = "ws"; TextBoxCamouflageType.Text = "none"; @@ -782,6 +791,15 @@ namespace ProxySU TextBlockVmessOrVless.Visibility = Visibility.Collapsed; ShowGroupBoxClientQRandURL(); } + + //设置Trojan over TCP with TLS + private void V2raySetTrojanTcpTls() + { + //隐藏所有不是Trojan的参数 + GridNotTrojanParameters.Visibility = Visibility.Collapsed; + //显示下面的二维码与分享链接 + ShowGroupBoxClientQRandURL(); + } #endregion #region 界面控制相关 @@ -842,6 +860,44 @@ namespace ProxySU } + //显示加密方式 + private void ShowEncryption() + { + TextBlockEncryption.Visibility = Visibility.Visible; + TextBoxEncryption.Visibility = Visibility.Visible; + } + //隐藏加密方式 + private void HideEncryption() + { + TextBlockEncryption.Visibility = Visibility.Collapsed; + TextBoxEncryption.Visibility = Visibility.Collapsed; + } + + //显示传输协议 + private void ShowTransferProtocol() + { + TextBlockTransferProtocol.Visibility = Visibility.Visible; + TextBoxTransmission.Visibility = Visibility.Visible; + } + //隐藏传输协议 + private void HideTransferProtocol() + { + TextBlockTransferProtocol.Visibility = Visibility.Collapsed; + TextBoxTransmission.Visibility = Visibility.Collapsed; + } + //显示伪装类型 + private void ShowTextBlockCamouflageType() + { + TextBlockCamouflageType.Visibility = Visibility.Visible; + TextBoxCamouflageType.Visibility = Visibility.Visible; + } + //隐藏伪装类型 + private void HideTextBlockCamouflageType() + { + TextBlockCamouflageType.Visibility = Visibility.Collapsed; + TextBoxCamouflageType.Visibility = Visibility.Collapsed; + } + //显示二维码与链接分享 private void ShowGroupBoxClientQRandURL() { @@ -878,6 +934,11 @@ namespace ProxySU { V2raySetVmessWsTls(); } + + private void RadioButtonTrojanTcpTls_Checked(object sender, RoutedEventArgs e) + { + V2raySetTrojanTcpTls(); + } #endregion #region 复制参数到剪贴板中 @@ -1730,48 +1791,6 @@ namespace ProxySU using (StreamWriter sw = new StreamWriter($"{configSavePath}\\readme.txt")) { ReadmeTxtWriteGenerate(sw); - //sw.WriteLine("config.json"); - ////****** "此文件为v2ray官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080,http代理地址:127.0.0.1:1081" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine01").ToString()); - - ////****** "v2ray官方网站:https://www.v2ray.com/" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine02").ToString()); - - ////****** "v2ray官方程序下载地址:https://github.com/v2ray/v2ray-core/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine03").ToString()); - - ////****** "下载相应版本,Windows选择v2ray-windows-64.zip或者v2ray-windows-32.zip,解压后提取v2ctl.exe和v2ray.exe。与config.json放在同一目录,运行v2ray.exe即可。" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine04").ToString()); - - //sw.WriteLine("-----------------------------------------"); - //sw.WriteLine("QR.bmp"); - - ////******"此文件为v2rayN、Qv2ray、v2rayNG(Android)、Shadowrocket(ios)扫码导入节点" * ***** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine05").ToString()); - - ////****** "v2rayN下载网址:https://github.com/2dust/v2rayN/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine06").ToString()); - - ////****** "Qv2ray:https://github.com/Qv2ray/Qv2ray/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine07").ToString()); - - ////****** "v2rayNG(Android)下载网址:https://github.com/2dust/v2rayNG/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine08").ToString()); - - ////****** "v2rayNG(Android)在Google Play下载网址:https://play.google.com/store/apps/details?id=com.v2ray.ang" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine09").ToString()); - - ////****** "Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine10").ToString()); - - //sw.WriteLine("-----------------------------------------"); - //sw.WriteLine("url.txt"); - - ////******"此文件为v2rayN、Qv2ray、v2rayNG(Android)、Shadowrocket(ios)复制粘贴导入节点的vmess网址" * ***** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine11").ToString()); - - ////写入通用配置参数-- - //TxtWriteGeneralParameters(sw); } } @@ -1858,50 +1877,100 @@ namespace ProxySU using (StreamWriter sw = new StreamWriter($"{configSavePath}\\readme.txt")) { ReadmeTxtWriteGenerate(sw); - //sw.WriteLine("config.json"); - ////****** "此文件为v2ray官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080,http代理地址:127.0.0.1:1081" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine01").ToString()); + + } + } - ////****** "v2ray官方网站:https://www.v2ray.com/" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine02").ToString()); + //生成Trojan over TCP with TLS的配置保存 + private void GenerateV2rayTrojanShareQRcodeAndBase64Url() + { + //创建保存目录 + string plainSavePath = @"trojan_tcp_tls_client_config"; + string configSavePath = CheckDir($"{configDomainSavePath}\\{plainSavePath}"); - ////****** "v2ray官方程序下载地址:https://github.com/v2ray/v2ray-core/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine03").ToString()); + string trojanUrl = $"trojan://{TextBoxUUID.Text}@{TextBoxHostAddress.Text}:{TextBoxPort.Text}#{TextBoxHostAddress.Text}"; - ////****** "下载相应版本,Windows选择v2ray-windows-64.zip或者v2ray-windows-32.zip,解压后提取v2ctl.exe和v2ray.exe。与config.json放在同一目录,运行v2ray.exe即可。" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine04").ToString()); - - //sw.WriteLine("-----------------------------------------"); - //sw.WriteLine("QR.bmp"); - - ////****** "此文件为v2rayN、Qv2ray、v2rayNG(Android)、Shadowrocket(ios)扫码导入节点" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine05").ToString()); - - ////****** "v2rayN下载网址:https://github.com/2dust/v2rayN/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine06").ToString()); - - ////****** "Qv2ray:https://github.com/Qv2ray/Qv2ray/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine07").ToString()); - - ////****** "v2rayNG(Android)下载网址:https://github.com/2dust/v2rayNG/releases" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine08").ToString()); - - ////****** "v2rayNG(Android)在Google Play下载网址:https://play.google.com/store/apps/details?id=com.v2ray.ang" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine09").ToString()); - - ////****** "Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine10").ToString()); - - //sw.WriteLine("-----------------------------------------"); - //sw.WriteLine("url.txt"); - - ////****** "此文件为v2rayN、Qv2ray、v2rayNG(Android)、Shadowrocket(ios)复制粘贴导入节点的vmess网址" ****** - //sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine11").ToString()); - - ////写入通用配置参数-- - //TxtWriteGeneralParameters(sw); + TextBoxURL.Text = trojanUrl; + using (StreamWriter sw = new StreamWriter($"{configSavePath}\\url.txt")) + { + sw.WriteLine(trojanUrl); } + ImageShareQRcode.Source = CreateQRCode(trojanUrl, $"{configSavePath}\\QR.bmp"); + + //移动官方程序配置文件到相应目录 + if (File.Exists($"v2ray_config\\{plainSavePath}\\config.json")) + { + File.Move($"v2ray_config\\{plainSavePath}\\config.json", $"{configSavePath}\\config.json"); + Directory.Delete($"v2ray_config\\{plainSavePath}"); + } + + using (StreamWriter sw = new StreamWriter($"{configSavePath}\\readme.txt")) + { + //ReadmeTxtWriteGenerate(sw); + sw.WriteLine("config.json"); + //****** "此文件为v2ray官方程序所使用的客户端配置文件,配置为全局模式,socks5地址:127.0.0.1:1080,http代理地址:127.0.0.1:1081" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine01").ToString()); + + //****** "v2ray官方网站:https://www.v2ray.com/" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine02").ToString()); + + //****** "v2ray官方程序下载地址:https://github.com/v2ray/v2ray-core/releases" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine03").ToString()); + + //****** "下载相应版本,Windows选择v2ray-windows-64.zip或者v2ray-windows-32.zip,解压后提取v2ctl.exe和v2ray.exe。与config.json放在同一目录,运行v2ray.exe即可。" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine04").ToString()); + + sw.WriteLine("-----------------------------------------"); + sw.WriteLine("QR.bmp"); + + //****** "此文件为v2rayN(windows)、Qv2ray(windows)、v2rayNG(Android)、Shadowrocket(ios)扫码导入节点" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine05").ToString()); + + //****** "v2rayN下载网址:https://github.com/2dust/v2rayN/releases" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine06").ToString()); + + //****** "Qv2ray下载网址:https://github.com/Qv2ray/Qv2ray/releases" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine07").ToString()); + + //****** "v2rayNG(Android)下载网址:https://github.com/2dust/v2rayNG/releases" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine08").ToString()); + + //****** "v2rayNG(Android)在Google Play下载网址:https://play.google.com/store/apps/details?id=com.v2ray.ang" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine09").ToString()); + + //****** "Shadowrocket(ios)下载,需要使用国外区的AppleID。请自行谷歌方法。" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine10").ToString()); + + sw.WriteLine("-----------------------------------------"); + sw.WriteLine("url.txt"); + + //****** "此文件为v2rayN、Qv2ray、v2rayNG(Android)、Shadowrocket(ios)复制粘贴导入节点的vmess网址" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine11").ToString()); + + sw.WriteLine("-----------------------------------------\n"); + + string strApplicat = ""; + string strParam = ""; + int strLenth = 20; + //****** "服务器通用连接配置参数:" ****** + sw.WriteLine(Application.Current.FindResource("readmeTxtV2RayExplainLine12").ToString()); + sw.WriteLine(""); + + strApplicat = "TextBlockServerAddress"; + strParam = TextBoxHostAddress.Text; + sw.WriteLine(AlignmentStrFunc(Application.Current.FindResource($"{strApplicat}").ToString(), strLenth) + strParam); + + strApplicat = "TextBlockServerPort"; + strParam = TextBoxPort.Text; + sw.WriteLine(AlignmentStrFunc(Application.Current.FindResource($"{strApplicat}").ToString(), strLenth) + strParam); + + strApplicat = "TextBlockUserUUID"; + strParam = TextBoxUUID.Text; + sw.WriteLine(AlignmentStrFunc(Application.Current.FindResource($"{strApplicat}").ToString(), strLenth) + strParam); + + } + } //写入VMESS的readme.txt文件 @@ -3155,8 +3224,6 @@ namespace ProxySU return spaceString + strTemp; } - - } diff --git a/ProxySU/Translations/ProxySU.en-US.xaml b/ProxySU/Translations/ProxySU.en-US.xaml index 30f96d4..f036808 100644 --- a/ProxySU/Translations/ProxySU.en-US.xaml +++ b/ProxySU/Translations/ProxySU.en-US.xaml @@ -173,6 +173,7 @@ VMESS ws path: QUIC Encryption: Domain name: + Trojan password is the same as V2ray UUID. Mask a website: Set this option to increase proxy concealment (can be empty) Enter only the domain name, excluding "http" and "/" etc. @@ -225,7 +226,7 @@ Client configuration parameters Server address: Port: - User ID(uuid): + User ID(uuid)/Password: Copy Copied to the clipboard! Empty content! diff --git a/ProxySU/Translations/ProxySU.zh-CN.xaml b/ProxySU/Translations/ProxySU.zh-CN.xaml index 5ee4870..d4f1e5b 100644 --- a/ProxySU/Translations/ProxySU.zh-CN.xaml +++ b/ProxySU/Translations/ProxySU.zh-CN.xaml @@ -176,6 +176,7 @@ QUIC加密方式: 域名: + Trojan密码与V2ray的UUID相同。 伪装网站: 设置此项可增加代理的隐蔽(可为空) 仅仅输入域名,不包括"http"及"/"等 @@ -228,7 +229,7 @@ 客户端配置参数 服务器地址(address): 端口(port): - 用户ID(uuid): + 用户ID(uuid)/密码: 复制 已复制到剪贴板中! 空内容! diff --git a/ProxySU/Translations/ProxySU.zh-TW.xaml b/ProxySU/Translations/ProxySU.zh-TW.xaml index b9373e5..2930e02 100644 --- a/ProxySU/Translations/ProxySU.zh-TW.xaml +++ b/ProxySU/Translations/ProxySU.zh-TW.xaml @@ -173,6 +173,7 @@ VMESS ws路徑: QUIC加密方式: 域名: + Trojan密碼與V2ray的UUID相同。 偽裝網站: 設置此項可增加代理的隱蔽(可為空) 僅僅輸入域名,不包括"http"及"/"等 @@ -225,7 +226,7 @@ 客戶端配置參數 服務器地址(address): 端口(port): - 用戶ID(uuid): + 用戶ID(uuid)/密碼: 複製 已復製到剪貼板中! 空內容! diff --git a/ProxySU/V2RayTemplateWindow.xaml b/ProxySU/V2RayTemplateWindow.xaml index a8cf780..eb56bcb 100644 --- a/ProxySU/V2RayTemplateWindow.xaml +++ b/ProxySU/V2RayTemplateWindow.xaml @@ -91,15 +91,18 @@ + - + + + - +