Merge pull request #14 from abbodi1406/master

Enhance sha256 capability check
This commit is contained in:
abbodi1406 2021-09-28 18:43:10 +03:00 committed by GitHub
commit 802c6751c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -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";

View File

@ -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;
}