From fd0b4ee51437937a6eb71e467dd1d4e3aa71048e Mon Sep 17 00:00:00 2001 From: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:59:54 +0300 Subject: [PATCH] APP_MOMENT support --- .gitmodules | 2 +- shared/genpack.php | 24 +++++++++++++++++++++--- shared/main.php | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 48b00ba..9a5296f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "api"] path = api - url = https://github.com/uup-dump-dev/api.git + url = https://github.com/uup-dump/api.git diff --git a/shared/genpack.php b/shared/genpack.php index 29555aa..f70aea5 100644 --- a/shared/genpack.php +++ b/shared/genpack.php @@ -34,6 +34,11 @@ function generatePack($updateId) { return 0; } + $updateTitle = $files['updateName']; + if(preg_match('/Corpnet Required/i', $updateTitle)) { + return 2; + } + $isku = $files['sku']; $ibld = $files['build']; $files = $files['files']; @@ -75,7 +80,7 @@ function generatePack($updateId) { if($ibld > 22557) { $dataFiles = preg_grep('/DesktopTargetCompDB_App_.*\.|ServerTargetCompDB_App_.*\./i', $dataFiles, PREG_GREP_INVERT); $dataApps = preg_grep('/DesktopTargetCompDB_App_.*\.|ServerTargetCompDB_App_.*\./i', $files); - } + } unset($out); exec("$z7z x -o\"$tmp\" \"$loc\" -y", $out, $errCode); @@ -136,7 +141,7 @@ function generatePack($updateId) { if($ibld > 22557) { $dataFiles = preg_grep('/DesktopTargetCompDB_App_.*\.|ServerTargetCompDB_App_.*\./i', $dataFiles, PREG_GREP_INVERT); $dataApps = preg_grep('/DesktopTargetCompDB_App_.*\.|ServerTargetCompDB_App_.*\./i', $filesKeys); - } + } foreach($dataFiles as $val) { if(!$files[$val]['sha256']) { @@ -258,6 +263,19 @@ function generatePack($updateId) { unset($file, $xml, $name, $newName, $lang, $edition); } + if(isset($appsToRead) && $ibld > 22620) foreach($appsToRead as $val) { + $file = $tmp.'/'.$val; + $xml = simplexml_load_file($file); + + foreach($xml->Features->Feature as $ftr) { + if(@count($ftr->Dependencies)) foreach($ftr->Dependencies->Feature as $dep) { + if(isset($dep['Group']) && ($dep['Group'] == 'PreinstalledApps')) $optAppx[] = strtolower($dep['FeatureID']); + } + } + + unset($file, $xml); + } + $appxOpt = array_flip($optAppx); $paks = array(); if(isset($appsToRead)) foreach($appsToRead as $val) { @@ -286,7 +304,7 @@ function generatePack($updateId) { $packages[$lang][$edition][] = $paks[$chk][0]; } continue; - } + } if(!isset($appxOpt[strtolower($ftr['FeatureID'])])) continue; foreach($ftr->Packages->Package as $pkg) { $chk = (string)$pkg['ID']; diff --git a/shared/main.php b/shared/main.php index c990f10..f5565f8 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.2'; + $projVersion = '1.1.3'; return 'UUP dump standalone v'.$projVersion; }