Rename Protection to ProtectionTool

This commit is contained in:
Matt Nadareski
2024-05-23 13:41:43 -04:00
parent 0f1b23056c
commit e1961612c0
7 changed files with 24 additions and 23 deletions

View File

@@ -79,6 +79,7 @@
- Move InfoTool to Core.Utilities
- Move SubmissionInfoTool to Core.Utilities
- Fix build
- Rename Protection to ProtectionTool
### 3.1.9a (2024-05-21)

View File

@@ -1305,7 +1305,7 @@ namespace MPF.Core.Processors
/// <returns>Status of the LibCrypt data, if possible</returns>
private static void GetLibCryptDetected(string basePath, out YesNo detected, out string? data)
{
bool? psLibCryptStatus = Protection.GetLibCryptDetected(basePath + ".sub");
bool? psLibCryptStatus = ProtectionTool.GetLibCryptDetected(basePath + ".sub");
if (psLibCryptStatus == true)
{
// Guard against false positives

View File

@@ -11,7 +11,7 @@ using psxt001z;
namespace MPF.Core
{
public static class Protection
public static class ProtectionTool
{
/// <summary>
/// Run protection scan on a given path

View File

@@ -1527,13 +1527,13 @@ namespace MPF.Core.UI.ViewModels
var progress = new Progress<ProtectionProgress>();
progress.ProgressChanged += ProgressUpdated;
#if NET40
var protectionTask = Protection.RunProtectionScanOnPath(this.CurrentDrive.Name, this.Options, progress);
var protectionTask = ProtectionTool.RunProtectionScanOnPath(this.CurrentDrive.Name, this.Options, progress);
protectionTask.Wait();
var (protections, error) = protectionTask.Result;
#else
var (protections, error) = await Protection.RunProtectionScanOnPath(this.CurrentDrive.Name, this.Options, progress);
var (protections, error) = await ProtectionTool.RunProtectionScanOnPath(this.CurrentDrive.Name, this.Options, progress);
#endif
var output = Protection.FormatProtections(protections);
var output = ProtectionTool.FormatProtections(protections);
// If SmartE is detected on the current disc, remove `/sf` from the flags for DIC only -- Disabled until further notice
//if (Env.InternalProgram == InternalProgram.DiscImageCreator && output.Contains("SmartE"))

View File

@@ -90,8 +90,8 @@ namespace MPF.Core.Utilities
{
if (options.ScanForProtection && drive?.Name != null)
{
(var protection, _) = await Protection.RunProtectionScanOnPath(drive.Name, options, progress);
return (Protection.FormatProtections(protection), protection);
(var protection, _) = await ProtectionTool.RunProtectionScanOnPath(drive.Name, options, progress);
return (ProtectionTool.FormatProtections(protection), protection);
}
return ("(CHECK WITH PROTECTIONID)", null);

View File

@@ -111,7 +111,7 @@ namespace MPF.Core.Utilities
if (drive != null && SupportsAntiModchipScans(system) && info.CopyProtection!.AntiModchip == YesNo.NULL)
{
resultProgress?.Report(ResultEventArgs.Success("Checking for anti-modchip strings... this might take a while!"));
info.CopyProtection.AntiModchip = await Protection.GetPlayStationAntiModchipDetected(drive?.Name) ? YesNo.Yes : YesNo.No;
info.CopyProtection.AntiModchip = await ProtectionTool.GetPlayStationAntiModchipDetected(drive?.Name) ? YesNo.Yes : YesNo.No;
resultProgress?.Report(ResultEventArgs.Success("Anti-modchip string scan complete!"));
}

View File

@@ -17,7 +17,7 @@ namespace MPF.Test.Library
"ActiveMARK 5",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("ActiveMARK 5", sanitized);
}
@@ -30,7 +30,7 @@ namespace MPF.Test.Library
"Cactus Data Shield 200 (Build 3.0.100a)",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Cactus Data Shield 200 (Build 3.0.100a)", sanitized);
}
@@ -43,7 +43,7 @@ namespace MPF.Test.Library
"Executable-Based CD Check",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Anything Else Protection", sanitized);
}
@@ -56,7 +56,7 @@ namespace MPF.Test.Library
"CD-Cops v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("CD-Cops v1.2.0", sanitized);
}
@@ -69,7 +69,7 @@ namespace MPF.Test.Library
"CD-Key / Serial",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Anything Else Protection", sanitized);
}
@@ -82,7 +82,7 @@ namespace MPF.Test.Library
"EA CdKey Registration Module v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("EA CdKey Registration Module v1.2.0", sanitized);
}
@@ -95,7 +95,7 @@ namespace MPF.Test.Library
"EA DRM Protection v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("EA DRM Protection v1.2.0", sanitized);
}
@@ -108,7 +108,7 @@ namespace MPF.Test.Library
"Games for Windows LIVE v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Games for Windows LIVE v1.2.0", sanitized);
}
@@ -121,7 +121,7 @@ namespace MPF.Test.Library
"Games for Windows LIVE Zero Day Piracy Protection",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Games for Windows LIVE, Games for Windows LIVE Zero Day Piracy Protection", sanitized);
}
@@ -134,7 +134,7 @@ namespace MPF.Test.Library
"Impulse Reactor Core Module v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Impulse Reactor Core Module v1.2.0", sanitized);
}
@@ -161,7 +161,7 @@ namespace MPF.Test.Library
// The list is in order of preference
protections = protections.Skip(skip).ToList();
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal(protections[0], sanitized);
}
@@ -174,7 +174,7 @@ namespace MPF.Test.Library
"Executable-Based Online Registration",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Anything Else Protection", sanitized);
}
@@ -201,7 +201,7 @@ namespace MPF.Test.Library
// The list is in order of preference
protections = protections.Skip(skip).ToList();
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal(protections[0], sanitized);
}
@@ -214,7 +214,7 @@ namespace MPF.Test.Library
"Sysiphus v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Sysiphus v1.2.0", sanitized);
}
@@ -227,7 +227,7 @@ namespace MPF.Test.Library
"XCP v1.2.0",
];
string sanitized = Protection.SanitizeFoundProtections(protections);
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("XCP v1.2.0", sanitized);
}
}