Archived
1
1

First release build.

This commit is contained in:
Mona Lassa
2025-05-22 01:31:03 +02:00
parent ec55169d57
commit f90695dfda
30 changed files with 499 additions and 1389 deletions

View File

@@ -1,33 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MetroUnlocker.LibTSForge.SPP;
namespace MetroUnlocker.LibTSForge.Modifiers
{
using System;
using System.IO;
using Microsoft.Win32;
using MetroUnlocker.LibTSForge.PhysicalStore;
using MetroUnlocker.LibTSForge.SPP;
using MetroUnlocker.LibTSForge.TokenStore;
public static class GenPKeyInstall
public static class ProductKeyInstaller
{
public static void InstallGenPKey(PSVersion version, bool production, Guid actId)
public static void InstallGeneratedProductKey(PhysicalStoreVersion version, bool production, Guid actId)
{
PKeyConfig pkc = new PKeyConfig();
ProductKeyConfig keyConfig = new ProductKeyConfig();
pkc.LoadConfig(actId);
keyConfig.LoadConfig(actId);
ProductConfig config;
pkc.Products.TryGetValue(actId, out config);
keyConfig.Products.TryGetValue(actId, out config);
if (config == null) throw new ArgumentException("Activation ID " + actId + " not found in PKeyConfig.");
if (config == null) throw new ArgumentException("Activation ID " + actId + " not found in ProductKeyConfig.");
ProductKey pkey = config.GetRandomKey();
Guid instPkeyId = SLApi.GetInstalledPkeyId(actId);
Guid instPkeyId = SLApi.GetInstalledProductKeyId(actId);
if (instPkeyId != Guid.Empty) SLApi.UninstallProductKey(instPkeyId);
if (pkey.Algorithm != PKeyAlgorithm.PKEY2009)