summaryrefslogtreecommitdiff
path: root/LibTSforge/Modifiers/KeyChangeLockDelete.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibTSforge/Modifiers/KeyChangeLockDelete.cs')
-rw-r--r--LibTSforge/Modifiers/KeyChangeLockDelete.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/LibTSforge/Modifiers/KeyChangeLockDelete.cs b/LibTSforge/Modifiers/KeyChangeLockDelete.cs
new file mode 100644
index 0000000..e3f32c4
--- /dev/null
+++ b/LibTSforge/Modifiers/KeyChangeLockDelete.cs
@@ -0,0 +1,33 @@
+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.");
+ }
+ }
+}