Add support for channels, keep compatibility with rings, update readme

This commit is contained in:
abbodi1406 2020-07-11 05:36:34 +03:00
parent da6129c720
commit 083fe875f8
4 changed files with 46 additions and 17 deletions

View File

@ -56,11 +56,11 @@ function uupFetchUpd(
return array('error' => 'UNKNOWN_ARCH'); return array('error' => 'UNKNOWN_ARCH');
} }
if(!($ring == 'WIF' || $ring == 'WIS' || $ring == 'RP' || $ring == 'RETAIL' || $ring == 'MSIT')) { if(!($ring == 'DEV' || $ring == 'BETA' || $ring == 'RELEASEPREVIEW' || $ring == 'WIF' || $ring == 'WIS' || $ring == 'RP' || $ring == 'RETAIL' || $ring == 'MSIT')) {
return array('error' => 'UNKNOWN_RING'); return array('error' => 'UNKNOWN_RING');
} }
if(!($flight == 'Skip' || $flight == 'Active')) { if(!($flight == 'Mainline' || $flight == 'Active' || $flight == 'Skip')) {
return array('error' => 'UNKNOWN_FLIGHT'); return array('error' => 'UNKNOWN_FLIGHT');
} }
@ -305,8 +305,8 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
$temp = array(); $temp = array();
$temp['title'] = $updateTitle; $temp['title'] = $updateTitle;
$temp['ring'] = $ring; $temp['channel'] = $ring;
$temp['flight'] = $flight; $temp['content'] = $flight;
$temp['arch'] = $foundArch; $temp['arch'] = $foundArch;
$temp['build'] = $foundBuild; $temp['build'] = $foundBuild;
$temp['checkBuild'] = $build; $temp['checkBuild'] = $build;

View File

@ -7,13 +7,15 @@ Fetches latest update information from Windows Update servers.
Parameters: Parameters:
- `arch` - Architecture of build to find - `arch` - Architecture of build to find
- **Supported values:** `amd64`, `arm64`, `x86` - **Supported values:** `amd64`, `x86`, `arm64`, `all`
- `ring` - Ring to use when fetching information - `ring` - Channel to use when fetching information (Previously called Ring)
- **Supported values:** `WIF`, `WIS`, `RP`, `RETAIL` - **Supported values:** `Dev`, `Beta`, `ReleasePreview`, `Retail`
- **Old Ring values :** `WIF`, `WIS`, `RP`
- `flight` - Flight to use when fetching information - `flight` - Content type to use when fetching information (Previously called Flight)
- **Supported values:** `Active`, `Skip`, `Current` - **Supported values:** `Mainline`
- **Old Flight values:** `Active`, `Skip`, `Current`
- **NOTE:** `Skip` is for `WIF` ring only. `Current` is for `RP` ring only. - **NOTE:** `Skip` is for `WIF` ring only. `Current` is for `RP` ring only.
- `build` - Build number to use when fetching information - `build` - Build number to use when fetching information

View File

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

View File

@ -26,18 +26,41 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
$arch = $arch[0]; $arch = $arch[0];
} }
if($sku == 125 || $sku == 126 || $sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168)
$blockUpgrades = 1;
$fltContent = 'Mainline';
$fltRing = 'External';
if($ring == 'RETAIL') { if($ring == 'RETAIL') {
$fltBranch = '';
$fltContent = '';
$fltRing = 'Retail';
$flightEnabled = 0; $flightEnabled = 0;
$isRetail = 1; $isRetail = 1;
} }
if($sku == 125 || $sku == 126) if($ring == 'WIF' || $ring == 'DEV') {
$blockUpgrades = 1; $fltBranch = 'Dev';
}
if($ring == 'WIS' || $ring == 'BETA') {
$fltBranch = 'Beta';
}
if($ring == 'RP' || $ring == 'RELEASEPREVIEW') {
$fltBranch = 'ReleasePreview';
}
if($ring == 'MSIT') {
$fltBranch = 'MSIT';
$fltRing = 'Internal';
}
$attrib = array( $attrib = array(
'App=WU_OS', 'App=WU_OS',
'AppVer='.$build, 'AppVer='.$build,
'AttrDataVer=96', 'AttrDataVer=99',
'BlockFeatureUpdates='.$blockUpgrades, 'BlockFeatureUpdates='.$blockUpgrades,
'BranchReadinessLevel=CB', 'BranchReadinessLevel=CB',
'CurrentBranch='.$branch, 'CurrentBranch='.$branch,
@ -48,9 +71,9 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) {
'DeviceFamily=Windows.Desktop', 'DeviceFamily=Windows.Desktop',
'EKB19H2InstallCount=1', 'EKB19H2InstallCount=1',
'EKB19H2InstallTimeEpoch=1255000000', 'EKB19H2InstallTimeEpoch=1255000000',
'FlightContent='.$flight, 'FlightingBranchName='.$fltBranch,
'FlightRing='.$ring, 'FlightContent='.$fltContent,
'FlightingBranchName=external', 'FlightRing='.$fltRing,
'Free=32to64', 'Free=32to64',
'GStatus_20H1=2', 'GStatus_20H1=2',
'GStatus_20H1Setup=2', 'GStatus_20H1Setup=2',
@ -124,6 +147,10 @@ function branchFromBuild($build) {
$branch = 'vb_release'; $branch = 'vb_release';
break; break;
case 19042: //19042 is a fake build based on 19041
$branch = 'vb_release';
break;
default: default:
$branch = 'rs_prerelease'; $branch = 'rs_prerelease';
break; break;
@ -206,7 +233,7 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build
$branch = branchFromBuild($build); $branch = branchFromBuild($build);
if($sku == 7 || $sku == 8) { if($sku == 7 || $sku == 8 || $sku == 120 || $sku == 145 || $sku == 146 || $sku == 168) {
$mainProduct = 'Server.OS'; $mainProduct = 'Server.OS';
} else { } else {
$mainProduct = 'Client.OS.rs2'; $mainProduct = 'Client.OS.rs2';