mirror of
https://github.com/Py-KMS-Organization/py-kms.git
synced 2025-07-22 17:55:54 +02:00
Use ReleaseDate instead of MinDate
Made InvalidWinBuild/NCountPolicy optional Signed-off-by: simonmicro <simon@simonmicro.de>
This commit is contained in:
parent
a639486121
commit
2ef58649f0
2 changed files with 6 additions and 5 deletions
|
@ -184,7 +184,7 @@ def client_update():
|
||||||
if sName == name + 'Enterprise' or \
|
if sName == name + 'Enterprise' or \
|
||||||
sName == name[:6] + 'ProfessionalPlus' + name[6:]:
|
sName == name[:6] + 'ProfessionalPlus' + name[6:]:
|
||||||
clt_config['KMSClientSkuID'] = skuitem['Id']
|
clt_config['KMSClientSkuID'] = skuitem['Id']
|
||||||
clt_config['RequiredClientCount'] = int(kmsitem['NCountPolicy'])
|
clt_config['RequiredClientCount'] = int(kmsitem.get('NCountPolicy', 25)) # if not given default to 25
|
||||||
clt_config['KMSProtocolMajorVersion'] = int(float(kmsitem['DefaultKmsProtocol']))
|
clt_config['KMSProtocolMajorVersion'] = int(float(kmsitem['DefaultKmsProtocol']))
|
||||||
clt_config['KMSProtocolMinorVersion'] = 0
|
clt_config['KMSProtocolMinorVersion'] = 0
|
||||||
clt_config['KMSClientLicenseStatus'] = 2
|
clt_config['KMSClientLicenseStatus'] = 2
|
||||||
|
|
|
@ -20,7 +20,7 @@ def epidGenerator(kmsId, version, lcid):
|
||||||
for csvlkitem in csvlkitems:
|
for csvlkitem in csvlkitems:
|
||||||
try:
|
try:
|
||||||
if kmsId in [ uuid.UUID(kmsitem) for kmsitem in csvlkitem['Activate'] ]:
|
if kmsId in [ uuid.UUID(kmsitem) for kmsitem in csvlkitem['Activate'] ]:
|
||||||
pkeys.append( (csvlkitem['GroupId'], csvlkitem['MinKeyId'], csvlkitem['MaxKeyId'], csvlkitem['InvalidWinBuild']) )
|
pkeys.append( (csvlkitem['GroupId'], csvlkitem['MinKeyId'], csvlkitem['MaxKeyId'], csvlkitem.get('InvalidWinBuild', '[]')) )
|
||||||
else:
|
else:
|
||||||
# fallback to Windows Server 2019 parameters.
|
# fallback to Windows Server 2019 parameters.
|
||||||
pkeys.append( ('206', '551000000', '570999999', '[0,1,2]') )
|
pkeys.append( ('206', '551000000', '570999999', '[0,1,2]') )
|
||||||
|
@ -40,10 +40,11 @@ def epidGenerator(kmsId, version, lcid):
|
||||||
hosts.append(winbuild)
|
hosts.append(winbuild)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# fallback to Windows Server 2019 parameters.
|
# fallback to Windows Server 2019 parameters.
|
||||||
hosts.append( {'BuildNumber':'17763', 'PlatformId':'3612', 'MinDate':'02/10/2018'} )
|
hosts.append( {'BuildNumber':'17763', 'PlatformId':'3612', 'ReleaseDate':'2018-10-02T00:00:00Z'} )
|
||||||
|
|
||||||
host = random.choice(hosts)
|
host = random.choice(hosts)
|
||||||
BuildNumber, PlatformId, MinDate = host['BuildNumber'], host['PlatformId'], host['MinDate']
|
|
||||||
|
BuildNumber, PlatformId, ReleaseDate = host['BuildNumber'], host['PlatformId'], host['ReleaseDate'].rstrip("Z")
|
||||||
|
|
||||||
# Generate Part 3 and Part 4: Product Key ID
|
# Generate Part 3 and Part 4: Product Key ID
|
||||||
productKeyID = random.randint(MinKeyId, MaxKeyId)
|
productKeyID = random.randint(MinKeyId, MaxKeyId)
|
||||||
|
@ -55,7 +56,7 @@ def epidGenerator(kmsId, version, lcid):
|
||||||
languageCode = lcid # (C# CultureInfo.InstalledUICulture.LCID)
|
languageCode = lcid # (C# CultureInfo.InstalledUICulture.LCID)
|
||||||
|
|
||||||
# Generate Part 8: KMS Host Activation Date
|
# Generate Part 8: KMS Host Activation Date
|
||||||
d = datetime.datetime.strptime(MinDate, "%d/%m/%Y")
|
d = datetime.datetime.fromisoformat(ReleaseDate)
|
||||||
minTime = datetime.date(d.year, d.month, d.day)
|
minTime = datetime.date(d.year, d.month, d.day)
|
||||||
|
|
||||||
# Generate Year and Day Number
|
# Generate Year and Day Number
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue