1.1.1 -> 1.1.2 第48次更新

This commit is contained in:
Space Time 2024-10-07 11:48:38 +08:00
parent 517ff4c3b3
commit 158ee04adc
3 changed files with 9 additions and 7 deletions

View File

@ -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.1</AssemblyVersion> <AssemblyVersion>1.1.2</AssemblyVersion>
<Version>1.1.1</Version> <Version>1.1.2</Version>
<FileVersion>1.1.1</FileVersion> <FileVersion>1.1.2</FileVersion>
<InformationalVersion>1.1.1</InformationalVersion> <InformationalVersion>1.1.2</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>

View File

@ -24,5 +24,7 @@ internal class NginxProc : Proc
foreach (X509Certificate2 storedCert in certStore.Certificates) foreach (X509Certificate2 storedCert in certStore.Certificates)
if (storedCert.Subject == MainConst.NginxRootCertSubjectName) if (storedCert.Subject == MainConst.NginxRootCertSubjectName)
certStore.Remove(storedCert); certStore.Remove(storedCert);
certStore.Close();
} }
} }

View File

@ -57,7 +57,6 @@ public partial class MainWin : Window
NginxConfWatcher.Changed += NginxConfWatcher_Changed; NginxConfWatcher.Changed += NginxConfWatcher_Changed;
MihomoConfWatcher.Changed += MihomoConfWatcher_Changed; MihomoConfWatcher.Changed += MihomoConfWatcher_Changed;
} }
protected override void OnSourceInitialized(EventArgs e) => IconRemover.RemoveIcon(this); protected override void OnSourceInitialized(EventArgs e) => IconRemover.RemoveIcon(this);
private async void MainWin_Loaded(object sender, RoutedEventArgs e) private async void MainWin_Loaded(object sender, RoutedEventArgs e)
{ {
@ -196,7 +195,7 @@ public partial class MainWin : Window
CertificateRequest rootCertRequest = new(MainConst.NginxRootCertSubjectName, certKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); CertificateRequest rootCertRequest = new(MainConst.NginxRootCertSubjectName, certKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
rootCertRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, false)); rootCertRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, false));
X509Certificate2 rootCert = rootCertRequest.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(100)); 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.CurrentUser, OpenFlags.ReadWrite);
certStore.Add(rootCert); certStore.Add(rootCert);
@ -236,7 +235,7 @@ public partial class MainWin : Window
} }
childCertRequest.CertificateExtensions.Add(childCertSanBuilder.Build()); childCertRequest.CertificateExtensions.Add(childCertSanBuilder.Build());
X509Certificate2 childCert = childCertRequest.Create(rootCert, rootCert.NotBefore, rootCert.NotAfter, Guid.NewGuid().ToByteArray()); using X509Certificate2 childCert = childCertRequest.Create(rootCert, rootCert.NotBefore, rootCert.NotAfter, Guid.NewGuid().ToByteArray());
File.WriteAllText(MainConst.NginxCertPath, childCert.ExportCertificatePem()); File.WriteAllText(MainConst.NginxCertPath, childCert.ExportCertificatePem());
File.WriteAllText(MainConst.NginxKeyPath, certKey.ExportPkcs8PrivateKeyPem()); File.WriteAllText(MainConst.NginxKeyPath, certKey.ExportPkcs8PrivateKeyPem());
@ -362,6 +361,7 @@ public partial class MainWin : Window
private void EditConfButton_Click(object sender, RoutedEventArgs e) private void EditConfButton_Click(object sender, RoutedEventArgs e)
{ {
Button? senderButton = sender as Button; Button? senderButton = sender as Button;
string confPath = senderButton == EditHostsConfButton ? MainConst.HostsConfPath : string confPath = senderButton == EditHostsConfButton ? MainConst.HostsConfPath :
senderButton == EditNginxConfButton ? MainConst.NginxConfPath : MainConst.MihomoConfPath; senderButton == EditNginxConfButton ? MainConst.NginxConfPath : MainConst.MihomoConfPath;