Co-authored-by: neko <109633131+nekoppai@users.noreply.github.com> Co-authored-by: Lyssa <75037904+thecatontheceiling@users.noreply.github.com> Co-authored-by: abbodi1406 <33669284+abbodi1406@users.noreply.github.com>
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
namespace LibTSforge.Modifiers
|
|
{
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using LibTSforge.PhysicalStore;
|
|
using LibTSforge;
|
|
public static class KeyChangeLockDelete
|
|
{
|
|
public static void Delete(PSVersion version, bool production)
|
|
{
|
|
Utils.KillSPP();
|
|
Logger.WriteLine("Writing TrustedStore data...");
|
|
using (IPhysicalStore store = Utils.GetStore(version, production))
|
|
{
|
|
List<string> values = new List<string>
|
|
{
|
|
"msft:spp/timebased/AB",
|
|
"msft:spp/timebased/CD"
|
|
};
|
|
List<PSBlock> blocks = new List<PSBlock>();
|
|
foreach (string value in values)
|
|
{
|
|
blocks.AddRange(store.FindBlocks(value).ToList());
|
|
}
|
|
foreach (PSBlock block in blocks)
|
|
{
|
|
store.DeleteBlock(block.KeyAsStr, block.ValueAsStr);
|
|
}
|
|
}
|
|
Logger.WriteLine("Successfully removed the key change lock.");
|
|
}
|
|
}
|
|
}
|