forked from uup-dump/api
		
	Reject the existence of corpnet updates, some minor changes
This commit is contained in:
		| @@ -109,7 +109,7 @@ function uupFetchUpd( | ||||
|     if(!$cached) { | ||||
|         consoleLogger('Fetching information from the server...'); | ||||
|         $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); | ||||
|         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 INFORMATION ---"); | ||||
|  | ||||
|     if(preg_match('/Corpnet Required/i', $updateTitle)) { | ||||
|         consoleLogger('Skipping corpnet only update...'); | ||||
|         return array('error' => 'CORPNET_ONLY_UPDATE'); | ||||
|     } | ||||
|  | ||||
|     $fileWrite = 'NO_SAVE'; | ||||
|     if(!file_exists('fileinfo/'.$updateString.'.json')) { | ||||
|         consoleLogger('WARNING: This build is NOT in the database. It will be saved now.'); | ||||
|   | ||||
							
								
								
									
										2
									
								
								get.php
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								get.php
									
									
									
									
									
								
							| @@ -271,7 +271,7 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) { | ||||
|         $fetchTime = time(); | ||||
|         consoleLogger('Fetching information from the server...'); | ||||
|         $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.'); | ||||
|  | ||||
|         if($cacheRequests == 1) { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| /* | ||||
| Copyright 2019 UUP dump API authors | ||||
| Copyright 2019 whatever127 | ||||
|  | ||||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| you may not use this file except in compliance with the License. | ||||
| @@ -16,7 +16,7 @@ limitations under the License. | ||||
| */ | ||||
|  | ||||
| function uupApiVersion() { | ||||
|     return '1.23.1'; | ||||
|     return '1.24.0'; | ||||
| } | ||||
|  | ||||
| require_once dirname(__FILE__).'/auths.php'; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| /* | ||||
| Copyright 2019 UUP dump API authors | ||||
| Copyright 2019 whatever127 | ||||
|  | ||||
| Licensed under the Apache License, Version 2.0 (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> | ||||
|                 <XmlUpdateFragmentType>FileUrl</XmlUpdateFragmentType> | ||||
|                 <XmlUpdateFragmentType>FileDecryption</XmlUpdateFragmentType> | ||||
|                 <XmlUpdateFragmentType>EsrpDecryptionInformation</XmlUpdateFragmentType> | ||||
|                 <XmlUpdateFragmentType>PiecesHashUrl</XmlUpdateFragmentType> | ||||
|                 <XmlUpdateFragmentType>BlockMapUrl</XmlUpdateFragmentType> | ||||
|             </infoTypes> | ||||
|             <deviceAttributes>$deviceAttributes</deviceAttributes> | ||||
|         </GetExtendedUpdateInfo2> | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| /* | ||||
| Copyright 2018 UUP dump API authors | ||||
| Copyright 2019 whatever127 | ||||
|  | ||||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| you may not use this file except in compliance with the License. | ||||
| @@ -54,6 +54,11 @@ function genUUID() { | ||||
| function sendWuPostRequest($url, $postData) { | ||||
|     $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_POST, 1); | ||||
|     curl_setopt($req, CURLOPT_RETURNTRANSFER, 1); | ||||
| @@ -99,4 +104,12 @@ function consoleLogger($message, $showTime = 1) { | ||||
|     $msg = $currTime.$message; | ||||
|     fwrite(STDERR, $msg."\n"); | ||||
| } | ||||
| ?> | ||||
|  | ||||
| function uupDumpApiGetDebug() { | ||||
|     if(!file_exists('debug.ini')) { | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     $data = parse_ini_file('debug.ini'); | ||||
|     return $data; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user