Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions MPF.Frontend.Test/Tools/ProtectionToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> 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()
Expand Down
6 changes: 6 additions & 0 deletions MPF.Frontend/Tools/ProtectionTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ public static string SanitizeFoundProtections(List<string> 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")
Expand Down