mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 05:12:09 +08:00
Compare commits
1 Commits
master
...
1.0.4-beta
Author | SHA1 | Date | |
---|---|---|---|
![]() |
76804a3be0 |
@ -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>
|
||||
|
@ -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>
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user