From 6fcbb263a396339b07b9cacdccea544d172ab771 Mon Sep 17 00:00:00 2001 From: whatever127 Date: Fri, 24 May 2019 18:25:57 +0200 Subject: [PATCH] Fixed OptionalInstall updates being ignored, fixed #1 --- fetchupd.php | 10 +++-- shared/main.php | 3 +- shared/requests.php | 94 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 95 insertions(+), 12 deletions(-) diff --git a/fetchupd.php b/fetchupd.php index 8694b0f..7c432e1 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -128,7 +128,7 @@ function uupFetchUpd( } preg_match_all('/.*?<\/UpdateInfo>/', $out, $updateInfos); - $updateInfo = preg_grep('/Install<\/Action>/', $updateInfos[0]); + $updateInfo = preg_grep('/true<\/IsLeaf>/', $updateInfos[0]); sort($updateInfo); if(empty($updateInfo)) { @@ -181,8 +181,13 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku $updateFiles = preg_grep('/.*<\/Files>/', $updateMeta); sort($updateFiles); + if(!isset($updateFiles[0])) { + consoleLogger('An error has occurred'); + return array('error' => 'EMPTY_FILELIST'); + } + preg_match('/.*<\/Files>/', $updateFiles[0], $fileList); - if(empty($fileList[0])) { + if(!isset($fileList[0]) || empty($fileList[0])) { consoleLogger('An error has occurred'); return array('error' => 'EMPTY_FILELIST'); } @@ -324,4 +329,3 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku 'fileWrite' => $fileWrite, ); } -?> diff --git a/shared/main.php b/shared/main.php index 999a160..03c192f 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,9 +16,8 @@ limitations under the License. */ function uupApiVersion() { - return '1.21.6'; + return '1.21.7'; } require_once dirname(__FILE__).'/auths.php'; require_once dirname(__FILE__).'/utils.php'; -?> diff --git a/shared/requests.php b/shared/requests.php index de2690e..71c4ba5 100644 --- a/shared/requests.php +++ b/shared/requests.php @@ -37,15 +37,18 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) { 'BlockFeatureUpdates='.$blockUpgrades, 'BranchReadinessLevel=CB', 'CurrentBranch='.$branch, + 'DataExpDateEpoch_19H1='.(time()+82800), + 'DataVer_RS5=2000000000', 'DefaultUserRegion=191', - 'DataVer_RS5='.PHP_INT_MAX, 'DeviceFamily=Windows.Desktop', 'FlightContent='.$flight, 'FlightRing='.$ring, 'FlightingBranchName=external', 'Free=32to64', - 'GStatus_RS5=2', 'GStatus_19H1=2', + 'GStatus_19H1Setup=Green', + 'GStatus_RS5=2', + 'GenTelRunTimestamp_19H1='.(time()-3600), 'InstallDate=1438196400', 'InstallLanguage=en-US', 'InstallationType=Client', @@ -61,11 +64,12 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) { 'OSVersion='.$build, 'ProcessorIdentifier=Intel64 Family 6 Model 85 Stepping 4', 'ProcessorManufacturer=GenuineIntel', + 'SdbVer_19H1=2000000000', 'TelemetryLevel=3', 'UpdateManagementGroup=2', - 'UpgEx_RS5=Green', 'UpgEx_19H1=Green', - 'Version_RS5='.PHP_INT_MAX, + 'UpgEx_RS5=Green', + 'Version_RS5=2000000000', 'WuClientVer='.$build, ); @@ -239,7 +243,85 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build false - + + 1 + 10 + 105939029 + 105995585 + 106017178 + 107825194 + 10809856 + 11 + 117765322 + 129905029 + 130040030 + 130040031 + 130040032 + 130040033 + 133399034 + 138372035 + 138372036 + 139536037 + 139536038 + 139536039 + 139536040 + 142045136 + 158941041 + 158941042 + 158941043 + 158941044 + 159776047 + 160733048 + 160733049 + 160733050 + 160733051 + 160733055 + 160733056 + 161870057 + 161870058 + 161870059 + 17 + 19 + 2 + 23110993 + 23110994 + 23110995 + 23110996 + 23110999 + 23111000 + 23111001 + 23111002 + 23111003 + 23111004 + 2359974 + 2359977 + 24513870 + 28880263 + 3 + 30077688 + 30486944 + 5143990 + 5169043 + 5169044 + 5169047 + 59830006 + 59830007 + 59830008 + 60484010 + 62450018 + 62450019 + 62450020 + 69801474 + 8788830 + 8806526 + 9125350 + 9154769 + 98959022 + 98959023 + 98959024 + 98959025 + 98959026 + false true @@ -249,7 +331,6 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build Extended LocalizedProperties - Eula en-US @@ -310,4 +391,3 @@ function composeGetCookieRequest($device) { XML; } -?>