forked from uup-dump/api
		
	Fixed OptionalInstall updates being ignored, fixed #1
This commit is contained in:
		
							
								
								
									
										10
									
								
								fetchupd.php
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								fetchupd.php
									
									
									
									
									
								
							| @@ -128,7 +128,7 @@ function uupFetchUpd( | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     preg_match_all('/<UpdateInfo>.*?<\/UpdateInfo>/', $out, $updateInfos); |     preg_match_all('/<UpdateInfo>.*?<\/UpdateInfo>/', $out, $updateInfos); | ||||||
|     $updateInfo = preg_grep('/<Action>Install<\/Action>/', $updateInfos[0]); |     $updateInfo = preg_grep('/<IsLeaf>true<\/IsLeaf>/', $updateInfos[0]); | ||||||
|     sort($updateInfo); |     sort($updateInfo); | ||||||
|  |  | ||||||
|     if(empty($updateInfo)) { |     if(empty($updateInfo)) { | ||||||
| @@ -181,8 +181,13 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku | |||||||
|     $updateFiles = preg_grep('/<Files>.*<\/Files>/', $updateMeta); |     $updateFiles = preg_grep('/<Files>.*<\/Files>/', $updateMeta); | ||||||
|     sort($updateFiles); |     sort($updateFiles); | ||||||
|  |  | ||||||
|  |     if(!isset($updateFiles[0])) { | ||||||
|  |         consoleLogger('An error has occurred'); | ||||||
|  |         return array('error' => 'EMPTY_FILELIST'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     preg_match('/<Files>.*<\/Files>/', $updateFiles[0], $fileList); |     preg_match('/<Files>.*<\/Files>/', $updateFiles[0], $fileList); | ||||||
|     if(empty($fileList[0])) { |     if(!isset($fileList[0]) || empty($fileList[0])) { | ||||||
|         consoleLogger('An error has occurred'); |         consoleLogger('An error has occurred'); | ||||||
|         return array('error' => 'EMPTY_FILELIST'); |         return array('error' => 'EMPTY_FILELIST'); | ||||||
|     } |     } | ||||||
| @@ -324,4 +329,3 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku | |||||||
|         'fileWrite' => $fileWrite, |         'fileWrite' => $fileWrite, | ||||||
|     ); |     ); | ||||||
| } | } | ||||||
| ?> |  | ||||||
|   | |||||||
| @@ -16,9 +16,8 @@ limitations under the License. | |||||||
| */ | */ | ||||||
|  |  | ||||||
| function uupApiVersion() { | function uupApiVersion() { | ||||||
|     return '1.21.6'; |     return '1.21.7'; | ||||||
| } | } | ||||||
|  |  | ||||||
| require_once dirname(__FILE__).'/auths.php'; | require_once dirname(__FILE__).'/auths.php'; | ||||||
| require_once dirname(__FILE__).'/utils.php'; | require_once dirname(__FILE__).'/utils.php'; | ||||||
| ?> |  | ||||||
|   | |||||||
| @@ -37,15 +37,18 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) { | |||||||
|         'BlockFeatureUpdates='.$blockUpgrades, |         'BlockFeatureUpdates='.$blockUpgrades, | ||||||
|         'BranchReadinessLevel=CB', |         'BranchReadinessLevel=CB', | ||||||
|         'CurrentBranch='.$branch, |         'CurrentBranch='.$branch, | ||||||
|  |         'DataExpDateEpoch_19H1='.(time()+82800), | ||||||
|  |         'DataVer_RS5=2000000000', | ||||||
|         'DefaultUserRegion=191', |         'DefaultUserRegion=191', | ||||||
|         'DataVer_RS5='.PHP_INT_MAX, |  | ||||||
|         'DeviceFamily=Windows.Desktop', |         'DeviceFamily=Windows.Desktop', | ||||||
|         'FlightContent='.$flight, |         'FlightContent='.$flight, | ||||||
|         'FlightRing='.$ring, |         'FlightRing='.$ring, | ||||||
|         'FlightingBranchName=external', |         'FlightingBranchName=external', | ||||||
|         'Free=32to64', |         'Free=32to64', | ||||||
|         'GStatus_RS5=2', |  | ||||||
|         'GStatus_19H1=2', |         'GStatus_19H1=2', | ||||||
|  |         'GStatus_19H1Setup=Green', | ||||||
|  |         'GStatus_RS5=2', | ||||||
|  |         'GenTelRunTimestamp_19H1='.(time()-3600), | ||||||
|         'InstallDate=1438196400', |         'InstallDate=1438196400', | ||||||
|         'InstallLanguage=en-US', |         'InstallLanguage=en-US', | ||||||
|         'InstallationType=Client', |         'InstallationType=Client', | ||||||
| @@ -61,11 +64,12 @@ function composeDeviceAttributes($flight, $ring, $build, $arch, $sku) { | |||||||
|         'OSVersion='.$build, |         'OSVersion='.$build, | ||||||
|         'ProcessorIdentifier=Intel64 Family 6 Model 85 Stepping 4', |         'ProcessorIdentifier=Intel64 Family 6 Model 85 Stepping 4', | ||||||
|         'ProcessorManufacturer=GenuineIntel', |         'ProcessorManufacturer=GenuineIntel', | ||||||
|  |         'SdbVer_19H1=2000000000', | ||||||
|         'TelemetryLevel=3', |         'TelemetryLevel=3', | ||||||
|         'UpdateManagementGroup=2', |         'UpdateManagementGroup=2', | ||||||
|         'UpgEx_RS5=Green', |  | ||||||
|         'UpgEx_19H1=Green', |         'UpgEx_19H1=Green', | ||||||
|         'Version_RS5='.PHP_INT_MAX, |         'UpgEx_RS5=Green', | ||||||
|  |         'Version_RS5=2000000000', | ||||||
|         'WuClientVer='.$build, |         'WuClientVer='.$build, | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
| @@ -239,7 +243,85 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build | |||||||
|             </cookie> |             </cookie> | ||||||
|             <parameters> |             <parameters> | ||||||
|                 <ExpressQuery>false</ExpressQuery> |                 <ExpressQuery>false</ExpressQuery> | ||||||
|                 <InstalledNonLeafUpdateIDs/> |                 <InstalledNonLeafUpdateIDs> | ||||||
|  |                     <int>1</int> | ||||||
|  |                     <int>10</int> | ||||||
|  |                     <int>105939029</int> | ||||||
|  |                     <int>105995585</int> | ||||||
|  |                     <int>106017178</int> | ||||||
|  |                     <int>107825194</int> | ||||||
|  |                     <int>10809856</int> | ||||||
|  |                     <int>11</int> | ||||||
|  |                     <int>117765322</int> | ||||||
|  |                     <int>129905029</int> | ||||||
|  |                     <int>130040030</int> | ||||||
|  |                     <int>130040031</int> | ||||||
|  |                     <int>130040032</int> | ||||||
|  |                     <int>130040033</int> | ||||||
|  |                     <int>133399034</int> | ||||||
|  |                     <int>138372035</int> | ||||||
|  |                     <int>138372036</int> | ||||||
|  |                     <int>139536037</int> | ||||||
|  |                     <int>139536038</int> | ||||||
|  |                     <int>139536039</int> | ||||||
|  |                     <int>139536040</int> | ||||||
|  |                     <int>142045136</int> | ||||||
|  |                     <int>158941041</int> | ||||||
|  |                     <int>158941042</int> | ||||||
|  |                     <int>158941043</int> | ||||||
|  |                     <int>158941044</int> | ||||||
|  |                     <int>159776047</int> | ||||||
|  |                     <int>160733048</int> | ||||||
|  |                     <int>160733049</int> | ||||||
|  |                     <int>160733050</int> | ||||||
|  |                     <int>160733051</int> | ||||||
|  |                     <int>160733055</int> | ||||||
|  |                     <int>160733056</int> | ||||||
|  |                     <int>161870057</int> | ||||||
|  |                     <int>161870058</int> | ||||||
|  |                     <int>161870059</int> | ||||||
|  |                     <int>17</int> | ||||||
|  |                     <int>19</int> | ||||||
|  |                     <int>2</int> | ||||||
|  |                     <int>23110993</int> | ||||||
|  |                     <int>23110994</int> | ||||||
|  |                     <int>23110995</int> | ||||||
|  |                     <int>23110996</int> | ||||||
|  |                     <int>23110999</int> | ||||||
|  |                     <int>23111000</int> | ||||||
|  |                     <int>23111001</int> | ||||||
|  |                     <int>23111002</int> | ||||||
|  |                     <int>23111003</int> | ||||||
|  |                     <int>23111004</int> | ||||||
|  |                     <int>2359974</int> | ||||||
|  |                     <int>2359977</int> | ||||||
|  |                     <int>24513870</int> | ||||||
|  |                     <int>28880263</int> | ||||||
|  |                     <int>3</int> | ||||||
|  |                     <int>30077688</int> | ||||||
|  |                     <int>30486944</int> | ||||||
|  |                     <int>5143990</int> | ||||||
|  |                     <int>5169043</int> | ||||||
|  |                     <int>5169044</int> | ||||||
|  |                     <int>5169047</int> | ||||||
|  |                     <int>59830006</int> | ||||||
|  |                     <int>59830007</int> | ||||||
|  |                     <int>59830008</int> | ||||||
|  |                     <int>60484010</int> | ||||||
|  |                     <int>62450018</int> | ||||||
|  |                     <int>62450019</int> | ||||||
|  |                     <int>62450020</int> | ||||||
|  |                     <int>69801474</int> | ||||||
|  |                     <int>8788830</int> | ||||||
|  |                     <int>8806526</int> | ||||||
|  |                     <int>9125350</int> | ||||||
|  |                     <int>9154769</int> | ||||||
|  |                     <int>98959022</int> | ||||||
|  |                     <int>98959023</int> | ||||||
|  |                     <int>98959024</int> | ||||||
|  |                     <int>98959025</int> | ||||||
|  |                     <int>98959026</int> | ||||||
|  |                 </InstalledNonLeafUpdateIDs> | ||||||
|                 <OtherCachedUpdateIDs/> |                 <OtherCachedUpdateIDs/> | ||||||
|                 <SkipSoftwareSync>false</SkipSoftwareSync> |                 <SkipSoftwareSync>false</SkipSoftwareSync> | ||||||
|                 <NeedTwoGroupOutOfScopeUpdates>true</NeedTwoGroupOutOfScopeUpdates> |                 <NeedTwoGroupOutOfScopeUpdates>true</NeedTwoGroupOutOfScopeUpdates> | ||||||
| @@ -249,7 +331,6 @@ function composeFetchUpdRequest($device, $encData, $arch, $flight, $ring, $build | |||||||
|                     <XmlUpdateFragmentTypes> |                     <XmlUpdateFragmentTypes> | ||||||
|                         <XmlUpdateFragmentType>Extended</XmlUpdateFragmentType> |                         <XmlUpdateFragmentType>Extended</XmlUpdateFragmentType> | ||||||
|                         <XmlUpdateFragmentType>LocalizedProperties</XmlUpdateFragmentType> |                         <XmlUpdateFragmentType>LocalizedProperties</XmlUpdateFragmentType> | ||||||
|                         <XmlUpdateFragmentType>Eula</XmlUpdateFragmentType> |  | ||||||
|                     </XmlUpdateFragmentTypes> |                     </XmlUpdateFragmentTypes> | ||||||
|                     <Locales> |                     <Locales> | ||||||
|                         <string>en-US</string> |                         <string>en-US</string> | ||||||
| @@ -310,4 +391,3 @@ function composeGetCookieRequest($device) { | |||||||
| </s:Envelope> | </s:Envelope> | ||||||
| XML; | XML; | ||||||
| } | } | ||||||
| ?> |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user