Compare commits
16 Commits
d58f53de42
...
master
Author | SHA1 | Date | |
---|---|---|---|
37cefa11c6 | |||
862d157672 | |||
e433df62cf | |||
1933521e0d | |||
7b3cd4eb10 | |||
c1f00cecbd | |||
8b576e4496 | |||
21b1500490 | |||
fb2c89b2f8 | |||
846feb2629 | |||
5e31a6f724 | |||
faa3b7fa45 | |||
42b1091c0b | |||
aa2dbd2938 | |||
42c1c12405 | |||
092e968f0c |
29
fetchupd.php
29
fetchupd.php
@ -50,8 +50,12 @@ function uupApiPrivateGetLatestBuild() {
|
||||
return $build;
|
||||
}
|
||||
|
||||
function uupApiPrivateGetAcceptableBranches() {
|
||||
return [
|
||||
function uupApiPrivateIsAcceptableBranch($branch) {
|
||||
if(!uupApiConfigIsTrue('production_mode')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$branches = [
|
||||
'auto',
|
||||
'rs2_release',
|
||||
'rs3_release',
|
||||
@ -66,8 +70,11 @@ function uupApiPrivateGetAcceptableBranches() {
|
||||
'ni_release',
|
||||
'zn_release',
|
||||
'ge_release',
|
||||
'ge_prerelease',
|
||||
'rs_prerelease',
|
||||
];
|
||||
|
||||
return in_array($branch, $branches);
|
||||
}
|
||||
|
||||
function uupApiPrivateNormalizeFetchParams($params) {
|
||||
@ -173,7 +180,7 @@ function uupFetchUpd2($params, $cacheRequests = 0) {
|
||||
return array('error' => 'ILLEGAL_MINOR');
|
||||
}
|
||||
|
||||
if(!in_array($branch, uupApiPrivateGetAcceptableBranches()))
|
||||
if(!uupApiPrivateIsAcceptableBranch($branch))
|
||||
$branch = 'auto';
|
||||
|
||||
if($ring == 'DEV') $ring = 'WIF';
|
||||
@ -295,6 +302,15 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
$foundBuild = @$info[3];
|
||||
}
|
||||
|
||||
$isNet = 0;
|
||||
if(strpos($foundArch, 'netfx') !== false) {
|
||||
$isNet = 1;
|
||||
preg_match('/ProductReleaseInstalled Name\=".*\.(.*?)\.(.*?)" Version\=".*\.\d{5}\.(.*?)"/', $updateInfo, $info);
|
||||
$foundType = @strtolower($info[1]);
|
||||
$foundArch = @strtolower($info[2]);
|
||||
$foundBuild = @$info[3];
|
||||
}
|
||||
|
||||
$updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta);
|
||||
sort($updateTitle);
|
||||
|
||||
@ -314,7 +330,11 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
$isCumulativeUpdate = 0;
|
||||
if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update|Microsoft Edge|Windows Feature Experience Pack|Cumulative security Hotpatch/i', $updateTitle)) {
|
||||
$isCumulativeUpdate = 1;
|
||||
$updateTitle = preg_replace('/ for .{3,5}-based systems| \(KB.*?\)/i', '', $updateTitle);
|
||||
if($isNet) {
|
||||
$updateTitle = preg_replace("/3.5 and 4.8.1 |3.5 and 4.8 | for $foundArch| for x64| \(KB.*?\)/i", '', $updateTitle);
|
||||
} else {
|
||||
$updateTitle = preg_replace('/ for .{3,5}-based systems| \(KB.*?\)/i', '', $updateTitle);
|
||||
}
|
||||
}
|
||||
|
||||
$updateTitle = preg_replace("/ ?\d{4}-\d{2}\D ?| ?$foundArch ?| ?x64 ?/i", '', $updateTitle);
|
||||
@ -433,6 +453,7 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
||||
$temp['flight'] = $flight;
|
||||
$temp['branch'] = $branch;
|
||||
$temp['arch'] = $foundArch;
|
||||
$temp['fetchArch'] = $arch == 'all' ? 'amd64' : $arch;
|
||||
$temp['build'] = $foundBuild;
|
||||
$temp['checkBuild'] = $build;
|
||||
$temp['sku'] = $sku;
|
||||
|
5
get.php
5
get.php
@ -76,6 +76,8 @@ function uupGetFiles(
|
||||
$info['sku'] = 48;
|
||||
}
|
||||
|
||||
$genPack = [];
|
||||
|
||||
if($usePack) {
|
||||
$genPack = uupApiGetPacks($updateId);
|
||||
if(empty($genPack)) return array('error' => 'UNSUPPORTED_COMBINATION');
|
||||
@ -298,7 +300,7 @@ function uupGetFiles(
|
||||
|
||||
$temp = preg_grep('/Windows(10|11)\.0-KB.*-baseless/i', $filesInfoKeys, PREG_GREP_INVERT);
|
||||
if($appEdition) {
|
||||
$temp = preg_grep('/.*?AggregatedMetadata.*?\.cab|.*?DesktopDeployment.*?\.cab/i', $temp);
|
||||
$temp = preg_grep('/.*?AggregatedMetadata.*?\.cab/i', $temp);
|
||||
} else if($build > 21380) {
|
||||
$temp = preg_grep('/Windows(10|11)\.0-KB|SSU-.*?\....$|.*?AggregatedMetadata.*?\.cab|.*?DesktopDeployment.*?\.cab/i', $temp);
|
||||
} else {
|
||||
@ -372,6 +374,7 @@ function uupGetFiles(
|
||||
'build' => $updateBuild,
|
||||
'sku' => $updateSku,
|
||||
'hasUpdates' => $hasUpdates,
|
||||
'appxPresent' => uupAreAppxPresent($genPack),
|
||||
'files' => $files,
|
||||
];
|
||||
|
||||
|
@ -40,6 +40,7 @@ function uupListLangsInternal($updateId) {
|
||||
return [
|
||||
'langList' => $langList,
|
||||
'langFancyNames' => $langListFancy,
|
||||
'appxPresent' => uupAreAppxPresent($genPack),
|
||||
];
|
||||
}
|
||||
|
||||
@ -51,11 +52,10 @@ function uupListLangs($updateId = 0, $returnInfo = true) {
|
||||
|
||||
$langList = uupListLangsInternal($updateId);
|
||||
|
||||
$response = [
|
||||
'apiVersion' => uupApiVersion(),
|
||||
'langList' => $langList['langList'],
|
||||
'langFancyNames' => $langList['langFancyNames'],
|
||||
];
|
||||
$response = array_merge(
|
||||
['apiVersion' => uupApiVersion()],
|
||||
$langList
|
||||
);
|
||||
|
||||
if($returnInfo) $response['updateInfo'] = $info;
|
||||
|
||||
|
@ -35,6 +35,10 @@ class UupDumpCache {
|
||||
}
|
||||
|
||||
public function get() {
|
||||
if(!uupApiConfigIsTrue('production_mode')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$cacheFile = $this->cacheFile;
|
||||
|
||||
if(!file_exists($cacheFile)) {
|
||||
@ -58,6 +62,10 @@ class UupDumpCache {
|
||||
}
|
||||
|
||||
public function put($content, $validity) {
|
||||
if(!uupApiConfigIsTrue('production_mode')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$cacheFile = $this->cacheFile;
|
||||
$expires = $validity ? time() + $validity : false;
|
||||
|
||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
function uupApiVersion() {
|
||||
return '1.44.1';
|
||||
return '1.49.0';
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/auths.php';
|
||||
|
@ -83,6 +83,7 @@ function uupGetInfoTexts() {
|
||||
'PPIPRO' => 'Windows Team',
|
||||
'PROFESSIONAL' => 'Windows Pro',
|
||||
'PROFESSIONALN' => 'Windows Pro N',
|
||||
'PROFESSIONALCOUNTRYSPECIFIC' => 'Windows Pro China Only',
|
||||
'SERVERSTANDARD' => 'Windows Server Standard',
|
||||
'SERVERSTANDARDCORE' => 'Windows Server Standard, Core',
|
||||
'SERVERDATACENTER' => 'Windows Server Datacenter',
|
||||
|
@ -33,12 +33,14 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
|
||||
$dvcFamily = 'Windows.Desktop';
|
||||
$insType = 'Client';
|
||||
$prodType = 'WinNT';
|
||||
if($sku == 119) {
|
||||
$dvcFamily = 'Windows.Team';
|
||||
}
|
||||
if(uupApiIsServer($sku)) {
|
||||
$dvcFamily = 'Windows.Server';
|
||||
$insType = 'Server';
|
||||
$prodType = 'ServerNT';
|
||||
$blockUpgrades = 1;
|
||||
}
|
||||
/*/ Hololens
|
||||
@ -114,7 +116,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
$attrib = array(
|
||||
'App=WU_OS',
|
||||
'AppVer='.$build,
|
||||
'AttrDataVer=247',
|
||||
'AttrDataVer=281',
|
||||
'AllowInPlaceUpgrade=1',
|
||||
'AllowOptionalContent=1',
|
||||
'AllowUpgradesWithUnsupportedTPMOrCPU=1',
|
||||
@ -122,6 +124,8 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
'BranchReadinessLevel=CB',
|
||||
'CIOptin=1',
|
||||
'CurrentBranch='.$branch,
|
||||
'DataExpDateEpoch_GE24H2='.(time()+82800),
|
||||
'DataExpDateEpoch_GE24H2Setup='.(time()+82800),
|
||||
'DataExpDateEpoch_CU23H2='.(time()+82800),
|
||||
'DataExpDateEpoch_CU23H2Setup='.(time()+82800),
|
||||
'DataExpDateEpoch_NI22H2='.(time()+82800),
|
||||
@ -144,13 +148,15 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
//'FlightContent='.$fltContent,
|
||||
'FlightRing='.$fltRing,
|
||||
'Free=gt64',
|
||||
'GStatus_GE24H2=2',
|
||||
'GStatus_GE24H2Setup=2',
|
||||
'GStatus_CU23H2=2',
|
||||
'GStatus_CU23H2Setup=2',
|
||||
'GStatus_NI23H2=2',
|
||||
'GStatus_NI22H2=2',
|
||||
'GStatus_NI22H2Setup=2',
|
||||
'GStatus_CO21H2=2',
|
||||
'GStatus_CO21H2Setup=2',
|
||||
'GStatus_23H2=2',
|
||||
'GStatus_22H2=2',
|
||||
'GStatus_21H2=2',
|
||||
'GStatus_21H1=2',
|
||||
@ -182,18 +188,21 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
'ProcessorIdentifier=Intel64 Family 6 Model 186 Stepping 3',
|
||||
'ProcessorManufacturer=GenuineIntel',
|
||||
'ProcessorModel=13th Gen Intel(R) Core(TM) i7-1355U',
|
||||
'ProductType='.$prodType,
|
||||
'ReleaseType='.$type,
|
||||
'SdbVer_20H1=2000000000',
|
||||
'SdbVer_19H1=2000000000',
|
||||
'SecureBootCapable=1',
|
||||
'TelemetryLevel=3',
|
||||
'TimestampEpochString_GE24H2='.(time()-3600),
|
||||
'TimestampEpochString_GE24H2Setup='.(time()-3600),
|
||||
'TimestampEpochString_CU23H2='.(time()-3600),
|
||||
'TimestampEpochString_CU23H2Setup='.(time()-3600),
|
||||
'TimestampEpochString_NI23H2='.(time()-3600),
|
||||
'TimestampEpochString_NI22H2='.(time()-3600),
|
||||
'TimestampEpochString_NI22H2Setup='.(time()-3600),
|
||||
'TimestampEpochString_CO21H2='.(time()-3600),
|
||||
'TimestampEpochString_CO21H2Setup='.(time()-3600),
|
||||
'TimestampEpochString_23H2='.(time()-3600),
|
||||
'TimestampEpochString_22H2='.(time()-3600),
|
||||
'TimestampEpochString_21H2='.(time()-3600),
|
||||
'TimestampEpochString_21H1='.(time()-3600),
|
||||
@ -202,7 +211,10 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type, $fl
|
||||
'TPMVersion=2',
|
||||
'UpdateManagementGroup=2',
|
||||
'UpdateOfferedDays=0',
|
||||
'UpgEx_GE24H2Setup=Green',
|
||||
'UpgEx_GE24H2=Green',
|
||||
'UpgEx_CU23H2=Green',
|
||||
'UpgEx_NI23H2=Green',
|
||||
'UpgEx_NI22H2=Green',
|
||||
'UpgEx_CO21H2=Green',
|
||||
'UpgEx_23H2=Green',
|
||||
@ -286,6 +298,7 @@ function branchFromBuild($build) {
|
||||
|
||||
case 22621:
|
||||
case 22631:
|
||||
case 22635:
|
||||
$branch = 'ni_release';
|
||||
break;
|
||||
|
||||
@ -293,6 +306,12 @@ function branchFromBuild($build) {
|
||||
$branch = 'zn_release';
|
||||
break;
|
||||
|
||||
case 26100:
|
||||
case 26120:
|
||||
case 26200:
|
||||
$branch = 'ge_release';
|
||||
break;
|
||||
|
||||
default:
|
||||
$branch = 'rs_prerelease';
|
||||
break;
|
||||
@ -312,11 +331,19 @@ function composeFileGetRequest($updateId, $info, $rev = 1, $type = 'Production')
|
||||
$created = gmdate(DATE_W3C, $createdTime);
|
||||
$expires = gmdate(DATE_W3C, $expiresTime);
|
||||
|
||||
$arch = 'amd64';
|
||||
|
||||
if(isset($info['fetchArch'])) {
|
||||
$arch = $info['fetchArch'];
|
||||
} elseif(isset($info['arch'])) {
|
||||
$arch = $info['arch'];
|
||||
}
|
||||
|
||||
$deviceAttributes = composeDeviceAttributes(
|
||||
isset($info['flight']) ? $info['flight'] : 'Active',
|
||||
isset($info['ring']) ? $info['ring'] : 'RETAIL',
|
||||
isset($info['checkBuild']) ? $info['checkBuild'] : '10.0.19041.1',
|
||||
isset($info['arch']) ? $info['arch'] : 'amd64',
|
||||
$arch,
|
||||
isset($info['sku']) ? $info['sku'] : 48,
|
||||
$type,
|
||||
isset($info['flags']) ? $info['flags'] : [],
|
||||
@ -403,6 +430,10 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
if($sku == 189) {
|
||||
$mainProduct = 'WCOSDevice0.OS';
|
||||
}
|
||||
// WNC
|
||||
if($sku == 210) {
|
||||
$mainProduct = 'WNC.OS';
|
||||
}
|
||||
|
||||
if($arch == 'all') {
|
||||
$arch = array(
|
||||
@ -422,7 +453,7 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
$products[] = "PN=$mainProduct.$currArch&Branch=$branch&PrimaryOSProduct=1&Repairable=1&V=$build&ReofferUpdate=1";
|
||||
$products[] = "PN=Adobe.Flash.$currArch&Repairable=1&V=0.0.0.0";
|
||||
$products[] = "PN=Microsoft.Edge.Stable.$currArch&Repairable=1&V=0.0.0.0";
|
||||
$products[] = "PN=Microsoft.NETFX.$currArch&V=2018.12.2.0";
|
||||
$products[] = "PN=Microsoft.NETFX.$currArch&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.Autopilot.$currArch&Repairable=1&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.AutopilotOOBE.$currArch&Repairable=1&V=0.0.0.0";
|
||||
$products[] = "PN=Windows.Appraiser.$currArch&Repairable=1&V=$build";
|
||||
@ -543,6 +574,7 @@ function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type
|
||||
<int>2359977</int>
|
||||
<int>24513870</int>
|
||||
<int>28880263</int>
|
||||
<int>296374060</int>
|
||||
<int>3</int>
|
||||
<int>30077688</int>
|
||||
<int>30486944</int>
|
||||
|
@ -64,8 +64,12 @@ function sendWuPostRequestInternal($url, $postData, $saveCookie = true) {
|
||||
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($req, CURLOPT_ENCODING, '');
|
||||
curl_setopt($req, CURLOPT_POSTFIELDS, $postData);
|
||||
curl_setopt($req, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($req, CURLOPT_TIMEOUT, 15);
|
||||
|
||||
if(uupApiConfigIsTrue('production_mode')) {
|
||||
curl_setopt($req, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($req, CURLOPT_TIMEOUT, 15);
|
||||
}
|
||||
|
||||
curl_setopt($req, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($req, CURLOPT_HTTPHEADER, array(
|
||||
'User-Agent: Windows-Update-Agent/10.0.10011.16384 Client-Protocol/2.50',
|
||||
@ -199,3 +203,7 @@ function getAllowedFlags() {
|
||||
|
||||
return $flags;
|
||||
}
|
||||
|
||||
function uupAreAppxPresent($genPack) {
|
||||
return isset($genPack['neutral']['APP']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user