From cf8be85ff76b7351033b4d39a651864142d83d3c Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 31 Dec 2024 16:30:27 +0800 Subject: [PATCH] Remove the display of run as an administrator in Linux and macos --- v2rayN/ServiceLib/Common/Utils.cs | 25 ++++++++++--------- .../v2rayN.Desktop/Views/MainWindow.axaml.cs | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index 4d4665ea..3aec2a9b 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -860,18 +860,19 @@ namespace ServiceLib.Common { return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); } - else - { - var id = GetLinuxUserId().Result ?? "1000"; - if (int.TryParse(id, out var userId)) - { - return userId == 0; - } - else - { - return false; - } - } + return false; + //else + //{ + // var id = GetLinuxUserId().Result ?? "1000"; + // if (int.TryParse(id, out var userId)) + // { + // return userId == 0; + // } + // else + // { + // return false; + // } + //} } private static async Task GetLinuxUserId() diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 79f4eea8..52c0fdc9 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -134,7 +134,7 @@ namespace v2rayN.Desktop.Views } }); - this.Title = $"{Utils.GetVersion()} - {(AppHandler.Instance.IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}"; + this.Title = $"{Utils.GetVersion()}"; if (Utils.IsWindows()) { ThreadPool.RegisterWaitForSingleObject(Program.ProgramStarted, OnProgramStarted, null, -1, false);