From d748976aa9ea32b738efa6ce4b039a9c19b055d7 Mon Sep 17 00:00:00 2001 From: Space Time Date: Mon, 30 Dec 2024 15:41:45 +0800 Subject: [PATCH] =?UTF-8?q?1.1.5=20(alpha)=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Consts/MainMultilangConst.Designer.cs | 9 +++++++++ Consts/MainMultilangConst.resx | 3 +++ Consts/MainMultilangConst.zh.resx | 3 +++ Convs/AboutVersionButtonContentConv.cs | 2 +- Wins/MainWin.xaml.cs | 6 +++--- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Consts/MainMultilangConst.Designer.cs b/Consts/MainMultilangConst.Designer.cs index 6a16880..e91b911 100644 --- a/Consts/MainMultilangConst.Designer.cs +++ b/Consts/MainMultilangConst.Designer.cs @@ -150,6 +150,15 @@ namespace Sheas_Cealer.Consts { } } + /// + /// 查找类似 You are using hosts-based non-wildcard domain global cealing. Do you want to continue? 的本地化字符串。 + /// + public static string _LaunchHostsNginxPrompt { + get { + return ResourceManager.GetString("_LaunchHostsNginxPrompt", resourceCulture); + } + } + /// /// 查找类似 Mihomo failed to launch 的本地化字符串。 /// diff --git a/Consts/MainMultilangConst.resx b/Consts/MainMultilangConst.resx index 6dd2bb0..0230a4f 100644 --- a/Consts/MainMultilangConst.resx +++ b/Consts/MainMultilangConst.resx @@ -285,6 +285,9 @@ All processes of the selected browser will be closed before launching. Do you want to continue? + + You are using hosts-based non-wildcard domain global cealing. Do you want to continue? + Mihomo failed to launch diff --git a/Consts/MainMultilangConst.zh.resx b/Consts/MainMultilangConst.zh.resx index 39d4a56..68dd390 100644 --- a/Consts/MainMultilangConst.zh.resx +++ b/Consts/MainMultilangConst.zh.resx @@ -285,6 +285,9 @@ 启动前将关闭所选浏览器的所有进程,是否继续? + + 正在使用基于 Hosts 的非泛域名全局伪造,是否继续? + Mihomo 启动失败 diff --git a/Convs/AboutVersionButtonContentConv.cs b/Convs/AboutVersionButtonContentConv.cs index 3cbdc15..ca884af 100644 --- a/Convs/AboutVersionButtonContentConv.cs +++ b/Convs/AboutVersionButtonContentConv.cs @@ -12,7 +12,7 @@ internal class AboutVersionButtonContentConv : IMultiValueConverter string versionButtonVersionContent = (string)values[1]; bool isSheasCealerUtd = (bool)values[2]; - return $"{versionButtonLabelContent} {versionButtonVersionContent}" + (isSheasCealerUtd ? string.Empty : " *"); + return $"{versionButtonVersionContent} (alpha)" + (isSheasCealerUtd ? string.Empty : " *"); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException(); diff --git a/Wins/MainWin.xaml.cs b/Wins/MainWin.xaml.cs index b72be1b..a027634 100644 --- a/Wins/MainWin.xaml.cs +++ b/Wins/MainWin.xaml.cs @@ -85,8 +85,6 @@ public partial class MainWin : Window foreach (string cealHostPath in Directory.GetFiles(CealHostWatcher.Path, CealHostWatcher.Filter)) CealHostWatcher_Changed(null!, new(new(), Path.GetDirectoryName(cealHostPath)!, Path.GetFileName(cealHostPath))); - MihomoConfWatcher_Changed(null!, null!); - if (MainConst.IsAdmin && !MainPres.IsConginxRunning && !MainPres.IsNginxRunning) await NginxCleaner.Clean(); @@ -217,6 +215,7 @@ public partial class MainWin : Window (CealHostRulesDict.ContainsValue(null!) && MessageBox.Show(MainConst._CealHostErrorPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) || (NginxHttpsPort != 443 && MessageBox.Show(string.Format(MainConst._NginxHttpsPortOccupiedPrompt, NginxHttpsPort), string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) || (NginxHttpPort != 80 && MessageBox.Show(string.Format(MainConst._NginxHttpPortOccupiedPrompt, NginxHttpPort), string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) || + (sender != null && MessageBox.Show(MainConst._LaunchHostsNginxPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) || (MessageBox.Show(MainConst._LaunchProxyPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) || (MainPres.IsFlashing && MessageBox.Show(MainConst._LaunchNginxFlashingPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes)) return; @@ -755,6 +754,7 @@ public partial class MainWin : Window CealArgs = @$"--host-rules=""{hostRules.TrimEnd(',')}"" --host-resolver-rules=""{hostResolverRules.TrimEnd(',')}"" --test-type --ignore-certificate-errors"; NginxConfWatcher_Changed(null!, null!); + MihomoConfWatcher_Changed(null!, null!); } } private async void NginxConfWatcher_Changed(object sender, FileSystemEventArgs e) @@ -799,7 +799,7 @@ public partial class MainWin : Window .AddOrUpdate("events:worker_connections", "65536") .AddOrUpdate("http:proxy_set_header", "Host $http_host") .AddOrUpdate("http:proxy_ssl_server_name", !MainPres.IsFlashing ? "on" : "off") - .AddOrUpdate("http:proxy_buffer_size", "8k") + .AddOrUpdate("http:proxy_buffer_size", "14k") .AddOrUpdate($"http:server[{serverIndex}]:listen", $"{NginxHttpPort} default_server") .AddOrUpdate($"http:server[{serverIndex}]:return", "https://$host$request_uri");