Add support for WCOS Windows 10X

This commit is contained in:
abbodi1406 2021-02-06 16:26:21 +03:00
parent 3579ce7afb
commit 6d3a5bb420
6 changed files with 185 additions and 74 deletions

View File

@ -26,6 +26,7 @@ function uupFetchUpd(
$build = 'latest', $build = 'latest',
$minor = '0', $minor = '0',
$sku = '48', $sku = '48',
$type = 'Production',
$cacheRequests = 0 $cacheRequests = 0
) { ) {
uupApiPrintBrand(); uupApiPrintBrand();
@ -84,7 +85,12 @@ function uupFetchUpd(
$build = '10.0.'.$build.'.'.$minor; $build = '10.0.'.$build.'.'.$minor;
$cacheHash = hash('sha256', strtolower("api-fetch-$arch-$ring-$flight-$build-$minor-$sku")); $type = ucwords(strtolower($type));
if(!($type == 'Production' || $type == 'Test')) {
$type = 'Production';
}
$cacheHash = hash('sha256', strtolower("api-fetch-$arch-$ring-$flight-$build-$minor-$sku-$type"));
$cached = 0; $cached = 0;
if(file_exists('cache/'.$cacheHash.'.json.gz') && $cacheRequests == 1) { if(file_exists('cache/'.$cacheHash.'.json.gz') && $cacheRequests == 1) {
@ -104,7 +110,7 @@ function uupFetchUpd(
if(!$cached) { if(!$cached) {
consoleLogger('Fetching information from the server...'); consoleLogger('Fetching information from the server...');
$postData = composeFetchUpdRequest(uupDevice(), uupEncryptedData(), $arch, $flight, $ring, $build, $sku); $postData = composeFetchUpdRequest(uupDevice(), uupEncryptedData(), $arch, $flight, $ring, $build, $sku, $type);
$out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx', $postData); $out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx', $postData);
$out = html_entity_decode($out); $out = html_entity_decode($out);
@ -141,7 +147,7 @@ function uupFetchUpd(
$num++; $num++;
consoleLogger("Checking build information for update {$num} of {$updatesNum}..."); consoleLogger("Checking build information for update {$num} of {$updatesNum}...");
$info = parseFetchUpdate($val, $out, $arch, $ring, $flight, $build, $sku); $info = parseFetchUpdate($val, $out, $arch, $ring, $flight, $build, $sku, $type);
if(isset($info['error'])) { if(isset($info['error'])) {
$errorCount++; $errorCount++;
continue; continue;
@ -165,7 +171,7 @@ function uupFetchUpd(
); );
} }
function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku) { function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku, $type) {
$updateNumId = preg_replace('/<UpdateInfo><ID>|<\/ID>.*/i', '', $updateInfo); $updateNumId = preg_replace('/<UpdateInfo><ID>|<\/ID>.*/i', '', $updateInfo);
$updates = preg_replace('/<Update>/', "\n<Update>", $out); $updates = preg_replace('/<Update>/', "\n<Update>", $out);
@ -193,7 +199,7 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
$foundArch = @strtolower($info[2]); $foundArch = @strtolower($info[2]);
$foundBuild = @$info[3]; $foundBuild = @$info[3];
if((!$foundArch)) { if(!isset($foundArch) || empty($foundArch)) {
preg_match('/ProductReleaseInstalled Name\="(.*?)\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info); preg_match('/ProductReleaseInstalled Name\="(.*?)\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info);
$foundType = @strtolower($info[1]); $foundType = @strtolower($info[1]);
$foundArch = @strtolower($info[2]); $foundArch = @strtolower($info[2]);
@ -213,6 +219,9 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
$updateTitle = 'Windows 10 build '.$foundBuild; $updateTitle = 'Windows 10 build '.$foundBuild;
} }
if($foundType == 'hololens' || $foundType == 'wcosdevice0')
$updateTitle = preg_replace('/ for .{3,5}-based/i', ' for', $updateTitle);
$isCumulativeUpdate = 0; $isCumulativeUpdate = 0;
if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update|Microsoft Edge|Windows Feature Experience Pack/i', $updateTitle)) { if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update|Microsoft Edge|Windows Feature Experience Pack/i', $updateTitle)) {
$isCumulativeUpdate = 1; $isCumulativeUpdate = 1;
@ -227,6 +236,9 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
if($foundType == 'sedimentpack') if($foundType == 'sedimentpack')
$updateTitle = $updateTitle.' - KB4023057'; $updateTitle = $updateTitle.' - KB4023057';
if($foundType == 'hololens' || $foundType == 'wcosdevice0')
$updateTitle = $updateTitle.' - '.$type;
if(!preg_match("/$foundBuild/i", $updateTitle)) if(!preg_match("/$foundBuild/i", $updateTitle))
$updateTitle = $updateTitle.' ('.$foundBuild.')'; $updateTitle = $updateTitle.' ('.$foundBuild.')';
@ -330,6 +342,10 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
$temp['containsCU'] = 1; $temp['containsCU'] = 1;
} }
if($foundType == 'hololens' || $foundType == 'wcosdevice0') {
$temp['releasetype'] = $type;
}
$temp['created'] = time(); $temp['created'] = time();
$temp['files'] = $shaArray; $temp['files'] = $shaArray;

138
get.php
View File

@ -88,15 +88,15 @@ function uupGetFiles(
if($usePack) { if($usePack) {
$fileListSource = 'GENERATEDPACKS'; $fileListSource = 'GENERATEDPACKS';
$filesList = array(); $filesPacksList = array();
foreach($genPack[$usePack] as $val) { foreach($genPack[$usePack] as $val) {
foreach($val as $package) { foreach($val as $package) {
$filesList[] = $package; $filesPacksList[] = $package;
} }
} }
array_unique($filesList); array_unique($filesPacksList);
sort($filesList); sort($filesPacksList);
} }
break; break;
@ -109,13 +109,13 @@ function uupGetFiles(
return array('error' => 'UNSUPPORTED_COMBINATION'); return array('error' => 'UNSUPPORTED_COMBINATION');
} }
$filesList = $genPack[$usePack][$desiredEdition]; $filesPacksList = $genPack[$usePack][$desiredEdition];
$fileListSource = 'GENERATEDPACKS'; $fileListSource = 'GENERATEDPACKS';
break; break;
} }
} else { } else {
$fileListSource = 'GENERATEDPACKS'; $fileListSource = 'GENERATEDPACKS';
$filesList = array(); $filesPacksList = array();
foreach($desiredEdition as $edition) { foreach($desiredEdition as $edition) {
$edition = strtoupper($edition); $edition = strtoupper($edition);
@ -123,7 +123,7 @@ function uupGetFiles(
return array('error' => 'UNSUPPORTED_COMBINATION'); return array('error' => 'UNSUPPORTED_COMBINATION');
} }
$filesList = array_merge($filesList, $genPack[$usePack][$edition]); $filesPacksList = array_merge($filesPacksList, $genPack[$usePack][$edition]);
} }
} }
@ -133,102 +133,117 @@ function uupGetFiles(
$updateId = preg_replace('/_rev\..*/', '', $updateId); $updateId = preg_replace('/_rev\..*/', '', $updateId);
} }
$updateSku = $info['sku'];
$updateArch = (isset($info['arch'])) ? $info['arch'] : 'UNKNOWN'; $updateArch = (isset($info['arch'])) ? $info['arch'] : 'UNKNOWN';
$updateBuild = (isset($info['build'])) ? $info['build'] : 'UNKNOWN'; $updateBuild = (isset($info['build'])) ? $info['build'] : 'UNKNOWN';
$updateName = (isset($info['title'])) ? $info['title'] : 'Unknown update: '.$updateId; $updateName = (isset($info['title'])) ? $info['title'] : 'Unknown update: '.$updateId;
if(isset($info['releasetype'])) {
$type = $info['releasetype'];
}
if(!isset($type)) {
$type = 'Production';
if($updateSku == 189 || $updateSku == 135) foreach($info['files'] as $val) {
if(preg_match('/NonProductionFM/i', $val['name'])) $type = 'Test';
}
}
if($requestType < 2) { if($requestType < 2) {
$files = uupGetOnlineFiles($updateId, $rev, $info, $requestType); $filesInfoList = uupGetOnlineFiles($updateId, $rev, $info, $requestType, $type);
} else { } else {
$files = uupGetOfflineFiles($info); $filesInfoList = uupGetOfflineFiles($info);
} }
if(isset($files['error'])) { if(isset($filesInfoList['error'])) {
return $files; return $filesInfoList;
} }
$baseless = preg_grep('/^baseless_|-baseless\....$/i', array_keys($files)); $baseless = preg_grep('/^baseless_|-baseless\....$/i', array_keys($filesInfoList));
foreach($baseless as $val) { foreach($baseless as $val) {
if(isset($files[$val])) unset($files[$val]); if(isset($filesInfoList[$val])) unset($filesInfoList[$val]);
} }
$diffs = preg_grep('/.*_Diffs_.*|.*_Forward_CompDB_.*|\.cbsu\.cab$/i', array_keys($files)); $diffs = preg_grep('/.*_Diffs_.*|.*_Forward_CompDB_.*|\.cbsu\.cab$/i', array_keys($filesInfoList));
foreach($diffs as $val) { foreach($diffs as $val) {
if(isset($files[$val])) unset($files[$val]); if(isset($filesInfoList[$val])) unset($filesInfoList[$val]);
} }
$psf = array_keys($files); $psf = array_keys($filesInfoList);
$psf = preg_grep('/\.psf$/i', $psf); $psf = preg_grep('/\.psf$/i', $psf);
$removeFiles = array(); $removeFiles = array();
foreach($psf as $val) { foreach($psf as $val) {
$name = preg_replace('/\.psf$/i', '', $val); $name = preg_replace('/\.psf$/i', '', $val);
$removeFiles[] = $name; $removeFiles[] = $name;
unset($files[$val]); unset($filesInfoList[$val]);
} }
unset($index, $name, $psf); unset($index, $name, $psf);
$temp = preg_grep('/'.$updateArch.'_.*|arm64\.arm_.*|arm64\.x86_.*/i', $removeFiles); $temp = preg_grep('/'.$updateArch.'_.*|arm64\.arm_.*|arm64\.x86_.*/i', $removeFiles);
foreach($temp as $key => $val) { foreach($temp as $key => $val) {
if(isset($files[$val.'.cab'])) unset($files[$val.'.cab']); if(isset($filesInfoList[$val.'.cab'])) unset($filesInfoList[$val.'.cab']);
unset($removeFiles[$key]); unset($removeFiles[$key]);
} }
unset($temp); unset($temp);
foreach($removeFiles as $val) { foreach($removeFiles as $val) {
if(isset($files[$val.'.esd'])) { if(isset($filesInfoList[$val.'.esd'])) {
if(isset($files[$val.'.cab'])) unset($files[$val.'.cab']); if(isset($filesInfoList[$val.'.cab'])) unset($filesInfoList[$val.'.cab']);
} }
} }
unset($removeFiles); unset($removeFiles);
$filesKeys = array_keys($files); $filesInfoKeys = array_keys($filesInfoList);
switch($fileListSource) { switch($fileListSource) {
case 'UPDATEONLY': case 'UPDATEONLY':
$skipPackBuild = 1; $skipPackBuild = 1;
$removeFiles = preg_grep('/Windows10\.0-KB.*-EXPRESS/i', $filesKeys); $removeFiles = preg_grep('/Windows10\.0-KB.*-EXPRESS/i', $filesInfoKeys);
foreach($removeFiles as $val) { foreach($removeFiles as $val) {
if(isset($files[$val])) unset($files[$val]); if(isset($filesInfoList[$val])) unset($filesInfoList[$val]);
} }
unset($removeFiles);
unset($removeFiles, $temp); $filesInfoKeys = array_keys($filesInfoList);
$filesKeys = array_keys($files);
$filesKeys = preg_grep('/Windows10\.0-KB/i', $filesKeys); $filesInfoKeys = preg_grep('/Windows10\.0-KB/i', $filesInfoKeys);
if(count($filesKeys) == 0) { if(count($filesInfoKeys) == 0) {
return array('error' => 'NOT_CUMULATIVE_UPDATE'); return array('error' => 'NOT_CUMULATIVE_UPDATE');
} }
break; break;
case 'WUBFILE': case 'WUBFILE':
$skipPackBuild = 1; $skipPackBuild = 1;
$filesKeys = preg_grep('/WindowsUpdateBox.exe/i', $filesKeys); $filesInfoKeys = preg_grep('/WindowsUpdateBox.exe/i', $filesInfoKeys);
break; break;
} }
$uupCleanFunc = 'uupCleanName';
if($updateSku == 189) $uupCleanFunc = 'uupCleanWCOS';
if($updateSku == 135) $uupCleanFunc = 'uupCleanHolo';
if($fileListSource == 'GENERATEDPACKS') { if($fileListSource == 'GENERATEDPACKS') {
$temp = preg_grep('/Windows10\.0-KB.*-EXPRESS/i', $filesKeys, PREG_GREP_INVERT); $temp = preg_grep('/Windows10\.0-KB.*-EXPRESS/i', $filesInfoKeys, PREG_GREP_INVERT);
$temp = preg_grep('/Windows10\.0-KB/i', $temp); $temp = preg_grep('/Windows10\.0-KB/i', $temp);
$filesList = array_merge($filesList, $temp); $filesPacksList = array_merge($filesPacksList, $temp);
$newFiles = array(); $newFiles = array();
foreach($filesList as $val) { foreach($filesPacksList as $val) {
$name = uupCleanName($val); $name = $uupCleanFunc($val);
$filesListKeys[] = $name; $filesPacksKeys[] = $name;
if(isset($files[$name])) { if(isset($filesInfoList[$name])) {
$newFiles[$name] = $files[$name]; $newFiles[$name] = $filesInfoList[$name];
} }
} }
$files = $newFiles; $filesInfoList = $newFiles;
$filesKeys = array_keys($files); $filesInfoKeys = array_keys($filesInfoList);
$filesListKeys = array_unique($filesListKeys); $filesPacksKeys = array_unique($filesPacksKeys);
sort($filesListKeys); sort($filesPacksKeys);
$compare = array_diff($filesListKeys, $filesKeys); $compare = array_diff($filesPacksKeys, $filesInfoKeys);
if(count($compare)) { if(count($compare)) {
foreach($compare as $val) { foreach($compare as $val) {
@ -238,12 +253,13 @@ function uupGetFiles(
} }
} }
if(empty($filesKeys)) { if(empty($filesInfoKeys)) {
return array('error' => 'NO_FILES'); return array('error' => 'NO_FILES');
} }
foreach($filesKeys as $val) { $filesNew = array();
$filesNew[$val] = $files[$val]; foreach($filesInfoKeys as $val) {
$filesNew[$val] = $filesInfoList[$val];
} }
$files = $filesNew; $files = $filesNew;
@ -256,11 +272,12 @@ function uupGetFiles(
'updateName' => $updateName, 'updateName' => $updateName,
'arch' => $updateArch, 'arch' => $updateArch,
'build' => $updateBuild, 'build' => $updateBuild,
'sku' => $updateSku,
'files' => $files, 'files' => $files,
); );
} }
function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) { function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests, $type) {
$cacheHash = hash('sha256', strtolower("api-get-${updateId}_rev.$rev")); $cacheHash = hash('sha256', strtolower("api-get-${updateId}_rev.$rev"));
$cached = 0; $cached = 0;
@ -283,7 +300,7 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
if(!$cached) { if(!$cached) {
$fetchTime = time(); $fetchTime = time();
consoleLogger('Fetching information from the server...'); consoleLogger('Fetching information from the server...');
$postData = composeFileGetRequest($updateId, uupDevice(), $info, $rev); $postData = composeFileGetRequest($updateId, uupDevice(), $info, $rev, $type);
$out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured', $postData); $out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured', $postData);
consoleLogger('Information has been successfully fetched.'); consoleLogger('Information has been successfully fetched.');
} }
@ -310,6 +327,10 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
return array('error' => 'EMPTY_FILELIST'); return array('error' => 'EMPTY_FILELIST');
} }
$uupCleanFunc = 'uupCleanName';
if($info['sku'] == 189) $uupCleanFunc = 'uupCleanWCOS';
if($info['sku'] == 135) $uupCleanFunc = 'uupCleanHolo';
$fileLocations = $getResult->FileLocations; $fileLocations = $getResult->FileLocations;
$info = $info['files']; $info = $info['files'];
@ -323,13 +344,9 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
if(empty($info[$sha1]['name'])) { if(empty($info[$sha1]['name'])) {
$name = $guid; $name = $guid;
} else {
$name = $info[$sha1]['name'];
}
if(empty($info[$sha1]['name'])) {
$size = -1; $size = -1;
} else { } else {
$name = $info[$sha1]['name'];
$size = $info[$sha1]['size']; $size = $info[$sha1]['size'];
} }
@ -360,7 +377,7 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
$temp['expire'] = $expire; $temp['expire'] = $expire;
$temp['debug'] = $val->asXML(); $temp['debug'] = $val->asXML();
$newName = uupCleanName($name); $newName = $uupCleanFunc($name);
$files[$newName] = $temp; $files[$newName] = $temp;
} }
} }
@ -382,6 +399,10 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
function uupGetOfflineFiles($info) { function uupGetOfflineFiles($info) {
if(empty($info['files'])) return array(); if(empty($info['files'])) return array();
$uupCleanFunc = 'uupCleanName';
if($info['sku'] == 189) $uupCleanFunc = 'uupCleanWCOS';
if($info['sku'] == 135) $uupCleanFunc = 'uupCleanHolo';
consoleLogger('Parsing information...'); consoleLogger('Parsing information...');
foreach($info['files'] as $sha1 => $val) { foreach($info['files'] as $sha1 => $val) {
$name = $val['name']; $name = $val['name'];
@ -399,7 +420,7 @@ function uupGetOfflineFiles($info) {
$temp['expire'] = 0; $temp['expire'] = 0;
$temp['debug'] = null; $temp['debug'] = null;
$newName = uupCleanName($name); $newName = $uupCleanFunc($name);
$files[$newName] = $temp; $files[$newName] = $temp;
} }
} }
@ -421,3 +442,16 @@ function uupCleanName($name) {
$name = strtr($name, 'QWERTYUIOPASDFGHJKLZXCVBNM', 'qwertyuiopasdfghjklzxcvbnm'); $name = strtr($name, 'QWERTYUIOPASDFGHJKLZXCVBNM', 'qwertyuiopasdfghjklzxcvbnm');
return strtr($name, $replace); return strtr($name, $replace);
} }
function uupCleanWCOS($name) {
$name = preg_replace('/^(appx)_(messaging_desktop|.*?)_/i', '$1/$2/', $name);
$name = preg_replace('/^(retail)_(.{3,5})_fre_/i', '$1/$2/fre/', $name);
return strtr($name, 'QWERTYUIOPASDFGHJKLZXCVBNM', 'qwertyuiopasdfghjklzxcvbnm');
}
function uupCleanHolo($name) {
$name = preg_replace('/^(appx)_(Cortana_WCOS|FeedbackHub_WCOS|HEVCExtension_HoloLens|MixedRealityViewer_arm64|MoviesTV_Hololens|Outlook_WindowsTeam|WinStore_HoloLens)_/i', '$1/$2/', $name);
$name = preg_replace('/^(appx)_(.*?)_/i', '$1/$2/', $name);
$name = preg_replace('/^(retail)_(.{3,5})_fre_/i', '$1/$2/fre/', $name);
return strtr($name, 'QWERTYUIOPASDFGHJKLZXCVBNM', 'qwertyuiopasdfghjklzxcvbnm');
}

View File

@ -2,7 +2,7 @@ UUP dump API
------------ ------------
### Functions ### Functions
#### fetchupd.php: `uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku, $cacheRequests);` #### fetchupd.php: `uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku, $type, $cacheRequests);`
Fetches latest update information from Windows Update servers. Fetches latest update information from Windows Update servers.
Parameters: Parameters:
@ -27,6 +27,9 @@ Parameters:
- `sku` - SKU number to use when fetching information - `sku` - SKU number to use when fetching information
- **Supported values:** Any integer - **Supported values:** Any integer
- `type` - Release type to use when fetching information for Windows Core OS (WCOS), e.g. Windows 10X
- **Supported values:** `Production`, `Test`
- `cacheRequests` - Should request responses be cached? (optional) - `cacheRequests` - Should request responses be cached? (optional)
- **Supported values:** 0 = Disable (default), 1 = Enable - **Supported values:** 0 = Disable (default), 1 = Enable

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
function uupApiVersion() { function uupApiVersion() {
return '1.30.4'; return '1.31.0';
} }
require_once dirname(__FILE__).'/auths.php'; require_once dirname(__FILE__).'/auths.php';

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
Copyright 2019 UUP dump API authors Copyright 2021 UUP dump API authors
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -72,6 +72,8 @@ function uupGetInfoTexts() {
'EDUCATIONN' => 'Windows 10 Education N', 'EDUCATIONN' => 'Windows 10 Education N',
'ENTERPRISE' => 'Windows 10 Enterprise', 'ENTERPRISE' => 'Windows 10 Enterprise',
'ENTERPRISEN' => 'Windows 10 Enterprise N', 'ENTERPRISEN' => 'Windows 10 Enterprise N',
'HOLOGRAPHIC' => 'Windows Holographic',
'LITE' => 'Windows 10X',
'PPIPRO' => 'Windows 10 Team', 'PPIPRO' => 'Windows 10 Team',
'PROFESSIONAL' => 'Windows 10 Pro', 'PROFESSIONAL' => 'Windows 10 Pro',
'PROFESSIONALN' => 'Windows 10 Pro N', 'PROFESSIONALN' => 'Windows 10 Pro N',
@ -82,6 +84,7 @@ function uupGetInfoTexts() {
'ANDROMEDA', 'ANDROMEDA',
'CLOUD', 'CLOUD',
'CLOUDE', 'CLOUDE',
'CLOUDEN',
'CLOUDN', 'CLOUDN',
'CORE', 'CORE',
'CORECOUNTRYSPECIFIC', 'CORECOUNTRYSPECIFIC',
@ -104,7 +107,13 @@ function uupGetInfoTexts() {
'ENTERPRISESEVAL', 'ENTERPRISESEVAL',
'ENTERPRISESN', 'ENTERPRISESN',
'ENTERPRISESNEVAL', 'ENTERPRISESNEVAL',
'HOLOGRAPHIC',
'HUBOS',
'IOTENTERPRISE',
'IOTENTERPRISES',
'IOTOS',
'IOTUAP', 'IOTUAP',
'LITE',
'MOBILECORE', 'MOBILECORE',
'ONECOREUPDATEOS', 'ONECOREUPDATEOS',
'PPIPRO', 'PPIPRO',
@ -161,6 +170,9 @@ function uupGetInfoTexts() {
'SERVERSTORAGEWORKGROUPCORE', 'SERVERSTORAGEWORKGROUPCORE',
'SERVERSTORAGEWORKGROUPEVAL', 'SERVERSTORAGEWORKGROUPEVAL',
'SERVERSTORAGEWORKGROUPEVALCORE', 'SERVERSTORAGEWORKGROUPEVALCORE',
'SERVERAZURESTACKHCICOR',
'SERVERTURBINE',
'SERVERTURBINECOR',
'SERVERWEB', 'SERVERWEB',
'SERVERWEBCORE', 'SERVERWEBCORE',
'STARTER', 'STARTER',

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
// Composes DeviceAttributes parameter needed to fetch data // Composes DeviceAttributes parameter needed to fetch data
function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) { function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type) {
$branch = branchFromBuild($build); $branch = branchFromBuild($build);
$blockUpgrades = 0; $blockUpgrades = 0;
$flightEnabled = 1; $flightEnabled = 1;
@ -29,13 +29,33 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
if($sku == 125 || $sku == 126 || $sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168) if($sku == 125 || $sku == 126 || $sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168)
$blockUpgrades = 1; $blockUpgrades = 1;
$dvcFamily = 'Windows.Desktop';
$insType = 'Client';
if($sku == 119) {
$dvcFamily = 'Windows.Team';
}
if($sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168) {
$dvcFamily = 'Windows.Server';
$insType = 'Server';
}
/*/ Hololens
if($sku == 135) {
$dvcFamily = 'Windows.Holographic';
$insType = 'FactoryOS';
}*/
// HubOS Andromeda Lite
if($sku == 180 || $sku == 184 || $sku == 189) {
$dvcFamily = 'Windows.Core';
$insType = 'FactoryOS';
}
$fltContent = 'Mainline'; $fltContent = 'Mainline';
$fltRing = 'External'; $fltRing = 'External';
$flight = 'Active'; $flight = 'Active';
if($ring == 'RETAIL') { if($ring == 'RETAIL') {
$fltBranch = ''; $fltBranch = '';
$fltContent = ''; $fltContent = $flight;
$fltRing = 'Retail'; $fltRing = 'Retail';
$flightEnabled = 0; $flightEnabled = 0;
$isRetail = 1; $isRetail = 1;
@ -86,7 +106,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
$attrib = array( $attrib = array(
'App=WU_OS', 'App=WU_OS',
'AppVer='.$build, 'AppVer='.$build,
'AttrDataVer=118', 'AttrDataVer=120',
'BlockFeatureUpdates='.$blockUpgrades, 'BlockFeatureUpdates='.$blockUpgrades,
'BranchReadinessLevel=CB', 'BranchReadinessLevel=CB',
'CurrentBranch='.$branch, 'CurrentBranch='.$branch,
@ -94,9 +114,13 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
'DataExpDateEpoch_19H1='.(time()+82800), 'DataExpDateEpoch_19H1='.(time()+82800),
'DataVer_RS5=2000000000', 'DataVer_RS5=2000000000',
'DefaultUserRegion=191', 'DefaultUserRegion=191',
'DeviceFamily=Windows.Desktop', 'DeviceFamily='.$dvcFamily,
'EKB19H2InstallCount=1', 'EKB19H2InstallCount=1',
'EKB19H2InstallTimeEpoch=1255000000', 'EKB19H2InstallTimeEpoch=1255000000',
'EKB20H2InstallCount=1',
'EKB20H2InstallTimeEpoch=1255000000',
'EKB21H1InstallCount=1',
'EKB21H1InstallTimeEpoch=1255000000',
'FlightingBranchName='.$fltBranch, 'FlightingBranchName='.$fltBranch,
'FlightContent='.$fltContent, 'FlightContent='.$fltContent,
'FlightRing='.$fltRing, 'FlightRing='.$fltRing,
@ -109,12 +133,13 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
'GenTelRunTimestamp_19H1='.(time()-3600), 'GenTelRunTimestamp_19H1='.(time()-3600),
'InstallDate=1438196400', 'InstallDate=1438196400',
'InstallLanguage=en-US', 'InstallLanguage=en-US',
'InstallationType=Client', 'InstallationType='.$insType,
'IsDeviceRetailDemo=0', 'IsDeviceRetailDemo=0',
'IsFlightingEnabled='.$flightEnabled, 'IsFlightingEnabled='.$flightEnabled,
'IsRetailOS='.$isRetail, 'IsRetailOS='.$isRetail,
'MediaBranch=',
'MediaVersion='.$build, 'MediaVersion='.$build,
'MediaBranch='.$branch, 'CloudPBR=1',
'DUScan=1', 'DUScan=1',
'OEMModel=Largehard Device Model 42069', 'OEMModel=Largehard Device Model 42069',
'OEMModelBaseBoard=Largehard Base Board', 'OEMModelBaseBoard=Largehard Base Board',
@ -125,7 +150,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
'OSVersion='.$build, 'OSVersion='.$build,
'ProcessorIdentifier=Intel64 Family 6 Model 85 Stepping 4', 'ProcessorIdentifier=Intel64 Family 6 Model 85 Stepping 4',
'ProcessorManufacturer=GenuineIntel', 'ProcessorManufacturer=GenuineIntel',
'ReleaseType=Production', 'ReleaseType='.$type,
'SdbVer_20H1=2000000000', 'SdbVer_20H1=2000000000',
'SdbVer_19H1=2000000000', 'SdbVer_19H1=2000000000',
'TelemetryLevel=3', 'TelemetryLevel=3',
@ -184,6 +209,10 @@ function branchFromBuild($build) {
$branch = 'vb_release'; $branch = 'vb_release';
break; break;
case 20279:
$branch = 'fe_release_10x';
break;
default: default:
$branch = 'rs_prerelease'; $branch = 'rs_prerelease';
break; break;
@ -193,7 +222,7 @@ function branchFromBuild($build) {
} }
// Composes POST data for gathering list of urls for download // Composes POST data for gathering list of urls for download
function composeFileGetRequest($updateId, $device, $info, $rev = 1) { function composeFileGetRequest($updateId, $device, $info, $rev = 1, $type = 'Production') {
$uuid = genUUID(); $uuid = genUUID();
$createdTime = time(); $createdTime = time();
@ -202,14 +231,15 @@ function composeFileGetRequest($updateId, $device, $info, $rev = 1) {
$created = gmdate(DATE_W3C, $createdTime); $created = gmdate(DATE_W3C, $createdTime);
$expires = gmdate(DATE_W3C, $expiresTime); $expires = gmdate(DATE_W3C, $expiresTime);
$branch = branchFromBuild($info['checkBuild']); //$branch = branchFromBuild($info['checkBuild']);
$deviceAttributes = composeDeviceAttributes( $deviceAttributes = composeDeviceAttributes(
$info['flight'], $info['flight'],
$info['ring'], $info['ring'],
$info['checkBuild'], $info['checkBuild'],
$info['arch'], $info['arch'],
$info['sku'] $info['sku'],
$type
); );
return <<<XML return <<<XML
@ -253,7 +283,7 @@ XML;
} }
// Composes POST data for fetching the latest update information from Windows Update // Composes POST data for fetching the latest update information from Windows Update
function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build, $sku = 48) { function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build, $sku = 48, $type = 'Production') {
$uuid = genUUID(); $uuid = genUUID();
$createdTime = time(); $createdTime = time();
@ -266,10 +296,25 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build
$branch = branchFromBuild($build); $branch = branchFromBuild($build);
$mainProduct = 'Client.OS.rs2';
if($sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168) { if($sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168) {
$mainProduct = 'Server.OS'; $mainProduct = 'Server.OS';
} else { }
$mainProduct = 'Client.OS.rs2'; /*/ Hololens
if($sku == 135) {
$mainProduct = 'HoloLens.OS.RS2';
}*/
// HubOS
if($sku == 180) {
$mainProduct = 'WCOSDevice2.OS';
}
// Andromeda
if($sku == 184) {
$mainProduct = 'WCOSDevice1.OS';
}
// Lite
if($sku == 189) {
$mainProduct = 'WCOSDevice0.OS';
} }
if($arch == 'all') { if($arch == 'all') {
@ -319,7 +364,8 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build
$ring, $ring,
$build, $build,
$arch, $arch,
$sku $sku,
$type
); );
return <<<XML return <<<XML