Merge pull request #22 from eraseyourknees/master

1.35.0
This commit is contained in:
eraseyourknees 2022-08-29 17:06:05 +02:00 committed by GitHub
commit 4a29784380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 7 deletions

View File

@ -17,15 +17,13 @@ limitations under the License.
class UupDumpCache { class UupDumpCache {
private $cacheFile; private $cacheFile;
private $isCompressed;
private $newCacheVersion = 1; private $newCacheVersion = 1;
public function __construct($resource, $compressed = true) { public function __construct($resource, private $isCompressed = true) {
$res = $resource."+cache_v".$this->newCacheVersion; $res = $resource."+cache_v".$this->newCacheVersion;
$cacheHash = hash('sha256', strtolower($res)); $cacheHash = hash('sha256', strtolower($res));
$ext = $compressed ? '.json.gz' : '.json'; $ext = $isCompressed ? '.json.gz' : '.json';
$this->cacheFile = 'cache/'.$cacheHash.$ext; $this->cacheFile = 'cache/'.$cacheHash.$ext;
$this->isCompressed = $compressed;
} }
public function getFileName() { public function getFileName() {

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
function uupApiVersion() { function uupApiVersion() {
return '1.34.0'; return '1.35.0';
} }
require_once dirname(__FILE__).'/auths.php'; require_once dirname(__FILE__).'/auths.php';

View File

@ -34,7 +34,7 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku, $type) {
if($sku == 119) { if($sku == 119) {
$dvcFamily = 'Windows.Team'; $dvcFamily = 'Windows.Team';
} }
if(in_array($sku, [7,8,12,13,79,80,120,145,146,147,148,159,160,406,407,408])) { if(uupApiIsServer($sku)) {
$dvcFamily = 'Windows.Server'; $dvcFamily = 'Windows.Server';
$insType = 'Server'; $insType = 'Server';
$blockUpgrades = 1; $blockUpgrades = 1;
@ -329,7 +329,7 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build
$branch = branchFromBuild($build); $branch = branchFromBuild($build);
$mainProduct = 'Client.OS.rs2'; $mainProduct = 'Client.OS.rs2';
if(in_array($sku, [7,8,12,13,79,80,120,145,146,147,148,159,160,406,407,408])) { if(uupApiIsServer($sku)) {
$mainProduct = 'Server.OS'; $mainProduct = 'Server.OS';
} }
/*/ Hololens /*/ Hololens

View File

@ -134,3 +134,19 @@ function uupApiCheckUpdateId($updateId) {
$updateId $updateId
); );
} }
function uupApiIsServer($skuId) {
$serverSkus = [
7, 8, 12, 13, 79, 80, 120, 145, 146,
147, 148, 159, 160, 406, 407, 408
];
return in_array($skuId, $serverSkus);
}
function uupApiBuildMajor($build) {
if(!str_contains($build, '.')) {
return intval($build);
}
return intval(explode('.', $build)[0]);
}