diff options
| author | Wither OrNot | 2025-02-13 14:49:35 +0000 |
|---|---|---|
| committer | Wither OrNot | 2025-02-13 14:49:37 +0000 |
| commit | 0d59561bee4cf7db10d53a8aa58952ae65e856b5 (patch) | |
| tree | b2ddb66c883dd2ef75426de4c080f3121f0a8658 /LibTSforge/Modifiers/GracePeriodReset.cs | |
| download | TSforge-0d59561bee4cf7db10d53a8aa58952ae65e856b5.zip | |
Initial commit1.0.0
Co-authored-by: neko <[email protected]>
Co-authored-by: Lyssa <[email protected]>
Co-authored-by: abbodi1406 <[email protected]>
Diffstat (limited to 'LibTSforge/Modifiers/GracePeriodReset.cs')
| -rw-r--r-- | LibTSforge/Modifiers/GracePeriodReset.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/LibTSforge/Modifiers/GracePeriodReset.cs b/LibTSforge/Modifiers/GracePeriodReset.cs new file mode 100644 index 0000000..4743ea6 --- /dev/null +++ b/LibTSforge/Modifiers/GracePeriodReset.cs @@ -0,0 +1,29 @@ +namespace LibTSforge.Modifiers +{ + using System; + using System.Collections.Generic; + using System.Linq; + using LibTSforge.PhysicalStore; + + public static class GracePeriodReset + { + public static void Reset(PSVersion version, bool production) + { + Utils.KillSPP(); + Logger.WriteLine("Writing TrustedStore data..."); + + using (IPhysicalStore store = Utils.GetStore(version, production)) + { + string value = "msft:sl/timer"; + List<PSBlock> blocks = store.FindBlocks(value).ToList(); + + foreach (PSBlock block in blocks) + { + store.DeleteBlock(block.KeyAsStr, block.ValueAsStr); + } + } + + Logger.WriteLine("Successfully reset all grace and evaluation period timers."); + } + } +} |
