From 7ed939f0cc482c9aa97bedf471df5dfc116892a0 Mon Sep 17 00:00:00 2001 From: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> Date: Wed, 27 Jan 2021 00:52:54 +0300 Subject: [PATCH] Add support for Windows Feature Experience Pack --- fetchupd.php | 14 +++++++++----- get.php | 4 ++-- shared/main.php | 4 ++-- shared/requests.php | 6 +++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fetchupd.php b/fetchupd.php index 68ae474..5fc5978 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -214,16 +214,19 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku } $isCumulativeUpdate = 0; - if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update/i', $updateTitle)) { + if(preg_match('/\d{4}-\d{2}.+Update|Cumulative Update|Microsoft Edge|Windows Feature Experience Pack/i', $updateTitle)) { $isCumulativeUpdate = 1; $updateTitle = preg_replace('/ for .{3,5}-based systems| \(KB.*?\)/i', '', $updateTitle); } - $updateTitle = preg_replace("/ ?\d{4}-\d{2}\w* ?| ?$foundArch ?| ?x64 ?/i", '', $updateTitle); + $updateTitle = preg_replace("/ ?\d{4}-\d{2}\D ?| ?$foundArch ?| ?x64 ?/i", '', $updateTitle); if($foundType == 'server') $updateTitle = str_replace('Windows 10', 'Windows Server', $updateTitle); + if($foundType == 'sedimentpack') + $updateTitle = $updateTitle.' - KB4023057'; + if(!preg_match("/$foundBuild/i", $updateTitle)) $updateTitle = $updateTitle.' ('.$foundBuild.')'; @@ -292,13 +295,14 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku $shaArray = array(); foreach($fileList[0] as $val) { + preg_match('/FileName=".*?"/', $val, $name); + $name = preg_replace('/FileName="|"$/', '', $name[0]); + if(preg_match('/.*_Diffs_.*|.*_Forward_CompDB_.*|\.cbsu\.cab$/i', $name)) continue; + preg_match('/Digest=".*?"/', $val, $sha1); $sha1 = preg_replace('/Digest="|"$/', '', $sha1[0]); $sha1 = bin2hex(base64_decode($sha1)); - preg_match('/FileName=".*?"/', $val, $name); - $name = preg_replace('/FileName="|"$/', '', $name[0]); - preg_match('/Size=".*?"/', $val, $size); $size = preg_replace('/Size="|"$/', '', $size[0]); diff --git a/get.php b/get.php index e6fe493..41fd197 100644 --- a/get.php +++ b/get.php @@ -152,7 +152,7 @@ function uupGetFiles( if(isset($files[$val])) unset($files[$val]); } - $diffs = preg_grep('/.*_Diffs_.*/i', array_keys($files)); + $diffs = preg_grep('/.*_Diffs_.*|.*_Forward_CompDB_.*|\.cbsu\.cab$/i', array_keys($files)); foreach($diffs as $val) { if(isset($files[$val])) unset($files[$val]); } @@ -168,7 +168,7 @@ function uupGetFiles( } unset($index, $name, $psf); - $temp = preg_grep('/'.$updateArch.'_.*|arm64.arm_.*/i', $removeFiles); + $temp = preg_grep('/'.$updateArch.'_.*|arm64\.arm_.*|arm64\.x86_.*/i', $removeFiles); foreach($temp as $key => $val) { if(isset($files[$val.'.cab'])) unset($files[$val.'.cab']); unset($removeFiles[$key]); diff --git a/shared/main.php b/shared/main.php index 7487d8d..93178bd 100644 --- a/shared/main.php +++ b/shared/main.php @@ -1,6 +1,6 @@