diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml
index 2bf568e4e..71a241619 100644
--- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml
+++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/GameListPage.axaml
@@ -209,11 +209,11 @@
-
+
-
+
@@ -247,14 +247,18 @@
-
+
+
+
+
diff --git a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
index e41fefa30..6f22e96e9 100644
--- a/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
+++ b/src/ST.Client.Desktop.Avalonia/ST.Client.Desktop.Avalonia.csproj
@@ -58,5 +58,17 @@
GameRelatedPage.axaml
+
+ HideAppWindow.axaml
+
+
+ IdleAppWindow.axaml
+
+
+ EncryptionAuthWindow.axaml
+
+
+ ExportAuthWindow.axaml
+
\ No newline at end of file
diff --git a/src/ST.Client.Desktop/CustomWindow.cs b/src/ST.Client.Desktop/CustomWindow.cs
index 0913e4615..d20856a06 100644
--- a/src/ST.Client.Desktop/CustomWindow.cs
+++ b/src/ST.Client.Desktop/CustomWindow.cs
@@ -10,6 +10,7 @@ namespace System.Application
AddAuth,
ShowAuth,
AuthTrade,
+ EncryptionAuth,
ScriptStore,
ChangeBindPhoneNumber,
UserProfile,
diff --git a/src/ST.Client.Desktop/Services/Implementation/SteamServiceImpl.cs b/src/ST.Client.Desktop/Services/Implementation/SteamServiceImpl.cs
index 674d3534e..faa896853 100644
--- a/src/ST.Client.Desktop/Services/Implementation/SteamServiceImpl.cs
+++ b/src/ST.Client.Desktop/Services/Implementation/SteamServiceImpl.cs
@@ -72,15 +72,15 @@ namespace System.Application.Services.Implementation
public void KillSteamProcess()
{
- var processes = Process.GetProcesses();
- foreach (var p in processes)
+ foreach (var p in steamProcess)
{
- if (steamProcess.Contains(p.ProcessName, StringComparer.OrdinalIgnoreCase))
+ var process = Process.GetProcessesByName(p).FirstOrDefault();
+ if (process != null)
{
- if (p.HasExited == false)
+ if (process.HasExited == false)
{
- p.Kill();
- p.WaitForExit();
+ process.Kill();
+ process.WaitForExit();
}
}
}
@@ -110,14 +110,9 @@ namespace System.Application.Services.Implementation
public int? GetSteamProcessPid()
{
- var processes = Process.GetProcesses();
- foreach (var p in processes)
- {
- if (string.Equals(p.ProcessName, steamProcess[0], StringComparison.OrdinalIgnoreCase))
- {
- return p.Id;
- }
- }
+ var processes = Process.GetProcessesByName(steamProcess[0]);
+ if (processes.Any_Nullable())
+ return processes.First().Id;
return default;
}
diff --git a/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs b/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs
index b6ead7fe0..c577f13e5 100644
--- a/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs
+++ b/src/ST.Client.Desktop/UI/Resx/AppResources.Designer.cs
@@ -1422,6 +1422,87 @@ namespace System.Application.UI.Resx {
}
}
+ ///
+ /// 查找类似 令牌加密 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 启用自定义密码保护 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_EnablePassword {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_EnablePassword", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 您的认证器将使用您自己的密码进行加密,您需要输入您的密码才能打开WinAuth。如果您忘记了密码,并且没有备份,您的认证器将无法访问。 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_EnablePasswordTip {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_EnablePasswordTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 强烈建议使用密码保护你的认证器,否则您的数据可能会被您电脑上运行的恶意软件读取和窃取。当然,你也可以不启用任何加密,这不是强制性的,但你的令牌数据会有被盗取的风险。 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_Info {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_Info", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 启用令牌仅在这台电脑上可解密 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_IsOnlyCurrentComputerEncrypt {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_IsOnlyCurrentComputerEncrypt", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 此外,你可以使用内置的Windows账户加密来保护和加密你的数据。这将把您的认证器锁定在这台计算机或用户上,因此即使文件被复制,也无法打开它们。如果你要重新格式化你的磁盘,重新安装Windows或删除这个用户账户,你必须把这个功能关掉。 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_IsOnlyCurrentComputerEncryptTip {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_IsOnlyCurrentComputerEncryptTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 自定义密码 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_Password {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_Password", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 保存并应用 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_SaveApply {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_SaveApply", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 再次输入密码 的本地化字符串。
+ ///
+ public static string LocalAuth_ProtectionAuth_VerifyPassword {
+ get {
+ return ResourceManager.GetString("LocalAuth_ProtectionAuth_VerifyPassword", resourceCulture);
+ }
+ }
+
///
/// 查找类似 令牌数据加载完成 的本地化字符串。
///
diff --git a/src/ST.Client.Desktop/UI/Resx/AppResources.resx b/src/ST.Client.Desktop/UI/Resx/AppResources.resx
index fe688ce09..74719a243 100644
--- a/src/ST.Client.Desktop/UI/Resx/AppResources.resx
+++ b/src/ST.Client.Desktop/UI/Resx/AppResources.resx
@@ -576,6 +576,33 @@
其它软件导入
+
+ 令牌加密
+
+
+ 启用自定义密码保护
+
+
+ 您的认证器将使用您自己的密码进行加密,您需要输入您的密码才能打开WinAuth。如果您忘记了密码,并且没有备份,您的认证器将无法访问。
+
+
+ 强烈建议使用密码保护你的认证器,否则您的数据可能会被您电脑上运行的恶意软件读取和窃取。当然,你也可以不启用任何加密,这不是强制性的,但你的令牌数据会有被盗取的风险。
+
+
+ 启用令牌仅在这台电脑上可解密
+
+
+ 此外,你可以使用内置的Windows账户加密来保护和加密你的数据。这将把您的认证器锁定在这台计算机或用户上,因此即使文件被复制,也无法打开它们。如果你要重新格式化你的磁盘,重新安装Windows或删除这个用户账户,你必须把这个功能关掉。
+
+
+ 自定义密码
+
+
+ 保存并应用
+
+
+ 再次输入密码
+
令牌数据加载完成
diff --git a/src/ST.Client.Desktop/UI/ViewModels/Pages/LocalAuthPageViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Pages/LocalAuthPageViewModel.cs
index 3c08d1e18..9a0e7d8ec 100644
--- a/src/ST.Client.Desktop/UI/ViewModels/Pages/LocalAuthPageViewModel.cs
+++ b/src/ST.Client.Desktop/UI/ViewModels/Pages/LocalAuthPageViewModel.cs
@@ -1,4 +1,4 @@
-using ReactiveUI;
+using ReactiveUI;
using System.Application.Models;
using System.Application.Services;
using System.Application.UI.Resx;
@@ -23,6 +23,8 @@ namespace System.Application.UI.ViewModels
AddAuthCommand = ReactiveCommand.Create(AddAuthMenu_Click);
RefreshAuthCommand = ReactiveCommand.Create(() => AuthService.Current.Initialize(true));
+ EncryptionAuthCommand = ReactiveCommand.Create(ShowEncryptionAuthWindow);
+
MenuItems = new ObservableCollection()
{
//new MenuItemViewModel(nameof(AppResources.LocalAuth_EditAuth))
@@ -31,6 +33,8 @@ namespace System.Application.UI.ViewModels
// {
new MenuItemViewModel(nameof(AppResources.Add)) { IconKey="AddDrawing",
Command= AddAuthCommand },
+ new MenuItemViewModel(nameof(AppResources.Encrypt)) {IconKey="LockDrawing",
+ Command =EncryptionAuthCommand },
//new MenuItemViewModel(nameof(AppResources.Edit)) { IconKey="EditDrawing" },
//new MenuItemViewModel(nameof(AppResources.Export)) { IconKey="ExportDrawing",
// Command= RefreshAuthCommand },
@@ -66,6 +70,9 @@ namespace System.Application.UI.ViewModels
public bool IsAuthenticatorsEmpty => !AuthService.Current.Authenticators.Items.Any_Nullable();
public ReactiveCommand AddAuthCommand { get; }
+
+ public ReactiveCommand EncryptionAuthCommand { get; }
+
public ReactiveCommand RefreshAuthCommand { get; }
//internal async override Task Initialize()
@@ -135,5 +142,11 @@ namespace System.Application.UI.ViewModels
IShowWindowService.Instance.Show(CustomWindow.AuthTrade, new AuthTradeWindowViewModel(auth), string.Empty, ResizeModeCompat.CanResize);
}
}
+
+ public void ShowEncryptionAuthWindow()
+ {
+ IShowWindowService.Instance.Show(CustomWindow.EncryptionAuth, new EncryptionAuthWindowViewModel(), string.Empty, ResizeModeCompat.CanResize);
+ }
+
}
}
diff --git a/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/HideAppWindowViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/HideAppWindowViewModel.cs
new file mode 100644
index 000000000..638fb6b56
--- /dev/null
+++ b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/HideAppWindowViewModel.cs
@@ -0,0 +1,19 @@
+using Newtonsoft.Json.Linq;
+using System.Application.Models;
+using System.Application.UI.Resx;
+using System.Properties;
+
+namespace System.Application.UI.ViewModels
+{
+ public class HideAppWindowViewModel : WindowViewModel
+ {
+ public HideAppWindowViewModel() : base()
+ {
+ Title = ThisAssembly.AssemblyTrademark + " | " + AppResources.GameList_EditAppInfo;
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs
new file mode 100644
index 000000000..48e43c009
--- /dev/null
+++ b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs
@@ -0,0 +1,19 @@
+using Newtonsoft.Json.Linq;
+using System.Application.Models;
+using System.Application.UI.Resx;
+using System.Properties;
+
+namespace System.Application.UI.ViewModels
+{
+ public class IdleAppWindowViewModel : WindowViewModel
+ {
+ public IdleAppWindowViewModel() : base()
+ {
+ Title = ThisAssembly.AssemblyTrademark + " | " + AppResources.GameList_EditAppInfo;
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/EncryptionAuthWindowViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/EncryptionAuthWindowViewModel.cs
new file mode 100644
index 000000000..27d000c21
--- /dev/null
+++ b/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/EncryptionAuthWindowViewModel.cs
@@ -0,0 +1,47 @@
+using Newtonsoft.Json.Linq;
+using ReactiveUI;
+using System.Application.Models;
+using System.Application.UI.Resx;
+using System.Properties;
+
+namespace System.Application.UI.ViewModels
+{
+ public class EncryptionAuthWindowViewModel : WindowViewModel
+ {
+ public EncryptionAuthWindowViewModel() : base()
+ {
+ Title = ThisAssembly.AssemblyTrademark + " | " + AppResources.LocalAuth_ProtectionAuth;
+ }
+
+ private string? _Password;
+ public string? Password
+ {
+ get => _Password;
+ set => this.RaiseAndSetIfChanged(ref _Password, value);
+ }
+
+ private string? _VerifyPassword;
+ public string? VerifyPassword
+ {
+ get => _VerifyPassword;
+ set => this.RaiseAndSetIfChanged(ref _VerifyPassword, value);
+ }
+
+ private bool _IsPasswordEncrypt;
+ public bool IsPasswordEncrypt
+ {
+ get => _IsPasswordEncrypt;
+ set => this.RaiseAndSetIfChanged(ref _IsPasswordEncrypt, value);
+ }
+
+ private bool _IsOnlyCurrentComputerEncrypt;
+ public bool IsOnlyCurrentComputerEncrypt
+ {
+ get => _IsOnlyCurrentComputerEncrypt;
+ set => this.RaiseAndSetIfChanged(ref _IsOnlyCurrentComputerEncrypt, value);
+ }
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/ExportAuthWindowViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/ExportAuthWindowViewModel.cs
new file mode 100644
index 000000000..2eff34ebb
--- /dev/null
+++ b/src/ST.Client.Desktop/UI/ViewModels/Windows/LocalAuthPage/ExportAuthWindowViewModel.cs
@@ -0,0 +1,19 @@
+using Newtonsoft.Json.Linq;
+using ReactiveUI;
+using System.Application.Models;
+using System.Application.UI.Resx;
+using System.Properties;
+
+namespace System.Application.UI.ViewModels
+{
+ public class ExportAuthWindowViewModel : WindowViewModel
+ {
+ public ExportAuthWindowViewModel() : base()
+ {
+ Title = ThisAssembly.AssemblyTrademark + " | " + AppResources.LocalAuth_ProtectionAuth;
+ }
+
+
+
+ }
+}
\ No newline at end of file