From f779e311edebf58db1f0f239310be7539fad8a62 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:42:59 +0800 Subject: [PATCH] Optimize code and remove unused resources --- v2rayN/ServiceLib/Handler/CoreAdminHandler.cs | 6 ++++-- v2rayN/ServiceLib/Handler/CoreHandler.cs | 4 ++-- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 --------- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 3 --- 9 files changed, 6 insertions(+), 31 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs b/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs index 661d9052..a573c1b0 100644 --- a/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs +++ b/v2rayN/ServiceLib/Handler/CoreAdminHandler.cs @@ -20,6 +20,8 @@ public class CoreAdminHandler } _config = config; _updateFunc = updateFunc; + + await Task.CompletedTask; } private void UpdateFunc(bool notify, string msg) @@ -49,13 +51,13 @@ public class CoreAdminHandler } }; - DataReceivedEventHandler dataHandler = (sender, e) => + void dataHandler(object sender, DataReceivedEventArgs e) { if (e.Data.IsNotEmpty()) { UpdateFunc(false, e.Data + Environment.NewLine); } - }; + } proc.OutputDataReceived += dataHandler; proc.ErrorDataReceived += dataHandler; diff --git a/v2rayN/ServiceLib/Handler/CoreHandler.cs b/v2rayN/ServiceLib/Handler/CoreHandler.cs index d1cf43f0..f0c23c69 100644 --- a/v2rayN/ServiceLib/Handler/CoreHandler.cs +++ b/v2rayN/ServiceLib/Handler/CoreHandler.cs @@ -280,13 +280,13 @@ public class CoreHandler if (displayLog) { - DataReceivedEventHandler dataHandler = (sender, e) => + void dataHandler(object sender, DataReceivedEventArgs e) { if (e.Data.IsNotEmpty()) { UpdateFunc(false, e.Data + Environment.NewLine); } - }; + } proc.OutputDataReceived += dataHandler; proc.ErrorDataReceived += dataHandler; } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 4732cdd4..23469763 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -2211,15 +2211,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 Sudo password has been verified successfully, please ignore the incorrect password prompts! 的本地化字符串。 - /// - public static string SudoPwdVerfiedSuccessTip { - get { - return ResourceManager.GetString("SudoPwdVerfiedSuccessTip", resourceCulture); - } - } - /// /// 查找类似 Address 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index f8f8d6fa..1f05cf8f 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1395,9 +1395,6 @@ Can fill in the configuration remarks, please make sure it exist and are unique - - Sudo password has been verified successfully, please ignore the incorrect password prompts! - Incorrect password, please try again. diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 85ea3335..862758f6 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1395,9 +1395,6 @@ Can fill in the configuration remarks, please make sure it exist and are unique - - Sudo password has been verified successfully, please ignore the incorrect password prompts! - Incorrect password, please try again. diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 8092e2e9..2826c9cc 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1395,9 +1395,6 @@ Can fill in the configuration remarks, please make sure it exist and are unique - - Sudo password has been verified successfully, please ignore the incorrect password prompts! - Incorrect password, please try again. diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index 434b2c8f..a4d82127 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1395,9 +1395,6 @@ Can fill in the configuration remarks, please make sure it exist and are unique - - Sudo password has been verified successfully, please ignore the incorrect password prompts! - Incorrect password, please try again. diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index fed61bf6..55186822 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1392,9 +1392,6 @@ 可以填写配置文件别名,请确保存在并唯一 - - sudo 密码已经验证成功,请忽略错误密码提示! - 密码错误,请重试。 diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index f6676488..cbf27b8c 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1392,9 +1392,6 @@ 可以填寫設定檔別名,請確保存在並唯一 - - sudo 密碼已經驗證成功,請忽略錯誤密碼提示! - 密碼錯誤,請重試。