forked from uup-dump/api
Compare commits
13
Commits
887dcf71d3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c942f52d3 | ||
|
|
20ddcb74e5 | ||
|
|
287a25a353 | ||
|
|
1e07081a0e | ||
|
|
2ddfdfc9f4 | ||
|
|
a433e40841 | ||
|
|
22e344bdf2 | ||
|
|
0774988365 | ||
|
|
e7fddd4e43 | ||
|
|
2231d65edb | ||
|
|
0da5532141 | ||
|
|
6b5a6885f8 | ||
|
|
5000b4c4b9 |
+92
-37
@@ -33,21 +33,41 @@ function uupApiPrivateParseFlags($str) {
|
||||
return [$split[0], $flagsSafe];
|
||||
}
|
||||
|
||||
function uupApiPrivateParseRing($str) {
|
||||
$split = explode(':', $str);
|
||||
if(!isset($split[1])) {
|
||||
return [$split[0], -1];
|
||||
}
|
||||
|
||||
return $split;
|
||||
}
|
||||
|
||||
function uupApiPrivateGetLatestBuild() {
|
||||
$builds = array('22000.1');
|
||||
|
||||
$ids = uupListIds();
|
||||
if(isset($ids['error'])) {
|
||||
$ids['builds'] = array();
|
||||
|
||||
if(!isset($ids['builds']) || empty($ids['builds'])) {
|
||||
return '26100.1';
|
||||
}
|
||||
|
||||
if(empty($ids['builds'])) {
|
||||
$build = $builds[0];
|
||||
} else {
|
||||
$build = $ids['builds'][0]['build'];
|
||||
return $ids['builds'][0]['build'];
|
||||
}
|
||||
|
||||
return $build;
|
||||
function uupApiPrivateGetLatestPatch($build) {
|
||||
$ids = uupListIds();
|
||||
|
||||
if(!isset($ids['builds']) || empty($ids['builds'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach($ids['builds'] as $val) {
|
||||
$valBuild = explode('.', $val['build']);
|
||||
|
||||
if($valBuild[0] == $build && isset($valBuild[1])) {
|
||||
return intval($valBuild[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function uupApiPrivateIsAcceptableBranch($branch) {
|
||||
@@ -83,12 +103,13 @@ function uupApiPrivateNormalizeFetchParams($params) {
|
||||
'arch' => 'amd64',
|
||||
'ring' => 'WIF',
|
||||
'flight' => 'Active',
|
||||
'branch' => 'ge_release',
|
||||
'branch' => 'auto',
|
||||
'build' => 'latest',
|
||||
'minor' => 0,
|
||||
'sku' => 48,
|
||||
'type' => 'Production',
|
||||
'flags' => [],
|
||||
'targetRelease' => -1,
|
||||
], $params);
|
||||
|
||||
if(!is_array($np['flags'])) $np['flags'] = [];
|
||||
@@ -102,6 +123,7 @@ function uupApiPrivateNormalizeFetchParams($params) {
|
||||
$np['sku'] = intval($np['sku']);
|
||||
$np['type'] = ucwords(strtolower($np['type']));
|
||||
$np['flags'] = array_map('strtolower', $np['flags']);
|
||||
$np['targetRelease'] = intval($np['targetRelease']);
|
||||
|
||||
return $np;
|
||||
}
|
||||
@@ -117,6 +139,7 @@ function uupFetchUpd(
|
||||
$cacheRequests = 0
|
||||
) {
|
||||
[$build, $flags] = uupApiPrivateParseFlags($build);
|
||||
[$ring, $targetRelease] = uupApiPrivateParseRing($ring);
|
||||
|
||||
$params = [
|
||||
'arch' => $arch,
|
||||
@@ -127,6 +150,7 @@ function uupFetchUpd(
|
||||
'sku' => $sku,
|
||||
'type' => $type,
|
||||
'flags' => $flags,
|
||||
'targetRelease' => $targetRelease,
|
||||
];
|
||||
|
||||
return uupFetchUpd2($params, $cacheRequests);
|
||||
@@ -146,6 +170,7 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
$sku = $np['sku'];
|
||||
$type = $np['type'];
|
||||
$flags = $np['flags'];
|
||||
$targetRelease = $np['targetRelease'];
|
||||
|
||||
$flagsStr = implode(',', $flags);
|
||||
|
||||
@@ -154,9 +179,15 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
}
|
||||
|
||||
$build = explode('.', $build);
|
||||
if(isset($build[1])) $minor = intval($build[1]);
|
||||
if(isset($build[1])) $minor = $build[1];
|
||||
$build = intval($build[0]);
|
||||
|
||||
if($minor == 'latest') {
|
||||
$minor = uupApiPrivateGetLatestPatch($build);
|
||||
} else {
|
||||
$minor = intval($minor);
|
||||
}
|
||||
|
||||
if(!($arch == 'amd64' || $arch == 'x86' || $arch == 'arm64' || $arch == 'arm' || $arch == 'all')) {
|
||||
return array('error' => 'UNKNOWN_ARCH');
|
||||
}
|
||||
@@ -197,13 +228,13 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
$type = 'Production';
|
||||
}
|
||||
|
||||
$res = "api-fetch-$arch-$ring-$flight-$branch-$build-$flagsStr-$minor-$sku-$type";
|
||||
$res = "api-fetch-$arch-$ring-$flight-$branch-$build-$flagsStr-$minor-$sku-$type-$targetRelease";
|
||||
$cache = new UupDumpCache($res);
|
||||
$fromCache = $cache->get();
|
||||
if($fromCache !== false) return $fromCache;
|
||||
|
||||
consoleLogger('Fetching information from the server...');
|
||||
$composerArgs = [$arch, $flight, $ring, $build, $sku, $type, $flags, $branch];
|
||||
$composerArgs = [$arch, $flight, $ring, $build, $sku, $type, $flags, $branch, $targetRelease];
|
||||
$out = sendWuPostRequestHelper('client', 'composeFetchUpdRequest', $composerArgs);
|
||||
if($out === false || $out['error'] != 200) {
|
||||
consoleLogger('The request has failed');
|
||||
@@ -231,7 +262,7 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
$num++;
|
||||
consoleLogger("Checking build information for update {$num} of {$updatesNum}...");
|
||||
|
||||
$info = parseFetchUpdate($val, $out, $arch, $ring, $flight, $build, $sku, $type, $flags, $branch);
|
||||
$info = parseFetchUpdate($val, $out, $arch, $ring, $flight, $build, $sku, $type, $flags, $branch, $targetRelease);
|
||||
if(isset($info['error'])) {
|
||||
$errorCount++;
|
||||
continue;
|
||||
@@ -261,7 +292,7 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku, $type, $flags, $branch) {
|
||||
function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku, $type, $flags, $branch, $targetRelease) {
|
||||
$updateNumId = preg_replace('/<UpdateInfo><ID>|<\/ID>.*/i', '', $updateInfo);
|
||||
|
||||
$updates = preg_replace('/<Update>/', "\n<Update>", $out);
|
||||
@@ -284,32 +315,40 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
return array('error' => 'EMPTY_FILELIST');
|
||||
}
|
||||
|
||||
preg_match('/ProductReleaseInstalled Name\="(.*?)\..*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info);
|
||||
$foundType = @strtolower($info[1]);
|
||||
$foundArch = @strtolower($info[2]);
|
||||
$foundBuild = @$info[3];
|
||||
preg_match('/ProductReleaseInstalled Name\="(.*?)" Version\="(.*?)"/', $updateInfo, $info);
|
||||
if(!isset($info[0]) || empty($info[0])) {
|
||||
$infoExt = preg_grep('/<ExtendedProperties .*?>/', $updateMeta);
|
||||
preg_match('/ProductName\="(.*?)" ReleaseVersion\="(.*?)"/', $infoExt[0], $info);
|
||||
}
|
||||
$matchName = @strtolower($info[1]);
|
||||
$matchVersion = @$info[2];
|
||||
|
||||
if(!isset($foundArch) || empty($foundArch)) {
|
||||
preg_match('/ProductReleaseInstalled Name\="(.*?)\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info);
|
||||
$foundType = @strtolower($info[1]);
|
||||
$foundArch = @strtolower($info[2]);
|
||||
$foundBuild = @$info[3];
|
||||
if($matchVersion == '1.0.0.0' || $matchVersion == '10.0.0.0') {
|
||||
preg_match('/"BuildFlightVersion":"(.*?)"/', $updateInfo, $infoVer);
|
||||
$matchVersion = @$infoVer[1];
|
||||
}
|
||||
|
||||
if(!isset($foundArch) || empty($foundArch)) {
|
||||
preg_match('/ProductReleaseInstalled Name\="(.*?)\.(.*?)" Version\="(.*?)"/', $updateInfo, $info);
|
||||
$foundType = @strtolower($info[1]);
|
||||
$foundArch = @strtolower($info[2]);
|
||||
$foundBuild = @$info[3];
|
||||
}
|
||||
$arrayName = explode('.', $matchName);
|
||||
$arrayVersion = explode('.', $matchVersion);
|
||||
|
||||
$foundArch = $arrayName[count($arrayName)-1];
|
||||
$foundType = $arrayName[0];
|
||||
if($foundType == 'windows' || $foundType == 'microsoft')
|
||||
$foundType = $arrayName[1];
|
||||
|
||||
$isNet = 0;
|
||||
if(strpos($foundArch, 'netfx') !== false) {
|
||||
if(strpos($matchVersion, '10.0.') !== false) {
|
||||
$foundBuild = $arrayVersion[2].'.'.$arrayVersion[3];
|
||||
} elseif($foundType == 'netfx') {
|
||||
$foundBuild = $arrayVersion[1].'.'.$arrayVersion[2];
|
||||
$isNet = 1;
|
||||
preg_match('/ProductReleaseInstalled Name\=".*\.(.*?)\.(.*?)" Version\=".*\.\d{5}\.(.*?)"/', $updateInfo, $info);
|
||||
$foundType = @strtolower($info[1]);
|
||||
$foundArch = @strtolower($info[2]);
|
||||
$foundBuild = @$info[3];
|
||||
} else {
|
||||
$foundBuild = $matchVersion;
|
||||
}
|
||||
|
||||
$addKB = 0;
|
||||
if($isNet || $foundType == 'oobe') {
|
||||
$addKB = 1;
|
||||
}
|
||||
|
||||
$updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta);
|
||||
@@ -328,9 +367,12 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
if($foundType == 'hololens' || $foundType == 'wcosdevice0')
|
||||
$updateTitle = preg_replace('/ for .{3,5}-based/i', ' for', $updateTitle);
|
||||
|
||||
preg_match('/\((KB.*?)\)/', $updateTitle, $updateKB);
|
||||
|
||||
$isCumulativeUpdate = 0;
|
||||
if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update|Microsoft Edge|Windows Feature Experience Pack|Cumulative security Hotpatch/i', $updateTitle)) {
|
||||
if(preg_match('/\d{4}-\d{2}.+Update|(Cumulative|Security|Preview) Update|Microsoft Edge|Windows Feature Experience Pack|Cumulative security Hotpatch/i', $updateTitle)) {
|
||||
$isCumulativeUpdate = 1;
|
||||
|
||||
if($isNet) {
|
||||
$updateTitle = preg_replace("/3.5 and 4.8.1 |3.5 and 4.8 | for $foundArch| for x64| \(KB.*?\)/i", '', $updateTitle);
|
||||
} else {
|
||||
@@ -345,6 +387,15 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
$updateTitle = str_replace('Windows 11', 'Windows Server', $updateTitle);
|
||||
}
|
||||
|
||||
if(preg_match('/Windows 1\d|Server|Azure Stack HCI|Windows CPC OS/i', $updateTitle) !== 1) {
|
||||
$osName = $foundType != 'server' ? 'Windows 11' : 'Microsoft server operating system';
|
||||
$updateTitle = str_replace('Update', "Update for $osName", $updateTitle);
|
||||
}
|
||||
|
||||
if($foundType == 'oobe' && !preg_match("/OOBE|Out of Box/i", $updateTitle)) {
|
||||
$updateTitle = str_replace('Update', 'OOBE Update', $updateTitle);
|
||||
}
|
||||
|
||||
if($sku == 406)
|
||||
$updateTitle = str_replace('Microsoft server operating system', 'Azure Stack HCI', $updateTitle);
|
||||
|
||||
@@ -354,7 +405,10 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
if($foundType == 'hololens' || $foundType == 'wcosdevice0')
|
||||
$updateTitle = $updateTitle.' - '.$type;
|
||||
|
||||
if(!preg_match("/$foundBuild/i", $updateTitle))
|
||||
if($addKB && isset($updateKB[0]))
|
||||
$updateTitle = $updateTitle.' - '.$updateKB[1];
|
||||
|
||||
if(!str_contains($updateTitle, $foundBuild))
|
||||
$updateTitle = $updateTitle.' ('.$foundBuild.')';
|
||||
|
||||
preg_match('/UpdateID=".*?"/', $updateInfo, $updateId);
|
||||
@@ -453,6 +507,7 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
$temp['ring'] = $ring;
|
||||
$temp['flight'] = $flight;
|
||||
$temp['branch'] = $branch;
|
||||
$temp['targetRelease'] = $targetRelease;
|
||||
$temp['arch'] = $foundArch;
|
||||
$temp['fetchArch'] = $arch == 'all' ? 'amd64' : $arch;
|
||||
$temp['build'] = $foundBuild;
|
||||
|
||||
+74
-75
@@ -27,19 +27,8 @@ function uupApiPrivateInvalidateFileinfoCache() {
|
||||
$cache2->delete();
|
||||
}
|
||||
|
||||
function uupApiPrivateGetFromFileinfo($sortByDate = 0) {
|
||||
$dirs = uupApiGetFileinfoDirs();
|
||||
$fileinfo = $dirs['fileinfoData'];
|
||||
$fileinfoRoot = $dirs['fileinfo'];
|
||||
|
||||
$files = scandir($fileinfo);
|
||||
$files = preg_grep('/\.json$/', $files);
|
||||
|
||||
consoleLogger('Parsing database info...');
|
||||
|
||||
$cacheFile = $fileinfoRoot.'/cache.json';
|
||||
function uupApiGetFileInfoCache($cacheFile) {
|
||||
$cacheV2Version = 1;
|
||||
|
||||
$database = uupApiReadJson($cacheFile);
|
||||
|
||||
if(isset($database['version'])) {
|
||||
@@ -54,88 +43,98 @@ function uupApiPrivateGetFromFileinfo($sortByDate = 0) {
|
||||
$database = array();
|
||||
}
|
||||
|
||||
if(empty($database)) $database = array();
|
||||
if(empty($database))
|
||||
$database = [];
|
||||
|
||||
return $database;
|
||||
}
|
||||
|
||||
function uupApiPrivateGetCachedBuild(&$cache, $uuid) {
|
||||
if(!isset($cache[$uuid])) {
|
||||
$info = uupApiReadFileinfoMeta($uuid);
|
||||
$data = [
|
||||
'title' => isset($info['title']) ? $info['title'] : 'UNKNOWN',
|
||||
'build' => isset($info['build']) ? $info['build'] : 'UNKNOWN',
|
||||
'arch' => isset($info['arch']) ? $info['arch'] : 'UNKNOWN',
|
||||
'created' => isset($info['created']) ? $info['created'] : null,
|
||||
];
|
||||
|
||||
$cache[$uuid] = $data;
|
||||
} else {
|
||||
$data = $cache[$uuid];
|
||||
}
|
||||
|
||||
$data['uuid'] = $uuid;
|
||||
return $data;
|
||||
}
|
||||
|
||||
function uupApiPrivateGetSortTag($data, $sortByDate) {
|
||||
$tmp = explode('.', $data['build']);
|
||||
|
||||
if($sortByDate) {
|
||||
$tag = PHP_INT_MAX - intval($data['created']);
|
||||
} else {
|
||||
$tag = '';
|
||||
}
|
||||
|
||||
$tag .= intval(uupApiIsUpdateLowPriority($data['title']));
|
||||
|
||||
if(isset($tmp[1])) {
|
||||
$tag .= str_pad(999999999 - $tmp[0], 10, '0', STR_PAD_LEFT);
|
||||
$tag .= str_pad(999999999 - $tmp[1], 10, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$tag .= $data['arch'] . $data['title'] . $data['uuid'];
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
function uupApiPrivateGetFromFileinfo($sortByDate = 0) {
|
||||
$dirs = uupApiGetFileinfoDirs();
|
||||
$fileinfo = $dirs['fileinfoData'];
|
||||
$fileinfoRoot = $dirs['fileinfo'];
|
||||
|
||||
$files = scandir($fileinfo);
|
||||
$files = preg_grep('/\.json$/', $files);
|
||||
|
||||
consoleLogger('Parsing database info...');
|
||||
|
||||
$cacheFile = $fileinfoRoot.'/cache.json';
|
||||
$cacheV2Version = 1;
|
||||
|
||||
$database = uupApiGetFileInfoCache($cacheFile);
|
||||
$oldDb = $database;
|
||||
|
||||
$newDb = array();
|
||||
$builds = array();
|
||||
foreach($files as $file) {
|
||||
if($file == '.' || $file == '..')
|
||||
continue;
|
||||
|
||||
$uuid = preg_replace('/\.json$/', '', $file);
|
||||
|
||||
if(!isset($database[$uuid])) {
|
||||
$info = uupApiReadFileinfoMeta($uuid);
|
||||
$data = uupApiPrivateGetCachedBuild($database, $uuid);
|
||||
$tag = uupApiPrivateGetSortTag($data, $sortByDate);
|
||||
|
||||
$title = isset($info['title']) ? $info['title'] : 'UNKNOWN';
|
||||
$build = isset($info['build']) ? $info['build'] : 'UNKNOWN';
|
||||
$arch = isset($info['arch']) ? $info['arch'] : 'UNKNOWN';
|
||||
$created = isset($info['created']) ? $info['created'] : null;
|
||||
|
||||
$temp = array(
|
||||
'title' => $title,
|
||||
'build' => $build,
|
||||
'arch' => $arch,
|
||||
'created' => $created,
|
||||
);
|
||||
|
||||
$newDb[$uuid] = $temp;
|
||||
} else {
|
||||
$title = $database[$uuid]['title'];
|
||||
$build = $database[$uuid]['build'];
|
||||
$arch = $database[$uuid]['arch'];
|
||||
$created = $database[$uuid]['created'];
|
||||
|
||||
$newDb[$uuid] = $database[$uuid];
|
||||
$buildAssoc[$tag] = $uuid;
|
||||
}
|
||||
|
||||
$temp = array(
|
||||
'title' => $title,
|
||||
'build' => $build,
|
||||
'arch' => $arch,
|
||||
'created' => $created,
|
||||
'uuid' => $uuid,
|
||||
);
|
||||
if(empty($buildAssoc))
|
||||
return [];
|
||||
|
||||
$tmp = explode('.', $build);
|
||||
if(isset($tmp[1])) {
|
||||
$tmp[0] = str_pad($tmp[0], 10, '0', STR_PAD_LEFT);
|
||||
$tmp[1] = str_pad($tmp[1], 10, '0', STR_PAD_LEFT);
|
||||
$tmp = $tmp[0].$tmp[1];
|
||||
} else {
|
||||
consoleLogger($uuid.'.json appears to be broken and may be useless.');
|
||||
$tmp = 0;
|
||||
ksort($buildAssoc);
|
||||
|
||||
$builds = [];
|
||||
foreach($buildAssoc as $val) {
|
||||
$builds[] = uupApiPrivateGetCachedBuild($database, $val);
|
||||
}
|
||||
|
||||
if($sortByDate) {
|
||||
$tmp = $created.$tmp;
|
||||
}
|
||||
|
||||
$buildAssoc[$tmp][] = $arch.$title.$uuid;
|
||||
$builds[$tmp.$arch.$title.$uuid] = $temp;
|
||||
}
|
||||
|
||||
if(empty($buildAssoc)) return [];
|
||||
|
||||
krsort($buildAssoc);
|
||||
$buildsNew = array();
|
||||
|
||||
foreach($buildAssoc as $key => $val) {
|
||||
sort($val);
|
||||
foreach($val as $id) {
|
||||
$buildsNew[] = $builds[$key.$id];
|
||||
}
|
||||
}
|
||||
|
||||
$builds = $buildsNew;
|
||||
consoleLogger('Done parsing database info.');
|
||||
|
||||
if($newDb != $database) {
|
||||
if($database != $oldDb) {
|
||||
if(!file_exists('cache')) mkdir('cache');
|
||||
|
||||
$cacheData = array(
|
||||
'version' => $cacheV2Version,
|
||||
'database' => $newDb,
|
||||
'database' => $database,
|
||||
);
|
||||
|
||||
$success = @file_put_contents(
|
||||
|
||||
+32
-4
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// Composes DeviceAttributes parameter needed to fetch data
|
||||
function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $flags, $branch) {
|
||||
function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $flags, $branch, $targetRelease) {
|
||||
if($branch == 'auto')
|
||||
$branch = branchFromBuild($build);
|
||||
|
||||
@@ -116,7 +116,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
$attrib = array(
|
||||
'App=WU_OS',
|
||||
'AppVer='.$build,
|
||||
'AttrDataVer=281',
|
||||
'AttrDataVer=352',
|
||||
'AllowInPlaceUpgrade=1',
|
||||
'AllowOptionalContent=1',
|
||||
'AllowUpgradesWithUnsupportedTPMOrCPU=1',
|
||||
@@ -174,6 +174,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
'IsDeviceRetailDemo=0',
|
||||
'IsFlightingEnabled='.$flightEnabled,
|
||||
'IsRetailOS='.$isRetail,
|
||||
'LaunchUserOOBE=1',
|
||||
'LCUVer=0.0.0.0',
|
||||
'MediaBranch=',
|
||||
'MediaVersion='.$build,
|
||||
@@ -232,9 +233,19 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
'UserInPlaceUpgrade=1',
|
||||
'VBSState=2',
|
||||
'Version_RS5=2000000000',
|
||||
'Win10CommercialAzureESUEligible=1',
|
||||
'Win10CommercialKeybasedESUEligible=1',
|
||||
'Win10CommercialW365ESUEligible=1',
|
||||
'Win10ConsumerESUStatus=3',
|
||||
'Win10ConsumerESUAY=9',
|
||||
'WuClientVer='.$build,
|
||||
);
|
||||
|
||||
if($bldnum >= 26100) {
|
||||
$attrib[] = 'FlightUpgradeTarget='.$targetRelease;
|
||||
$attrib[] = 'IsFutureKeyEnabled=1';
|
||||
}
|
||||
|
||||
if(in_array('thisonly', $flags)) {
|
||||
$attrib[] = 'MediaBranch='.$branch;
|
||||
}
|
||||
@@ -312,9 +323,15 @@ function branchFromBuild($build) {
|
||||
case 26100:
|
||||
case 26120:
|
||||
case 26200:
|
||||
case 26300:
|
||||
$branch = 'ge_release';
|
||||
break;
|
||||
|
||||
case 28000:
|
||||
case 28100:
|
||||
$branch = 'br_release';
|
||||
break;
|
||||
|
||||
default:
|
||||
$branch = 'rs_prerelease';
|
||||
break;
|
||||
@@ -351,6 +368,7 @@ function composeFileGetRequest($updateId, $info, $rev = 1, $type = 'Production')
|
||||
$type,
|
||||
isset($info['flags']) ? $info['flags'] : [],
|
||||
isset($info['branch']) ? $info['branch'] : 'auto',
|
||||
isset($info['targetRelease']) ? $info['targetRelease'] : -1
|
||||
);
|
||||
|
||||
return <<<XML
|
||||
@@ -394,7 +412,7 @@ XML;
|
||||
}
|
||||
|
||||
// Composes POST data for fetching the latest update information from Windows Update
|
||||
function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type = 'Production', $flags = [], $branch = 'auto') {
|
||||
function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type = 'Production', $flags = [], $branch = 'auto', $targetRelease = -1) {
|
||||
$encData = uupEncryptedData();
|
||||
if($encData === false)
|
||||
return false;
|
||||
@@ -465,6 +483,8 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
$products[] = "PN=Windows.FeatureExperiencePack.$currArch&Repairable=1&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.ManagementOOBE.$currArch&IsWindowsManagementOOBE=1&Repairable=1&V=$build";
|
||||
$products[] = "PN=Windows.OOBE.$currArch&IsWindowsOOBE=1&Repairable=1&V=$build";
|
||||
$products[] = "PN=Windows.OOBE.Cumulative.$currArch&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.OOBE.Standalone.$currArch&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.UpdateStackPackage.$currArch&Name=Update Stack Package&Repairable=1&V=$build";
|
||||
$products[] = "PN=Hammer.$currArch&Source=UpdateOrchestrator&V=0.0.0.0";
|
||||
$products[] = "PN=MSRT.$currArch&Source=UpdateOrchestrator&V=0.0.0.0";
|
||||
@@ -492,7 +512,8 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
$sku,
|
||||
$type,
|
||||
$flags,
|
||||
$branch
|
||||
$branch,
|
||||
$targetRelease
|
||||
);
|
||||
|
||||
$syncCurrent = in_array('thisonly', $flags) ? 'true' : 'false';
|
||||
@@ -581,6 +602,13 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
<int>3</int>
|
||||
<int>30077688</int>
|
||||
<int>30486944</int>
|
||||
<int>316003061</int>
|
||||
<int>326686062</int>
|
||||
<int>326686063</int>
|
||||
<int>327065581</int>
|
||||
<int>327072300</int>
|
||||
<int>327072305</int>
|
||||
<int>327100345</int>
|
||||
<int>5143990</int>
|
||||
<int>5169043</int>
|
||||
<int>5169044</int>
|
||||
|
||||
@@ -207,3 +207,18 @@ function getAllowedFlags() {
|
||||
function uupAreAppxPresent($genPack) {
|
||||
return isset($genPack['neutral']['APP']);
|
||||
}
|
||||
|
||||
function uupApiIsUpdateLowPriority($title) {
|
||||
$titles = [
|
||||
'Update Stack Package',
|
||||
'.NET Framework',
|
||||
'OOBE'
|
||||
];
|
||||
|
||||
foreach($titles as $val) {
|
||||
if(str_contains($title, $val) == true)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user