Reject the existence of corpnet updates, some minor changes

This commit is contained in:
whatever127 2019-07-27 19:43:02 +02:00
parent 0af760d408
commit dbd8b5f9c9
5 changed files with 28 additions and 7 deletions

View File

@ -109,7 +109,7 @@ function uupFetchUpd(
if(!$cached) { if(!$cached) {
consoleLogger('Fetching information from the server...'); consoleLogger('Fetching information from the server...');
$postData = composeFetchUpdRequest(uupDevice(), uupEncryptedData(), $arch, $flight, $ring, $build, $sku); $postData = composeFetchUpdRequest(uupDevice(), uupEncryptedData(), $arch, $flight, $ring, $build, $sku);
$out = sendWuPostRequest('https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx', $postData); $out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx', $postData);
$out = html_entity_decode($out); $out = html_entity_decode($out);
consoleLogger('Information has been successfully fetched.'); consoleLogger('Information has been successfully fetched.');
@ -264,6 +264,11 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
consoleLogger("Update ID: ".$updateString); consoleLogger("Update ID: ".$updateString);
consoleLogger("--- UPDATE INFORMATION ---"); consoleLogger("--- UPDATE INFORMATION ---");
if(preg_match('/Corpnet Required/i', $updateTitle)) {
consoleLogger('Skipping corpnet only update...');
return array('error' => 'CORPNET_ONLY_UPDATE');
}
$fileWrite = 'NO_SAVE'; $fileWrite = 'NO_SAVE';
if(!file_exists('fileinfo/'.$updateString.'.json')) { if(!file_exists('fileinfo/'.$updateString.'.json')) {
consoleLogger('WARNING: This build is NOT in the database. It will be saved now.'); consoleLogger('WARNING: This build is NOT in the database. It will be saved now.');

View File

@ -271,7 +271,7 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) {
$fetchTime = time(); $fetchTime = time();
consoleLogger('Fetching information from the server...'); consoleLogger('Fetching information from the server...');
$postData = composeFileGetRequest($updateId, uupDevice(), $info, $rev); $postData = composeFileGetRequest($updateId, uupDevice(), $info, $rev);
$out = sendWuPostRequest('https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured', $postData); $out = sendWuPostRequest('https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured', $postData);
consoleLogger('Information has been successfully fetched.'); consoleLogger('Information has been successfully fetched.');
if($cacheRequests == 1) { if($cacheRequests == 1) {

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
Copyright 2019 UUP dump API authors Copyright 2019 whatever127
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@ limitations under the License.
*/ */
function uupApiVersion() { function uupApiVersion() {
return '1.23.1'; return '1.24.0';
} }
require_once dirname(__FILE__).'/auths.php'; require_once dirname(__FILE__).'/auths.php';

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
Copyright 2019 UUP dump API authors Copyright 2019 whatever127
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -159,6 +159,9 @@ function composeFileGetRequest($updateId, $device, $info, $rev = 1) {
<infoTypes> <infoTypes>
<XmlUpdateFragmentType>FileUrl</XmlUpdateFragmentType> <XmlUpdateFragmentType>FileUrl</XmlUpdateFragmentType>
<XmlUpdateFragmentType>FileDecryption</XmlUpdateFragmentType> <XmlUpdateFragmentType>FileDecryption</XmlUpdateFragmentType>
<XmlUpdateFragmentType>EsrpDecryptionInformation</XmlUpdateFragmentType>
<XmlUpdateFragmentType>PiecesHashUrl</XmlUpdateFragmentType>
<XmlUpdateFragmentType>BlockMapUrl</XmlUpdateFragmentType>
</infoTypes> </infoTypes>
<deviceAttributes>$deviceAttributes</deviceAttributes> <deviceAttributes>$deviceAttributes</deviceAttributes>
</GetExtendedUpdateInfo2> </GetExtendedUpdateInfo2>

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
Copyright 2018 UUP dump API authors Copyright 2019 whatever127
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -54,6 +54,11 @@ function genUUID() {
function sendWuPostRequest($url, $postData) { function sendWuPostRequest($url, $postData) {
$req = curl_init($url); $req = curl_init($url);
$proxy = uupDumpApiGetDebug();
if(isset($proxy['proxy'])) {
curl_setopt($req, CURLOPT_PROXY, $proxy['proxy']);
}
curl_setopt($req, CURLOPT_HEADER, 0); curl_setopt($req, CURLOPT_HEADER, 0);
curl_setopt($req, CURLOPT_POST, 1); curl_setopt($req, CURLOPT_POST, 1);
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1); curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
@ -99,4 +104,12 @@ function consoleLogger($message, $showTime = 1) {
$msg = $currTime.$message; $msg = $currTime.$message;
fwrite(STDERR, $msg."\n"); fwrite(STDERR, $msg."\n");
} }
?>
function uupDumpApiGetDebug() {
if(!file_exists('debug.ini')) {
return null;
}
$data = parse_ini_file('debug.ini');
return $data;
}