mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-13 21:02:08 +08:00
1.0.4 (beta) 更新
This commit is contained in:
parent
6c10f37f93
commit
76804a3be0
@ -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.0.3</AssemblyVersion>
|
<AssemblyVersion>1.0.4</AssemblyVersion>
|
||||||
<Version>1.0.3</Version>
|
<Version>1.0.4</Version>
|
||||||
<FileVersion>1.0.3</FileVersion>
|
<FileVersion>1.0.4</FileVersion>
|
||||||
<InformationalVersion>1.0.3</InformationalVersion>
|
<InformationalVersion>1.0.4</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>
|
||||||
@ -74,6 +74,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MaterialDesignThemes" Version="4.5.0" />
|
<PackageReference Include="MaterialDesignThemes" Version="4.5.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
|
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Row="0" Margin="5">
|
<Grid Grid.Row="0" Margin="5">
|
||||||
@ -21,17 +22,24 @@
|
|||||||
<Button x:Name="ViewButton" Grid.Column="2" Content="浏览" Click="ViewButton_Click" />
|
<Button x:Name="ViewButton" Grid.Column="2" Content="浏览" Click="ViewButton_Click" />
|
||||||
</Grid>
|
</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>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button x:Name="EditButton" Content="编辑" Grid.Column="0" Margin="0,0,5,0" Click="EditButton_Click" />
|
<Button x:Name="ConfigButton" Content="代理规则" Grid.Column="0" Margin="5,0,5,0" Click="ConfigButton_Click" />
|
||||||
<Button x:Name="ClashButton" Content="代理" Grid.Column="1" Margin="5,0,5,0" Click="ClashButton_Click" />
|
<Button x:Name="HostButton" Content="伪造规则" Grid.Column="1" Margin="5,0,5,0" Click="HostButton_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="2" Margin="5,0,5,0" Click="AboutButton_Click" />
|
||||||
<Button x:Name="AboutButton" Content="关于" Grid.Column="3" Margin="5,0,0,0" Click="AboutButton_Click" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
@ -9,6 +9,7 @@ using System.Windows.Threading;
|
|||||||
using IWshRuntimeLibrary;
|
using IWshRuntimeLibrary;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using YamlDotNet.RepresentationModel;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
|
|
||||||
namespace Sheas_Cealer
|
namespace Sheas_Cealer
|
||||||
@ -119,24 +120,19 @@ namespace Sheas_Cealer
|
|||||||
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
|
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)
|
private void ClashButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RegistryKey proxyKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true)!;
|
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("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 .");
|
new Clash().ShellRun(AppDomain.CurrentDomain.SetupInformation.ApplicationBase!, "-d .");
|
||||||
}
|
}
|
||||||
@ -172,14 +168,33 @@ namespace Sheas_Cealer
|
|||||||
}
|
}
|
||||||
catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); return; }
|
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 AboutButton_Click(object sender, RoutedEventArgs e) => new AboutWindow().ShowDialog();
|
||||||
|
|
||||||
private void MONITOR_TIMER_Tick(object? sender, EventArgs e)
|
private void MONITOR_TIMER_Tick(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Process.GetProcessesByName("Cealing-Clash").Length == 0)
|
if (Process.GetProcessesByName("Cealing-Clash").Length == 0)
|
||||||
ClashButton.Content = "代理";
|
ClashButton.Content = "启动代理";
|
||||||
else
|
else
|
||||||
ClashButton.Content = "停代";
|
ClashButton.Content = "停止代理";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CEALING_HOST_WATCHER_Changed(object sender, FileSystemEventArgs e)
|
private void CEALING_HOST_WATCHER_Changed(object sender, FileSystemEventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user