mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
Compare commits
147 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e1b1c606e1 | ||
![]() |
46de61c4f2 | ||
![]() |
479c16c2a1 | ||
![]() |
938ca77fc1 | ||
![]() |
d9e307e647 | ||
![]() |
85213b61da | ||
![]() |
bf7772a35f | ||
![]() |
188e56b57b | ||
![]() |
0150440de4 | ||
![]() |
c25888bd5a | ||
![]() |
a97b04e5d9 | ||
![]() |
b3dc94eb2b | ||
![]() |
597e441af5 | ||
![]() |
8a81ba59dc | ||
![]() |
d748976aa9 | ||
![]() |
f428de3fd7 | ||
![]() |
bcccb73520 | ||
![]() |
6fd9631d5c | ||
![]() |
2c5004f02d | ||
![]() |
8de6980f59 | ||
![]() |
b1d41436de | ||
![]() |
1fd5b99e67 | ||
![]() |
eecec3bbd7 | ||
![]() |
ccf47c85c9 | ||
![]() |
cf616b33a8 | ||
![]() |
592f871778 | ||
![]() |
f625d79667 | ||
![]() |
80abfa8116 | ||
![]() |
87d97c2f04 | ||
![]() |
345c291305 | ||
![]() |
5af134c7a4 | ||
![]() |
bd73327fc0 | ||
![]() |
1a08c65c0d | ||
![]() |
64f4bbad02 | ||
![]() |
b52eb93e40 | ||
![]() |
f1e9df5418 | ||
![]() |
9ea750e336 | ||
![]() |
e66f1eb5b2 | ||
![]() |
ec5d3893fb | ||
![]() |
13d8663a6e | ||
![]() |
af28d96bf9 | ||
![]() |
dcef7be238 | ||
![]() |
6a7b65fe99 | ||
![]() |
e962850d05 | ||
![]() |
aa5765d168 | ||
![]() |
ebe199d048 | ||
![]() |
56185d2750 | ||
![]() |
c7efd8df68 | ||
![]() |
92f55711a6 | ||
![]() |
b54ef3a3bb | ||
![]() |
0f3724508c | ||
![]() |
e0317c870f | ||
![]() |
49fb4cf655 | ||
![]() |
419ddd8fdb | ||
![]() |
bdf34249c6 | ||
![]() |
c96d51459f | ||
![]() |
536a498e65 | ||
![]() |
1e310cc69d | ||
![]() |
32871f580a | ||
![]() |
5e9ab2d928 | ||
![]() |
7dd6036cec | ||
![]() |
8637b18fd2 | ||
![]() |
029bd787dc | ||
![]() |
f8501fc05b | ||
![]() |
ee99628508 | ||
![]() |
bf73c635d3 | ||
![]() |
8dc34243bd | ||
![]() |
54f9326f29 | ||
![]() |
2660c63311 | ||
![]() |
dc73a30540 | ||
![]() |
73de1516ea | ||
![]() |
67079cf9e0 | ||
![]() |
9d50e772fd | ||
![]() |
753b53bc17 | ||
![]() |
21964c0e76 | ||
![]() |
ef997ad840 | ||
![]() |
2b3ca3f3ee | ||
![]() |
4af0990ea6 | ||
![]() |
3a95e8cbea | ||
![]() |
5a0a05e62f | ||
![]() |
6ebc22c8ea | ||
![]() |
34165391b4 | ||
![]() |
2e7f4d4cf9 | ||
![]() |
42bd83f4d3 | ||
![]() |
4009e8ce63 | ||
![]() |
66230df9a5 | ||
![]() |
f7a0729eaa | ||
![]() |
73f411aca3 | ||
![]() |
5e94c1e81b | ||
![]() |
dda0c2efee | ||
![]() |
688412f2b5 | ||
![]() |
9709cf249b | ||
![]() |
0021b1516e | ||
![]() |
8c44b0b82a | ||
![]() |
abd180c0e7 | ||
![]() |
c8bffaa96c | ||
![]() |
be23d1bce8 | ||
![]() |
038e9fe7e7 | ||
![]() |
8178742f62 | ||
![]() |
e37ef64aca | ||
![]() |
007fea343c | ||
![]() |
fe8f73afb8 | ||
![]() |
2e07e97e01 | ||
![]() |
48afa92ed9 | ||
![]() |
a8f408dc62 | ||
![]() |
dac9459e1c | ||
![]() |
460826b1ee | ||
![]() |
426596f780 | ||
![]() |
6b7542a3b9 | ||
![]() |
9b1533b51c | ||
![]() |
94581ee703 | ||
![]() |
144de24013 | ||
![]() |
48509f46cf | ||
![]() |
21fc19059d | ||
![]() |
94ede5b64b | ||
![]() |
5bd9ef3e58 | ||
![]() |
fe44a5231e | ||
![]() |
a4ff7972ae | ||
![]() |
443822902a | ||
![]() |
eef852304d | ||
![]() |
3d8f1412b4 | ||
![]() |
ca92fa349d | ||
![]() |
372d900280 | ||
![]() |
f100becc01 | ||
![]() |
dd0064469f | ||
![]() |
27826633a1 | ||
![]() |
b78c982621 | ||
![]() |
3b48344946 | ||
![]() |
8d8a4f016a | ||
![]() |
7932212e5f | ||
![]() |
c680f6e3f8 | ||
![]() |
0c76f6ed59 | ||
![]() |
37bcd63b9e | ||
![]() |
820df74051 | ||
![]() |
fe2475b8fa | ||
![]() |
0a9efb4f0b | ||
![]() |
c103b860a8 | ||
![]() |
bce0a8a5ca | ||
![]() |
6431a90a72 | ||
![]() |
f54e470874 | ||
![]() |
cfe4108590 | ||
![]() |
5ba6303a8e | ||
![]() |
e016d97c71 | ||
![]() |
b00e3aa8c2 | ||
![]() |
a81b408f12 | ||
![]() |
84b54e65de | ||
![]() |
8511a5e85d |
42
.filenesting.json
Normal file
42
.filenesting.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"dependentFileProviders": {
|
||||||
|
"add": {
|
||||||
|
"fileToFile": {
|
||||||
|
"add": {
|
||||||
|
"AboutMultilangConst.resx": [ "AboutConst.cs" ],
|
||||||
|
"AboutMultilangConst.zh.resx": [ "AboutConst.cs" ],
|
||||||
|
"MainMultilangConst.resx": [ "MainConst.cs" ],
|
||||||
|
"MainMultilangConst.zh.resx": [ "MainConst.cs" ],
|
||||||
|
"SettingsMultilangConst.resx": [ "SettingsConst.cs" ],
|
||||||
|
"SettingsMultilangConst.zh.resx": [ "SettingsConst.cs" ],
|
||||||
|
|
||||||
|
"AboutAccentButtonForegroundConv.cs": [ "AboutConv.cs" ],
|
||||||
|
"AboutVersionButtonContentConv.cs": [ "AboutConv.cs" ],
|
||||||
|
"MainAdminControlVisibilityConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainMihomoButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainMihomoButtonIsEnabledConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainMihomoButtonToolTipConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainNginxButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainNginxButtonIsEnabledConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainNginxButtonToolTipConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainNoClickButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainNoClickButtonToolTipConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainProxyColumnWidthConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainSettingsBoxHintConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainSettingsBoxTextConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainSettingsBoxToolTipConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainSettingsFunctionButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainSettingsModeButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainBrowserButtonIsEnabledConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainUpdateHostButtonContentConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainUpdateHostButtonIsEnabledConv.cs": [ "MainConv.cs" ],
|
||||||
|
"MainWinWidthConv.cs": [ "MainConv.cs" ],
|
||||||
|
"SettingsLangsButtonContentConv.cs": [ "SettingsConv.cs" ],
|
||||||
|
"SettingsThemesButtonContentConv.cs": [ "SettingsConv.cs" ],
|
||||||
|
"SettingsWeightsButtonContentConv.cs": [ "SettingsConv.cs" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
App.xaml
6
App.xaml
@ -2,7 +2,7 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
DispatcherUnhandledException="App_DispatcherUnhandledException">
|
Startup="App_OnStartup" DispatcherUnhandledException="App_DispatcherUnhandledException">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@ -11,7 +11,8 @@
|
|||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Style x:Key="CommonWindow" TargetType="{x:Type Window}">
|
<Style x:Key="CommonWindow" TargetType="{x:Type Window}">
|
||||||
<Setter Property="Background" Value="{DynamicResource MaterialDesignBackground}" />
|
<Setter Property="AutomationProperties.Name" Value="Sheas Cealer" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
|
||||||
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}" />
|
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
@ -20,6 +21,7 @@
|
|||||||
<Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="{x:Type Button}">
|
<Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="{x:Type Button}">
|
||||||
<Setter Property="Height" Value="Auto" />
|
<Setter Property="Height" Value="Auto" />
|
||||||
<Setter Property="Width" Value="Auto" />
|
<Setter Property="Width" Value="Auto" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
54
App.xaml.cs
54
App.xaml.cs
@ -1,12 +1,60 @@
|
|||||||
using System.Windows;
|
using MaterialDesignThemes.Wpf;
|
||||||
using System.Windows.Threading;
|
using Sheas_Cealer.Preses;
|
||||||
|
using Sheas_Cealer.Props;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
using Sheas_Cealer.Wins;
|
using Sheas_Cealer.Wins;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace Sheas_Cealer;
|
namespace Sheas_Cealer;
|
||||||
|
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
protected override void OnStartup(StartupEventArgs e) => new MainWin(e.Args).Show();
|
private void App_OnStartup(object sender, StartupEventArgs e)
|
||||||
|
{
|
||||||
|
#region Upgrade Settings
|
||||||
|
if (Settings.Default.IsUpgradeRequired)
|
||||||
|
{
|
||||||
|
Settings.Default.Upgrade();
|
||||||
|
Settings.Default.IsUpgradeRequired = false;
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
#endregion Upgrade Settings
|
||||||
|
|
||||||
|
#region Primary Color
|
||||||
|
PaletteHelper paletteHelper = new();
|
||||||
|
Theme newTheme = paletteHelper.GetTheme();
|
||||||
|
Color newPrimaryColor = Color.FromRgb(Settings.Default.PrimaryColor.R, Settings.Default.PrimaryColor.G, Settings.Default.PrimaryColor.B);
|
||||||
|
|
||||||
|
newTheme.SetPrimaryColor(newPrimaryColor);
|
||||||
|
paletteHelper.SetTheme(newTheme);
|
||||||
|
#endregion Primary Color
|
||||||
|
|
||||||
|
#region Background Color
|
||||||
|
if (Environment.OSVersion.Version.Build < 22000)
|
||||||
|
{
|
||||||
|
Style newWindowStyle = new(typeof(Window), Current.Resources["CommonWindow"] as Style);
|
||||||
|
|
||||||
|
newWindowStyle.Setters.Add(new Setter(Window.BackgroundProperty, new DynamicResourceExtension("MaterialDesignBackground")));
|
||||||
|
Current.Resources["CommonWindow"] = newWindowStyle;
|
||||||
|
}
|
||||||
|
#endregion Background Color
|
||||||
|
|
||||||
|
#region Foreground Color
|
||||||
|
Style newButtonStyle = new(typeof(Button), Current.Resources[typeof(Button)] as Style);
|
||||||
|
(Color? newForegroundColor, Color newAccentForegroundColor) = ForegroundGenerator.GetForeground(newPrimaryColor.R, newPrimaryColor.G, newPrimaryColor.B);
|
||||||
|
|
||||||
|
newButtonStyle.Setters.Add(new Setter(Button.ForegroundProperty, newForegroundColor.HasValue ? new SolidColorBrush(newForegroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
||||||
|
Current.Resources[typeof(Button)] = newButtonStyle;
|
||||||
|
|
||||||
|
new SettingsPres().AccentForegroundColor = newAccentForegroundColor;
|
||||||
|
#endregion Foreground Color
|
||||||
|
|
||||||
|
new MainWin().Show();
|
||||||
|
}
|
||||||
|
|
||||||
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Sheas_Cealer.Consts;
|
namespace Sheas_Cealer.Consts;
|
||||||
|
|
||||||
internal class AboutConst : AboutMultilangConst
|
internal abstract class AboutConst : AboutMultilangConst
|
||||||
{
|
{
|
||||||
|
public static Color AccentBlueColor => (Color)ColorConverter.ConvertFromString("#2196F3");
|
||||||
|
public static Color AccentRedColor => (Color)ColorConverter.ConvertFromString("#F44336");
|
||||||
|
|
||||||
public static string DeveloperButtonUrl => "https://www.spacetimee.xyz";
|
public static string DeveloperButtonUrl => "https://www.spacetimee.xyz";
|
||||||
public static string VersionButtonVersionContent => Assembly.GetExecutingAssembly().GetName().Version!.ToString().TrimEnd(".0".ToCharArray());
|
public static string VersionButtonVersionContent => Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2];
|
||||||
public static string VersionButtonUrl => "https://spacetime.lanzouu.com/b017hp0lc";
|
public static string VersionButtonUrl => "https://github.com/SpaceTimee/Sheas-Cealer/releases/latest";
|
||||||
internal static string ReleasePagePassword => "3wnj";
|
|
||||||
public static string EmailButtonUrl => "Zeus6_6@163.com";
|
public static string EmailButtonUrl => "Zeus6_6@163.com";
|
||||||
|
|
||||||
public static string DocumentationButtonUrl => "https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation";
|
public static string DocumentationButtonUrl => "https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation";
|
||||||
@ -15,4 +18,7 @@ internal class AboutConst : AboutMultilangConst
|
|||||||
|
|
||||||
public static string PolicyButtonUrl => "https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策";
|
public static string PolicyButtonUrl => "https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策";
|
||||||
public static string AgreementButtonUrl => "https://thoughts.teambition.com/share/6264edd78adeb10041b92fdb#title=Sheas_Cealer_使用协议";
|
public static string AgreementButtonUrl => "https://thoughts.teambition.com/share/6264edd78adeb10041b92fdb#title=Sheas_Cealer_使用协议";
|
||||||
|
|
||||||
|
internal static string ReleaseApiUrl => "https://api.github.com/repos/SpaceTimee/Sheas-Cealer/releases/latest";
|
||||||
|
internal static string ReleaseApiUserAgent => "Sheas-Cealer";
|
||||||
}
|
}
|
@ -1,41 +1,51 @@
|
|||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.Win32;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Consts;
|
namespace Sheas_Cealer.Consts;
|
||||||
|
|
||||||
internal partial class MainConst : MainMultilangConst
|
internal abstract partial class MainConst : MainMultilangConst
|
||||||
{
|
{
|
||||||
internal enum SettingsMode
|
internal enum SettingsMode
|
||||||
{ BrowserPathMode, UpstreamUrlMode, ExtraArgsMode };
|
{ BrowserPathMode, UpstreamUrlMode, ExtraArgsMode }
|
||||||
|
|
||||||
public static bool IsAdmin => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
|
public static bool IsAdmin => new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
|
||||||
|
|
||||||
internal static string CealingHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-*.json");
|
|
||||||
internal static string LocalHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-Local.json");
|
|
||||||
internal static string UpstreamHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-Upstream.json");
|
|
||||||
internal static string EdgeBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe";
|
internal static string EdgeBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe";
|
||||||
internal static string ChromeBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe";
|
internal static string ChromeBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe";
|
||||||
internal static string BraveBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe";
|
internal static string BraveBrowserRegistryPath => @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\brave.exe";
|
||||||
internal static string UncealedBrowserPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Uncealed-Browser.lnk");
|
|
||||||
internal static string UncealedBrowserDescription => "Created By Sheas Cealer";
|
internal static string DefaultUpstreamUrl => "https://gitlab.com/SpaceTimee/Cealing-Host/raw/main/Cealing-Host.json";
|
||||||
internal static string CommandName => "Cmd.exe";
|
internal static string CealHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-*.json");
|
||||||
|
internal static string LocalHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-L.json");
|
||||||
|
internal static string UpstreamHostPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Host-U.json");
|
||||||
|
|
||||||
internal static string HostsConfPath => Path.Combine(Registry.LocalMachine.OpenSubKey(@"\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath")?.GetValue("DataBasePath", null)?.ToString() ?? @"C:\Windows\System32\drivers\etc", "hosts");
|
internal static string HostsConfPath => Path.Combine(Registry.LocalMachine.OpenSubKey(@"\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath")?.GetValue("DataBasePath", null)?.ToString() ?? @"C:\Windows\System32\drivers\etc", "hosts");
|
||||||
internal static string HostsConfStartMarker => "# Cealing Nginx Start\n";
|
internal static string HostsConfStartMarker => $"# Cealing Nginx Start{Environment.NewLine}";
|
||||||
internal static string HostsConfEndMarker => "# Cealing Nginx End";
|
internal static string HostsConfEndMarker => "# Cealing Nginx End";
|
||||||
|
|
||||||
|
internal static string ConginxPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Conginx.exe");
|
||||||
internal static string NginxPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Nginx.exe");
|
internal static string NginxPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Nginx.exe");
|
||||||
internal static string NginxConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "nginx.conf");
|
internal static string NginxConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "nginx.conf");
|
||||||
internal static string NginxLogsPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "logs");
|
internal static string NginxLogsPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "logs");
|
||||||
|
internal static string NginxErrorLogsPath => Path.Combine(NginxLogsPath, "error.log");
|
||||||
internal static string NginxTempPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "temp");
|
internal static string NginxTempPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "temp");
|
||||||
internal static string NginxCertPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Cert.pem");
|
internal static string NginxCertPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Cert.pem");
|
||||||
|
internal static string NginxKeyPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Key.pem");
|
||||||
internal static string NginxRootCertSubjectName => "CN=Cealing Cert Root";
|
internal static string NginxRootCertSubjectName => "CN=Cealing Cert Root";
|
||||||
internal static string NginxChildCertSubjectName => "CN=Cealing Cert Child";
|
internal static string NginxChildCertSubjectName => "CN=Cealing Cert Child";
|
||||||
internal static string NginxKeyPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Key.pem");
|
|
||||||
|
internal static string ComihomoPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Comihomo.exe");
|
||||||
internal static string MihomoPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Mihomo.exe");
|
internal static string MihomoPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "Cealing-Mihomo.exe");
|
||||||
internal static string MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml");
|
internal static string MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml");
|
||||||
internal static string DefaultUpstreamUrl => "https://gitlab.com/SpaceTimee/Cealing-Host/raw/main/Cealing-Host.json";
|
internal static string[] MihomoNameServers => ["https://ns.net.kg/dns-query", "https://dnschina1.soraharu.com/dns-query", "https://0ms.dev/dns-query"];
|
||||||
|
|
||||||
|
internal static string NotifyIconText => "Sheas Cealer";
|
||||||
|
|
||||||
|
[GeneratedRegex("^Cealing-Host-")]
|
||||||
|
internal static partial Regex CealHostPrefixRegex();
|
||||||
|
|
||||||
[GeneratedRegex(@"^(https?:\/\/)?[a-zA-Z0-9](-*[a-zA-Z0-9])*(\.[a-zA-Z0-9](-*[a-zA-Z0-9])*)*(:\d{1,5})?(\/[a-zA-Z0-9.\-_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%]*)*$")]
|
[GeneratedRegex(@"^(https?:\/\/)?[a-zA-Z0-9](-*[a-zA-Z0-9])*(\.[a-zA-Z0-9](-*[a-zA-Z0-9])*)*(:\d{1,5})?(\/[a-zA-Z0-9.\-_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%]*)*$")]
|
||||||
internal static partial Regex UpstreamUrlRegex();
|
internal static partial Regex UpstreamUrlRegex();
|
||||||
|
244
Consts/MainMultilangConst.Designer.cs
generated
244
Consts/MainMultilangConst.Designer.cs
generated
@ -70,16 +70,16 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 The config cannot be recognized. Check if the config contain syntax errors 的本地化字符串。
|
/// 查找类似 Some cealing hosts contain syntax errors and cannot be recognized. Do you want to continue anyway? 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _ConfErrorMsg {
|
public static string _CealHostErrorPrompt {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("_ConfErrorMsg", resourceCulture);
|
return ResourceManager.GetString("_CealHostErrorPrompt", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 I know you would do it, but nothing will actually happen. Whee. 的本地化字符串。
|
/// 查找类似 I know you would click me, but nothing will actually happen. Whee~ 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameClickOnceMsg {
|
public static string _GameClickOnceMsg {
|
||||||
get {
|
get {
|
||||||
@ -88,7 +88,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Ugh, what are you doing. Please stop, I don't want to hurt anyone. Stop please, this is your last chance. Ugh, I can't control it anymore. 的本地化字符串。
|
/// 查找类似 Ugh, what are you doing. Please stop, I don't want to hurt anyone. Stop please, this is your last chance. Ugh, I can't control it anymore 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameClickThreeMsg {
|
public static string _GameClickThreeMsg {
|
||||||
get {
|
get {
|
||||||
@ -97,7 +97,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 No no no, don't click me. Sorry, I shouldn't have lied to you, I am a cursed button, and continuing to click me will bring disaster to the entire Sheas Cealer. Please believe me, this is not a game, and there are no new features here. Listen to me and use the normal functions, okay? 的本地化字符串。
|
/// 查找类似 No no no, don't click me. Sorry, I shouldn't have lied to you, I am a cursed button, and continuing to click me will bring disaster to the entire Sheas Cealer. Please believe me. This is not a game, and there are no new features here. Listen to me and use the normal functions. Please 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameClickTwiceMsg {
|
public static string _GameClickTwiceMsg {
|
||||||
get {
|
get {
|
||||||
@ -106,7 +106,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 You defeated the evil button and saved Sheas Cealer, you are hero 的本地化字符串。
|
/// 查找类似 You defeated the evil button and saved Sheas Cealer. You are the HERO! 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameEndingMsg {
|
public static string _GameEndingMsg {
|
||||||
get {
|
get {
|
||||||
@ -124,7 +124,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 It's dead, and you're the hero of Sheas Cealer 的本地化字符串。
|
/// 查找类似 It's dead. You're the HERO of Sheas Cealer 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameReviewEndingMsg {
|
public static string _GameReviewEndingMsg {
|
||||||
get {
|
get {
|
||||||
@ -133,7 +133,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 No, please kill me, I...can't control myself... 的本地化字符串。
|
/// 查找类似 No, please kill me. I... can't control it... 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _GameStartMsg {
|
public static string _GameStartMsg {
|
||||||
get {
|
get {
|
||||||
@ -141,15 +141,6 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 The args cannot be recognized. Check if the hosts contain syntax errors 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string _HostErrorMsg {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("_HostErrorMsg", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 All processes of the selected browser will be closed before launching. Do you want to continue? 的本地化字符串。
|
/// 查找类似 All processes of the selected browser will be closed before launching. Do you want to continue? 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -160,7 +151,34 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Warning: The proxy core is under attack and cannot forge SNI. The SNI removal mode has been turned on urgently. Do you want to continue? 的本地化字符串。
|
/// 查找类似 You are using hosts-based non-wildcard domain global cealing. Do you want to continue? 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _LaunchHostsNginxPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_LaunchHostsNginxPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Mihomo failed to launch 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _LaunchMihomoErrorMsg {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_LaunchMihomoErrorMsg", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Nginx failed to launch. Do you want to open the error log? 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _LaunchNginxErrorPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_LaunchNginxErrorPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Warning: The proxy core is under attack and failes to conceal SNI. The SNI removal mode has been turned on urgently. Do you want to continue? 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _LaunchNginxFlashingPrompt {
|
public static string _LaunchNginxFlashingPrompt {
|
||||||
get {
|
get {
|
||||||
@ -178,7 +196,34 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 There is an update available. Do you want to update upstream host? If No it will only open the upstream host page for you 的本地化字符串。
|
/// 查找类似 The mihomo conf contains syntax errors and cannot be recognized 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _MihomoConfErrorMsg {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_MihomoConfErrorMsg", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 The local port 80 is occupied. Do you want to use port {0} to continue? This may cause the http connection to fail to automatically jump to https 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _NginxHttpPortOccupiedPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_NginxHttpPortOccupiedPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 The local port 443 is occupied. Do you want to use port {0} to continue? This may cause the global cealing to not work properly 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _NginxHttpsPortOccupiedPrompt {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_NginxHttpsPortOccupiedPrompt", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 There is an update available. Do you want to update upstream host? If No it will only open the upstream host web page for you 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _OverrideUpstreamHostPrompt {
|
public static string _OverrideUpstreamHostPrompt {
|
||||||
get {
|
get {
|
||||||
@ -196,7 +241,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Upstream host has been updated to the latest 的本地化字符串。
|
/// 查找类似 Upstream host is already up to date 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string _UpstreamHostUtdMsg {
|
public static string _UpstreamHostUtdMsg {
|
||||||
get {
|
get {
|
||||||
@ -214,7 +259,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Click to open an about window 的本地化字符串。
|
/// 查找类似 Click to open the about window 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string AboutButtonToolTip {
|
public static string AboutButtonToolTip {
|
||||||
get {
|
get {
|
||||||
@ -223,11 +268,38 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Browser Path 的本地化字符串。
|
/// 查找类似 Start Cealing 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string BrowserPathSettingsModeName {
|
public static string BrowserButtonContent {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("BrowserPathSettingsModeName", resourceCulture);
|
return ResourceManager.GetString("BrowserButtonContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to launch the injected browser 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string BrowserButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("BrowserButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 GLB. Purging CHA. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ComihomoButtonIsInitingContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ComihomoButtonIsInitingContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 GLB. Cealing INIT. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ConginxButtonIsInitingContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ConginxButtonIsInitingContent", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,15 +393,6 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Extra Args 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string ExtraArgsSettingsModeName {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ExtraArgsSettingsModeName", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 GLB. Purging INIT. 的本地化字符串。
|
/// 查找类似 GLB. Purging INIT. 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -340,7 +403,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Stop Global Purging 的本地化字符串。
|
/// 查找类似 Stop GLB. Purging 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MihomoButtonIsRunningContent {
|
public static string MihomoButtonIsRunningContent {
|
||||||
get {
|
get {
|
||||||
@ -358,7 +421,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Start Global Purging 的本地化字符串。
|
/// 查找类似 Start GLB. Purging 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string MihomoButtonIsStoppedContent {
|
public static string MihomoButtonIsStoppedContent {
|
||||||
get {
|
get {
|
||||||
@ -375,6 +438,15 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 GLB. Purging STP. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string MihomoButtonIsStoppingContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MihomoButtonIsStoppingContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 GLB. Cealing INIT. 的本地化字符串。
|
/// 查找类似 GLB. Cealing INIT. 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -430,7 +502,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Click the button now 的本地化字符串。
|
/// 查找类似 Click this button now 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string NoClickButtonIsFlashingToolTip {
|
public static string NoClickButtonIsFlashingToolTip {
|
||||||
get {
|
get {
|
||||||
@ -448,7 +520,7 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Donot click the button 的本地化字符串。
|
/// 查找类似 Do not click this button 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string NoClickButtonIsStoppedToolTip {
|
public static string NoClickButtonIsStoppedToolTip {
|
||||||
get {
|
get {
|
||||||
@ -483,6 +555,24 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Appearance Settings 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string SettingsButtonContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsButtonContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to open the settings window 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string SettingsButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Browse Path 的本地化字符串。
|
/// 查找类似 Browse Path 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -519,6 +609,24 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Browser Path 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string SettingsModeButtonBrowserPathContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsModeButtonBrowserPathContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Extra Args 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string SettingsModeButtonExtraArgsContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsModeButtonExtraArgsContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Click to switch settings 的本地化字符串。
|
/// 查找类似 Click to switch settings 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -529,56 +637,11 @@ namespace Sheas_Cealer.Consts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Start Cealing 的本地化字符串。
|
/// 查找类似 Upstream URL 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string StartButtonContent {
|
public static string SettingsModeButtonUpstreamUrlContent {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("StartButtonContent", resourceCulture);
|
return ResourceManager.GetString("SettingsModeButtonUpstreamUrlContent", resourceCulture);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Click to launch an injected browser 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string StartButtonToolTip {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("StartButtonToolTip", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Auto Theme 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string ThemesButtonDarkThemeContent {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ThemesButtonDarkThemeContent", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Dark Theme 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string ThemesButtonInheritThemeContent {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ThemesButtonInheritThemeContent", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Light Theme 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string ThemesButtonLightThemeContent {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ThemesButtonLightThemeContent", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Click to switch themes 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string ThemesButtonToolTip {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ThemesButtonToolTip", resourceCulture);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,14 +662,5 @@ namespace Sheas_Cealer.Consts {
|
|||||||
return ResourceManager.GetString("UpdateUpstreamHostButtonToolTip", resourceCulture);
|
return ResourceManager.GetString("UpdateUpstreamHostButtonToolTip", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Upstream URL 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string UpstreamUrlSettingsModeName {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("UpstreamUrlSettingsModeName", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,10 +121,19 @@
|
|||||||
<value>About Me</value>
|
<value>About Me</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="AboutButtonToolTip" xml:space="preserve">
|
<data name="AboutButtonToolTip" xml:space="preserve">
|
||||||
<value>Click to open an about window</value>
|
<value>Click to open the about window</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BrowserPathSettingsModeName" xml:space="preserve">
|
<data name="BrowserButtonContent" xml:space="preserve">
|
||||||
<value>Browser Path</value>
|
<value>Start Cealing</value>
|
||||||
|
</data>
|
||||||
|
<data name="BrowserButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to launch the injected browser</value>
|
||||||
|
</data>
|
||||||
|
<data name="ComihomoButtonIsInitingContent" xml:space="preserve">
|
||||||
|
<value>GLB. Purging CHA.</value>
|
||||||
|
</data>
|
||||||
|
<data name="ConginxButtonIsInitingContent" xml:space="preserve">
|
||||||
|
<value>GLB. Cealing INIT.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EditHostsConfButtonContent" xml:space="preserve">
|
<data name="EditHostsConfButtonContent" xml:space="preserve">
|
||||||
<value>Edit Hosts Conf</value>
|
<value>Edit Hosts Conf</value>
|
||||||
@ -156,24 +165,24 @@
|
|||||||
<data name="EditUpstreamHostButtonToolTip" xml:space="preserve">
|
<data name="EditUpstreamHostButtonToolTip" xml:space="preserve">
|
||||||
<value>Click to edit upstream host</value>
|
<value>Click to edit upstream host</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExtraArgsSettingsModeName" xml:space="preserve">
|
|
||||||
<value>Extra Args</value>
|
|
||||||
</data>
|
|
||||||
<data name="MihomoButtonIsInitingContent" xml:space="preserve">
|
<data name="MihomoButtonIsInitingContent" xml:space="preserve">
|
||||||
<value>GLB. Purging INIT.</value>
|
<value>GLB. Purging INIT.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MihomoButtonIsRunningContent" xml:space="preserve">
|
<data name="MihomoButtonIsRunningContent" xml:space="preserve">
|
||||||
<value>Stop Global Purging</value>
|
<value>Stop GLB. Purging</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MihomoButtonIsRunningToolTip" xml:space="preserve">
|
<data name="MihomoButtonIsRunningToolTip" xml:space="preserve">
|
||||||
<value>Click to stop the local Mihomo</value>
|
<value>Click to stop the local Mihomo</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MihomoButtonIsStoppedContent" xml:space="preserve">
|
<data name="MihomoButtonIsStoppedContent" xml:space="preserve">
|
||||||
<value>Start Global Purging</value>
|
<value>Start GLB. Purging</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
||||||
<value>Click to launch a local Mihomo</value>
|
<value>Click to launch a local Mihomo</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MihomoButtonIsStoppingContent" xml:space="preserve">
|
||||||
|
<value>GLB. Purging STP.</value>
|
||||||
|
</data>
|
||||||
<data name="NginxButtonIsInitingContent" xml:space="preserve">
|
<data name="NginxButtonIsInitingContent" xml:space="preserve">
|
||||||
<value>GLB. Cealing INIT.</value>
|
<value>GLB. Cealing INIT.</value>
|
||||||
</data>
|
</data>
|
||||||
@ -193,13 +202,13 @@
|
|||||||
<value>Click Now</value>
|
<value>Click Now</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NoClickButtonIsFlashingToolTip" xml:space="preserve">
|
<data name="NoClickButtonIsFlashingToolTip" xml:space="preserve">
|
||||||
<value>Click the button now</value>
|
<value>Click this button now</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NoClickButtonIsStoppedContent" xml:space="preserve">
|
<data name="NoClickButtonIsStoppedContent" xml:space="preserve">
|
||||||
<value>No Clicking</value>
|
<value>No Clicking</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NoClickButtonIsStoppedToolTip" xml:space="preserve">
|
<data name="NoClickButtonIsStoppedToolTip" xml:space="preserve">
|
||||||
<value>Donot click the button</value>
|
<value>Do not click this button</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="SettingsBoxBrowserPathToolTip" xml:space="preserve">
|
<data name="SettingsBoxBrowserPathToolTip" xml:space="preserve">
|
||||||
<value>Fill in a Chromium-based browser path</value>
|
<value>Fill in a Chromium-based browser path</value>
|
||||||
@ -210,6 +219,12 @@
|
|||||||
<data name="SettingsBoxUpstreamUrlToolTip" xml:space="preserve">
|
<data name="SettingsBoxUpstreamUrlToolTip" xml:space="preserve">
|
||||||
<value>Fill in an upstream host URL</value>
|
<value>Fill in an upstream host URL</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsButtonContent" xml:space="preserve">
|
||||||
|
<value>Appearance Settings</value>
|
||||||
|
</data>
|
||||||
|
<data name="SettingsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to open the settings window</value>
|
||||||
|
</data>
|
||||||
<data name="SettingsFunctionButtonBrowserPathContent" xml:space="preserve">
|
<data name="SettingsFunctionButtonBrowserPathContent" xml:space="preserve">
|
||||||
<value>Browse Path</value>
|
<value>Browse Path</value>
|
||||||
</data>
|
</data>
|
||||||
@ -222,26 +237,17 @@
|
|||||||
<data name="SettingsFunctionButtonUpstreamUrlContent" xml:space="preserve">
|
<data name="SettingsFunctionButtonUpstreamUrlContent" xml:space="preserve">
|
||||||
<value>Reset URL</value>
|
<value>Reset URL</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsModeButtonBrowserPathContent" xml:space="preserve">
|
||||||
|
<value>Browser Path</value>
|
||||||
|
</data>
|
||||||
|
<data name="SettingsModeButtonExtraArgsContent" xml:space="preserve">
|
||||||
|
<value>Extra Args</value>
|
||||||
|
</data>
|
||||||
<data name="SettingsModeButtonToolTip" xml:space="preserve">
|
<data name="SettingsModeButtonToolTip" xml:space="preserve">
|
||||||
<value>Click to switch settings</value>
|
<value>Click to switch settings</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="StartButtonContent" xml:space="preserve">
|
<data name="SettingsModeButtonUpstreamUrlContent" xml:space="preserve">
|
||||||
<value>Start Cealing</value>
|
<value>Upstream URL</value>
|
||||||
</data>
|
|
||||||
<data name="StartButtonToolTip" xml:space="preserve">
|
|
||||||
<value>Click to launch an injected browser</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonDarkThemeContent" xml:space="preserve">
|
|
||||||
<value>Auto Theme</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonInheritThemeContent" xml:space="preserve">
|
|
||||||
<value>Dark Theme</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonLightThemeContent" xml:space="preserve">
|
|
||||||
<value>Light Theme</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonToolTip" xml:space="preserve">
|
|
||||||
<value>Click to switch themes</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateUpstreamHostButtonContent" xml:space="preserve">
|
<data name="UpdateUpstreamHostButtonContent" xml:space="preserve">
|
||||||
<value>Update Upstream Host</value>
|
<value>Update Upstream Host</value>
|
||||||
@ -249,55 +255,67 @@
|
|||||||
<data name="UpdateUpstreamHostButtonToolTip" xml:space="preserve">
|
<data name="UpdateUpstreamHostButtonToolTip" xml:space="preserve">
|
||||||
<value>Click to update upstream host</value>
|
<value>Click to update upstream host</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
|
||||||
<value>Upstream URL</value>
|
|
||||||
</data>
|
|
||||||
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||||
<value>Browser</value>
|
<value>Browser</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_ConfErrorMsg" xml:space="preserve">
|
<data name="_CealHostErrorPrompt" xml:space="preserve">
|
||||||
<value>The config cannot be recognized. Check if the config contain syntax errors</value>
|
<value>Some cealing hosts contain syntax errors and cannot be recognized. Do you want to continue anyway?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickOnceMsg" xml:space="preserve">
|
<data name="_GameClickOnceMsg" xml:space="preserve">
|
||||||
<value>I know you would do it, but nothing will actually happen. Whee.</value>
|
<value>I know you would click me, but nothing will actually happen. Whee~</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickThreeMsg" xml:space="preserve">
|
<data name="_GameClickThreeMsg" xml:space="preserve">
|
||||||
<value>Ugh, what are you doing. Please stop, I don't want to hurt anyone. Stop please, this is your last chance. Ugh, I can't control it anymore.</value>
|
<value>Ugh, what are you doing. Please stop, I don't want to hurt anyone. Stop please, this is your last chance. Ugh, I can't control it anymore</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickTwiceMsg" xml:space="preserve">
|
<data name="_GameClickTwiceMsg" xml:space="preserve">
|
||||||
<value>No no no, don't click me. Sorry, I shouldn't have lied to you, I am a cursed button, and continuing to click me will bring disaster to the entire Sheas Cealer. Please believe me, this is not a game, and there are no new features here. Listen to me and use the normal functions, okay?</value>
|
<value>No no no, don't click me. Sorry, I shouldn't have lied to you, I am a cursed button, and continuing to click me will bring disaster to the entire Sheas Cealer. Please believe me. This is not a game, and there are no new features here. Listen to me and use the normal functions. Please</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameEndingMsg" xml:space="preserve">
|
<data name="_GameEndingMsg" xml:space="preserve">
|
||||||
<value>You defeated the evil button and saved Sheas Cealer, you are hero</value>
|
<value>You defeated the evil button and saved Sheas Cealer. You are the HERO!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameGradeMsg" xml:space="preserve">
|
<data name="_GameGradeMsg" xml:space="preserve">
|
||||||
<value>Button Remaining HP.</value>
|
<value>Button Remaining HP.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameReviewEndingMsg" xml:space="preserve">
|
<data name="_GameReviewEndingMsg" xml:space="preserve">
|
||||||
<value>It's dead, and you're the hero of Sheas Cealer</value>
|
<value>It's dead. You're the HERO of Sheas Cealer</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameStartMsg" xml:space="preserve">
|
<data name="_GameStartMsg" xml:space="preserve">
|
||||||
<value>No, please kill me, I...can't control myself...</value>
|
<value>No, please kill me. I... can't control it...</value>
|
||||||
</data>
|
|
||||||
<data name="_HostErrorMsg" xml:space="preserve">
|
|
||||||
<value>The args cannot be recognized. Check if the hosts contain syntax errors</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
|
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
|
||||||
<value>All processes of the selected browser will be closed before launching. Do you want to continue?</value>
|
<value>All processes of the selected browser will be closed before launching. Do you want to continue?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_LaunchHostsNginxPrompt" xml:space="preserve">
|
||||||
|
<value>You are using hosts-based non-wildcard domain global cealing. Do you want to continue?</value>
|
||||||
|
</data>
|
||||||
|
<data name="_LaunchMihomoErrorMsg" xml:space="preserve">
|
||||||
|
<value>Mihomo failed to launch</value>
|
||||||
|
</data>
|
||||||
|
<data name="_LaunchNginxErrorPrompt" xml:space="preserve">
|
||||||
|
<value>Nginx failed to launch. Do you want to open the error log?</value>
|
||||||
|
</data>
|
||||||
<data name="_LaunchNginxFlashingPrompt" xml:space="preserve">
|
<data name="_LaunchNginxFlashingPrompt" xml:space="preserve">
|
||||||
<value>Warning: The proxy core is under attack and cannot forge SNI. The SNI removal mode has been turned on urgently. Do you want to continue?</value>
|
<value>Warning: The proxy core is under attack and failes to conceal SNI. The SNI removal mode has been turned on urgently. Do you want to continue?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_LaunchProxyPrompt" xml:space="preserve">
|
<data name="_LaunchProxyPrompt" xml:space="preserve">
|
||||||
<value>Please remember to come back and stop the proxy manually after use. Do you want to continue?</value>
|
<value>Please remember to come back and stop the proxy manually after use. Do you want to continue?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_MihomoConfErrorMsg" xml:space="preserve">
|
||||||
|
<value>The mihomo conf contains syntax errors and cannot be recognized</value>
|
||||||
|
</data>
|
||||||
|
<data name="_NginxHttpPortOccupiedPrompt" xml:space="preserve">
|
||||||
|
<value>The local port 80 is occupied. Do you want to use port {0} to continue? This may cause the http connection to fail to automatically jump to https</value>
|
||||||
|
</data>
|
||||||
|
<data name="_NginxHttpsPortOccupiedPrompt" xml:space="preserve">
|
||||||
|
<value>The local port 443 is occupied. Do you want to use port {0} to continue? This may cause the global cealing to not work properly</value>
|
||||||
|
</data>
|
||||||
<data name="_OverrideUpstreamHostPrompt" xml:space="preserve">
|
<data name="_OverrideUpstreamHostPrompt" xml:space="preserve">
|
||||||
<value>There is an update available. Do you want to update upstream host? If No it will only open the upstream host page for you</value>
|
<value>There is an update available. Do you want to update upstream host? If No it will only open the upstream host web page for you</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_UpdateUpstreamHostSuccessMsg" xml:space="preserve">
|
<data name="_UpdateUpstreamHostSuccessMsg" xml:space="preserve">
|
||||||
<value>Update successfully</value>
|
<value>Update successfully</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_UpstreamHostUtdMsg" xml:space="preserve">
|
<data name="_UpstreamHostUtdMsg" xml:space="preserve">
|
||||||
<value>Upstream host has been updated to the latest</value>
|
<value>Upstream host is already up to date</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
@ -123,8 +123,17 @@
|
|||||||
<data name="AboutButtonToolTip" xml:space="preserve">
|
<data name="AboutButtonToolTip" xml:space="preserve">
|
||||||
<value>点击打开关于窗口</value>
|
<value>点击打开关于窗口</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="BrowserPathSettingsModeName" xml:space="preserve">
|
<data name="BrowserButtonContent" xml:space="preserve">
|
||||||
<value>文件路径</value>
|
<value>启动伪造</value>
|
||||||
|
</data>
|
||||||
|
<data name="BrowserButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击启动参数注入完成的浏览器</value>
|
||||||
|
</data>
|
||||||
|
<data name="ComihomoButtonIsInitingContent" xml:space="preserve">
|
||||||
|
<value>全局净化调整中</value>
|
||||||
|
</data>
|
||||||
|
<data name="ConginxButtonIsInitingContent" xml:space="preserve">
|
||||||
|
<value>全局伪造启动中</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EditHostsConfButtonContent" xml:space="preserve">
|
<data name="EditHostsConfButtonContent" xml:space="preserve">
|
||||||
<value>编辑 Hosts 配置</value>
|
<value>编辑 Hosts 配置</value>
|
||||||
@ -156,9 +165,6 @@
|
|||||||
<data name="EditUpstreamHostButtonToolTip" xml:space="preserve">
|
<data name="EditUpstreamHostButtonToolTip" xml:space="preserve">
|
||||||
<value>点击编辑上游规则</value>
|
<value>点击编辑上游规则</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExtraArgsSettingsModeName" xml:space="preserve">
|
|
||||||
<value>额外参数</value>
|
|
||||||
</data>
|
|
||||||
<data name="MihomoButtonIsInitingContent" xml:space="preserve">
|
<data name="MihomoButtonIsInitingContent" xml:space="preserve">
|
||||||
<value>全局净化启动中</value>
|
<value>全局净化启动中</value>
|
||||||
</data>
|
</data>
|
||||||
@ -174,6 +180,9 @@
|
|||||||
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
<data name="MihomoButtonIsStoppedToolTip" xml:space="preserve">
|
||||||
<value>点击启动本地 Mihomo</value>
|
<value>点击启动本地 Mihomo</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MihomoButtonIsStoppingContent" xml:space="preserve">
|
||||||
|
<value>全局净化停止中</value>
|
||||||
|
</data>
|
||||||
<data name="NginxButtonIsInitingContent" xml:space="preserve">
|
<data name="NginxButtonIsInitingContent" xml:space="preserve">
|
||||||
<value>全局伪造启动中</value>
|
<value>全局伪造启动中</value>
|
||||||
</data>
|
</data>
|
||||||
@ -210,6 +219,12 @@
|
|||||||
<data name="SettingsBoxUpstreamUrlToolTip" xml:space="preserve">
|
<data name="SettingsBoxUpstreamUrlToolTip" xml:space="preserve">
|
||||||
<value>填入任意上游规则链接</value>
|
<value>填入任意上游规则链接</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsButtonContent" xml:space="preserve">
|
||||||
|
<value>界面设置</value>
|
||||||
|
</data>
|
||||||
|
<data name="SettingsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击打开设置窗口</value>
|
||||||
|
</data>
|
||||||
<data name="SettingsFunctionButtonBrowserPathContent" xml:space="preserve">
|
<data name="SettingsFunctionButtonBrowserPathContent" xml:space="preserve">
|
||||||
<value>浏览路径</value>
|
<value>浏览路径</value>
|
||||||
</data>
|
</data>
|
||||||
@ -222,26 +237,17 @@
|
|||||||
<data name="SettingsFunctionButtonUpstreamUrlContent" xml:space="preserve">
|
<data name="SettingsFunctionButtonUpstreamUrlContent" xml:space="preserve">
|
||||||
<value>重置链接</value>
|
<value>重置链接</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsModeButtonBrowserPathContent" xml:space="preserve">
|
||||||
|
<value>文件路径</value>
|
||||||
|
</data>
|
||||||
|
<data name="SettingsModeButtonExtraArgsContent" xml:space="preserve">
|
||||||
|
<value>额外参数</value>
|
||||||
|
</data>
|
||||||
<data name="SettingsModeButtonToolTip" xml:space="preserve">
|
<data name="SettingsModeButtonToolTip" xml:space="preserve">
|
||||||
<value>点击切换设置模式</value>
|
<value>点击切换设置模式</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="StartButtonContent" xml:space="preserve">
|
<data name="SettingsModeButtonUpstreamUrlContent" xml:space="preserve">
|
||||||
<value>启动伪造</value>
|
<value>上游链接</value>
|
||||||
</data>
|
|
||||||
<data name="StartButtonToolTip" xml:space="preserve">
|
|
||||||
<value>点击启动参数注入完成的浏览器</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonDarkThemeContent" xml:space="preserve">
|
|
||||||
<value>跟随系统</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonInheritThemeContent" xml:space="preserve">
|
|
||||||
<value>暗色模式</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonLightThemeContent" xml:space="preserve">
|
|
||||||
<value>亮色模式</value>
|
|
||||||
</data>
|
|
||||||
<data name="ThemesButtonToolTip" xml:space="preserve">
|
|
||||||
<value>点击切换显示主题</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="UpdateUpstreamHostButtonContent" xml:space="preserve">
|
<data name="UpdateUpstreamHostButtonContent" xml:space="preserve">
|
||||||
<value>更新上游规则</value>
|
<value>更新上游规则</value>
|
||||||
@ -249,26 +255,23 @@
|
|||||||
<data name="UpdateUpstreamHostButtonToolTip" xml:space="preserve">
|
<data name="UpdateUpstreamHostButtonToolTip" xml:space="preserve">
|
||||||
<value>点击更新上游规则</value>
|
<value>点击更新上游规则</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UpstreamUrlSettingsModeName" xml:space="preserve">
|
|
||||||
<value>上游链接</value>
|
|
||||||
</data>
|
|
||||||
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
<data name="_BrowserPathDialogFilterFileType" xml:space="preserve">
|
||||||
<value>浏览器</value>
|
<value>浏览器</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_ConfErrorMsg" xml:space="preserve">
|
<data name="_CealHostErrorPrompt" xml:space="preserve">
|
||||||
<value>配置无法识别,请检查配置文件中是否含有语法错误</value>
|
<value>伪造规则含有语法错误,部分规则无法识别,是否仍然继续?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickOnceMsg" xml:space="preserve">
|
<data name="_GameClickOnceMsg" xml:space="preserve">
|
||||||
<value>就知道你会点,但其实什么事情都不会发生的。嘻嘻</value>
|
<value>就知道你会点,但其实什么事情都不会发生的。嘻嘻~</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickThreeMsg" xml:space="preserve">
|
<data name="_GameClickThreeMsg" xml:space="preserve">
|
||||||
<value>呜,你在做什么。求求你不要再继续点了,我不想伤害大家。快停下,这是最后一次机会。呃,我快要控制不住了</value>
|
<value>呜,你在做什么。求求你不要再继续点了,我不想伤害大家。快停下,这是最后一次机会。呃,我快要控制不住了</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameClickTwiceMsg" xml:space="preserve">
|
<data name="_GameClickTwiceMsg" xml:space="preserve">
|
||||||
<value>不不不,不要点我。对不起,我不该骗你的,我是一个受诅咒的按钮,继续点我会给整个 Sheas Cealer 带来灾难的。请相信我,这不是游戏,这里也没有新功能。听我的,去用正常的功能好吗</value>
|
<value>不不不,不要点我。对不起,我不该骗你的,我是一个受诅咒的按钮,继续点我会给整个 Sheas Cealer 带来灾难的。请相信我,这不是游戏,这里也没有新功能。听我的,去用正常的功能好吗,求求你了</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameEndingMsg" xml:space="preserve">
|
<data name="_GameEndingMsg" xml:space="preserve">
|
||||||
<value>你击败了邪恶的按钮,拯救了 Sheas Cealer,你是英雄</value>
|
<value>你击败了邪恶的按钮,拯救了 Sheas Cealer,你是英雄!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameGradeMsg" xml:space="preserve">
|
<data name="_GameGradeMsg" xml:space="preserve">
|
||||||
<value>按钮剩余血量:</value>
|
<value>按钮剩余血量:</value>
|
||||||
@ -277,20 +280,35 @@
|
|||||||
<value>它死了,你是 Sheas Cealer 的英雄</value>
|
<value>它死了,你是 Sheas Cealer 的英雄</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_GameStartMsg" xml:space="preserve">
|
<data name="_GameStartMsg" xml:space="preserve">
|
||||||
<value>不,求你杀了我,我...控制不住了...</value>
|
<value>不,求你杀了我,我... 控制不住了...</value>
|
||||||
</data>
|
|
||||||
<data name="_HostErrorMsg" xml:space="preserve">
|
|
||||||
<value>规则无法识别,请检查伪造规则中是否含有语法错误</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
|
<data name="_KillBrowserProcessPrompt" xml:space="preserve">
|
||||||
<value>启动前将关闭所选浏览器的所有进程,是否继续?</value>
|
<value>启动前将关闭所选浏览器的所有进程,是否继续?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_LaunchHostsNginxPrompt" xml:space="preserve">
|
||||||
|
<value>正在使用基于 Hosts 的非泛域名全局伪造,是否继续?</value>
|
||||||
|
</data>
|
||||||
|
<data name="_LaunchMihomoErrorMsg" xml:space="preserve">
|
||||||
|
<value>Mihomo 启动失败</value>
|
||||||
|
</data>
|
||||||
|
<data name="_LaunchNginxErrorPrompt" xml:space="preserve">
|
||||||
|
<value>Nginx 启动失败,是否打开错误日志?</value>
|
||||||
|
</data>
|
||||||
<data name="_LaunchNginxFlashingPrompt" xml:space="preserve">
|
<data name="_LaunchNginxFlashingPrompt" xml:space="preserve">
|
||||||
<value>Warning: 代理核心正在遭受攻击,无法伪造 SNI,已紧急开启 SNI 拔除模式,是否继续?</value>
|
<value>Warning: 代理核心正在遭受攻击,无法伪造 SNI,已紧急开启 SNI 拔除模式,是否继续?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_LaunchProxyPrompt" xml:space="preserve">
|
<data name="_LaunchProxyPrompt" xml:space="preserve">
|
||||||
<value>使用完请务必记得回来手动关闭代理,是否继续?</value>
|
<value>使用完请务必记得回来手动关闭代理,是否继续?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="_MihomoConfErrorMsg" xml:space="preserve">
|
||||||
|
<value>Mihomo 配置文件含有语法错误,部分配置无法识别</value>
|
||||||
|
</data>
|
||||||
|
<data name="_NginxHttpPortOccupiedPrompt" xml:space="preserve">
|
||||||
|
<value>本地 80 端口被占用,是否换用 {0} 端口继续? 这可能导致 http 连接无法自动跳转到 https</value>
|
||||||
|
</data>
|
||||||
|
<data name="_NginxHttpsPortOccupiedPrompt" xml:space="preserve">
|
||||||
|
<value>本地 443 端口被占用,是否换用 {0} 端口继续? 这可能导致全局伪造无法正常工作</value>
|
||||||
|
</data>
|
||||||
<data name="_OverrideUpstreamHostPrompt" xml:space="preserve">
|
<data name="_OverrideUpstreamHostPrompt" xml:space="preserve">
|
||||||
<value>上游规则有更新可用,需要更新吗?否则只为你打开上游规则网页</value>
|
<value>上游规则有更新可用,需要更新吗?否则只为你打开上游规则网页</value>
|
||||||
</data>
|
</data>
|
||||||
|
3
Consts/SettingsConst.cs
Normal file
3
Consts/SettingsConst.cs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
namespace Sheas_Cealer.Consts;
|
||||||
|
|
||||||
|
internal abstract class SettingsConst : SettingsMultilangConst;
|
198
Consts/SettingsMultilangConst.Designer.cs
generated
Normal file
198
Consts/SettingsMultilangConst.Designer.cs
generated
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
// 运行时版本:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||||
|
// 重新生成代码,这些更改将会丢失。
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Consts {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
||||||
|
/// </summary>
|
||||||
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
|
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
public class SettingsMultilangConst {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal SettingsMultilangConst() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回此类使用的缓存的 ResourceManager 实例。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
public static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sheas_Cealer.Consts.SettingsMultilangConst", typeof(SettingsMultilangConst).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||||
|
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
public static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Switch successfuly, restart to refresh the windows 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string _ChangeLangSuccessMsg {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_ChangeLangSuccessMsg", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Color (Fully Random) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ColorsButtonContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ColorsButtonContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to switch colors 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ColorsButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ColorsButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Switch Lang (中文 → En) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LangsButtonChineseLangContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LangsButtonChineseLangContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Switch Lang (En → Auto) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LangsButtonEnglishLangContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LangsButtonEnglishLangContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Switch Lang (Auto → 中文) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LangsButtonInheritLangContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LangsButtonInheritLangContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to switch langs 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LangsButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LangsButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Theme (Dark → Light) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ThemesButtonDarkThemeContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ThemesButtonDarkThemeContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Theme (Auto → Dark) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ThemesButtonInheritThemeContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ThemesButtonInheritThemeContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Theme (Light → Auto) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ThemesButtonLightThemeContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ThemesButtonLightThemeContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to switch themes 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ThemesButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ThemesButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Weight (Bold → Light) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string WeightsButtonBoldWeightContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("WeightsButtonBoldWeightContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Weight (Light → Regular) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string WeightsButtonLightWeightContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("WeightsButtonLightWeightContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 SWT. Weight (RGL. → Bold) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string WeightsButtonRegularWeightContent {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("WeightsButtonRegularWeightContent", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Click to switch font weights 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string WeightsButtonToolTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("WeightsButtonToolTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
145
Consts/SettingsMultilangConst.resx
Normal file
145
Consts/SettingsMultilangConst.resx
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 1.3
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">1.3</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1">this is my long string</data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
[base64 mime encoded serialized .NET Framework object]
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>1.3</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="ColorsButtonContent" xml:space="preserve">
|
||||||
|
<value>SWT. Color (Fully Random)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ColorsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to switch colors</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonChineseLangContent" xml:space="preserve">
|
||||||
|
<value>Switch Lang (中文 → En)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonEnglishLangContent" xml:space="preserve">
|
||||||
|
<value>Switch Lang (En → Auto)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonInheritLangContent" xml:space="preserve">
|
||||||
|
<value>Switch Lang (Auto → 中文)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to switch langs</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonDarkThemeContent" xml:space="preserve">
|
||||||
|
<value>SWT. Theme (Dark → Light)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonInheritThemeContent" xml:space="preserve">
|
||||||
|
<value>SWT. Theme (Auto → Dark)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonLightThemeContent" xml:space="preserve">
|
||||||
|
<value>SWT. Theme (Light → Auto)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to switch themes</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonBoldWeightContent" xml:space="preserve">
|
||||||
|
<value>SWT. Weight (Bold → Light)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonLightWeightContent" xml:space="preserve">
|
||||||
|
<value>SWT. Weight (Light → Regular)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonRegularWeightContent" xml:space="preserve">
|
||||||
|
<value>SWT. Weight (RGL. → Bold)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>Click to switch font weights</value>
|
||||||
|
</data>
|
||||||
|
<data name="_ChangeLangSuccessMsg" xml:space="preserve">
|
||||||
|
<value>Switch successfuly, restart to refresh the windows</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
145
Consts/SettingsMultilangConst.zh.resx
Normal file
145
Consts/SettingsMultilangConst.zh.resx
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 1.3
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">1.3</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1">this is my long string</data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
[base64 mime encoded serialized .NET Framework object]
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>1.3</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="ColorsButtonContent" xml:space="preserve">
|
||||||
|
<value>切换颜色 (全随机)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ColorsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击切换按钮颜色</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonChineseLangContent" xml:space="preserve">
|
||||||
|
<value>切换语言 (中文 → En)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonEnglishLangContent" xml:space="preserve">
|
||||||
|
<value>切换语言 (En → 系统)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonInheritLangContent" xml:space="preserve">
|
||||||
|
<value>切换语言 (系统 → 中文)</value>
|
||||||
|
</data>
|
||||||
|
<data name="LangsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击切换界面语言</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonDarkThemeContent" xml:space="preserve">
|
||||||
|
<value>切换主题 (暗色 → 亮色)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonInheritThemeContent" xml:space="preserve">
|
||||||
|
<value>切换主题 (系统 → 暗色)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonLightThemeContent" xml:space="preserve">
|
||||||
|
<value>切换主题 (亮色 → 系统)</value>
|
||||||
|
</data>
|
||||||
|
<data name="ThemesButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击切换显示主题</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonBoldWeightContent" xml:space="preserve">
|
||||||
|
<value>切换字重 (粗体 → 细体)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonLightWeightContent" xml:space="preserve">
|
||||||
|
<value>切换字重 (细体 → 标准)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonRegularWeightContent" xml:space="preserve">
|
||||||
|
<value>切换字重 (标准 → 粗体)</value>
|
||||||
|
</data>
|
||||||
|
<data name="WeightsButtonToolTip" xml:space="preserve">
|
||||||
|
<value>点击切换字体粗细</value>
|
||||||
|
</data>
|
||||||
|
<data name="_ChangeLangSuccessMsg" xml:space="preserve">
|
||||||
|
<value>语言更改完成,重启以刷新界面</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
@ -1,19 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
internal class MainThemesButtonContentConv : IValueConverter
|
internal class AboutAccentButtonForegroundConv : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
bool? isLightMode = value as bool?;
|
Color accentForegroundColor = (Color)value;
|
||||||
|
|
||||||
return isLightMode.HasValue ?
|
return new SolidColorBrush(accentForegroundColor);
|
||||||
isLightMode.GetValueOrDefault() ? MainConst.ThemesButtonLightThemeContent : MainConst.ThemesButtonDarkThemeContent :
|
|
||||||
MainConst.ThemesButtonInheritThemeContent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
7
Convs/AboutConv.cs
Normal file
7
Convs/AboutConv.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal static class AboutConv
|
||||||
|
{
|
||||||
|
public static AboutAccentButtonForegroundConv AboutAccentButtonForegroundConv => new();
|
||||||
|
public static AboutVersionButtonContentConv AboutVersionButtonContentConv => new();
|
||||||
|
}
|
@ -8,10 +8,11 @@ internal class AboutVersionButtonContentConv : IMultiValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? versionButtonLabelContent = values[0] as string;
|
string versionButtonLabelContent = (string)values[0];
|
||||||
string? versionButtonVersionContent = values[1] as string;
|
string versionButtonVersionContent = (string)values[1];
|
||||||
|
bool isSheasCealerUtd = (bool)values[2];
|
||||||
|
|
||||||
return $"{versionButtonLabelContent} {versionButtonVersionContent}";
|
return $"{versionButtonLabelContent} {versionButtonVersionContent}" + (isSheasCealerUtd ? string.Empty : " *");
|
||||||
}
|
}
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
internal class MainStartButtonIsEnabledConv : IMultiValueConverter
|
internal class MainBrowserButtonIsEnabledConv : IMultiValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? browserPath = values[0] as string;
|
string browserPath = (string)values[0];
|
||||||
string? extraArgs = values[1] as string;
|
string extraArgs = (string)values[1];
|
||||||
|
|
||||||
return File.Exists(browserPath) && Path.GetFileName(browserPath).ToLowerInvariant().EndsWith(".exe") && MainConst.ExtraArgsRegex().IsMatch(extraArgs!);
|
return File.Exists(browserPath) && Path.GetFileName(browserPath).ToLowerInvariant().EndsWith(".exe") && MainConst.ExtraArgsRegex().IsMatch(extraArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
24
Convs/MainConv.cs
Normal file
24
Convs/MainConv.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal static class MainConv
|
||||||
|
{
|
||||||
|
public static MainAdminControlVisibilityConv MainAdminControlVisibilityConv => new();
|
||||||
|
public static MainMihomoButtonContentConv MainMihomoButtonContentConv => new();
|
||||||
|
public static MainMihomoButtonIsEnabledConv MainMihomoButtonIsEnabledConv => new();
|
||||||
|
public static MainMihomoButtonToolTipConv MainMihomoButtonToolTipConv => new();
|
||||||
|
public static MainNginxButtonContentConv MainNginxButtonContentConv => new();
|
||||||
|
public static MainNginxButtonToolTipConv MainNginxButtonToolTipConv => new();
|
||||||
|
public static MainNoClickButtonContentConv MainNoClickButtonContentConv => new();
|
||||||
|
public static MainNoClickButtonToolTipConv MainNoClickButtonToolTipConv => new();
|
||||||
|
public static MainNginxButtonIsEnabledConv MainNginxButtonIsEnabledConv => new();
|
||||||
|
public static MainProxyColumnWidthConv MainProxyColumnWidthConv => new();
|
||||||
|
public static MainSettingsBoxHintConv MainSettingsBoxHintConv => new();
|
||||||
|
public static MainSettingsBoxTextConv MainSettingsBoxTextConv => new();
|
||||||
|
public static MainSettingsBoxToolTipConv MainSettingsBoxToolTipConv => new();
|
||||||
|
public static MainSettingsFunctionButtonContentConv MainSettingsFunctionButtonContentConv => new();
|
||||||
|
public static MainSettingsModeButtonContentConv MainSettingsModeButtonContentConv => new();
|
||||||
|
public static MainBrowserButtonIsEnabledConv MainBrowserButtonIsEnabledConv => new();
|
||||||
|
public static MainUpdateHostButtonContentConv MainUpdateHostButtonContentConv => new();
|
||||||
|
public static MainUpdateHostButtonIsEnabledConv MainUpdateHostButtonIsEnabledConv => new();
|
||||||
|
public static MainWinWidthConv MainWinWidthConv => new();
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -10,9 +10,14 @@ internal class MainMihomoButtonContentConv : IMultiValueConverter
|
|||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
bool isMihomoRunning = (bool)values[0];
|
bool isMihomoRunning = (bool)values[0];
|
||||||
bool isMihomoIniting = (bool)values[1];
|
bool isComihomoIniting = (bool)values[1];
|
||||||
|
bool isMihomoIniting = (bool)values[2];
|
||||||
|
bool isCoproxyIniting = (bool)values[3];
|
||||||
|
bool isCoproxyStopping = (bool)values[4];
|
||||||
|
|
||||||
return isMihomoIniting ? MainConst.MihomoButtonIsInitingContent :
|
return isCoproxyIniting || isCoproxyStopping ? Binding.DoNothing :
|
||||||
|
isComihomoIniting ? MainConst.MihomoButtonIsStoppingContent :
|
||||||
|
isMihomoIniting ? MainConst.MihomoButtonIsInitingContent :
|
||||||
isMihomoRunning ? MainConst.MihomoButtonIsRunningContent : MainConst.MihomoButtonIsStoppedContent;
|
isMihomoRunning ? MainConst.MihomoButtonIsRunningContent : MainConst.MihomoButtonIsStoppedContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
21
Convs/MainMihomoButtonIsEnabledConv.cs
Normal file
21
Convs/MainMihomoButtonIsEnabledConv.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class MainMihomoButtonIsEnabledConv : IMultiValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool isCoMihomoExist = (bool)values[0];
|
||||||
|
bool isMihomoExist = (bool)values[1];
|
||||||
|
bool isCoproxyIniting = (bool)values[2];
|
||||||
|
bool isComihomoIniting = (bool)values[3];
|
||||||
|
bool isMihomoIniting = (bool)values[4];
|
||||||
|
|
||||||
|
return !isCoproxyIniting && !isComihomoIniting && !isMihomoIniting && (isCoMihomoExist || isMihomoExist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -9,11 +9,14 @@ internal class MainNginxButtonContentConv : IMultiValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
bool isNginxRunning = (bool)values[0];
|
bool isConginxRunning = (bool)values[0];
|
||||||
bool isNginxIniting = (bool)values[1];
|
bool isNginxRunning = (bool)values[1];
|
||||||
|
bool isCoproxyIniting = (bool)values[2];
|
||||||
|
bool isNginxIniting = (bool)values[3];
|
||||||
|
|
||||||
return isNginxIniting ? MainConst.NginxButtonIsInitingContent :
|
return isCoproxyIniting ? MainConst.ConginxButtonIsInitingContent :
|
||||||
isNginxRunning ? MainConst.NginxButtonIsRunningContent : MainConst.NginxButtonIsStoppedContent;
|
isNginxIniting ? MainConst.NginxButtonIsInitingContent :
|
||||||
|
isConginxRunning || isNginxRunning ? MainConst.NginxButtonIsRunningContent : MainConst.NginxButtonIsStoppedContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
22
Convs/MainNginxButtonIsEnabledConv.cs
Normal file
22
Convs/MainNginxButtonIsEnabledConv.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class MainNginxButtonIsEnabledConv : IMultiValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool isConginxExist = (bool)values[0];
|
||||||
|
bool isNginxExist = (bool)values[1];
|
||||||
|
bool isCoproxyIniting = (bool)values[2];
|
||||||
|
bool isNginxIniting = (bool)values[3];
|
||||||
|
bool isComihomoIniting = (bool)values[4];
|
||||||
|
bool isMihomoIniting = (bool)values[5];
|
||||||
|
|
||||||
|
return !isCoproxyIniting && !isNginxIniting && !isComihomoIniting && !isMihomoIniting && (isConginxExist || isNginxExist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
@ -1,18 +1,19 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
internal class MainNginxButtonToolTipConv : IValueConverter
|
internal class MainNginxButtonToolTipConv : IMultiValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
bool isNginxRunning = (bool)value;
|
bool isConginxRunning = (bool)values[0];
|
||||||
|
bool isNginxRunning = (bool)values[1];
|
||||||
|
|
||||||
return isNginxRunning ? MainConst.NginxButtonIsRunningToolTip : MainConst.NginxButtonIsStoppedToolTip;
|
return isConginxRunning || isNginxRunning ? MainConst.NginxButtonIsRunningToolTip : MainConst.NginxButtonIsStoppedToolTip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
|
||||||
|
|
||||||
internal class MainProxyButtonIsEnabledConv : IMultiValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
bool isProxyExist = (bool)values[0];
|
|
||||||
bool isProxyIniting = (bool)values[1];
|
|
||||||
|
|
||||||
return !isProxyIniting && isProxyExist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
|
||||||
}
|
|
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -10,13 +10,13 @@ internal class MainSettingsBoxHintConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode.BrowserPathMode => MainConst.BrowserPathSettingsModeName,
|
MainConst.SettingsMode.BrowserPathMode => MainConst.SettingsModeButtonBrowserPathContent,
|
||||||
MainConst.SettingsMode.UpstreamUrlMode => MainConst.UpstreamUrlSettingsModeName,
|
MainConst.SettingsMode.UpstreamUrlMode => MainConst.SettingsModeButtonUpstreamUrlContent,
|
||||||
MainConst.SettingsMode.ExtraArgsMode => MainConst.ExtraArgsSettingsModeName,
|
MainConst.SettingsMode.ExtraArgsMode => MainConst.SettingsModeButtonExtraArgsContent,
|
||||||
_ => throw new UnreachableException()
|
_ => throw new UnreachableException()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
internal class MainSettingsBoxTextConv : IMultiValueConverter
|
internal class MainSettingsBoxTextConv : IMultiValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = values[0] as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)values[0];
|
||||||
string? browserPath = values[1] as string;
|
string browserPath = (string)values[1];
|
||||||
string? upstreamUrl = values[2] as string;
|
string upstreamUrl = (string)values[2];
|
||||||
string? extraArgs = values[3] as string;
|
string extraArgs = (string)values[3];
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode.BrowserPathMode => browserPath!,
|
MainConst.SettingsMode.BrowserPathMode => browserPath,
|
||||||
MainConst.SettingsMode.UpstreamUrlMode => upstreamUrl!,
|
MainConst.SettingsMode.UpstreamUrlMode => upstreamUrl,
|
||||||
MainConst.SettingsMode.ExtraArgsMode => extraArgs!,
|
MainConst.SettingsMode.ExtraArgsMode => extraArgs,
|
||||||
_ => throw new UnreachableException(),
|
_ => throw new UnreachableException()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
}
|
}
|
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ internal class MainSettingsBoxToolTipConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ internal class MainSettingsFunctionButtonContentConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -9,13 +9,13 @@ internal class MainSettingsModeButtonContentConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode.BrowserPathMode => MainConst.UpstreamUrlSettingsModeName,
|
MainConst.SettingsMode.BrowserPathMode => MainConst.SettingsModeButtonUpstreamUrlContent,
|
||||||
MainConst.SettingsMode.UpstreamUrlMode => MainConst.ExtraArgsSettingsModeName,
|
MainConst.SettingsMode.UpstreamUrlMode => MainConst.SettingsModeButtonExtraArgsContent,
|
||||||
MainConst.SettingsMode.ExtraArgsMode => MainConst.BrowserPathSettingsModeName,
|
MainConst.SettingsMode.ExtraArgsMode => MainConst.SettingsModeButtonBrowserPathContent,
|
||||||
_ => throw new NotImplementedException()
|
_ => throw new NotImplementedException()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
18
Convs/MainUpdateHostButtonContentConv.cs
Normal file
18
Convs/MainUpdateHostButtonContentConv.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class MainUpdateHostButtonContentConv : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool isUpstreamHostUtd = (bool)value;
|
||||||
|
|
||||||
|
return MainConst.UpdateUpstreamHostButtonContent + (isUpstreamHostUtd ? string.Empty : " *");
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Convs;
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
@ -9,9 +9,9 @@ internal class MainUpdateHostButtonIsEnabledConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? upstreamUrl = value as string;
|
string upstreamUrl = (string)value;
|
||||||
|
|
||||||
return MainConst.UpstreamUrlRegex().IsMatch(upstreamUrl!);
|
return MainConst.UpstreamUrlRegex().IsMatch(upstreamUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
@ -10,7 +10,7 @@ internal class MainWinWidthConv : IValueConverter
|
|||||||
{
|
{
|
||||||
bool isAdmin = (bool)value;
|
bool isAdmin = (bool)value;
|
||||||
|
|
||||||
return isAdmin ? 700 : 500;
|
return isAdmin ? 708 : 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
8
Convs/SettingsConv.cs
Normal file
8
Convs/SettingsConv.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal static class SettingsConv
|
||||||
|
{
|
||||||
|
public static SettingsLangsButtonContentConv SettingsLangsButtonContentConv => new();
|
||||||
|
public static SettingsThemesButtonContentConv SettingsThemesButtonContentConv => new();
|
||||||
|
public static SettingsWeightsButtonContentConv SettingsWeightsButtonContentConv => new();
|
||||||
|
}
|
20
Convs/SettingsLangsButtonContentConv.cs
Normal file
20
Convs/SettingsLangsButtonContentConv.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class SettingsLangsButtonContentConv : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object? value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool? isEnglishLang = value as bool?;
|
||||||
|
|
||||||
|
return isEnglishLang.HasValue ?
|
||||||
|
isEnglishLang.GetValueOrDefault() ? SettingsConst.LangsButtonEnglishLangContent : SettingsConst.LangsButtonChineseLangContent :
|
||||||
|
SettingsConst.LangsButtonInheritLangContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
20
Convs/SettingsThemesButtonContentConv.cs
Normal file
20
Convs/SettingsThemesButtonContentConv.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class SettingsThemesButtonContentConv : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object? value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool? isLightMode = value as bool?;
|
||||||
|
|
||||||
|
return isLightMode.HasValue ?
|
||||||
|
isLightMode.GetValueOrDefault() ? SettingsConst.ThemesButtonLightThemeContent : SettingsConst.ThemesButtonDarkThemeContent :
|
||||||
|
SettingsConst.ThemesButtonInheritThemeContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
20
Convs/SettingsWeightsButtonContentConv.cs
Normal file
20
Convs/SettingsWeightsButtonContentConv.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Convs;
|
||||||
|
|
||||||
|
internal class SettingsWeightsButtonContentConv : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object? value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool? isLightWeight = value as bool?;
|
||||||
|
|
||||||
|
return isLightWeight.HasValue ?
|
||||||
|
isLightWeight.GetValueOrDefault() ? SettingsConst.WeightsButtonLightWeightContent : SettingsConst.WeightsButtonBoldWeightContent :
|
||||||
|
SettingsConst.WeightsButtonRegularWeightContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
}
|
9
Preses/AboutPres.cs
Normal file
9
Preses/AboutPres.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
|
internal partial class AboutPres : GlobalPres
|
||||||
|
{
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isSheasCealerUtd = true;
|
||||||
|
}
|
44
Preses/GlobalPres.cs
Normal file
44
Preses/GlobalPres.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using MaterialDesignThemes.Wpf;
|
||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Cealer.Props;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
|
internal partial class GlobalPres : ObservableObject
|
||||||
|
{
|
||||||
|
internal GlobalPres()
|
||||||
|
{
|
||||||
|
IsLightTheme = Settings.Default.IsLightTheme switch
|
||||||
|
{
|
||||||
|
-1 => null,
|
||||||
|
0 => false,
|
||||||
|
1 => true,
|
||||||
|
_ => throw new UnreachableException()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private static bool? isLightTheme = null;
|
||||||
|
partial void OnIsLightThemeChanged(bool? value)
|
||||||
|
{
|
||||||
|
PaletteHelper paletteHelper = new();
|
||||||
|
Theme newTheme = paletteHelper.GetTheme();
|
||||||
|
|
||||||
|
newTheme.SetBaseTheme(value.HasValue ? value.Value ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit);
|
||||||
|
paletteHelper.SetTheme(newTheme);
|
||||||
|
|
||||||
|
foreach (Window currentWindow in Application.Current.Windows)
|
||||||
|
BorderThemeSetter.SetBorderTheme(currentWindow, value);
|
||||||
|
|
||||||
|
Settings.Default.IsLightTheme = (sbyte)(value.HasValue ? value.Value ? 1 : 0 : -1);
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private static Color accentForegroundColor = AboutConst.AccentBlueColor;
|
||||||
|
}
|
@ -1,19 +1,20 @@
|
|||||||
using System;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using MaterialDesignThemes.Wpf;
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Sheas_Cealer.Consts;
|
using Sheas_Cealer.Consts;
|
||||||
using Sheas_Cealer.Props;
|
using Sheas_Cealer.Props;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
|
|
||||||
namespace Sheas_Cealer.Preses;
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
internal partial class MainPres : ObservableObject
|
internal partial class MainPres : GlobalPres
|
||||||
{
|
{
|
||||||
internal MainPres(string[] args)
|
internal MainPres()
|
||||||
{
|
{
|
||||||
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
int browserPathIndex = Array.FindIndex(args, arg => arg.Equals("-b", StringComparison.OrdinalIgnoreCase)) + 1;
|
int browserPathIndex = Array.FindIndex(args, arg => arg.Equals("-b", StringComparison.OrdinalIgnoreCase)) + 1;
|
||||||
int upstreamUrlIndex = Array.FindIndex(args, arg => arg.Equals("-u", StringComparison.OrdinalIgnoreCase)) + 1;
|
int upstreamUrlIndex = Array.FindIndex(args, arg => arg.Equals("-u", StringComparison.OrdinalIgnoreCase)) + 1;
|
||||||
int extraArgsIndex = Array.FindIndex(args, arg => arg.Equals("-e", StringComparison.OrdinalIgnoreCase)) + 1;
|
int extraArgsIndex = Array.FindIndex(args, arg => arg.Equals("-e", StringComparison.OrdinalIgnoreCase)) + 1;
|
||||||
@ -41,45 +42,46 @@ internal partial class MainPres : ObservableObject
|
|||||||
private string browserPath;
|
private string browserPath;
|
||||||
partial void OnBrowserPathChanged(string value)
|
partial void OnBrowserPathChanged(string value)
|
||||||
{
|
{
|
||||||
if (File.Exists(value) && Path.GetFileName(value).ToLowerInvariant().EndsWith(".exe"))
|
if (!File.Exists(value) || !Path.GetFileName(value).ToLowerInvariant().EndsWith(".exe"))
|
||||||
{
|
return;
|
||||||
Settings.Default.BrowserPath = value;
|
|
||||||
Settings.Default.Save();
|
Settings.Default.BrowserPath = value;
|
||||||
}
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string upstreamUrl;
|
private string upstreamUrl;
|
||||||
partial void OnUpstreamUrlChanged(string value)
|
partial void OnUpstreamUrlChanged(string value)
|
||||||
{
|
{
|
||||||
if (MainConst.UpstreamUrlRegex().IsMatch(value))
|
if (!MainConst.UpstreamUrlRegex().IsMatch(value))
|
||||||
{
|
return;
|
||||||
Settings.Default.UpstreamUrl = value;
|
|
||||||
Settings.Default.Save();
|
Settings.Default.UpstreamUrl = value;
|
||||||
}
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string extraArgs;
|
private string extraArgs;
|
||||||
partial void OnExtraArgsChanged(string value)
|
partial void OnExtraArgsChanged(string value)
|
||||||
{
|
{
|
||||||
if (MainConst.ExtraArgsRegex().IsMatch(value))
|
if (!MainConst.ExtraArgsRegex().IsMatch(value))
|
||||||
{
|
return;
|
||||||
Settings.Default.ExtraArgs = value;
|
|
||||||
Settings.Default.Save();
|
Settings.Default.ExtraArgs = value;
|
||||||
}
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool? isLightTheme = null;
|
private bool isUpstreamHostUtd = true;
|
||||||
partial void OnIsLightThemeChanged(bool? value)
|
|
||||||
{
|
|
||||||
PaletteHelper paletteHelper = new();
|
|
||||||
Theme newTheme = paletteHelper.GetTheme();
|
|
||||||
|
|
||||||
newTheme.SetBaseTheme(value.HasValue ? value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark : BaseTheme.Inherit);
|
[ObservableProperty]
|
||||||
paletteHelper.SetTheme(newTheme);
|
private bool isCoproxyIniting = false;
|
||||||
}
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isCoproxyStopping = false;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isConginxExist = File.Exists(MainConst.ConginxPath);
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isNginxExist = File.Exists(MainConst.NginxPath);
|
private bool isNginxExist = File.Exists(MainConst.NginxPath);
|
||||||
@ -87,15 +89,27 @@ internal partial class MainPres : ObservableObject
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isNginxIniting = false;
|
private bool isNginxIniting = false;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isConginxRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.ConginxPath)).Length != 0;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isNginxRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.NginxPath)).Length != 0;
|
private bool isNginxRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.NginxPath)).Length != 0;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isComihomoExist = File.Exists(MainConst.ComihomoPath);
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isMihomoExist = File.Exists(MainConst.MihomoPath);
|
private bool isMihomoExist = File.Exists(MainConst.MihomoPath);
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isComihomoIniting = false;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isMihomoIniting = false;
|
private bool isMihomoIniting = false;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool isComihomoRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.ComihomoPath)).Length != 0;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isMihomoRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath)).Length != 0;
|
private bool isMihomoRunning = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(MainConst.MihomoPath)).Length != 0;
|
||||||
|
|
||||||
|
66
Preses/SettingsPres.cs
Normal file
66
Preses/SettingsPres.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Sheas_Cealer.Props;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Markup;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Preses;
|
||||||
|
|
||||||
|
internal partial class SettingsPres : GlobalPres
|
||||||
|
{
|
||||||
|
internal SettingsPres()
|
||||||
|
{
|
||||||
|
IsEnglishLang = Settings.Default.IsEnglishLang switch
|
||||||
|
{
|
||||||
|
-1 => null,
|
||||||
|
0 => false,
|
||||||
|
1 => true,
|
||||||
|
_ => throw new UnreachableException()
|
||||||
|
};
|
||||||
|
|
||||||
|
IsLightWeight = Settings.Default.IsLightWeight switch
|
||||||
|
{
|
||||||
|
-1 => null,
|
||||||
|
0 => false,
|
||||||
|
1 => true,
|
||||||
|
_ => throw new UnreachableException()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private static bool? isEnglishLang = null;
|
||||||
|
partial void OnIsEnglishLangChanged(bool? value)
|
||||||
|
{
|
||||||
|
CultureInfo newCulture = value.HasValue ? new(value.Value ? "en" : "zh") : CultureInfo.InstalledUICulture;
|
||||||
|
|
||||||
|
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = newCulture;
|
||||||
|
|
||||||
|
foreach (Window currentWindow in Application.Current.Windows)
|
||||||
|
currentWindow.Language = XmlLanguage.GetLanguage(newCulture.IetfLanguageTag);
|
||||||
|
|
||||||
|
Settings.Default.IsEnglishLang = (sbyte)(value.HasValue ? value.Value ? 1 : 0 : -1);
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private static bool? isLightWeight = null;
|
||||||
|
partial void OnIsLightWeightChanged(bool? value)
|
||||||
|
{
|
||||||
|
FontWeight newWeight = value.HasValue ? value.Value ? FontWeights.Light : FontWeights.Bold : FontWeights.Regular;
|
||||||
|
Style newWindowStyle = new(typeof(Window), Application.Current.Resources["CommonWindow"] as Style);
|
||||||
|
|
||||||
|
newWindowStyle.Setters.Add(new Setter(Window.FontWeightProperty, newWeight));
|
||||||
|
Application.Current.Resources["CommonWindow"] = newWindowStyle;
|
||||||
|
|
||||||
|
Style newButtonStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||||
|
|
||||||
|
newButtonStyle.Setters.Add(new Setter(Button.FontWeightProperty, newWeight));
|
||||||
|
Application.Current.Resources[typeof(Button)] = newButtonStyle;
|
||||||
|
|
||||||
|
Settings.Default.IsLightWeight = (sbyte)(value.HasValue ? value.Value ? 1 : 0 : -1);
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
18
Proces/BrowserProc.cs
Normal file
18
Proces/BrowserProc.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using Sheas_Core;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Proces;
|
||||||
|
|
||||||
|
internal class BrowserProc : Proc
|
||||||
|
{
|
||||||
|
private readonly bool ShutDownAppOnProcessExit;
|
||||||
|
|
||||||
|
internal BrowserProc(string browserPath, bool shutDownAppOnProcessExit) : base(browserPath) => ShutDownAppOnProcessExit = shutDownAppOnProcessExit;
|
||||||
|
|
||||||
|
protected sealed override void Process_Exited(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ShutDownAppOnProcessExit)
|
||||||
|
Application.Current.Dispatcher.InvokeShutdown();
|
||||||
|
}
|
||||||
|
}
|
9
Proces/ComihomoProc.cs
Normal file
9
Proces/ComihomoProc.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Core;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Proces;
|
||||||
|
|
||||||
|
internal class ComihomoProc : Proc
|
||||||
|
{
|
||||||
|
internal ComihomoProc() : base(MainConst.ComihomoPath) { }
|
||||||
|
}
|
13
Proces/ConginxProc.cs
Normal file
13
Proces/ConginxProc.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
|
using Sheas_Core;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Proces;
|
||||||
|
|
||||||
|
internal class ConginxProc : Proc
|
||||||
|
{
|
||||||
|
internal ConginxProc() : base(MainConst.ConginxPath) { }
|
||||||
|
|
||||||
|
protected override async void Process_Exited(object? sender, EventArgs e) => await NginxCleaner.Clean();
|
||||||
|
}
|
9
Proces/MihomoProc.cs
Normal file
9
Proces/MihomoProc.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Core;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Proces;
|
||||||
|
|
||||||
|
internal class MihomoProc : Proc
|
||||||
|
{
|
||||||
|
internal MihomoProc() : base(MainConst.MihomoPath) { }
|
||||||
|
}
|
13
Proces/NginxProc.cs
Normal file
13
Proces/NginxProc.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
|
using Sheas_Core;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Proces;
|
||||||
|
|
||||||
|
internal class NginxProc : Proc
|
||||||
|
{
|
||||||
|
internal NginxProc() : base(MainConst.NginxPath) { }
|
||||||
|
|
||||||
|
protected override async void Process_Exited(object? sender, EventArgs e) => await NginxCleaner.Clean();
|
||||||
|
}
|
@ -1,10 +0,0 @@
|
|||||||
using System.Windows;
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// or application resource dictionaries)
|
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// app, or any theme specific resource dictionaries)
|
|
||||||
)]
|
|
62
Props/Settings.Designer.cs
generated
62
Props/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace Sheas_Cealer.Props {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
@ -58,5 +58,65 @@ namespace Sheas_Cealer.Props {
|
|||||||
this["ExtraArgs"] = value;
|
this["ExtraArgs"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("244, 67, 54")]
|
||||||
|
public global::System.Drawing.Color PrimaryColor {
|
||||||
|
get {
|
||||||
|
return ((global::System.Drawing.Color)(this["PrimaryColor"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["PrimaryColor"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||||
|
public sbyte IsLightTheme {
|
||||||
|
get {
|
||||||
|
return ((sbyte)(this["IsLightTheme"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["IsLightTheme"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||||
|
public sbyte IsEnglishLang {
|
||||||
|
get {
|
||||||
|
return ((sbyte)(this["IsEnglishLang"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["IsEnglishLang"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
|
||||||
|
public sbyte IsLightWeight {
|
||||||
|
get {
|
||||||
|
return ((sbyte)(this["IsLightWeight"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["IsLightWeight"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool IsUpgradeRequired {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["IsUpgradeRequired"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["IsUpgradeRequired"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,20 @@
|
|||||||
<Setting Name="ExtraArgs" Type="System.String" Scope="User">
|
<Setting Name="ExtraArgs" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="PrimaryColor" Type="System.Drawing.Color" Scope="User">
|
||||||
|
<Value Profile="(Default)">244, 67, 54</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="IsLightTheme" Type="System.SByte" Scope="User">
|
||||||
|
<Value Profile="(Default)">-1</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="IsEnglishLang" Type="System.SByte" Scope="User">
|
||||||
|
<Value Profile="(Default)">-1</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="IsLightWeight" Type="System.SByte" Scope="User">
|
||||||
|
<Value Profile="(Default)">-1</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="IsUpgradeRequired" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
45
README.md
45
README.md
@ -2,35 +2,40 @@
|
|||||||
<h3 align="center">- Just Ceal It -</h3>
|
<h3 align="center">- Just Ceal It -</h3>
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
## 自我介绍
|
## 其他语言
|
||||||
**Sheas Cealer**: 一只基于 **WPF(.Net8)** 的 SNI 伪造工具
|
[English README](README_EN.md)
|
||||||
|
|
||||||
* 适用平台: Windows x64
|
## 自我介绍
|
||||||
|
**Sheas Cealer**: 一只基于 **WPF(.Net8)** 的桌面端 SNI 伪造工具
|
||||||
|
|
||||||
|
* 适用平台: Windows (Win10 之前的系统版本请使用 [1.1.0](https://github.com/SpaceTimee/Sheas-Cealer/releases/tag/1.1.0)) (其他平台请参考[相关项目](https://github.com/SpaceTimee/Sheas-Cealer#相关项目))
|
||||||
|
|
||||||
## 词汇解释
|
## 词汇解释
|
||||||
**[Sheas Cealer Dictionary](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Dictionary)**
|
**[Sheas Cealer Dictionary](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Dictionary)**
|
||||||
|
|
||||||
## 注意事项
|
## 注意事项
|
||||||
1. 内置伪造规则在 [Cealing Host 存储库](https://github.com/SpaceTimee/Cealing-Host) 持续更新
|
1. 内置伪造规则在 [Cealing Host 存储库](https://github.com/SpaceTimee/Cealing-Host) 持续更新
|
||||||
2. Sheas Cealer 更新时不会覆盖已有的伪造规则,如需与上游同步,需点击**更新规则**按钮 (>= 1.1.0),或**手动修改覆盖**
|
2. Sheas Cealer 更新时不会覆盖已有的伪造规则,如需与上游同步,需点击**更新上游规则**按钮,或**手动修改覆盖**
|
||||||
3. 本项目仅供**学习参考**,无意绕过任何审查设备的审查
|
3. 本项目及所有相关资源仅供**抵御网络非法监听**和**开展网络安全研究**使用,无意绕过任何国家审查设备的审查
|
||||||
4. 请根据你应遵守的法律法规修改后使用本项目
|
4. 为避免不必要的麻烦,使用前请先阅读[**用户协议**](https://github.com/SpaceTimee/Sheas-Cealer#用户协议)
|
||||||
5. 为避免不必要的麻烦,使用前请先阅读**注意事项**和**用户协议**
|
5. Sheas Cealer 仍处于**开发阶段**,但每个正式版发布前会尽量确保其**稳定可用**
|
||||||
6. Sheas Cealer 仍处于**开发阶段**,但每个正式版发布前会尽量确保其**稳定可用**
|
|
||||||
7. Github Release 中会保留目前能够使用的**所有版本**,但强烈推荐使用**最新版**
|
|
||||||
|
|
||||||
## 用户协议
|
## 用户协议
|
||||||
1. [隐私政策](https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策)
|
1. [隐私政策](https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策)
|
||||||
2. [使用协议](https://thoughts.teambition.com/share/6264edd78adeb10041b92fdb#title=Sheas_Cealer_使用协议)
|
2. [使用协议](https://thoughts.teambition.com/share/6264edd78adeb10041b92fdb#title=Sheas_Cealer_使用协议)
|
||||||
|
|
||||||
## 下载地址
|
## 下载地址
|
||||||
1. Github (首选): [https://github.com/SpaceTimee/Sheas-Cealer/releases](https://github.com/SpaceTimee/Sheas-Cealer/releases)
|
1. Github: [https://github.com/SpaceTimee/Sheas-Cealer/releases](https://github.com/SpaceTimee/Sheas-Cealer/releases)
|
||||||
2. 蓝奏云 (密码 3wnj) (大陆推荐): [https://spacetime.lanzouu.com/b017hp0lc](https://spacetime.lanzouu.com/b017hp0lc)
|
2. 群文件 (参与内测): 参考[联系方式](https://github.com/SpaceTimee/Sheas-Cealer#联系方式)
|
||||||
|
|
||||||
|
> 出于不可抗力因素,Sheas Cealer 暂时无法再提供蓝奏云下载地址,在此依旧感谢蓝奏云一直以来的免费分发服务
|
||||||
|
|
||||||
## 安装方式
|
## 安装方式
|
||||||
1. Setup 安装器 (首选): 下载 Sheas Cealer Setup.exe 并运行 -> 按照提示设置即可安装
|
1. Setup 安装器 (首选): 下载 Sheas Cealer Setup.exe 并运行 -> 按照提示设置即可安装
|
||||||
2. Zip 压缩包 (免安装): 下载 Sheas Cealer Zip.zip 并解压 -> 完成后即可直接使用
|
2. Zip 压缩包 (免安装): 下载 Sheas Cealer Zip.zip 并解压 -> 完成后即可直接使用
|
||||||
|
|
||||||
|
> Scd 版本: Scd 版本内置 .Net 运行时,可在缺乏 .Net 运行时的环境下运行,但代价是更大的文件体积以及更差的跨平台能力,如果没有特殊原因,不建议使用 Scd 版本
|
||||||
|
|
||||||
## 食用文档
|
## 食用文档
|
||||||
**[Sheas Cealer Documentation](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation)**
|
**[Sheas Cealer Documentation](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation)**
|
||||||
|
|
||||||
@ -38,7 +43,7 @@
|
|||||||
[Sheas Cealer Build](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Build)
|
[Sheas Cealer Build](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Build)
|
||||||
|
|
||||||
## 项目原理
|
## 项目原理
|
||||||
利用 Chromium 内核的参数特性伪造 SNI 拓展标记,详细原理可参考[这篇文章](https://nicebowl.fun/24_8)
|
利用 Chromium 内核的启动参数特性伪造 SNI 拓展标记,详细原理可参考[这篇文章](https://nicebowl.fun/24_8)
|
||||||
|
|
||||||
## 致谢名单
|
## 致谢名单
|
||||||
* **kit: 为本项目提供全部的原理基础**
|
* **kit: 为本项目提供全部的原理基础**
|
||||||
@ -48,9 +53,19 @@
|
|||||||
**Space Time**
|
**Space Time**
|
||||||
|
|
||||||
## 联系方式
|
## 联系方式
|
||||||
1. **QQ 群 (主群): 338919498**
|
1. **QQ 群: 1034315671,716266896,338919498**
|
||||||
2. TG 群 (分群) (宽松管理): [PixCealerChat](https://t.me/PixCealerChat)
|
2. **TG 群: [PixCealerChat](https://t.me/PixCealerChat)**
|
||||||
3. **邮箱: Zeus6_6@163.com**
|
3. 邮箱: Zeus6_6@163.com
|
||||||
|
|
||||||
|
## 相关项目
|
||||||
|
1. [Sheas Cealer Droid](https://github.com/SpaceTimee/Sheas-Cealer-Droid): Sheas Cealer 安卓端
|
||||||
|
2. [Sheas Cealer Nix](https://github.com/SpaceTimee/Sheas-Cealer/tree/nix): Sheas Cealer 跨平台桌面端
|
||||||
|
3. [Cealing Host](https://github.com/SpaceTimee/Cealing-Host): 最新的 Sheas Cealer 内置伪造规则
|
||||||
|
4. [Sheas Dop](https://github.com/SpaceTimee/Sheas-Dop): DNS 抗污染解析工具 (Sheas Cealer 全局净化子项目)
|
||||||
|
5. [Sheas Nginx](https://github.com/SpaceTimee/Sheas-Nginx): Pixiv Nginx 启动器 (Sheas Cealer 全局伪造 × Pixiv Nginx 合作子项目)
|
||||||
|
6. [Bot CealingCat](https://github.com/SpaceTimee/Bot-CealingCat): 提供 Sheas Cealer 相关服务的 Telegram Bot
|
||||||
|
7. [Console HostChecker](https://github.com/SpaceTimee/Console-HostChecker): Cealing Host 自动化检查脚本
|
||||||
|
8. [Console HostGenerator](https://github.com/SpaceTimee/Console-HostGenerator): Cealing Host 自动化生成脚本
|
||||||
|
|
||||||
## 许可证
|
## 许可证
|
||||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2FSpaceTimee%2FSheas-Cealer?ref=badge_large)
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2FSpaceTimee%2FSheas-Cealer?ref=badge_large)
|
||||||
|
73
README_EN.md
Normal file
73
README_EN.md
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<h1 align="center">Sheas ◁ Cealer</h1>
|
||||||
|
<h3 align="center">- Just Ceal It -</h3>
|
||||||
|
</br>
|
||||||
|
|
||||||
|
## Language
|
||||||
|
[中文 README](README.md)
|
||||||
|
|
||||||
|
## About
|
||||||
|
**Sheas Cealer**: A desktop SNI concealing tool based on **WPF(.Net8)**
|
||||||
|
|
||||||
|
* Applicable platform: Windows (For system versions before Win10, please use [1.1.0](https://github.com/SpaceTimee/Sheas-Cealer/releases/tag/1.1.0)) (For more platforms, please refer to [Projects](https://github.com/SpaceTimee/Sheas-Cealer#Projects))
|
||||||
|
|
||||||
|
## Vocabulary
|
||||||
|
**[Sheas Cealer Dictionary](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Dictionary)**
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
1. The Built-in Cealing Host is continuously updated in the [Cealing Host repository](https://github.com/SpaceTimee/Cealing-Host)
|
||||||
|
2. When Sheas Cealer is updated, it will not overwrite the existing configs. If you need to synchronize with the upstream, you need to click the **Update Upstream Host** button, or **manually overwrite**
|
||||||
|
3. This project and all its resources are for the sole purpose of **defending against illegal network monitoring** and **conducting network security research**, and are not intended to bypass the censorship of any country
|
||||||
|
4. Please read the [**Agreements**](https://github.com/SpaceTimee/Sheas-Cealer#Agreements) before use
|
||||||
|
5. Sheas Cealer is still in the **development stage**, but each production version will be **stable and available** before release
|
||||||
|
|
||||||
|
## Agreements
|
||||||
|
1. [Privacy Policy](https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策)
|
||||||
|
2. [EULA](https://thoughts.teambition.com/share/6264edd78adeb10041b92fdb#title=Sheas_Cealer_使用协议)
|
||||||
|
|
||||||
|
## Download
|
||||||
|
1. Github (preferred): [https://github.com/SpaceTimee/Sheas-Cealer/releases](https://github.com/SpaceTimee/Sheas-Cealer/releases)
|
||||||
|
2. Group File (participate in internal testing): Please refer to [Contacts](https://github.com/SpaceTimee/Sheas-Cealer#Contacts)
|
||||||
|
|
||||||
|
> Due to force majeure, Sheas Cealer is temporarily unable to provide the download address of Lanzou Cloud. We would like to thank Lanzou Cloud for its free distribution service
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
1. Setup Installer (preferred): Download Sheas Cealer Setup.exe and run -> Then follow the prompts to install
|
||||||
|
2. Zip Package (installation-free): Download Sheas Cealer Zip.zip and unzip -> Then you can use it directly
|
||||||
|
|
||||||
|
> Scd version: The Scd version has a built-in .Net runtime and can run in an environment without a .Net runtime, but the cost is a larger file size and worse cross-platform capabilities. If there is no special reason, it is not recommended to use the Scd version
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
**[Sheas Cealer Documentation](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation)**
|
||||||
|
|
||||||
|
## Build
|
||||||
|
[Sheas Cealer Build](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Build)
|
||||||
|
|
||||||
|
## Principles
|
||||||
|
Using the startup parameter feature of the Chromium kernel to conceal SNI. For more detailes, please refer to [this article](https://nicebowl.fun/24_8)
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
* **kit: Provides all the principle foundations for this project**
|
||||||
|
* **NiceBowl: Provides detailed principle explanations for this project**
|
||||||
|
|
||||||
|
## Developer
|
||||||
|
**Space Time**
|
||||||
|
|
||||||
|
## Contacts
|
||||||
|
1. **QQ Group: 1034315671, 716266896, 338919498**
|
||||||
|
2. **TG Group: [PixCealerChat](https://t.me/PixCealerChat)**
|
||||||
|
3. Email: Zeus6_6@163.com
|
||||||
|
|
||||||
|
## Projects
|
||||||
|
1. [Sheas Cealer Droid](https://github.com/SpaceTimee/Sheas-Cealer-Droid): Sheas Cealer for Android
|
||||||
|
2. [Sheas Cealer Nix](https://github.com/SpaceTimee/Sheas-Cealer/tree/nix): Sheas Cealer cross-platform for desktop
|
||||||
|
3. [Cealing Host](https://github.com/SpaceTimee/Cealing-Host): The latest Built-in Cealing Host
|
||||||
|
4. [Sheas Dop](https://github.com/SpaceTimee/Sheas-Dop): DNS anti-pollution resolution tool (Sheas Cealer Global Cealing subproject)
|
||||||
|
5. [Sheas Nginx](https://github.com/SpaceTimee/Sheas-Nginx): Pixiv Nginx launcher (Sheas Cealer Global Purging × Pixiv Nginx cooperative subproject)
|
||||||
|
6. [Bot CealingCat](https://github.com/SpaceTimee/Bot-CealingCat): Telegram Bot providing Sheas Cealer related services
|
||||||
|
7. [Console HostChecker](https://github.com/SpaceTimee/Console-HostChecker): Cealing Host automated checking script
|
||||||
|
8. [Console HostGenerator](https://github.com/SpaceTimee/Console-HostGenerator): Cealing Host automated generation script
|
||||||
|
|
||||||
|
## License
|
||||||
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2FSpaceTimee%2FSheas-Cealer?ref=badge_large)
|
||||||
|
|
||||||
|
•ᴗ•
|
@ -8,10 +8,10 @@
|
|||||||
<PackageReleaseNotes>Just Ceal It</PackageReleaseNotes>
|
<PackageReleaseNotes>Just Ceal It</PackageReleaseNotes>
|
||||||
<Authors>Space Time</Authors>
|
<Authors>Space Time</Authors>
|
||||||
<Company>Space Time</Company>
|
<Company>Space Time</Company>
|
||||||
<AssemblyVersion>1.1.2</AssemblyVersion>
|
<AssemblyVersion>1.1.5</AssemblyVersion>
|
||||||
<Version>1.1.2</Version>
|
<Version>1.1.5</Version>
|
||||||
<FileVersion>1.1.2</FileVersion>
|
<FileVersion>1.1.5</FileVersion>
|
||||||
<InformationalVersion>1.1.2</InformationalVersion>
|
<InformationalVersion>1.1.5</InformationalVersion>
|
||||||
<PackageTags>Tool;Sheas;Cealer;Sni</PackageTags>
|
<PackageTags>Tool;Sheas;Cealer;Sni</PackageTags>
|
||||||
<ApplicationIcon>Sheas-Cealer-Logo.ico</ApplicationIcon>
|
<ApplicationIcon>Sheas-Cealer-Logo.ico</ApplicationIcon>
|
||||||
<PackageIcon>Sheas Cealer Logo.png</PackageIcon>
|
<PackageIcon>Sheas Cealer Logo.png</PackageIcon>
|
||||||
@ -23,27 +23,20 @@
|
|||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
||||||
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
|
||||||
<WindowsSdkPackageVersion>10.0.26100.41</WindowsSdkPackageVersion>
|
<WindowsSdkPackageVersion>10.0.26100.41</WindowsSdkPackageVersion>
|
||||||
<RootNamespace>Sheas_Cealer</RootNamespace>
|
<RootNamespace>Sheas_Cealer</RootNamespace>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<UseWindowsForms>True</UseWindowsForms>
|
<UseWindowsForms>True</UseWindowsForms>
|
||||||
<IsPublishable>True</IsPublishable>
|
<IsPublishable>True</IsPublishable>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||||
<ErrorReport>none</ErrorReport>
|
<ErrorReport>none</ErrorReport>
|
||||||
<NoWin32Manifest>true</NoWin32Manifest>
|
<NoWin32Manifest>true</NoWin32Manifest>
|
||||||
<AppDesignerFolder>Props</AppDesignerFolder>
|
<AppDesignerFolder>Props</AppDesignerFolder>
|
||||||
<NeutralLanguage>en</NeutralLanguage>
|
<NeutralLanguage>en</NeutralLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
|
||||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
|
||||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="bin\**" />
|
<Compile Remove="bin\**" />
|
||||||
<EmbeddedResource Remove="bin\**" />
|
<EmbeddedResource Remove="bin\**" />
|
||||||
@ -52,45 +45,41 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AdditionalFiles Remove="app.manifest" />
|
<None Remove=".filenesting.json" />
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove=".gitattributes" />
|
<None Remove=".gitattributes" />
|
||||||
<None Remove=".gitignore" />
|
<None Remove=".gitignore" />
|
||||||
<None Remove="README.md" />
|
<None Remove="README.md" />
|
||||||
|
<None Remove="README_EN.md" />
|
||||||
<None Remove="Sheas-Cealer-Logo.ico" />
|
<None Remove="Sheas-Cealer-Logo.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<COMReference Include="IWshRuntimeLibrary">
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="*" />
|
||||||
<WrapperTool>tlbimp</WrapperTool>
|
<PackageReference Include="MaterialDesignThemes" Version="*" />
|
||||||
<VersionMinor>0</VersionMinor>
|
<PackageReference Include="NginxConfigParser" Version="*" />
|
||||||
<VersionMajor>1</VersionMajor>
|
<PackageReference Include="YamlDotNet" Version="*" />
|
||||||
<Guid>f935dc20-1cf0-11d0-adb9-00c04fd58a0b</Guid>
|
|
||||||
<Lcid>0</Lcid>
|
|
||||||
<Isolated>false</Isolated>
|
|
||||||
<EmbedInteropTypes>true</EmbedInteropTypes>
|
|
||||||
</COMReference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
|
|
||||||
<PackageReference Include="MaterialDesignThemes" Version="5.0.0" />
|
|
||||||
<PackageReference Include="NginxConfigParser" Version="0.1.4" />
|
|
||||||
<PackageReference Include="YamlDotNet" Version="16.1.3" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Ona-Core">
|
<Reference Include="Ona-Core">
|
||||||
<HintPath>..\Ona-Core\bin\Release\net8.0-windows10.0.26100.0\Ona-Core.dll</HintPath>
|
<HintPath>..\Ona-Core\bin\Release\net8.0\Ona-Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Sheas-Core">
|
<Reference Include="Sheas-Core">
|
||||||
<HintPath>..\Sheas-Core\bin\Release\Sheas-Core.dll</HintPath>
|
<HintPath>..\Sheas-Core\bin\Release\net8.0\Sheas-Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Update="Consts\MainMultilangConst.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>MainMultilangConst.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Update="Consts\SettingsMultilangConst.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>SettingsMultilangConst.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Consts\AboutMultilangConst.Designer.cs">
|
<Compile Update="Consts\AboutMultilangConst.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@ -101,25 +90,21 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="Consts\MainMultilangConst.Designer.cs">
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>MainMultilangConst.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Update="Consts\AboutMultilangConst.resx">
|
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>AboutMultilangConst.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Update="Consts\MainMultilangConst.resx">
|
<EmbeddedResource Update="Consts\MainMultilangConst.resx">
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>MainMultilangConst.Designer.cs</LastGenOutput>
|
<LastGenOutput>MainMultilangConst.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
<EmbeddedResource Update="Consts\SettingsMultilangConst.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
<ItemGroup>
|
<LastGenOutput>SettingsMultilangConst.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Consts\AboutMultilangConst.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>AboutMultilangConst.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
<None Update="Props\Settings.settings">
|
<None Update="Props\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
@ -4,6 +4,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
VisualStudioVersion = 17.1.32328.378
|
VisualStudioVersion = 17.1.32328.378
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sheas-Cealer", "Sheas-Cealer.csproj", "{662F787A-474F-41FD-B813-645CAA89E531}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sheas-Cealer", "Sheas-Cealer.csproj", "{662F787A-474F-41FD-B813-645CAA89E531}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{42491572-0050-4CDA-9189-DFC98BDBBF73} = {42491572-0050-4CDA-9189-DFC98BDBBF73}
|
||||||
|
{76263DF7-E4E4-4846-8604-8CFCA7125E2F} = {76263DF7-E4E4-4846-8604-8CFCA7125E2F}
|
||||||
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sheas-Core", "..\Sheas-Core\Sheas-Core.csproj", "{42491572-0050-4CDA-9189-DFC98BDBBF73}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sheas-Core", "..\Sheas-Core\Sheas-Core.csproj", "{42491572-0050-4CDA-9189-DFC98BDBBF73}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -32,12 +36,12 @@ Global
|
|||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
RESX_DuplicateKeyHandling = Fail
|
|
||||||
RESX_AutoCreateNewLanguageFiles = True
|
|
||||||
RESX_ConfirmAddLanguageFile = True
|
|
||||||
RESX_NeutralResourcesLanguage = en-US
|
|
||||||
SolutionGuid = {33005A8D-2D3D-4101-AFF0-F68B29FE9B28}
|
|
||||||
RESX_SortFileContentOnSave = True
|
|
||||||
RESX_Rules = {"EnabledRules":["StringFormat","WhiteSpaceLead","WhiteSpaceTail","PunctuationLead"]}
|
RESX_Rules = {"EnabledRules":["StringFormat","WhiteSpaceLead","WhiteSpaceTail","PunctuationLead"]}
|
||||||
|
RESX_SortFileContentOnSave = True
|
||||||
|
SolutionGuid = {33005A8D-2D3D-4101-AFF0-F68B29FE9B28}
|
||||||
|
RESX_NeutralResourcesLanguage = en-US
|
||||||
|
RESX_ConfirmAddLanguageFile = True
|
||||||
|
RESX_AutoCreateNewLanguageFiles = True
|
||||||
|
RESX_DuplicateKeyHandling = Fail
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
31
Utils/BorderThemeSetter.cs
Normal file
31
Utils/BorderThemeSetter.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Interop;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Utils;
|
||||||
|
|
||||||
|
internal static partial class BorderThemeSetter
|
||||||
|
{
|
||||||
|
private const int DwmwaUseImmersiveDarkModeOld = 19;
|
||||||
|
private const int DwmwaUseImmersiveDarkMode = 20;
|
||||||
|
|
||||||
|
[LibraryImport("dwmapi.dll")]
|
||||||
|
private static partial void DwmGetWindowAttribute(nint hwnd, uint attr, out nint attrValue, uint attrSize);
|
||||||
|
[LibraryImport("dwmapi.dll")]
|
||||||
|
private static partial void DwmSetWindowAttribute(nint hwnd, uint attr, ref nint attrValue, uint attrSize);
|
||||||
|
|
||||||
|
internal static void SetBorderTheme(Window window, bool? isLightTheme)
|
||||||
|
{
|
||||||
|
nint isDarkTheme;
|
||||||
|
nint desktopHwnd = nint.Zero;
|
||||||
|
nint windowHwnd = new WindowInteropHelper(window).EnsureHandle();
|
||||||
|
|
||||||
|
if (isLightTheme.HasValue)
|
||||||
|
isDarkTheme = !isLightTheme.Value ? 1 : 0;
|
||||||
|
else
|
||||||
|
DwmGetWindowAttribute(desktopHwnd, DwmwaUseImmersiveDarkMode, out isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
|
|
||||||
|
DwmSetWindowAttribute(windowHwnd, DwmwaUseImmersiveDarkModeOld, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
|
DwmSetWindowAttribute(windowHwnd, DwmwaUseImmersiveDarkMode, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Windows;
|
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
using SheasCore;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Utils;
|
|
||||||
|
|
||||||
internal class CommandProc : Proc
|
|
||||||
{
|
|
||||||
private static bool ShutDownAppOnProcessExit;
|
|
||||||
|
|
||||||
internal CommandProc(bool shutDownAppOnProcessExit) : base(MainConst.CommandName) => ShutDownAppOnProcessExit = shutDownAppOnProcessExit;
|
|
||||||
|
|
||||||
public override void Process_Exited(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (ShutDownAppOnProcessExit)
|
|
||||||
Application.Current.Dispatcher.InvokeShutdown();
|
|
||||||
}
|
|
||||||
}
|
|
11
Utils/DnsFlusher.cs
Normal file
11
Utils/DnsFlusher.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Utils;
|
||||||
|
|
||||||
|
internal static partial class DnsFlusher
|
||||||
|
{
|
||||||
|
[LibraryImport("dnsapi.dll")]
|
||||||
|
private static partial void DnsFlushResolverCache();
|
||||||
|
|
||||||
|
internal static void FlushDns() => DnsFlushResolverCache();
|
||||||
|
}
|
31
Utils/ForegroundGenerator.cs
Normal file
31
Utils/ForegroundGenerator.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Utils;
|
||||||
|
|
||||||
|
internal static class ForegroundGenerator
|
||||||
|
{
|
||||||
|
internal static (Color?, Color) GetForeground(int red, int green, int blue)
|
||||||
|
{
|
||||||
|
double redComponent = red / 255.0, greenComponent = green / 255.0, blueComponent = blue / 255.0;
|
||||||
|
|
||||||
|
double luminance = 0.2126 * GammaCorrect(redComponent) + 0.7152 * GammaCorrect(greenComponent) + 0.0722 * GammaCorrect(blueComponent);
|
||||||
|
|
||||||
|
double blackContrast = (luminance + 0.05) / 0.05;
|
||||||
|
double whiteContrast = 1.05 / (luminance + 0.05);
|
||||||
|
|
||||||
|
double hue = redComponent > greenComponent && redComponent > blueComponent ? 60 * ((greenComponent - blueComponent) / (redComponent - Math.Min(greenComponent, blueComponent)) + (greenComponent < blueComponent ? 6 : 0)) :
|
||||||
|
greenComponent > blueComponent && greenComponent > redComponent ? 60 * ((blueComponent - redComponent) / (greenComponent - Math.Min(blueComponent, redComponent)) + 2) :
|
||||||
|
blueComponent > redComponent && blueComponent > greenComponent ? 60 * ((redComponent - greenComponent) / (blueComponent - Math.Min(redComponent, greenComponent)) + 4) : 0;
|
||||||
|
|
||||||
|
double blueContrast = Math.Min(Math.Abs(hue - 206.57), 360 - Math.Abs(hue - 206.57));
|
||||||
|
double redContrast = Math.Min(Math.Abs(hue - 4.11), 360 - Math.Abs(hue - 4.11));
|
||||||
|
|
||||||
|
return (blackContrast >= 5.5 && whiteContrast >= 2.5 ? null :
|
||||||
|
blackContrast >= whiteContrast ? Colors.Black : Colors.White,
|
||||||
|
blueContrast >= redContrast ? AboutConst.AccentBlueColor : AboutConst.AccentRedColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double GammaCorrect(double component) => component <= 0.03928 ? component / 12.92 : Math.Pow((component + 0.055) / 1.055, 2.4);
|
||||||
|
}
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
|
|
||||||
@ -7,37 +6,33 @@ namespace Sheas_Cealer.Utils;
|
|||||||
|
|
||||||
internal static partial class IconRemover
|
internal static partial class IconRemover
|
||||||
{
|
{
|
||||||
private const int GWL_EXSTYLE = -20;
|
private const int GwlExStyle = -20;
|
||||||
private const int WS_EX_DLGMODALFRAME = 0x0001;
|
private const int WsExDlgModalFrame = 0x0001;
|
||||||
private const int SWP_NOSIZE = 0x0001;
|
private const int SwpNoSize = 0x0001;
|
||||||
private const int SWP_NOMOVE = 0x0002;
|
private const int SwpNoMove = 0x0002;
|
||||||
private const int SWP_NOZORDER = 0x0004;
|
private const int SwpNoZOrder = 0x0004;
|
||||||
private const int SWP_FRAMECHANGED = 0x0020;
|
private const int SwpFrameChanged = 0x0020;
|
||||||
private const uint WM_SETICON = 0x0080;
|
private const uint WmSetIcon = 0x0080;
|
||||||
|
|
||||||
[LibraryImport("user32.dll", EntryPoint = "GetWindowLongW")]
|
[LibraryImport("user32.dll", EntryPoint = "GetWindowLongW")]
|
||||||
private static partial int GetWindowLong(IntPtr hwnd, int index);
|
private static partial int GetWindowLong(nint hwnd, int index);
|
||||||
[LibraryImport("user32.dll", EntryPoint = "SetWindowLongW")]
|
[LibraryImport("user32.dll", EntryPoint = "SetWindowLongW")]
|
||||||
private static partial int SetWindowLong(IntPtr hwnd, int index, int newStyle);
|
private static partial void SetWindowLong(nint hwnd, int index, nint newStyle);
|
||||||
[LibraryImport("user32.dll")]
|
[LibraryImport("user32.dll")]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
private static partial bool SetWindowPos(IntPtr hwnd, IntPtr hwndInsertAfter, int x, int y, int width, int height, uint flags);
|
private static partial void SetWindowPos(nint hwnd, nint hwndInsertAfter, int x, int y, int width, int height, uint flags);
|
||||||
[LibraryImport("user32.dll", EntryPoint = "SendMessageW")]
|
[LibraryImport("user32.dll", EntryPoint = "SendMessageW")]
|
||||||
private static partial IntPtr SendMessage(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
|
private static partial void SendMessage(nint hwnd, uint msg, nint wParam, nint lParam);
|
||||||
|
|
||||||
internal static void RemoveIcon(Window window)
|
internal static void RemoveIcon(Window window)
|
||||||
{
|
{
|
||||||
// 获取该窗口句柄
|
nint hwnd = new WindowInteropHelper(window).Handle;
|
||||||
IntPtr hwnd = new WindowInteropHelper(window).Handle;
|
|
||||||
|
|
||||||
// 将窗口更改为不显示窗口图标
|
SetWindowLong(hwnd, GwlExStyle, GetWindowLong(hwnd, GwlExStyle) | WsExDlgModalFrame);
|
||||||
_ = SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_DLGMODALFRAME);
|
|
||||||
|
|
||||||
// 更新窗口的非客户区域来显示更改
|
SetWindowPos(hwnd, nint.Zero, 0, 0, 0, 0, SwpNoMove | SwpNoSize | SwpNoZOrder | SwpFrameChanged);
|
||||||
SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
|
||||||
|
|
||||||
// 防止自定义图标生效
|
SendMessage(hwnd, WmSetIcon, new(1), nint.Zero);
|
||||||
SendMessage(hwnd, WM_SETICON, new IntPtr(1), IntPtr.Zero);
|
SendMessage(hwnd, WmSetIcon, nint.Zero, nint.Zero);
|
||||||
SendMessage(hwnd, WM_SETICON, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,10 +0,0 @@
|
|||||||
using System.IO;
|
|
||||||
using Sheas_Cealer.Consts;
|
|
||||||
using SheasCore;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Utils;
|
|
||||||
|
|
||||||
internal class MihomoProc : Proc
|
|
||||||
{
|
|
||||||
internal MihomoProc() : base(Path.GetFileName(MainConst.MihomoPath)) { }
|
|
||||||
}
|
|
@ -1,25 +1,23 @@
|
|||||||
using System;
|
using Sheas_Cealer.Consts;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using Sheas_Cealer.Consts;
|
using System.Threading.Tasks;
|
||||||
using SheasCore;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Utils;
|
namespace Sheas_Cealer.Utils;
|
||||||
|
|
||||||
internal class NginxProc : Proc
|
internal static class NginxCleaner
|
||||||
{
|
{
|
||||||
internal NginxProc() : base(Path.GetFileName(MainConst.NginxPath)) { }
|
internal static async Task Clean()
|
||||||
|
|
||||||
public override void Process_Exited(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
string hostsContent = File.ReadAllText(MainConst.HostsConfPath);
|
string hostsContent = await File.ReadAllTextAsync(MainConst.HostsConfPath);
|
||||||
int hostsConfStartIndex = hostsContent.IndexOf(MainConst.HostsConfStartMarker);
|
int hostsConfStartIndex = hostsContent.IndexOf(MainConst.HostsConfStartMarker, StringComparison.Ordinal);
|
||||||
int hostsConfEndIndex = hostsContent.LastIndexOf(MainConst.HostsConfEndMarker);
|
int hostsConfEndIndex = hostsContent.LastIndexOf(MainConst.HostsConfEndMarker, StringComparison.Ordinal);
|
||||||
|
|
||||||
if (hostsConfStartIndex != -1 && hostsConfEndIndex != -1)
|
if (hostsConfStartIndex != -1 && hostsConfEndIndex != -1)
|
||||||
File.WriteAllText(MainConst.HostsConfPath, hostsContent.Remove(hostsConfStartIndex, hostsConfEndIndex - hostsConfStartIndex + MainConst.HostsConfEndMarker.Length));
|
await File.WriteAllTextAsync(MainConst.HostsConfPath, hostsContent.Remove(hostsConfStartIndex, hostsConfEndIndex - hostsConfStartIndex + MainConst.HostsConfEndMarker.Length));
|
||||||
|
|
||||||
using X509Store certStore = new(StoreName.Root, StoreLocation.CurrentUser, OpenFlags.ReadWrite);
|
using X509Store certStore = new(StoreName.Root, StoreLocation.LocalMachine, OpenFlags.ReadWrite);
|
||||||
|
|
||||||
foreach (X509Certificate2 storedCert in certStore.Certificates)
|
foreach (X509Certificate2 storedCert in certStore.Certificates)
|
||||||
if (storedCert.Subject == MainConst.NginxRootCertSubjectName)
|
if (storedCert.Subject == MainConst.NginxRootCertSubjectName)
|
||||||
@ -27,6 +25,7 @@ internal class NginxProc : Proc
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
certStore.Remove(storedCert);
|
certStore.Remove(storedCert);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
@ -5,49 +5,65 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:consts="clr-namespace:Sheas_Cealer.Consts"
|
xmlns:consts="clr-namespace:Sheas_Cealer.Consts"
|
||||||
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
|
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
|
||||||
|
xmlns:preses="clr-namespace:Sheas_Cealer.Preses"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="Height" Width="500"
|
WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="Height" Width="500"
|
||||||
KeyDown="AboutWin_KeyDown">
|
d:DataContext="{d:DesignInstance preses:AboutPres}"
|
||||||
|
Style="{DynamicResource CommonWindow}"
|
||||||
|
SourceInitialized="AboutWin_SourceInitialized" Loaded="AboutWin_Loaded" KeyDown="AboutWin_KeyDown">
|
||||||
<Grid Margin="5">
|
<Grid Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1.1*" />
|
<ColumnDefinition Width="1.2*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" Foreground="#FF2196F3" Content="{Binding Source={x:Static consts:AboutConst.DeveloperButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.DeveloperButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5"
|
||||||
|
d:Foreground="{Binding Source={x:Static consts:AboutConst.AccentBlueColor}, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
|
||||||
|
Foreground="{Binding AccentForegroundColor, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
|
||||||
|
Content="{x:Static consts:AboutConst.DeveloperButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.DeveloperButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
<Button x:Name="VersionButton"
|
<Button Grid.Row="1" Grid.Column="0" Margin="5" d:Content="# # #: #.#.#"
|
||||||
Grid.Row="1" Grid.Column="0" Margin="5" Foreground="#FF2196F3" ToolTip="{Binding Source={x:Static consts:AboutConst.VersionButtonUrl}, Mode=OneTime}"
|
d:Foreground="{Binding Source={x:Static consts:AboutConst.AccentBlueColor}, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
|
||||||
|
Foreground="{Binding AccentForegroundColor, Converter={x:Static convs:AboutConv.AboutAccentButtonForegroundConv}}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.VersionButtonUrl}"
|
||||||
Click="AboutButton_Click">
|
Click="AboutButton_Click">
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<MultiBinding Mode="OneTime">
|
<MultiBinding Converter="{x:Static convs:AboutConv.AboutVersionButtonContentConv}">
|
||||||
<MultiBinding.Converter>
|
|
||||||
<convs:AboutVersionButtonContentConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Source="{x:Static consts:AboutConst.VersionButtonLabelContent}" />
|
<Binding Source="{x:Static consts:AboutConst.VersionButtonLabelContent}" />
|
||||||
<Binding Source="{x:Static consts:AboutConst.VersionButtonVersionContent}" />
|
<Binding Source="{x:Static consts:AboutConst.VersionButtonVersionContent}" />
|
||||||
|
<Binding Path="IsSheasCealerUtd" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.Content>
|
</Button.Content>
|
||||||
</Button>
|
</Button>
|
||||||
<Button x:Name="EmailButton"
|
<Button x:Name="EmailButton"
|
||||||
Grid.Row="1" Grid.Column="1" Margin="5" Content="{Binding Source={x:Static consts:AboutConst.EmailButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.EmailButtonUrl}, Mode=OneTime}"
|
Grid.Row="1" Grid.Column="1" Margin="5"
|
||||||
|
Content="{x:Static consts:AboutConst.EmailButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.EmailButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:AboutConst.DocumentationButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.DocumentationButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="0" Grid.Column="2" Margin="5"
|
||||||
|
Content="{x:Static consts:AboutConst.DocumentationButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.DocumentationButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
<Button Grid.Row="1" Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:AboutConst.RepositoryButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.RepositoryButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="1" Grid.Column="2" Margin="5"
|
||||||
|
Content="{x:Static consts:AboutConst.RepositoryButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.RepositoryButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="3" Margin="5" Content="{Binding Source={x:Static consts:AboutConst.PolicyButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.PolicyButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="0" Grid.Column="3" Margin="5"
|
||||||
|
Content="{x:Static consts:AboutConst.PolicyButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.PolicyButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
<Button Grid.Row="1" Grid.Column="3" Margin="5" Content="{Binding Source={x:Static consts:AboutConst.AgreementButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.AgreementButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="1" Grid.Column="3" Margin="5"
|
||||||
|
Content="{x:Static consts:AboutConst.AgreementButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:AboutConst.AgreementButtonUrl}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
@ -1,27 +1,66 @@
|
|||||||
using System;
|
using Ona_Core;
|
||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Cealer.Preses;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Threading.Tasks;
|
||||||
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;
|
|
||||||
|
|
||||||
namespace Sheas_Cealer.Wins;
|
namespace Sheas_Cealer.Wins;
|
||||||
|
|
||||||
public partial class AboutWin : Window
|
public partial class AboutWin : Window
|
||||||
{
|
{
|
||||||
internal AboutWin() => InitializeComponent();
|
private readonly AboutPres AboutPres;
|
||||||
protected override void OnSourceInitialized(EventArgs e) => IconRemover.RemoveIcon(this);
|
private readonly HttpClient AboutClient = new(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator });
|
||||||
|
|
||||||
|
internal AboutWin()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
DataContext = AboutPres = new();
|
||||||
|
}
|
||||||
|
private void AboutWin_SourceInitialized(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
IconRemover.RemoveIcon(this);
|
||||||
|
BorderThemeSetter.SetBorderTheme(this, AboutPres.IsLightTheme);
|
||||||
|
}
|
||||||
|
private async void AboutWin_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await Task.Run(async () =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AboutClient.DefaultRequestHeaders.Add("User-Agent", AboutConst.ReleaseApiUserAgent);
|
||||||
|
|
||||||
|
JsonElement releaseInfoObject = JsonDocument.Parse(await Http.GetAsync<string>(AboutConst.ReleaseApiUrl, AboutClient)).RootElement;
|
||||||
|
|
||||||
|
AboutClient.DefaultRequestHeaders.Clear();
|
||||||
|
|
||||||
|
foreach (JsonProperty releaseInfoContent in releaseInfoObject.EnumerateObject())
|
||||||
|
if (releaseInfoContent.Name == "name" && releaseInfoContent.Value.ToString() != AboutConst.VersionButtonVersionContent)
|
||||||
|
AboutPres.IsSheasCealerUtd = false;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void AboutButton_Click(object sender, RoutedEventArgs e)
|
private void AboutButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Button? senderButton = sender as Button;
|
Button senderButton = (Button)sender;
|
||||||
|
|
||||||
if (senderButton == VersionButton)
|
ProcessStartInfo processStartInfo = new(senderButton == EmailButton ? "mailto:" : string.Empty + senderButton.ToolTip) { UseShellExecute = true };
|
||||||
MessageBox.Show($"{AboutConst._ReleasePagePasswordLabel} {AboutConst.ReleasePagePassword}");
|
|
||||||
|
|
||||||
ProcessStartInfo processStartInfo = new(senderButton == EmailButton ? "mailto:" : string.Empty + senderButton!.ToolTip) { UseShellExecute = true };
|
try { Process.Start(processStartInfo); }
|
||||||
Process.Start(processStartInfo);
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
processStartInfo.Verb = "RunAs";
|
||||||
|
Process.Start(processStartInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AboutWin_KeyDown(object sender, KeyEventArgs e)
|
private void AboutWin_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
@ -8,17 +8,12 @@
|
|||||||
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
|
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
|
||||||
xmlns:preses="clr-namespace:Sheas_Cealer.Preses"
|
xmlns:preses="clr-namespace:Sheas_Cealer.Preses"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance preses:MainPres}" AllowDrop="True"
|
AllowDrop="True"
|
||||||
Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SizeToContent="Height"
|
WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SizeToContent="Height"
|
||||||
Loaded="MainWin_Loaded" Closing="MainWin_Closing" DragEnter="MainWin_DragEnter" Drop="MainWin_Drop" KeyDown="MainWin_KeyDown">
|
d:DataContext="{d:DesignInstance preses:MainPres}"
|
||||||
<Window.Width>
|
Style="{DynamicResource CommonWindow}"
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainWinWidthConv}}"
|
||||||
<Binding.Converter>
|
SourceInitialized="MainWin_SourceInitialized" Loaded="MainWin_Loaded" Closing="MainWin_Closing" DragEnter="MainWin_DragEnter" Drop="MainWin_Drop" KeyDown="MainWin_KeyDown">
|
||||||
<convs:MainWinWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Window.Width>
|
|
||||||
|
|
||||||
<Grid Margin="5">
|
<Grid Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@ -35,328 +30,192 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Column="0" Margin="5" d:Content="# # # #" ToolTip="{Binding Source={x:Static consts:MainConst.SettingsModeButtonToolTip}}"
|
<Button Grid.Column="0" Margin="5" d:Content="# # # #"
|
||||||
Click="SettingsModeButton_Click">
|
Content="{Binding SettingsMode, Converter={x:Static convs:MainConv.MainSettingsModeButtonContentConv}}"
|
||||||
<Button.Content>
|
ToolTip="{x:Static consts:MainConst.SettingsModeButtonToolTip}"
|
||||||
<Binding Path="SettingsMode">
|
Click="SettingsModeButton_Click" />
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainSettingsModeButtonContentConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Content>
|
|
||||||
</Button>
|
|
||||||
<TextBox x:Name="SettingsBox"
|
<TextBox x:Name="SettingsBox"
|
||||||
Grid.Column="1" Margin="5" VerticalContentAlignment="Center" md:HintAssist.IsFloating="True"
|
Grid.Column="1" Margin="5" VerticalContentAlignment="Center" md:HintAssist.IsFloating="True"
|
||||||
|
AutomationProperties.Name="{Binding SettingsMode, Converter={x:Static convs:MainConv.MainSettingsBoxHintConv}}"
|
||||||
|
md:HintAssist.Hint="{Binding SettingsMode, Converter={x:Static convs:MainConv.MainSettingsBoxHintConv}}"
|
||||||
|
ToolTip="{Binding SettingsMode, Converter={x:Static convs:MainConv.MainSettingsBoxToolTipConv}}"
|
||||||
TextChanged="SettingsBox_TextChanged" PreviewDragOver="MainWin_DragEnter">
|
TextChanged="SettingsBox_TextChanged" PreviewDragOver="MainWin_DragEnter">
|
||||||
<TextBox.Text>
|
<TextBox.Text>
|
||||||
<MultiBinding Mode="OneWay" UpdateSourceTrigger="PropertyChanged">
|
<MultiBinding Mode="OneWay" UpdateSourceTrigger="PropertyChanged"
|
||||||
<MultiBinding.Converter>
|
Converter="{x:Static convs:MainConv.MainSettingsBoxTextConv}">
|
||||||
<convs:MainSettingsBoxTextConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="SettingsMode" />
|
<Binding Path="SettingsMode" />
|
||||||
<Binding Path="BrowserPath" />
|
<Binding Path="BrowserPath" />
|
||||||
<Binding Path="UpstreamUrl" />
|
<Binding Path="UpstreamUrl" />
|
||||||
<Binding Path="ExtraArgs" />
|
<Binding Path="ExtraArgs" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</TextBox.Text>
|
</TextBox.Text>
|
||||||
<TextBox.ToolTip>
|
|
||||||
<Binding Path="SettingsMode">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainSettingsBoxToolTipConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</TextBox.ToolTip>
|
|
||||||
<md:HintAssist.Hint>
|
|
||||||
<Binding Path="SettingsMode">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainSettingsBoxHintConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</md:HintAssist.Hint>
|
|
||||||
</TextBox>
|
</TextBox>
|
||||||
<Button Grid.Column="2" Margin="5" d:Content="# # # #" ToolTip="{Binding Source={x:Static consts:MainConst.SettingsFunctionButtonToolTip}}"
|
<Button Grid.Column="2" Margin="5" d:Content="# # # #"
|
||||||
Click="SettingsFunctionButton_Click">
|
Content="{Binding SettingsMode, Converter={x:Static convs:MainConv.MainSettingsFunctionButtonContentConv}}"
|
||||||
<Button.Content>
|
ToolTip="{x:Static consts:MainConst.SettingsFunctionButtonToolTip}"
|
||||||
<Binding Path="SettingsMode">
|
Click="SettingsFunctionButton_Click" />
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainSettingsFunctionButtonContentConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Content>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="1">
|
<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*" />
|
<ColumnDefinition Width="2*" />
|
||||||
<ColumnDefinition>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<ColumnDefinition.Width>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
<ColumnDefinition>
|
|
||||||
<ColumnDefinition.Width>
|
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button IsDefault="True"
|
<Button IsDefault="True"
|
||||||
Grid.Column="0" Margin="5" Content="{Binding Source={x:Static consts:MainConst.StartButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.StartButtonToolTip}}"
|
Grid.Column="0" Margin="5"
|
||||||
Click="StartButton_Click" PreviewMouseDown="StartButton_PreviewMouseDown">
|
Content="{x:Static consts:MainConst.BrowserButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:MainConst.BrowserButtonToolTip}"
|
||||||
|
Click="LaunchButton_Click" PreviewMouseDown="LaunchButton_PreviewMouseDown">
|
||||||
<Button.IsEnabled>
|
<Button.IsEnabled>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainBrowserButtonIsEnabledConv}">
|
||||||
<MultiBinding.Converter>
|
|
||||||
<convs:MainStartButtonIsEnabledConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="BrowserPath" />
|
<Binding Path="BrowserPath" />
|
||||||
<Binding Path="ExtraArgs" />
|
<Binding Path="ExtraArgs" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.IsEnabled>
|
</Button.IsEnabled>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="1" Margin="5" d:Content="# # # #"
|
<Button x:Name="NginxButton"
|
||||||
Click="NginxButton_Click" PreviewMouseDown="NginxButton_PreviewMouseDown">
|
Grid.Column="1" Margin="5" d:Content="# # # #"
|
||||||
<Button.Visibility>
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
Click="LaunchButton_Click" PreviewMouseDown="LaunchButton_PreviewMouseDown">
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainAdminControlVisibilityConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Visibility>
|
|
||||||
<Button.IsEnabled>
|
<Button.IsEnabled>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainNginxButtonIsEnabledConv}">
|
||||||
<MultiBinding.Converter>
|
<Binding Path="IsConginxExist" />
|
||||||
<convs:MainProxyButtonIsEnabledConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsNginxExist" />
|
<Binding Path="IsNginxExist" />
|
||||||
|
<Binding Path="IsCoproxyIniting" />
|
||||||
<Binding Path="IsNginxIniting" />
|
<Binding Path="IsNginxIniting" />
|
||||||
|
<Binding Path="IsComihomoIniting" />
|
||||||
|
<Binding Path="IsMihomoIniting" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.IsEnabled>
|
</Button.IsEnabled>
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainNginxButtonContentConv}">
|
||||||
<MultiBinding.Converter>
|
<Binding Path="IsConginxRunning" />
|
||||||
<convs:MainNginxButtonContentConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsNginxRunning" />
|
<Binding Path="IsNginxRunning" />
|
||||||
|
<Binding Path="IsCoproxyIniting" />
|
||||||
<Binding Path="IsNginxIniting" />
|
<Binding Path="IsNginxIniting" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.Content>
|
</Button.Content>
|
||||||
<Button.ToolTip>
|
<Button.ToolTip>
|
||||||
<Binding Path="IsNginxRunning">
|
<MultiBinding Converter="{x:Static convs:MainConv.MainNginxButtonToolTipConv}">
|
||||||
<Binding.Converter>
|
<Binding Path="IsConginxRunning" />
|
||||||
<convs:MainNginxButtonToolTipConv />
|
<Binding Path="IsNginxRunning" />
|
||||||
</Binding.Converter>
|
</MultiBinding>
|
||||||
</Binding>
|
|
||||||
</Button.ToolTip>
|
</Button.ToolTip>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="2" Margin="5" d:Content="# # # #"
|
<Button x:Name="MihomoButton"
|
||||||
Click="MihomoButton_Click" PreviewMouseDown="MihomoButton_PreviewMouseDown">
|
Grid.Column="2" Margin="5" d:Content="# # # #"
|
||||||
<Button.Visibility>
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
ToolTip="{Binding IsMihomoRunning, Converter={x:Static convs:MainConv.MainMihomoButtonToolTipConv}}"
|
||||||
<Binding.Converter>
|
Click="LaunchButton_Click" PreviewMouseDown="LaunchButton_PreviewMouseDown">
|
||||||
<convs:MainAdminControlVisibilityConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Visibility>
|
|
||||||
<Button.IsEnabled>
|
<Button.IsEnabled>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainMihomoButtonIsEnabledConv}">
|
||||||
<MultiBinding.Converter>
|
<Binding Path="IsComihomoExist" />
|
||||||
<convs:MainProxyButtonIsEnabledConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsMihomoExist" />
|
<Binding Path="IsMihomoExist" />
|
||||||
|
<Binding Path="IsCoproxyIniting" />
|
||||||
|
<Binding Path="IsComihomoIniting" />
|
||||||
<Binding Path="IsMihomoIniting" />
|
<Binding Path="IsMihomoIniting" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.IsEnabled>
|
</Button.IsEnabled>
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainMihomoButtonContentConv}">
|
||||||
<MultiBinding.Converter>
|
|
||||||
<convs:MainMihomoButtonContentConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsMihomoRunning" />
|
<Binding Path="IsMihomoRunning" />
|
||||||
|
<Binding Path="IsComihomoIniting" />
|
||||||
<Binding Path="IsMihomoIniting" />
|
<Binding Path="IsMihomoIniting" />
|
||||||
|
<Binding Path="IsCoproxyIniting" />
|
||||||
|
<Binding Path="IsCoproxyStopping" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.Content>
|
</Button.Content>
|
||||||
<Button.ToolTip>
|
|
||||||
<Binding Path="IsMihomoRunning">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainMihomoButtonToolTipConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.ToolTip>
|
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="2">
|
<Grid Grid.Row="2">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<ColumnDefinition.Width>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
<ColumnDefinition>
|
|
||||||
<ColumnDefinition.Width>
|
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button x:Name="EditLocalHostButton"
|
<Button x:Name="EditLocalHostButton"
|
||||||
Grid.Column="0" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditLocalHostButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditLocalHostButtonToolTip}}"
|
Grid.Column="0" Margin="5"
|
||||||
|
Content="{x:Static consts:MainConst.EditLocalHostButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:MainConst.EditLocalHostButtonToolTip}"
|
||||||
Click="EditHostButton_Click" />
|
Click="EditHostButton_Click" />
|
||||||
<Button Grid.Column="1" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditUpstreamHostButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditUpstreamHostButtonToolTip}}"
|
<Button Grid.Column="1" Margin="5"
|
||||||
|
Content="{x:Static consts:MainConst.EditUpstreamHostButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:MainConst.EditUpstreamHostButtonToolTip}"
|
||||||
Click="EditHostButton_Click" />
|
Click="EditHostButton_Click" />
|
||||||
<Button x:Name="EditNginxConfButton"
|
<Button x:Name="EditNginxConfButton"
|
||||||
Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditNginxConfButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditNginxConfButtonToolTip}}"
|
Grid.Column="2" Margin="5"
|
||||||
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
|
Content="{x:Static consts:MainConst.EditNginxConfButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:MainConst.EditNginxConfButtonToolTip}"
|
||||||
Click="EditConfButton_Click">
|
Click="EditConfButton_Click">
|
||||||
<Button.IsEnabled>
|
<Button.IsEnabled>
|
||||||
<MultiBinding>
|
<MultiBinding Converter="{x:Static convs:MainConv.MainNginxButtonIsEnabledConv}">
|
||||||
<MultiBinding.Converter>
|
<Binding Path="IsConginxExist" />
|
||||||
<convs:MainProxyButtonIsEnabledConv />
|
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsNginxExist" />
|
<Binding Path="IsNginxExist" />
|
||||||
|
<Binding Path="IsCoproxyIniting" />
|
||||||
<Binding Path="IsNginxIniting" />
|
<Binding Path="IsNginxIniting" />
|
||||||
</MultiBinding>
|
<Binding Path="IsComihomoIniting" />
|
||||||
</Button.IsEnabled>
|
<Binding Path="IsMihomoIniting" />
|
||||||
<Button.Visibility>
|
</MultiBinding>
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
</Button.IsEnabled>
|
||||||
<Binding.Converter>
|
</Button>
|
||||||
<convs:MainAdminControlVisibilityConv />
|
<Button Grid.Column="3" Margin="5"
|
||||||
</Binding.Converter>
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
</Binding>
|
Content="{x:Static consts:MainConst.EditMihomoConfButtonContent}"
|
||||||
</Button.Visibility>
|
ToolTip="{x:Static consts:MainConst.EditMihomoConfButtonToolTip}"
|
||||||
</Button>
|
Click="EditConfButton_Click">
|
||||||
<Button Grid.Column="3" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditMihomoConfButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditMihomoConfButtonToolTip}}"
|
<Button.IsEnabled>
|
||||||
Click="EditConfButton_Click">
|
<MultiBinding Converter="{x:Static convs:MainConv.MainMihomoButtonIsEnabledConv}">
|
||||||
<Button.IsEnabled>
|
<Binding Path="IsComihomoExist" />
|
||||||
<MultiBinding>
|
<Binding Path="IsMihomoExist" />
|
||||||
<MultiBinding.Converter>
|
<Binding Path="IsCoproxyIniting" />
|
||||||
<convs:MainProxyButtonIsEnabledConv />
|
<Binding Path="IsComihomoIniting" />
|
||||||
</MultiBinding.Converter>
|
|
||||||
|
|
||||||
<Binding Path="IsMihomoExist" />
|
|
||||||
<Binding Path="IsMihomoIniting" />
|
<Binding Path="IsMihomoIniting" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Button.IsEnabled>
|
</Button.IsEnabled>
|
||||||
<Button.Visibility>
|
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainAdminControlVisibilityConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Visibility>
|
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="3">
|
<Grid Grid.Row="3">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<ColumnDefinition.Width>
|
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Column="0" Margin="5" Content="{Binding Source={x:Static consts:MainConst.UpdateUpstreamHostButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.UpdateUpstreamHostButtonToolTip}}"
|
<Button Grid.Column="0" Margin="5" d:Content="# # # # # #"
|
||||||
Click="UpdateUpstreamHostButton_Click">
|
IsEnabled="{Binding UpstreamUrl, Converter={x:Static convs:MainConv.MainUpdateHostButtonIsEnabledConv}}"
|
||||||
<Button.IsEnabled>
|
Content="{Binding IsUpstreamHostUtd, Converter={x:Static convs:MainConv.MainUpdateHostButtonContentConv}}"
|
||||||
<Binding Path="UpstreamUrl">
|
ToolTip="{x:Static consts:MainConst.UpdateUpstreamHostButtonToolTip}"
|
||||||
<Binding.Converter>
|
Click="UpdateUpstreamHostButton_Click" />
|
||||||
<convs:MainUpdateHostButtonIsEnabledConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.IsEnabled>
|
|
||||||
</Button>
|
|
||||||
<Button x:Name="EditHostsConfButton"
|
<Button x:Name="EditHostsConfButton"
|
||||||
Grid.Column="1" Margin="5" Content="{Binding Source={x:Static consts:MainConst.EditHostsConfButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.EditHostsConfButtonToolTip}}"
|
Grid.Column="1" Margin="5"
|
||||||
Click="EditConfButton_Click">
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
<Button.Visibility>
|
Content="{x:Static consts:MainConst.EditHostsConfButtonContent}"
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
ToolTip="{x:Static consts:MainConst.EditHostsConfButtonToolTip}"
|
||||||
<Binding.Converter>
|
Click="EditConfButton_Click" />
|
||||||
<convs:MainAdminControlVisibilityConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Visibility>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Grid.Row="4">
|
<Grid Grid.Row="4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition>
|
<ColumnDefinition Width="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainProxyColumnWidthConv}}" />
|
||||||
<ColumnDefinition.Width>
|
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainProxyColumnWidthConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</ColumnDefinition.Width>
|
|
||||||
</ColumnDefinition>
|
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Column="0" Margin="5" d:Content="# # # #" ToolTip="{Binding Source={x:Static consts:MainConst.ThemesButtonToolTip}}"
|
<Button Grid.Column="0" Margin="5"
|
||||||
Click="ThemesButton_Click">
|
Content="{x:Static consts:MainConst.SettingsButtonContent}"
|
||||||
<Button.Content>
|
ToolTip="{x:Static consts:MainConst.SettingsButtonToolTip}"
|
||||||
<Binding Path="IsLightTheme">
|
Click="SettingsButton_Click" />
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainThemesButtonContentConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Content>
|
|
||||||
</Button>
|
|
||||||
<Button Focusable="False"
|
<Button Focusable="False"
|
||||||
Grid.Column="1" Margin="5" d:Content="# # # #"
|
Grid.Column="1" Margin="5" d:Content="# # # #"
|
||||||
Click="NoClickButton_Click" Cursor="Hand">
|
Visibility="{Binding Source={x:Static consts:MainConst.IsAdmin}, Converter={x:Static convs:MainConv.MainAdminControlVisibilityConv}}"
|
||||||
<Button.Visibility>
|
Content="{Binding IsFlashing, Converter={x:Static convs:MainConv.MainNoClickButtonContentConv}}"
|
||||||
<Binding Source="{x:Static consts:MainConst.IsAdmin}" Mode="OneTime">
|
ToolTip="{Binding IsFlashing, Converter={x:Static convs:MainConv.MainNoClickButtonToolTipConv}}"
|
||||||
<Binding.Converter>
|
Click="NoClickButton_Click" />
|
||||||
<convs:MainAdminControlVisibilityConv />
|
<Button Grid.Column="2" Margin="5"
|
||||||
</Binding.Converter>
|
Content="{x:Static consts:MainConst.AboutButtonContent}"
|
||||||
</Binding>
|
ToolTip="{x:Static consts:MainConst.AboutButtonToolTip}"
|
||||||
</Button.Visibility>
|
|
||||||
<Button.Content>
|
|
||||||
<Binding Path="IsFlashing">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainNoClickButtonContentConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.Content>
|
|
||||||
<Button.ToolTip>
|
|
||||||
<Binding Path="IsFlashing">
|
|
||||||
<Binding.Converter>
|
|
||||||
<convs:MainNoClickButtonToolTipConv />
|
|
||||||
</Binding.Converter>
|
|
||||||
</Binding>
|
|
||||||
</Button.ToolTip>
|
|
||||||
</Button>
|
|
||||||
<Button x:Name="AboutButton"
|
|
||||||
Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:MainConst.AboutButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.AboutButtonToolTip}}"
|
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
1005
Wins/MainWin.xaml.cs
1005
Wins/MainWin.xaml.cs
File diff suppressed because it is too large
Load Diff
41
Wins/SettingsWin.xaml
Normal file
41
Wins/SettingsWin.xaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<Window x:Class="Sheas_Cealer.Wins.SettingsWin"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:consts="clr-namespace:Sheas_Cealer.Consts"
|
||||||
|
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
|
||||||
|
xmlns:preses="clr-namespace:Sheas_Cealer.Preses"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="Height" Width="500"
|
||||||
|
d:DataContext="{d:DesignInstance preses:SettingsPres}"
|
||||||
|
Style="{DynamicResource CommonWindow}"
|
||||||
|
SourceInitialized="SettingsWin_SourceInitialized" KeyDown="SettingsWin_KeyDown">
|
||||||
|
<Grid Margin="5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Grid.Row="0" Grid.Column="0" Margin="5" d:Content="# # # #"
|
||||||
|
Content="{Binding IsLightTheme, Converter={x:Static convs:SettingsConv.SettingsThemesButtonContentConv}}"
|
||||||
|
ToolTip="{x:Static consts:SettingsConst.ThemesButtonToolTip}"
|
||||||
|
Click="ThemesButton_Click" />
|
||||||
|
<Button Grid.Row="0" Grid.Column="1" Margin="5" d:Content="# # # #"
|
||||||
|
Content="{Binding IsEnglishLang, Converter={x:Static convs:SettingsConv.SettingsLangsButtonContentConv}}"
|
||||||
|
ToolTip="{x:Static consts:SettingsConst.LangsButtonToolTip}"
|
||||||
|
Click="LangsButton_Click" />
|
||||||
|
<Button Grid.Row="1" Grid.Column="0" Margin="5"
|
||||||
|
Content="{x:Static consts:SettingsConst.ColorsButtonContent}"
|
||||||
|
ToolTip="{x:Static consts:SettingsConst.ColorsButtonToolTip}"
|
||||||
|
Click="ColorsButton_Click" />
|
||||||
|
<Button Grid.Row="1" Grid.Column="1" Margin="5" d:Content="# # # #"
|
||||||
|
Content="{Binding IsLightWeight, Converter={x:Static convs:SettingsConv.SettingsWeightsButtonContentConv}}"
|
||||||
|
ToolTip="{x:Static consts:SettingsConst.WeightsButtonToolTip}"
|
||||||
|
Click="WeightsButton_Click" />
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
65
Wins/SettingsWin.xaml.cs
Normal file
65
Wins/SettingsWin.xaml.cs
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
using MaterialDesignThemes.Wpf;
|
||||||
|
using Sheas_Cealer.Consts;
|
||||||
|
using Sheas_Cealer.Preses;
|
||||||
|
using Sheas_Cealer.Props;
|
||||||
|
using Sheas_Cealer.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Sheas_Cealer.Wins;
|
||||||
|
|
||||||
|
public partial class SettingsWin : Window
|
||||||
|
{
|
||||||
|
private readonly SettingsPres SettingsPres;
|
||||||
|
|
||||||
|
internal SettingsWin()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
DataContext = SettingsPres = new();
|
||||||
|
}
|
||||||
|
private void SettingsWin_SourceInitialized(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
IconRemover.RemoveIcon(this);
|
||||||
|
BorderThemeSetter.SetBorderTheme(this, SettingsPres.IsLightTheme);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ThemesButton_Click(object sender, RoutedEventArgs e) => SettingsPres.IsLightTheme = SettingsPres.IsLightTheme.HasValue ? SettingsPres.IsLightTheme.Value ? null : true : false;
|
||||||
|
private void LangsButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
SettingsPres.IsEnglishLang = SettingsPres.IsEnglishLang.HasValue ? SettingsPres.IsEnglishLang.Value ? null : true : false;
|
||||||
|
|
||||||
|
MessageBox.Show(SettingsConst._ChangeLangSuccessMsg);
|
||||||
|
}
|
||||||
|
private void ColorsButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Random random = new();
|
||||||
|
PaletteHelper paletteHelper = new();
|
||||||
|
Theme newTheme = paletteHelper.GetTheme();
|
||||||
|
Color newPrimaryColor = Color.FromRgb((byte)random.Next(256), (byte)random.Next(256), (byte)random.Next(256));
|
||||||
|
|
||||||
|
newTheme.SetPrimaryColor(newPrimaryColor);
|
||||||
|
paletteHelper.SetTheme(newTheme);
|
||||||
|
|
||||||
|
Style newButtonStyle = new(typeof(Button), Application.Current.Resources[typeof(Button)] as Style);
|
||||||
|
(Color? newForegroundColor, Color newAccentForegroundColor) = ForegroundGenerator.GetForeground(newPrimaryColor.R, newPrimaryColor.G, newPrimaryColor.B);
|
||||||
|
|
||||||
|
newButtonStyle.Setters.Add(new Setter(ForegroundProperty, newForegroundColor.HasValue ? new SolidColorBrush(newForegroundColor.Value) : new DynamicResourceExtension("MaterialDesignBackground")));
|
||||||
|
Application.Current.Resources[typeof(Button)] = newButtonStyle;
|
||||||
|
|
||||||
|
SettingsPres.AccentForegroundColor = newAccentForegroundColor;
|
||||||
|
|
||||||
|
Settings.Default.PrimaryColor = System.Drawing.Color.FromArgb(newPrimaryColor.A, newPrimaryColor.R, newPrimaryColor.G, newPrimaryColor.B);
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
private void WeightsButton_Click(object sender, RoutedEventArgs e) => SettingsPres.IsLightWeight = SettingsPres.IsLightWeight.HasValue ? SettingsPres.IsLightWeight.Value ? null : true : false;
|
||||||
|
|
||||||
|
private void SettingsWin_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Key.Escape)
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user