Enhance sha256 capability check

Upgrade to Windows 11 builds include extra EULA files which do not have sha256 value
This commit is contained in:
abbodi1406 2021-09-28 18:41:06 +03:00
parent 337a58cd39
commit 99533a04a8
2 changed files with 12 additions and 6 deletions

View File

@ -37,11 +37,6 @@ function generatePack($updateId) {
$isku = $files['sku']; $isku = $files['sku'];
$files = $files['files']; $files = $files['files'];
if(!$files[key($files)]['sha256']) {
consoleLogger('Update is not SHA-256 capable!');
return 0;
}
$filesKeys = array_keys($files); $filesKeys = array_keys($files);
$filesToRead = array(); $filesToRead = array();
@ -50,6 +45,12 @@ function generatePack($updateId) {
if(!empty($aggregatedMetadata)) { if(!empty($aggregatedMetadata)) {
sort($aggregatedMetadata); sort($aggregatedMetadata);
$checkFile = $aggregatedMetadata[0]; $checkFile = $aggregatedMetadata[0];
if(!$files[$checkFile]['sha256']) {
consoleLogger('Update is not SHA-256 capable!');
return 0;
}
$url = $files[$checkFile]['url']; $url = $files[$checkFile]['url'];
$loc = "$tmp/$checkFile"; $loc = "$tmp/$checkFile";
@ -105,6 +106,11 @@ function generatePack($updateId) {
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\.|ModernPCTargetCompDB\.|HolographicTargetCompDB\./i', $filesKeys); $dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\.|ModernPCTargetCompDB\.|HolographicTargetCompDB\./i', $filesKeys);
foreach($dataFiles as $val) { foreach($dataFiles as $val) {
if(!$files[$val]['sha256']) {
consoleLogger('Update is not SHA-256 capable!');
return 0;
}
$url = $files[$val]['url']; $url = $files[$val]['url'];
$loc = "$tmp/$val"; $loc = "$tmp/$val";

View File

@ -2,7 +2,7 @@
require_once dirname(__FILE__).'/../api/shared/main.php'; require_once dirname(__FILE__).'/../api/shared/main.php';
function brand($script = null) { function brand($script = null) {
$projVersion = '1.1.0'; $projVersion = '1.1.1';
return 'UUP dump standalone v'.$projVersion; return 'UUP dump standalone v'.$projVersion;
} }