mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 05:12:09 +08:00
1.1.0 -> 1.1.1 第14次更新
This commit is contained in:
parent
eaaca182d4
commit
e502c6df2e
9
Consts/AboutMultilangConst.Designer.cs
generated
9
Consts/AboutMultilangConst.Designer.cs
generated
@ -60,6 +60,15 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Password: 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _ReleasePagePasswordLabel {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_ReleasePagePasswordLabel", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Dev. Space Time 的本地化字符串。
|
/// 查找类似 Dev. Space Time 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -117,25 +117,28 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="TermsButtonContent" xml:space="preserve">
|
|
||||||
<value>ToS</value>
|
|
||||||
</data>
|
|
||||||
<data name="DeveloperButtonContent" xml:space="preserve">
|
<data name="DeveloperButtonContent" xml:space="preserve">
|
||||||
<value>Dev. Space Time</value>
|
<value>Dev. Space Time</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EmailButtonContent" xml:space="preserve">
|
|
||||||
<value>Email</value>
|
|
||||||
</data>
|
|
||||||
<data name="DocumentationButtonContent" xml:space="preserve">
|
<data name="DocumentationButtonContent" xml:space="preserve">
|
||||||
<value>Docs</value>
|
<value>Docs</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RepositoryButtonContent" xml:space="preserve">
|
<data name="EmailButtonContent" xml:space="preserve">
|
||||||
<value>Repo</value>
|
<value>Email</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PolicyButtonContent" xml:space="preserve">
|
<data name="PolicyButtonContent" xml:space="preserve">
|
||||||
<value>PP</value>
|
<value>PP</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RepositoryButtonContent" xml:space="preserve">
|
||||||
|
<value>Repo</value>
|
||||||
|
</data>
|
||||||
|
<data name="TermsButtonContent" xml:space="preserve">
|
||||||
|
<value>ToS</value>
|
||||||
|
</data>
|
||||||
<data name="VersionButtonLabelContent" xml:space="preserve">
|
<data name="VersionButtonLabelContent" xml:space="preserve">
|
||||||
<value>Ver.</value>
|
<value>Ver.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_ReleasePagePasswordLabel" xml:space="preserve">
|
||||||
|
<value>Password:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -97,25 +97,28 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="TermsButtonContent" xml:space="preserve">
|
|
||||||
<value>使用协议</value>
|
|
||||||
</data>
|
|
||||||
<data name="DeveloperButtonContent" xml:space="preserve">
|
<data name="DeveloperButtonContent" xml:space="preserve">
|
||||||
<value>开发者: Space Time</value>
|
<value>开发者: Space Time</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EmailButtonContent" xml:space="preserve">
|
|
||||||
<value>联系邮箱</value>
|
|
||||||
</data>
|
|
||||||
<data name="DocumentationButtonContent" xml:space="preserve">
|
<data name="DocumentationButtonContent" xml:space="preserve">
|
||||||
<value>使用文档</value>
|
<value>使用文档</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="RepositoryButtonContent" xml:space="preserve">
|
<data name="EmailButtonContent" xml:space="preserve">
|
||||||
<value>开源地址</value>
|
<value>联系邮箱</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PolicyButtonContent" xml:space="preserve">
|
<data name="PolicyButtonContent" xml:space="preserve">
|
||||||
<value>隐私政策</value>
|
<value>隐私政策</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="RepositoryButtonContent" xml:space="preserve">
|
||||||
|
<value>开源地址</value>
|
||||||
|
</data>
|
||||||
|
<data name="TermsButtonContent" xml:space="preserve">
|
||||||
|
<value>使用协议</value>
|
||||||
|
</data>
|
||||||
<data name="VersionButtonLabelContent" xml:space="preserve">
|
<data name="VersionButtonLabelContent" xml:space="preserve">
|
||||||
<value>版本号:</value>
|
<value>版本号:</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_ReleasePagePasswordLabel" xml:space="preserve">
|
||||||
|
<value>密码:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
54
Consts/MainMultilangConst.Designer.cs
generated
54
Consts/MainMultilangConst.Designer.cs
generated
@ -60,6 +60,60 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Browser 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _BrowserPathDialogFilterFileType {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_BrowserPathDialogFilterFileType", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 The args cannot be recognized, check if the host contains syntax errors 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _CealingHostErrorHint {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_CealingHostErrorHint", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Local host is exactly the same as upstream 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _HostUtdHint {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_HostUtdHint", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 All processes of the selected browser will be closed before launching, do you want to continue? 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _KillBrowserProcessesPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_KillBrowserProcessesPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Do you need to override local host that are slightly different from upstream? If not it will only open a page with the upstream host for you 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _OverrideLocalHostPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_OverrideLocalHostPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Update successfully 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _UpdateHostSuccessHint {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_UpdateHostSuccessHint", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 About Me 的本地化字符串。
|
/// 查找类似 About Me 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -186,4 +186,22 @@
|
|||||||
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
||||||
<value>Upstream URL</value>
|
<value>Upstream URL</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||||
|
<value>Browser</value>
|
||||||
|
</data>
|
||||||
|
<data name="_CealingHostErrorHint" xml:space="preserve">
|
||||||
|
<value>The args cannot be recognized, check if the host contains syntax errors</value>
|
||||||
|
</data>
|
||||||
|
<data name="_HostUtdHint" xml:space="preserve">
|
||||||
|
<value>Local host is exactly the same as upstream</value>
|
||||||
|
</data>
|
||||||
|
<data name="_KillBrowserProcessesPrompt" xml:space="preserve">
|
||||||
|
<value>All processes of the selected browser will be closed before launching, do you want to continue?</value>
|
||||||
|
</data>
|
||||||
|
<data name="_OverrideLocalHostPrompt" xml:space="preserve">
|
||||||
|
<value>Do you need to override local host that are slightly different from upstream? If not it will only open a page with the upstream host for you</value>
|
||||||
|
</data>
|
||||||
|
<data name="_UpdateHostSuccessHint" xml:space="preserve">
|
||||||
|
<value>Update successfully</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -186,4 +186,22 @@
|
|||||||
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
||||||
<value>上游链接</value>
|
<value>上游链接</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||||
|
<value>浏览器</value>
|
||||||
|
</data>
|
||||||
|
<data name="_CealingHostErrorHint" xml:space="preserve">
|
||||||
|
<value>规则无法识别,请检查伪造规则是否含有语法错误</value>
|
||||||
|
</data>
|
||||||
|
<data name="_HostUtdHint" xml:space="preserve">
|
||||||
|
<value>本地伪造规则和上游一模一样</value>
|
||||||
|
</data>
|
||||||
|
<data name="_KillBrowserProcessesPrompt" xml:space="preserve">
|
||||||
|
<value>启动前将关闭所选浏览器的所有进程,是否继续?</value>
|
||||||
|
</data>
|
||||||
|
<data name="_OverrideLocalHostPrompt" xml:space="preserve">
|
||||||
|
<value>本地伪造规则和上游略有不同,需要覆盖本地吗?否则只为你打开上游规则的网页</value>
|
||||||
|
</data>
|
||||||
|
<data name="_UpdateHostSuccessHint" xml:space="preserve">
|
||||||
|
<value>更新已完成</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -3,6 +3,7 @@ using System.Diagnostics;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using Sheas_Cealer.Consts;
|
||||||
using Sheas_Cealer.Utils;
|
using Sheas_Cealer.Utils;
|
||||||
|
|
||||||
namespace Sheas_Cealer.Wins;
|
namespace Sheas_Cealer.Wins;
|
||||||
@ -17,7 +18,7 @@ public partial class AboutWin : Window
|
|||||||
Button? senderButton = sender as Button;
|
Button? senderButton = sender as Button;
|
||||||
|
|
||||||
if (senderButton == VersionButton)
|
if (senderButton == VersionButton)
|
||||||
MessageBox.Show("密码: 3wnj");
|
MessageBox.Show($"{AboutConst._ReleasePagePasswordLabel} 3wnj");
|
||||||
|
|
||||||
ProcessStartInfo processStartInfo = new(senderButton == EmailButton ? "mailto:" : string.Empty + senderButton!.ToolTip) { UseShellExecute = true };
|
ProcessStartInfo processStartInfo = new(senderButton == EmailButton ? "mailto:" : string.Empty + senderButton!.ToolTip) { UseShellExecute = true };
|
||||||
Process.Start(processStartInfo);
|
Process.Start(processStartInfo);
|
||||||
|
@ -77,7 +77,7 @@ public partial class MainWin : Window
|
|||||||
}
|
}
|
||||||
private void SettingsFunctionButton_Click(object sender, RoutedEventArgs e)
|
private void SettingsFunctionButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OpenFileDialog browserPathDialog = new() { Filter = "浏览器 (*.exe)|*.exe" };
|
OpenFileDialog browserPathDialog = new() { Filter = $"{MainConst._BrowserPathDialogFilterFileType} (*.exe)|*.exe" };
|
||||||
|
|
||||||
switch (MainPres!.SettingsMode)
|
switch (MainPres!.SettingsMode)
|
||||||
{
|
{
|
||||||
@ -110,11 +110,11 @@ public partial class MainWin : Window
|
|||||||
HoldButtonTimer!.Stop();
|
HoldButtonTimer!.Stop();
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(CealArgs))
|
if (string.IsNullOrWhiteSpace(CealArgs))
|
||||||
throw new Exception("规则无法识别,请检查伪造规则是否含有语法错误");
|
throw new Exception(MainConst._CealingHostErrorHint);
|
||||||
if (MessageBox.Show("启动前将关闭所选浏览器的所有进程,是否继续?", string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
if (MessageBox.Show(MainConst._KillBrowserProcessesPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IWshShortcut uncealedBrowserShortcut = (IWshShortcut)new WshShell().CreateShortcut(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Uncealed-Browser.lnk"));
|
IWshShortcut uncealedBrowserShortcut = (IWshShortcut)new WshShell().CreateShortcut(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Uncealed-Browser.lnk"));
|
||||||
uncealedBrowserShortcut.TargetPath = MainPres!.BrowserPath;
|
uncealedBrowserShortcut.TargetPath = MainPres!.BrowserPath;
|
||||||
uncealedBrowserShortcut.Description = "Created By Sheas Cealer";
|
uncealedBrowserShortcut.Description = "Created By Sheas Cealer";
|
||||||
uncealedBrowserShortcut.Save();
|
uncealedBrowserShortcut.Save();
|
||||||
@ -130,7 +130,7 @@ public partial class MainWin : Window
|
|||||||
|
|
||||||
private void EditHostButton_Click(object sender, RoutedEventArgs e)
|
private void EditHostButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ProcessStartInfo processStartInfo = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json")) { UseShellExecute = true };
|
ProcessStartInfo processStartInfo = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host.json")) { UseShellExecute = true };
|
||||||
Process.Start(processStartInfo);
|
Process.Start(processStartInfo);
|
||||||
}
|
}
|
||||||
private async void UpdateHostButton_Click(object sender, RoutedEventArgs e)
|
private async void UpdateHostButton_Click(object sender, RoutedEventArgs e)
|
||||||
@ -139,18 +139,18 @@ public partial class MainWin : Window
|
|||||||
string upstreamHostString = await Http.GetAsync<string>(upstreamHostUrl, MainClient);
|
string upstreamHostString = await Http.GetAsync<string>(upstreamHostUrl, MainClient);
|
||||||
string localHostString;
|
string localHostString;
|
||||||
|
|
||||||
using (StreamReader localHostStreamReader = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json")))
|
using (StreamReader localHostStreamReader = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host.json")))
|
||||||
localHostString = localHostStreamReader.ReadToEnd();
|
localHostString = localHostStreamReader.ReadToEnd();
|
||||||
|
|
||||||
if (localHostString.Replace("\r", string.Empty) == upstreamHostString)
|
if (localHostString.Replace("\r", string.Empty) == upstreamHostString)
|
||||||
MessageBox.Show("本地伪造规则和上游一模一样");
|
MessageBox.Show(MainConst._HostUtdHint);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBoxResult overrideOptionResult = MessageBox.Show("本地伪造规则和上游略有不同,需要覆盖本地吗? 否则只为你打开上游规则的网页", string.Empty, MessageBoxButton.YesNoCancel);
|
MessageBoxResult overrideOptionResult = MessageBox.Show(MainConst._OverrideLocalHostPrompt, string.Empty, MessageBoxButton.YesNoCancel);
|
||||||
if (overrideOptionResult == MessageBoxResult.Yes)
|
if (overrideOptionResult == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json"), upstreamHostString);
|
File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host.json"), upstreamHostString);
|
||||||
MessageBox.Show("更新已完成");
|
MessageBox.Show(MainConst._UpdateHostSuccessHint);
|
||||||
}
|
}
|
||||||
else if (overrideOptionResult == MessageBoxResult.No)
|
else if (overrideOptionResult == MessageBoxResult.No)
|
||||||
Process.Start(new ProcessStartInfo(upstreamHostUrl) { UseShellExecute = true });
|
Process.Start(new ProcessStartInfo(upstreamHostUrl) { UseShellExecute = true });
|
||||||
@ -167,7 +167,7 @@ public partial class MainWin : Window
|
|||||||
string hostResolverRules = string.Empty;
|
string hostResolverRules = string.Empty;
|
||||||
int ruleIndex = 0;
|
int ruleIndex = 0;
|
||||||
|
|
||||||
using FileStream hostStream = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json"), FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
using FileStream hostStream = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host.json"), FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
||||||
using StreamReader hostReader = new(hostStream);
|
using StreamReader hostReader = new(hostStream);
|
||||||
|
|
||||||
foreach (JToken hostJToken in JArray.Parse(hostReader.ReadToEnd()))
|
foreach (JToken hostJToken in JArray.Parse(hostReader.ReadToEnd()))
|
||||||
|
Loading…
Reference in New Issue
Block a user