mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-29 07:27:36 +08:00
fix
This commit is contained in:
@@ -27,11 +27,10 @@ namespace System.Application.Services.Implementation
|
||||
Threading.Tasks.Task.Run(async () =>
|
||||
{
|
||||
var file = new FileInfo(Path.Combine(IOPath.AppDataDirectory, $@"sudoShell.js"));
|
||||
int index = 0;
|
||||
if (file.Exists)
|
||||
file.Delete();
|
||||
var vm = new UI.ViewModels.PasswordWindowViewModel();
|
||||
vm.SetTitle = AppResources.MacSudoPasswordTips;
|
||||
vm.Title = AppResources.MacSudoPasswordTips;
|
||||
await IShowWindowService.Instance.ShowDialog(CustomWindow.Password, vm, string.Empty, ResizeModeCompat.CanResize);
|
||||
var scriptContent = new Text.StringBuilder();
|
||||
scriptContent.AppendLine($"#!/bin/bash -e");
|
||||
|
||||
+1
-8
@@ -21,14 +21,7 @@ namespace System.Application.UI.ViewModels
|
||||
{
|
||||
get => _Password;
|
||||
set => this.RaiseAndSetIfChanged(ref _Password, value);
|
||||
}
|
||||
public string? SetTitle
|
||||
{
|
||||
get => Title;
|
||||
set {
|
||||
Title = value??"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string? ITextBoxWindowViewModel.Value { get => Password; set => Password = value; }
|
||||
|
||||
|
||||
@@ -337,7 +337,9 @@ namespace System.Application.Services.Implementation
|
||||
Toast.Show(SR.CreateCertificateFaild);
|
||||
return false;
|
||||
}
|
||||
|
||||
var filePath = Path.Combine(IOPath.AppDataDirectory, $@"{CertificateName}.Certificate.cer");
|
||||
try {
|
||||
proxyServer.CertificateManager.RootCertificate.SaveCerCertificateFile(filePath);
|
||||
|
||||
proxyServer.CertificateManager.TrustRootCertificate();
|
||||
@@ -347,6 +349,10 @@ namespace System.Application.Services.Implementation
|
||||
{
|
||||
//安装证书
|
||||
IPlatformService.Instance.AdminShell($"security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {filePath}");
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.Error("CerError", e,"证书安装失败");
|
||||
}
|
||||
return IsCertificateInstalled(proxyServer.CertificateManager.RootCertificate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user