From 99533a04a8c8e869aa3a314efe0d4fe57054c254 Mon Sep 17 00:00:00 2001 From: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> Date: Tue, 28 Sep 2021 18:41:06 +0300 Subject: [PATCH] Enhance sha256 capability check Upgrade to Windows 11 builds include extra EULA files which do not have sha256 value --- shared/genpack.php | 16 +++++++++++----- shared/main.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/shared/genpack.php b/shared/genpack.php index e6bde16..702f47a 100644 --- a/shared/genpack.php +++ b/shared/genpack.php @@ -37,11 +37,6 @@ function generatePack($updateId) { $isku = $files['sku']; $files = $files['files']; - if(!$files[key($files)]['sha256']) { - consoleLogger('Update is not SHA-256 capable!'); - return 0; - } - $filesKeys = array_keys($files); $filesToRead = array(); @@ -50,6 +45,12 @@ function generatePack($updateId) { if(!empty($aggregatedMetadata)) { sort($aggregatedMetadata); $checkFile = $aggregatedMetadata[0]; + + if(!$files[$checkFile]['sha256']) { + consoleLogger('Update is not SHA-256 capable!'); + return 0; + } + $url = $files[$checkFile]['url']; $loc = "$tmp/$checkFile"; @@ -105,6 +106,11 @@ function generatePack($updateId) { $dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\.|ModernPCTargetCompDB\.|HolographicTargetCompDB\./i', $filesKeys); foreach($dataFiles as $val) { + if(!$files[$val]['sha256']) { + consoleLogger('Update is not SHA-256 capable!'); + return 0; + } + $url = $files[$val]['url']; $loc = "$tmp/$val"; diff --git a/shared/main.php b/shared/main.php index 004d66d..57079a4 100644 --- a/shared/main.php +++ b/shared/main.php @@ -2,7 +2,7 @@ require_once dirname(__FILE__).'/../api/shared/main.php'; function brand($script = null) { - $projVersion = '1.1.0'; + $projVersion = '1.1.1'; return 'UUP dump standalone v'.$projVersion; }