mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
Compare commits
14 Commits
1.1.5-alph
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e1b1c606e1 | ||
![]() |
46de61c4f2 | ||
![]() |
479c16c2a1 | ||
![]() |
938ca77fc1 | ||
![]() |
d9e307e647 | ||
![]() |
85213b61da | ||
![]() |
bf7772a35f | ||
![]() |
188e56b57b | ||
![]() |
0150440de4 | ||
![]() |
c25888bd5a | ||
![]() |
a97b04e5d9 | ||
![]() |
b3dc94eb2b | ||
![]() |
597e441af5 | ||
![]() |
8a81ba59dc |
@ -10,7 +10,7 @@ internal abstract class AboutConst : AboutMultilangConst
|
||||
|
||||
public static string DeveloperButtonUrl => "https://www.spacetimee.xyz";
|
||||
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";
|
||||
public static string EmailButtonUrl => "Zeus6_6@163.com";
|
||||
|
||||
public static string DocumentationButtonUrl => "https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation";
|
||||
|
@ -40,10 +40,13 @@ internal abstract partial class MainConst : MainMultilangConst
|
||||
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 MihomoConfPath => Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "config.yaml");
|
||||
internal static string[] MihomoNameServers => ["https://doh.apad.pro/dns-query", "https://ns.net.kg/dns-query"];
|
||||
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.\-_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%]*)*$")]
|
||||
internal static partial Regex UpstreamUrlRegex();
|
||||
|
||||
|
@ -12,7 +12,7 @@ internal class AboutVersionButtonContentConv : IMultiValueConverter
|
||||
string versionButtonVersionContent = (string)values[1];
|
||||
bool isSheasCealerUtd = (bool)values[2];
|
||||
|
||||
return $"{versionButtonVersionContent} (alpha)" + (isSheasCealerUtd ? string.Empty : " *");
|
||||
return $"{versionButtonLabelContent} {versionButtonVersionContent}" + (isSheasCealerUtd ? string.Empty : " *");
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||
|
@ -8,12 +8,7 @@ internal class BrowserProc : Proc
|
||||
{
|
||||
private readonly bool ShutDownAppOnProcessExit;
|
||||
|
||||
internal BrowserProc(string browserPath, bool shutDownAppOnProcessExit) : base(browserPath)
|
||||
{
|
||||
ShutDownAppOnProcessExit = shutDownAppOnProcessExit;
|
||||
|
||||
Process_Exited(null, EventArgs.Empty);
|
||||
}
|
||||
internal BrowserProc(string browserPath, bool shutDownAppOnProcessExit) : base(browserPath) => ShutDownAppOnProcessExit = shutDownAppOnProcessExit;
|
||||
|
||||
protected sealed override void Process_Exited(object? sender, EventArgs e)
|
||||
{
|
||||
|
39
README.md
39
README.md
@ -6,9 +6,9 @@
|
||||
[English README](README_EN.md)
|
||||
|
||||
## 自我介绍
|
||||
**Sheas Cealer**: 一只基于 **WPF(.Net8)** 的 SNI 伪造工具
|
||||
**Sheas Cealer**: 一只基于 **WPF(.Net8)** 的桌面端 SNI 伪造工具
|
||||
|
||||
* 适用平台: Windows (Win10 之前的系统版本请使用 [1.1.0](https://github.com/SpaceTimee/Sheas-Cealer/releases/tag/1.1.0))
|
||||
* 适用平台: 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)**
|
||||
@ -17,24 +17,24 @@
|
||||
1. 内置伪造规则在 [Cealing Host 存储库](https://github.com/SpaceTimee/Cealing-Host) 持续更新
|
||||
2. Sheas Cealer 更新时不会覆盖已有的伪造规则,如需与上游同步,需点击**更新上游规则**按钮,或**手动修改覆盖**
|
||||
3. 本项目及所有相关资源仅供**抵御网络非法监听**和**开展网络安全研究**使用,无意绕过任何国家审查设备的审查
|
||||
4. 为避免不必要的麻烦,使用前请先阅读**注意事项**和**用户协议**
|
||||
4. 为避免不必要的麻烦,使用前请先阅读[**用户协议**](https://github.com/SpaceTimee/Sheas-Cealer#用户协议)
|
||||
5. Sheas Cealer 仍处于**开发阶段**,但每个正式版发布前会尽量确保其**稳定可用**
|
||||
6. Github Release 中会保留目前能够使用的**所有版本**,但强烈推荐使用**最新版**
|
||||
7. 注意事项第 3 条将从 2024.12.31 起正式严格执行
|
||||
|
||||
## 用户协议
|
||||
1. [隐私政策](https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#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)
|
||||
2. 蓝奏云 (密码 3wnj) (大陆推荐): [https://spacetime.lanzouu.com/b017hp0lc](https://spacetime.lanzouu.com/b017hp0lc)
|
||||
1. Github: [https://github.com/SpaceTimee/Sheas-Cealer/releases](https://github.com/SpaceTimee/Sheas-Cealer/releases)
|
||||
2. 群文件 (参与内测): 参考[联系方式](https://github.com/SpaceTimee/Sheas-Cealer#联系方式)
|
||||
|
||||
> 出于不可抗力因素,Sheas Cealer 暂时无法再提供蓝奏云下载地址,在此依旧感谢蓝奏云一直以来的免费分发服务
|
||||
|
||||
## 安装方式
|
||||
1. Setup 安装器 (首选): 下载 Sheas Cealer Setup.exe 并运行 -> 按照提示设置即可安装
|
||||
2. Zip 压缩包 (免安装): 下载 Sheas Cealer Zip.zip 并解压 -> 完成后即可直接使用
|
||||
|
||||
> Scd 版本: Scd 版本内置 .Net 运行时,可在缺乏 .Net 运行时的环境下运行,但代价是更大的文件体积以及更差跨平台能力,如果没有特殊原因,不建议使用 Scd 版本
|
||||
> Scd 版本: Scd 版本内置 .Net 运行时,可在缺乏 .Net 运行时的环境下运行,但代价是更大的文件体积以及更差的跨平台能力,如果没有特殊原因,不建议使用 Scd 版本
|
||||
|
||||
## 食用文档
|
||||
**[Sheas Cealer Documentation](https://github.com/SpaceTimee/Sheas-Cealer/wiki/Sheas-Cealer-Documentation)**
|
||||
@ -53,20 +53,19 @@
|
||||
**Space Time**
|
||||
|
||||
## 联系方式
|
||||
1. **QQ 群 (主群): 716266896,338919498**
|
||||
2. TG 群 (分群): [PixCealerChat](https://t.me/PixCealerChat)
|
||||
3. **邮箱: Zeus6_6@163.com**
|
||||
1. **QQ 群: 1034315671,716266896,338919498**
|
||||
2. **TG 群: [PixCealerChat](https://t.me/PixCealerChat)**
|
||||
3. 邮箱: Zeus6_6@163.com
|
||||
|
||||
## 相关项目
|
||||
1. [Cealing Host](https://github.com/SpaceTimee/Cealing-Host): 最新的 Sheas Cealer 内置伪造规则
|
||||
2. [Sheas Dop](https://github.com/SpaceTimee/Sheas-Dop): DNS 抗污染解析工具 (Sheas Cealer 全局净化子项目)
|
||||
3. [Sheas Nginx](https://github.com/SpaceTimee/Sheas-Nginx): Pixiv Nginx 启动器 (Sheas Cealer 全局伪造 × Pixiv Nginx 合作子项目)
|
||||
4. [Bot CealingCat](https://github.com/SpaceTimee/Bot-CealingCat): 提供 Sheas Cealer 相关服务的 Telegram Bot
|
||||
5. [Console HostChecker](https://github.com/SpaceTimee/Console-HostChecker): Cealing Host 自动化检查脚本
|
||||
6. [Console HostGenerator](https://github.com/SpaceTimee/Console-HostGenerator): Cealing Host 自动化生成脚本
|
||||
|
||||
## 推广合作
|
||||
[产品社区营](https://mp.weixin.qq.com/s?__biz=MzI3MTQ0ODQ3Ng==&mid=2247487284&idx=1&sn=94fcb19438ddba204c4fbe4803edc062&chksm=eb6ebe23f78ca1c3a360e8b46558c14cb8360ad199a19cbc1b4b4b8e2379c98699f2d6eca5da)
|
||||
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)
|
||||
|
34
README_EN.md
34
README_EN.md
@ -6,9 +6,9 @@
|
||||
[中文 README](README.md)
|
||||
|
||||
## About
|
||||
**Sheas Cealer**: A SNI concealing tool based on **WPF(.Net8)**
|
||||
**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))
|
||||
* 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)**
|
||||
@ -17,10 +17,8 @@
|
||||
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 **Notes** and **Agreements** before use
|
||||
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
|
||||
6. Github Release will retain **all versions** that can be used currently, but it is strongly recommended to use the **latest version**
|
||||
7. Note 3 will be officially and strictly implemented from 2024.12.31
|
||||
|
||||
## Agreements
|
||||
1. [Privacy Policy](https://thoughts.teambition.com/share/6264eda98adeb10041b92fda#title=Sheas_Cealer_隐私政策)
|
||||
@ -28,14 +26,16 @@
|
||||
|
||||
## Download
|
||||
1. Github (preferred): [https://github.com/SpaceTimee/Sheas-Cealer/releases](https://github.com/SpaceTimee/Sheas-Cealer/releases)
|
||||
2. Lanzou (password 3wnj) (recommended in mainland China): [https://spacetime.lanzouu.com/b017hp0lc](https://spacetime.lanzouu.com/b017hp0lc)
|
||||
2. Group File (participate in internal testing): Please refer to [Contacts](https://github.com/SpaceTimee/Sheas-Cealer#Contacts)
|
||||
|
||||
> 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
|
||||
> 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)**
|
||||
|
||||
@ -53,17 +53,19 @@ Using the startup parameter feature of the Chromium kernel to conceal SNI. For m
|
||||
**Space Time**
|
||||
|
||||
## Contacts
|
||||
1. **QQ Group (Main Group): 716266896, 338919498**
|
||||
2. TG Group (Sub Group): [PixCealerChat](https://t.me/PixCealerChat)
|
||||
3. **Email: Zeus6_6@163.com**
|
||||
1. **QQ Group: 1034315671, 716266896, 338919498**
|
||||
2. **TG Group: [PixCealerChat](https://t.me/PixCealerChat)**
|
||||
3. Email: Zeus6_6@163.com
|
||||
|
||||
## Projects
|
||||
1. [Cealing Host](https://github.com/SpaceTimee/Cealing-Host): The latest Built-in Cealing Host
|
||||
2. [Sheas Dop](https://github.com/SpaceTimee/Sheas-Dop): DNS anti-pollution resolution tool (Sheas Cealer Global Cealing subproject)
|
||||
3. [Sheas Nginx](https://github.com/SpaceTimee/Sheas-Nginx): Pixiv Nginx launcher (Sheas Cealer Global Purging × Pixiv Nginx cooperative subproject)
|
||||
4. [Bot CealingCat](https://github.com/SpaceTimee/Bot-CealingCat): Telegram Bot providing Sheas Cealer related services
|
||||
5. [Console HostChecker](https://github.com/SpaceTimee/Console-HostChecker): Cealing Host automated checking script
|
||||
6. [Console HostGenerator](https://github.com/SpaceTimee/Console-HostGenerator): Cealing Host automated generation script
|
||||
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)
|
||||
|
@ -30,20 +30,13 @@
|
||||
<UseWindowsForms>True</UseWindowsForms>
|
||||
<IsPublishable>True</IsPublishable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<ErrorReport>none</ErrorReport>
|
||||
<NoWin32Manifest>true</NoWin32Manifest>
|
||||
<AppDesignerFolder>Props</AppDesignerFolder>
|
||||
<NeutralLanguage>en</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="bin\**" />
|
||||
<EmbeddedResource Remove="bin\**" />
|
||||
@ -51,10 +44,6 @@
|
||||
<Page Remove="bin\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Remove="app.manifest" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove=".filenesting.json" />
|
||||
<None Remove=".gitattributes" />
|
||||
@ -73,44 +62,37 @@
|
||||
|
||||
<ItemGroup>
|
||||
<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 Include="Sheas-Core">
|
||||
<HintPath>..\Sheas-Core\bin\Release\net8.0-windows10.0.26100.0\Sheas-Core.dll</HintPath>
|
||||
<HintPath>..\Sheas-Core\bin\Release\net8.0\Sheas-Core.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Consts\AboutMultilangConst.Designer.cs">
|
||||
<Compile Update="Consts\MainMultilangConst.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>AboutMultilangConst.resx</DependentUpon>
|
||||
<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">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>AboutMultilangConst.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Props\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Consts\MainMultilangConst.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>MainMultilangConst.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Wins\SettingsWin.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Consts\AboutMultilangConst.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AboutMultilangConst.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Consts\MainMultilangConst.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>MainMultilangConst.Designer.cs</LastGenOutput>
|
||||
@ -119,9 +101,10 @@
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>SettingsMultilangConst.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Consts\AboutMultilangConst.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AboutMultilangConst.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Update="Props\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
@ -2,44 +2,34 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sheas_Cealer.Utils;
|
||||
|
||||
internal static class NginxCleaner
|
||||
{
|
||||
internal static readonly SemaphoreSlim IsNginxCleaningSemaphore = new(1);
|
||||
|
||||
internal static async Task Clean()
|
||||
{
|
||||
if (!await IsNginxCleaningSemaphore.WaitAsync(0))
|
||||
return;
|
||||
string hostsContent = await File.ReadAllTextAsync(MainConst.HostsConfPath);
|
||||
int hostsConfStartIndex = hostsContent.IndexOf(MainConst.HostsConfStartMarker, StringComparison.Ordinal);
|
||||
int hostsConfEndIndex = hostsContent.LastIndexOf(MainConst.HostsConfEndMarker, StringComparison.Ordinal);
|
||||
|
||||
try
|
||||
{
|
||||
string hostsContent = await File.ReadAllTextAsync(MainConst.HostsConfPath);
|
||||
int hostsConfStartIndex = hostsContent.IndexOf(MainConst.HostsConfStartMarker, StringComparison.Ordinal);
|
||||
int hostsConfEndIndex = hostsContent.LastIndexOf(MainConst.HostsConfEndMarker, StringComparison.Ordinal);
|
||||
if (hostsConfStartIndex != -1 && hostsConfEndIndex != -1)
|
||||
await File.WriteAllTextAsync(MainConst.HostsConfPath, hostsContent.Remove(hostsConfStartIndex, hostsConfEndIndex - hostsConfStartIndex + MainConst.HostsConfEndMarker.Length));
|
||||
|
||||
if (hostsConfStartIndex != -1 && hostsConfEndIndex != -1)
|
||||
await File.WriteAllTextAsync(MainConst.HostsConfPath, hostsContent.Remove(hostsConfStartIndex, hostsConfEndIndex - hostsConfStartIndex + MainConst.HostsConfEndMarker.Length));
|
||||
using X509Store certStore = new(StoreName.Root, StoreLocation.LocalMachine, OpenFlags.ReadWrite);
|
||||
|
||||
using X509Store certStore = new(StoreName.Root, StoreLocation.CurrentUser, OpenFlags.ReadWrite);
|
||||
foreach (X509Certificate2 storedCert in certStore.Certificates)
|
||||
if (storedCert.Subject == MainConst.NginxRootCertSubjectName)
|
||||
while (true)
|
||||
try
|
||||
{
|
||||
certStore.Remove(storedCert);
|
||||
|
||||
foreach (X509Certificate2 storedCert in certStore.Certificates)
|
||||
if (storedCert.Subject == MainConst.NginxRootCertSubjectName)
|
||||
while (true)
|
||||
try
|
||||
{
|
||||
certStore.Remove(storedCert);
|
||||
break;
|
||||
}
|
||||
catch { }
|
||||
|
||||
break;
|
||||
}
|
||||
catch { }
|
||||
|
||||
certStore.Close();
|
||||
}
|
||||
finally { IsNginxCleaningSemaphore.Release(); }
|
||||
certStore.Close();
|
||||
}
|
||||
}
|
@ -29,8 +29,7 @@
|
||||
Content="{x:Static consts:AboutConst.DeveloperButtonContent}"
|
||||
ToolTip="{x:Static consts:AboutConst.DeveloperButtonUrl}"
|
||||
Click="AboutButton_Click" />
|
||||
<Button x:Name="VersionButton"
|
||||
Grid.Row="1" Grid.Column="0" Margin="5" d:Content="# # #: #.#.#"
|
||||
<Button Grid.Row="1" Grid.Column="0" Margin="5" d:Content="# # #: #.#.#"
|
||||
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}"
|
||||
|
@ -53,9 +53,6 @@ public partial class AboutWin : Window
|
||||
{
|
||||
Button senderButton = (Button)sender;
|
||||
|
||||
if (senderButton == VersionButton)
|
||||
MessageBox.Show($"{AboutConst._ReleasePagePasswordLabel} 3wnj");
|
||||
|
||||
ProcessStartInfo processStartInfo = new(senderButton == EmailButton ? "mailto:" : string.Empty + senderButton.ToolTip) { UseShellExecute = true };
|
||||
|
||||
try { Process.Start(processStartInfo); }
|
||||
|
@ -185,7 +185,7 @@ public partial class MainWin : Window
|
||||
{
|
||||
HoldButtonTimer?.Stop();
|
||||
|
||||
if ((CealHostRulesDict.ContainsValue(null!) && MessageBox.Show(MainConst._CealHostErrorPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
|
||||
if ((CealHostRulesDict.ContainsValue(null) && MessageBox.Show(MainConst._CealHostErrorPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes) ||
|
||||
(sender is not true && MessageBox.Show(MainConst._KillBrowserProcessPrompt, string.Empty, MessageBoxButton.YesNo) != MessageBoxResult.Yes))
|
||||
return;
|
||||
|
||||
@ -206,9 +206,6 @@ public partial class MainWin : Window
|
||||
|
||||
if (!MainPres.IsConginxRunning && !MainPres.IsNginxRunning)
|
||||
{
|
||||
if (NginxCleaner.IsNginxCleaningSemaphore.CurrentCount == 0 || !await IsNginxLaunchingSemaphore.WaitAsync(0))
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
if ((!MainPres.IsConginxExist && !MainPres.IsNginxExist) ||
|
||||
@ -238,7 +235,7 @@ public partial class MainWin : Window
|
||||
rootCertRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, false));
|
||||
|
||||
using X509Certificate2 rootCert = rootCertRequest.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(100));
|
||||
using X509Store certStore = new(StoreName.Root, StoreLocation.CurrentUser, OpenFlags.ReadWrite);
|
||||
using X509Store certStore = new(StoreName.Root, StoreLocation.LocalMachine, OpenFlags.ReadWrite);
|
||||
|
||||
certStore.Add(rootCert);
|
||||
certStore.Close();
|
||||
@ -690,7 +687,7 @@ public partial class MainWin : Window
|
||||
}
|
||||
private async void CealHostWatcher_Changed(object sender, FileSystemEventArgs e)
|
||||
{
|
||||
string cealHostName = e.Name!.TrimStart("Cealing-Host-".ToCharArray()).TrimEnd(".json".ToCharArray());
|
||||
string cealHostName = MainConst.CealHostPrefixRegex().Replace(Path.GetFileNameWithoutExtension(e.Name!), string.Empty);
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user