forked from uup-dump/standalone
Merge pull request #14 from abbodi1406/master
Enhance sha256 capability check
This commit is contained in:
commit
802c6751c9
@ -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";
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user