mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 11:03:04 +00:00
Made AV detection method return a bool instead of a program name
Changed relevant log message
This commit is contained in:
parent
1f1811b9ac
commit
619d5cc6d6
3 changed files with 8 additions and 10 deletions
|
@ -6,11 +6,11 @@ namespace Ryujinx.Common.Utilities
|
|||
{
|
||||
public static class AVUtils
|
||||
{
|
||||
public static string GetAVName()
|
||||
public static bool IsRunningThirdPartyAV()
|
||||
{
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
ManagementObjectSearcher wmiData = new ManagementObjectSearcher(@"root\SecurityCenter2", "SELECT * FROM AntiVirusProduct");
|
||||
|
@ -23,7 +23,7 @@ namespace Ryujinx.Common.Utilities
|
|||
string displayName = (string)dataObj["displayName"];
|
||||
if (displayName != "Windows Defender")
|
||||
{
|
||||
return displayName;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (ManagementException)
|
||||
|
@ -32,7 +32,7 @@ namespace Ryujinx.Common.Utilities
|
|||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -342,10 +342,9 @@ namespace Ryujinx
|
|||
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
||||
SystemInfo.Gather().Print();
|
||||
|
||||
string avName = AVUtils.GetAVName();
|
||||
if (avName != null)
|
||||
if (AVUtils.IsRunningThirdPartyAV())
|
||||
{
|
||||
Logger.Notice.Print(LogClass.Application, $"Detected AV: {avName}");
|
||||
Logger.Notice.Print(LogClass.Application, $"Third-Party AV active");
|
||||
}
|
||||
|
||||
var enabledLogs = Logger.GetEnabledLevels();
|
||||
|
|
|
@ -215,10 +215,9 @@ namespace Ryujinx.Ava
|
|||
Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}");
|
||||
SystemInfo.Gather().Print();
|
||||
|
||||
string avName = AVUtils.GetAVName();
|
||||
if (avName != null)
|
||||
if (AVUtils.IsRunningThirdPartyAV())
|
||||
{
|
||||
Logger.Notice.Print(LogClass.Application, $"Detected AV: {avName}");
|
||||
Logger.Notice.Print(LogClass.Application, $"Third-Party AV active");
|
||||
}
|
||||
|
||||
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "<None>" : string.Join(", ", Logger.GetEnabledLevels()))}");
|
||||
|
|
Loading…
Reference in a new issue