Simplify environment checks in Utils.cs

Removed checks for APPIMAGE environment variable and mount path.
This commit is contained in:
JieXu 2025-10-26 08:53:11 +08:00 committed by GitHub
parent 42279d3fa8
commit 718fececac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -994,11 +994,6 @@ public class Utils
return false; return false;
} }
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPIMAGE")))
{
return true;
}
var exePath = GetExePath(); var exePath = GetExePath();
var baseDir = string.IsNullOrEmpty(exePath) ? StartupPath() : Path.GetDirectoryName(exePath) ?? ""; var baseDir = string.IsNullOrEmpty(exePath) ? StartupPath() : Path.GetDirectoryName(exePath) ?? "";
var p = baseDir.Replace('\\', '/'); var p = baseDir.Replace('\\', '/');
@ -1008,11 +1003,6 @@ public class Utils
return false; return false;
} }
if (p.Contains("/.mount_", StringComparison.Ordinal))
{
return true;
}
if (p.StartsWith("/opt/v2rayN", StringComparison.OrdinalIgnoreCase)) if (p.StartsWith("/opt/v2rayN", StringComparison.OrdinalIgnoreCase))
{ {
return true; return true;