From f5f4795cd9ce6e73b56b8ac2560fd6f296650698 Mon Sep 17 00:00:00 2001 From: eraseyourknees <112027564+eraseyourknees@users.noreply.github.com> Date: Fri, 16 Sep 2022 00:34:44 +0200 Subject: [PATCH] Add support for the internal corpnet --- fetchupd.php | 3 ++- shared/requests.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fetchupd.php b/fetchupd.php index 69fa50a..c246a4a 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -283,7 +283,8 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku return array('error' => 'BROKEN_UPDATE'); } - if(preg_match('/Corpnet Required/i', $updateTitle)) { + $isCorpnet = preg_match('/Corpnet Required/i', $updateTitle); + if($isCorpnet && !uupApiConfigIsTrue('allow_corpnet')) { consoleLogger('Skipping corpnet only update...'); return array('error' => 'CORPNET_ONLY_UPDATE'); } diff --git a/shared/requests.php b/shared/requests.php index a40977d..a94d02f 100644 --- a/shared/requests.php +++ b/shared/requests.php @@ -184,6 +184,10 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type) { 'WuClientVer='.$build, ); + if($ring == 'MSIT' && uupApiConfigIsTrue('allow_corpnet')) { + $attrib[] = 'DUInternal=1'; + } + return htmlentities('E:'.implode('&', $attrib)); }