diff --git a/get.php b/get.php index e7adde4..7035189 100644 --- a/get.php +++ b/get.php @@ -188,10 +188,7 @@ function uupGetFiles( $newFiles = array(); foreach($filesList as $val) { - $name = preg_replace('/~31bf3856ad364e35/', '', $val); - $name = preg_replace('/~~\.|~\./', '.', $name); - $name = preg_replace('/~/', '-', $name); - $name = strtolower($name); + $name = uupCleanName($val); if(isset($files[$name])) { $newFiles[$name] = $files[$name]; @@ -336,11 +333,8 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests) { $temp['uuid'] = $guid; $temp['expire'] = $expire; - $newName = preg_replace('/^cabs_|^metadataesd_|~31bf3856ad364e35/i', '', $name); - $newName = preg_replace('/~~\.|~\./', '.', $newName); - $newName = preg_replace('/~/', '-', $newName); - $newName = strtolower($newName); + $newName = uupCleanName($name); $files[$newName] = $temp; } } @@ -367,14 +361,24 @@ function uupGetOfflineFiles($info) { $temp['uuid'] = null; $temp['expire'] = 0; - $newName = preg_replace('/^cabs_|^metadataesd_|~31bf3856ad364e35/i', '', $name); - $newName = preg_replace('/~~\.|~\./', '.', $newName); - $newName = preg_replace('/~/', '-', $newName); - $newName = strtolower($newName); - + $newName = uupCleanName($name); $files[$newName] = $temp; } } return $files; } + +function uupCleanName($name) { + $replace = array( + 'cabs_' => null, + 'metadataesd_' => null, + '~31bf3856ad364e35' => null, + '~~.' => '.', + '~.' => '.', + '~' => '-', + ); + + $name = strtr($name, 'QWERTYUIOPASDFGHJKLZXCVBNM', 'qwertyuiopasdfghjklzxcvbnm'); + return strtr($name, $replace); +} diff --git a/shared/main.php b/shared/main.php index 6009458..eb60283 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.19.1'; + return '1.19.2'; } require_once dirname(__FILE__).'/auths.php'; diff --git a/shared/packs.php b/shared/packs.php index bed753a..80dcd06 100644 --- a/shared/packs.php +++ b/shared/packs.php @@ -231,6 +231,8 @@ function uupGetGenPacks($build = 15063, $arch = null, $updateId = null) { unset($temp); } } + } elseif(!isset($metadata['knownBuilds'][$useBuild][$arch])) { + return array(); } else { $hash = $metadata['knownBuilds'][$useBuild][$arch]; } diff --git a/shared/requests.php b/shared/requests.php index a397a48..796fb7d 100644 --- a/shared/requests.php +++ b/shared/requests.php @@ -1,6 +1,6 @@ http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetExtendedUpdateInfo2urn:uuid:'.$uuid.'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured'.$created.''.$expires.''.$device.''.$updateId.''.$rev.'FileUrlFileDecryption'.$deviceAttributes.''; + return << + + http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetExtendedUpdateInfo2 + urn:uuid:$uuid + https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured + + + $created + $expires + + + + $device + + + + + + + + + $updateId + $rev + + + + FileUrl + FileDecryption + + $deviceAttributes + + + +XML; } // Composes POST data for fetching the latest update information from Windows Update @@ -159,7 +197,60 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build $sku ); - return 'http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/SyncUpdatesurn:uuid:'.$uuid.'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx'.$created.''.$expires.''.$device.''.$cookieExpires.''.$encData.'falsefalsetruetrueExtendedLocalizedPropertiesEulaen-USfalse'.$deviceAttributes.''.$callerAttrib.''.$products.''; + return << + + http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/SyncUpdates + urn:uuid:$uuid + https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx + + + $created + $expires + + + + $device + + + + + + + + $cookieExpires + $encData + + + false + + + false + true + true + + + + Extended + LocalizedProperties + Eula + + + en-US + + + + + false + $deviceAttributes + $callerAttrib + $products + + + + + +XML; } // Composes POST data for Get Cookie request @@ -172,6 +263,35 @@ function composeGetCookieRequest($device) { $created = gmdate(DATE_W3C, $createdTime); $expires = gmdate(DATE_W3C, $expiresTime); - return 'http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookieurn:uuid:'.$uuid.'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx'.$created.''.$expires.''.$device.''.$created.''.$created.''.$created.'2.0'; + return << + + http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService/GetCookie + urn:uuid:$uuid + https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx + + + $created + $expires + + + + $device + + + + + + + + $created + + $created + $created + 2.0 + + + +XML; } ?>