diff --git a/MPF.Frontend.Test/Tools/ProtectionToolTests.cs b/MPF.Frontend.Test/Tools/ProtectionToolTests.cs index 18418a6e2..e532d98ae 100644 --- a/MPF.Frontend.Test/Tools/ProtectionToolTests.cs +++ b/MPF.Frontend.Test/Tools/ProtectionToolTests.cs @@ -775,6 +775,21 @@ public void SanitizeFoundProtections_StarForce(int skip) string sanitized = ProtectionTool.SanitizeFoundProtections(protections); Assert.Equal(protections[0], sanitized); } + + [Fact] + public void SanitizeFoundProtections_StarForce_Keyless() + { + List protections = + [ + "StarForce Keyless", + "StarForce Keyless - ", + "StarForce Keyless - ESPY97LS8FHNYR52JDWL8D6FJ", + "StarForce Keyless - UAYA-RPMVHJ-ZRY45G-ETUJ36-WL922B", + ]; + + string sanitized = ProtectionTool.SanitizeFoundProtections(protections); + Assert.Equal("StarForce Keyless", sanitized); + } [Fact] public void SanitizeFoundProtections_Sysiphus() diff --git a/MPF.Frontend/Tools/ProtectionTool.cs b/MPF.Frontend/Tools/ProtectionTool.cs index 5c6a71495..1c7aa02b4 100644 --- a/MPF.Frontend/Tools/ProtectionTool.cs +++ b/MPF.Frontend/Tools/ProtectionTool.cs @@ -637,6 +637,12 @@ public static string SanitizeFoundProtections(List foundProtections) foundProtections = foundProtections.FindAll(p => p != "StarForce"); } } + + if (foundProtections.Exists(p => p.StartsWith("StarForce Keyless"))) + { + foundProtections = foundProtections.FindAll(p => !p.StartsWith("StarForce Keyless")); + foundProtections.Add("StarForce Keyless"); + } // Sysiphus if (foundProtections.Exists(p => p == "Sysiphus")