1.0.4 (beta) 更新

This commit is contained in:
Space Time 2022-05-19 13:11:29 +08:00
parent 6c10f37f93
commit 202aba02f0
4 changed files with 49 additions and 25 deletions

View File

@ -12,7 +12,7 @@
## 注意事项
1. 最新的 **Cealing-Host.json** 内置伪造规则可在 [Cealing Host 存储库](https://github.com/SpaceTimee/Cealing-Host) 获取
2. 自动更新时不会覆盖已有的 **Cealing-Host.json** 文件,如有需要应**手动覆盖或修改**
2. 自动更新时不会覆盖已有的 **Cealing-Host.json** **config.yaml** 文件,如有需要应**手动覆盖或修改**
3. 本项目仅供**学习参考**,无意绕过任何审查设备的审查
4. 为避免不必要的麻烦,食用前请先阅读**注意事项**和**用户协议**
5. Sheas Cealer 仍处于**开发阶段**,但每个正式版发布前会尽量确保其**稳定可用**
@ -49,7 +49,7 @@
## 联系方式
1. **新 QQ 群 (主群): 338919498**
2. 新 TG 群 (分群) (宽松管理) (低情商: 懒得管): [PixCealerChat](https://t.me/PixCealerChat)
2. 新 TG 群 (分群) (宽松管理): [PixCealerChat](https://t.me/PixCealerChat)
3. **邮箱: Zeus6_6@163.com**
## 许可证

View File

@ -8,10 +8,10 @@
<PackageReleaseNotes>Just Ceal It</PackageReleaseNotes>
<Authors>Space Time</Authors>
<Company>Space Time</Company>
<AssemblyVersion>1.0.3</AssemblyVersion>
<Version>1.0.3</Version>
<FileVersion>1.0.3</FileVersion>
<InformationalVersion>1.0.3</InformationalVersion>
<AssemblyVersion>1.0.4</AssemblyVersion>
<Version>1.0.4</Version>
<FileVersion>1.0.4</FileVersion>
<InformationalVersion>1.0.4</InformationalVersion>
<PackageTags>Tool;Sheas;Cealer;Sni</PackageTags>
<ApplicationIcon>Sheas-Cealer-Logo.ico</ApplicationIcon>
<PackageIcon>Sheas Cealer Logo.png</PackageIcon>
@ -74,6 +74,7 @@
<ItemGroup>
<PackageReference Include="MaterialDesignThemes" Version="4.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>
<ItemGroup>

View File

@ -10,6 +10,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="5">
@ -21,17 +22,24 @@
<Button x:Name="ViewButton" Grid.Column="2" Content="浏览" Click="ViewButton_Click" />
</Grid>
<Grid Grid.Row="1" Margin="5">
<Grid Grid.Row="1" Margin="0,5,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="ClashButton" Content="启动代理" Grid.Column="0" Margin="5,0,5,0" Click="ClashButton_Click" />
<Button x:Name="OpenButton" Content="启动伪造" Grid.Column="1" Margin="5,0,5,0" IsDefault="True" IsEnabled="False" Click="OpenButton_Click" />
</Grid>
<Grid Grid.Row="2" Margin="0,5,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button x:Name="EditButton" Content="编辑" Grid.Column="0" Margin="0,0,5,0" Click="EditButton_Click" />
<Button x:Name="ClashButton" Content="代理" Grid.Column="1" Margin="5,0,5,0" Click="ClashButton_Click" />
<Button x:Name="OpenButton" Content="启动" Grid.Column="2" Margin="5,0,5,0" IsDefault="True" IsEnabled="False" Click="OpenButton_Click" />
<Button x:Name="AboutButton" Content="关于" Grid.Column="3" Margin="5,0,0,0" Click="AboutButton_Click" />
<Button x:Name="ConfigButton" Content="代理规则" Grid.Column="0" Margin="5,0,5,0" Click="ConfigButton_Click" />
<Button x:Name="HostButton" Content="伪造规则" Grid.Column="1" Margin="5,0,5,0" Click="HostButton_Click" />
<Button x:Name="AboutButton" Content="关于项目" Grid.Column="2" Margin="5,0,5,0" Click="AboutButton_Click" />
</Grid>
</Grid>
</Window>

View File

@ -9,6 +9,7 @@ using System.Windows.Threading;
using IWshRuntimeLibrary;
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using YamlDotNet.RepresentationModel;
using File = System.IO.File;
namespace Sheas_Cealer
@ -119,24 +120,19 @@ namespace Sheas_Cealer
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
}
private void EditButton_Click(object sender, RoutedEventArgs e)
{
try
{
ProcessStartInfo processStartInfo = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json")) { UseShellExecute = true };
Process.Start(processStartInfo);
}
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
}
private void ClashButton_Click(object sender, RoutedEventArgs e)
{
try
{
RegistryKey proxyKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true)!;
if (ClashButton.Content.ToString() == "代理")
if (ClashButton.Content.ToString() == "启动代理")
{
YamlStream configStream = new();
configStream.Load(File.OpenText(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"config.yaml")));
YamlMappingNode configMap = (YamlMappingNode)configStream.Documents[0].RootNode;
proxyKey.SetValue("ProxyEnable", 1);
proxyKey.SetValue("ProxyServer", "127.0.0.1:7880");
proxyKey.SetValue("ProxyServer", "127.0.0.1:" + configMap["mixed-port"]);
new Clash().ShellRun(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "-d .");
}
@ -172,14 +168,33 @@ namespace Sheas_Cealer
}
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
}
private void ConfigButton_Click(object sender, RoutedEventArgs e)
{
try
{
ProcessStartInfo processStartInfo = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"config.yaml")) { UseShellExecute = true };
Process.Start(processStartInfo);
}
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
}
private void HostButton_Click(object sender, RoutedEventArgs e)
{
try
{
ProcessStartInfo processStartInfo = new(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, @"Cealing-Host.json")) { UseShellExecute = true };
Process.Start(processStartInfo);
}
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
}
private void AboutButton_Click(object sender, RoutedEventArgs e) => new AboutWindow().ShowDialog();
private void MONITOR_TIMER_Tick(object? sender, EventArgs e)
{
if (Process.GetProcessesByName("Cealing-Clash").Length == 0)
ClashButton.Content = "代理";
ClashButton.Content = "启动代理";
else
ClashButton.Content = "停代";
ClashButton.Content = "停";
}
private void CEALING_HOST_WATCHER_Changed(object sender, FileSystemEventArgs e)