diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6eb1d70..13a9a1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Build CLI utilities shell: pwsh run: | - msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=${{ matrix.architecture }} /p:RuntimeIdentifier=${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishDir=${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }}/CLIs /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln + msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=${{ matrix.architecture }} /p:RuntimeIdentifier=${{ matrix.platform }}-${{ matrix.architecture }} /p:PublishDir=${{ github.workspace }}/artifacts/${{ matrix.platform }}-${{ matrix.architecture }}/CLIs /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release /p:IncludeNativeLibrariesForSelfExtract=true UUPMediaCreator.sln - name: Create PDB Output Directory shell: pwsh diff --git a/UUPMediaCreator.sln b/UUPMediaCreator.sln index 533d36be..e7d12b9b 100644 --- a/UUPMediaCreator.sln +++ b/UUPMediaCreator.sln @@ -43,6 +43,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windows.Internal.Flighting" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playground", "src\Applications\Playground\Playground.csproj", "{CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj", "{7AFF6421-B605-43F1-B849-D331E979B3B1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP\UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj", "{E5A8D8A2-6219-4632-84EC-8F8BF625A596}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Models", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Models\UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj", "{D78B2286-F75B-4FE6-990B-84117E722CD4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests", "src\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj", "{95007D84-20A1-4711-9CBC-DEE3B1798E74}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareIds", "src\Applications\ComputerHardwareIds\ComputerHardwareIds.csproj", "{7955FADE-628E-4E41-B48B-350EFB5418E7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UUPSort", "src\Applications\UUPSort\UUPSort.csproj", "{21630DC1-A538-4198-A2C5-C38D9CDA0FB1}" EndProject Global @@ -419,6 +428,106 @@ Global {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x64.Build.0 = Release|Any CPU {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x86.ActiveCfg = Release|Any CPU {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8}.Release|x86.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|ARM.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|arm64.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x64.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Debug|x86.Build.0 = Debug|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|Any CPU.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|ARM.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|ARM.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|arm64.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|arm64.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x64.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x64.Build.0 = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x86.ActiveCfg = Release|Any CPU + {7AFF6421-B605-43F1-B849-D331E979B3B1}.Release|x86.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|ARM.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|arm64.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|arm64.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x64.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x64.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Debug|x86.Build.0 = Debug|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|Any CPU.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|ARM.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|ARM.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|arm64.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|arm64.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x64.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x64.Build.0 = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x86.ActiveCfg = Release|Any CPU + {E5A8D8A2-6219-4632-84EC-8F8BF625A596}.Release|x86.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|ARM.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|arm64.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|arm64.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x64.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x64.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x86.ActiveCfg = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Debug|x86.Build.0 = Debug|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|Any CPU.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|ARM.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|ARM.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|arm64.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|arm64.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x64.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x64.Build.0 = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.ActiveCfg = Release|Any CPU + {D78B2286-F75B-4FE6-990B-84117E722CD4}.Release|x86.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|ARM.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|ARM.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|arm64.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|arm64.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x64.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x64.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x86.ActiveCfg = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Debug|x86.Build.0 = Debug|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|Any CPU.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|ARM.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|ARM.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|arm64.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|arm64.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x64.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x64.Build.0 = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.ActiveCfg = Release|Any CPU + {95007D84-20A1-4711-9CBC-DEE3B1798E74}.Release|x86.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|ARM.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|arm64.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|arm64.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x64.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x64.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Debug|x86.Build.0 = Debug|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|Any CPU.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|ARM.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|ARM.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|arm64.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|arm64.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x64.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x64.Build.0 = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x86.ActiveCfg = Release|Any CPU + {7955FADE-628E-4E41-B48B-350EFB5418E7}.Release|x86.Build.0 = Release|Any CPU {21630DC1-A538-4198-A2C5-C38D9CDA0FB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {21630DC1-A538-4198-A2C5-C38D9CDA0FB1}.Debug|Any CPU.Build.0 = Debug|Any CPU {21630DC1-A538-4198-A2C5-C38D9CDA0FB1}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -462,6 +571,11 @@ Global {1AAC4923-A4E5-41D9-87FA-CFB028F802E5} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {B86CE874-B470-4294-BF98-21BB603E1F46} = {162FE1A9-890A-4101-AFF8-54F6B1483882} {CB4B918C-3DBD-40AA-99F7-83EF033DB8A8} = {C4A7DBD6-6FB5-410A-9252-922C7909C82C} + {7AFF6421-B605-43F1-B849-D331E979B3B1} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {E5A8D8A2-6219-4632-84EC-8F8BF625A596} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {D78B2286-F75B-4FE6-990B-84117E722CD4} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {95007D84-20A1-4711-9CBC-DEE3B1798E74} = {162FE1A9-890A-4101-AFF8-54F6B1483882} + {7955FADE-628E-4E41-B48B-350EFB5418E7} = {C4A7DBD6-6FB5-410A-9252-922C7909C82C} {21630DC1-A538-4198-A2C5-C38D9CDA0FB1} = {C4A7DBD6-6FB5-410A-9252-922C7909C82C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/publish_win_arm64.cmd b/publish_win_arm64.cmd index ed1d257f..afc4f0cc 100644 --- a/publish_win_arm64.cmd +++ b/publish_win_arm64.cmd @@ -1,3 +1,3 @@ @echo off -msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish /p:Platform=arm64 /p:RuntimeIdentifier=win-arm64 /p:PublishDir=%CD%\publish\artifacts\win-arm64\CLI /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln \ No newline at end of file +msbuild /m /t:restore,cli\uupmediaconverter:publish,cli\uupdownload:publish,cli\computerhardwareids:publish /p:Platform=arm64 /p:RuntimeIdentifier=win-arm64 /p:PublishDir=%CD%\publish\artifacts\win-arm64\CLI /p:PublishSingleFile=true /p:PublishTrimmed=false /p:Configuration=Release UUPMediaCreator.sln \ No newline at end of file diff --git a/src/Applications/ComputerHardwareIds/ComputerHardwareIds.csproj b/src/Applications/ComputerHardwareIds/ComputerHardwareIds.csproj new file mode 100644 index 00000000..b8202d58 --- /dev/null +++ b/src/Applications/ComputerHardwareIds/ComputerHardwareIds.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0-windows10.0.22621 + enable + enable + + + + + + + + + + + diff --git a/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs new file mode 100644 index 00000000..02221d92 --- /dev/null +++ b/src/Applications/ComputerHardwareIds/ComputerInformationFetcher.cs @@ -0,0 +1,59 @@ +using Microsoft.Management.Infrastructure; +using Microsoft.Management.Infrastructure.Options; + +namespace ComputerHardwareIds +{ + public static class ComputerInformationFetcher + { + public static (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) FetchComputerInformation() + { + using DComSessionOptions dcomSessionOptions = new(); + using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + + CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); + + string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; + byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; + byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); + + string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; + string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; + string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); + + ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); + + string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + + return (SystemManufacturer, + SystemFamily, + SystemProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProductName, + SystemEnclosureorChassisType, + BIOSVersionString, + SystemBIOSMajorRelease, + SystemBIOSMinorRelease); + } + } +} diff --git a/src/Applications/ComputerHardwareIds/Program.cs b/src/Applications/ComputerHardwareIds/Program.cs new file mode 100644 index 00000000..e1d5fd50 --- /dev/null +++ b/src/Applications/ComputerHardwareIds/Program.cs @@ -0,0 +1,85 @@ +using System.Diagnostics; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace ComputerHardwareIds +{ + internal class Program + { + public static void Main(string[] _) + { + Process currentProcess = Process.GetCurrentProcess(); + ProcessModule MainModule = currentProcess.MainModule!; + + (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); + + string HardwareId1 = ComputerHardwareID.GenerateHardwareId1(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId2 = ComputerHardwareID.GenerateHardwareId2(Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId3 = ComputerHardwareID.GenerateHardwareId3(Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease.ToString("X").ToLower(), BIOSMinorRelease.ToString("X").ToLower()); + string HardwareId4 = ComputerHardwareID.GenerateHardwareId4(Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct); + string HardwareId5 = ComputerHardwareID.GenerateHardwareId5(Manufacturer, Family, ProductName, SKUNumber); + string HardwareId6 = ComputerHardwareID.GenerateHardwareId6(Manufacturer, Family, ProductName); + string HardwareId7 = ComputerHardwareID.GenerateHardwareId7(Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct); + string HardwareId8 = ComputerHardwareID.GenerateHardwareId8(Manufacturer, SKUNumber); + string HardwareId9 = ComputerHardwareID.GenerateHardwareId9(Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct); + string HardwareId10 = ComputerHardwareID.GenerateHardwareId10(Manufacturer, ProductName); + string HardwareId11 = ComputerHardwareID.GenerateHardwareId11(Manufacturer, Family, BaseboardManufacturer, BaseboardProduct); + string HardwareId12 = ComputerHardwareID.GenerateHardwareId12(Manufacturer, Family); + string HardwareId13 = ComputerHardwareID.GenerateHardwareId13(Manufacturer, EnclosureType.ToString()); + string HardwareId14 = ComputerHardwareID.GenerateHardwareId14(Manufacturer, BaseboardManufacturer, BaseboardProduct); + string HardwareId15 = ComputerHardwareID.GenerateHardwareId15(Manufacturer); + + Console.WriteLine("Using the BIOS to gather information"); + Console.WriteLine(); + Console.WriteLine("Tool Information"); + Console.WriteLine("----------------"); + Console.WriteLine($"{Path.GetFileName(MainModule.FileName)} version: {MainModule.FileVersionInfo.FileVersion}"); + Console.WriteLine(); + Console.WriteLine(); + Console.WriteLine("Computer Information"); + Console.WriteLine("--------------------"); + Console.WriteLine($"BIOS Vendor: {BIOSVendor}"); + Console.WriteLine($"BIOS Version String: {BIOSVersion}"); + Console.WriteLine($"System BIOS Major Release: {BIOSMajorRelease}"); + Console.WriteLine($"System BIOS Minor Release: {BIOSMinorRelease}"); + Console.WriteLine(); + Console.WriteLine($"System Manufacturer: {Manufacturer}"); + Console.WriteLine($"System Family: {Family}"); + Console.WriteLine($"System Product Name: {ProductName}"); + Console.WriteLine($"SKU Number: {SKUNumber}"); + Console.WriteLine(); + Console.WriteLine($"System Enclosure or Chassis Type: {EnclosureType:X2}h"); + Console.WriteLine(); + Console.WriteLine($"Baseboard Manufacturer: {BaseboardManufacturer}"); + Console.WriteLine($"Baseboard Product Name: {BaseboardProduct}"); + Console.WriteLine(); + Console.WriteLine(); + Console.WriteLine("Hardware IDs"); + Console.WriteLine("------------"); + Console.WriteLine($"{HardwareId1} <- Manufacturer + Family + ProductName + SKUNumber + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId2} <- Manufacturer + Family + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId3} <- Manufacturer + ProductName + BIOS Vendor + BIOS Version + BIOS Major Release + BIOS Minor Release"); + Console.WriteLine($"{HardwareId4} <- Manufacturer + Family + ProductName + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId5} <- Manufacturer + Family + ProductName + SKUNumber"); + Console.WriteLine($"{HardwareId6} <- Manufacturer + Family + ProductName"); + Console.WriteLine($"{HardwareId7} <- Manufacturer + SKUNumber + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId8} <- Manufacturer + SKUNumber"); + Console.WriteLine($"{HardwareId9} <- Manufacturer + ProductName + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId10} <- Manufacturer + ProductName"); + Console.WriteLine($"{HardwareId11} <- Manufacturer + Family + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId12} <- Manufacturer + Family"); + Console.WriteLine($"{HardwareId13} <- Manufacturer + Enclosure Type"); + Console.WriteLine($"{HardwareId14} <- Manufacturer + Baseboard Manufacturer + Baseboard Product"); + Console.WriteLine($"{HardwareId15} <- Manufacturer"); + } + } +} \ No newline at end of file diff --git a/src/Applications/Playground/Playground.csproj b/src/Applications/Playground/Playground.csproj index 4e095025..40c7bdae 100644 --- a/src/Applications/Playground/Playground.csproj +++ b/src/Applications/Playground/Playground.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Applications/Playground/Program.cs b/src/Applications/Playground/Program.cs index 3884f9e9..b07c4f88 100644 --- a/src/Applications/Playground/Program.cs +++ b/src/Applications/Playground/Program.cs @@ -2,7 +2,7 @@ { internal class Program { - static void Main(string[] args) + private static void Main(string[] args) { Console.WriteLine(new Windows.Internal.Flighting.PlatformCTAC("WU_OS", "10.0.26058.1000").UriQuery); } diff --git a/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs b/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs new file mode 100644 index 00000000..db6d491a --- /dev/null +++ b/src/Applications/UUPDownload/BuildTargets.EditionPlanningWithLanguage.cs @@ -0,0 +1,35 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Collections.Generic; +using UnifiedUpdatePlatform.Media.Creator.Planning; + +namespace UUPDownload +{ + public static partial class BuildTargets + { + public class EditionPlanningWithLanguage + { + public List EditionTargets; + public string LanguageCode; + } + } +} diff --git a/src/Applications/UUPDownload/BuildTargets.cs b/src/Applications/UUPDownload/BuildTargets.cs index ff10fea0..f0687ad2 100644 --- a/src/Applications/UUPDownload/BuildTargets.cs +++ b/src/Applications/UUPDownload/BuildTargets.cs @@ -29,17 +29,11 @@ namespace UUPDownload { - public static class BuildTargets + public static partial class BuildTargets { - public class EditionPlanningWithLanguage - { - public List EditionTargets; - public string LanguageCode; - } - public static async Task GetTargetedPlanAsync(this UpdateData update, string LanguageCode) { - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); Package editionPackPkg = compDBs.GetEditionPackFromCompDBs(); string editionPkg = await update.DownloadFileFromDigestAsync(editionPackPkg.Payload.PayloadItem.First(x => !x.Path.EndsWith(".psf")).PayloadHash); @@ -48,7 +42,7 @@ public static async Task GetTargetedPlanAsync(this public static async Task GetTargetedPlanAsync(this UpdateData update, string LanguageCode, string editionPkg) { - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); if (string.IsNullOrEmpty(editionPkg)) { return null; diff --git a/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs new file mode 100644 index 00000000..9c7e9303 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/Drivers/ProcessDrivers.cs @@ -0,0 +1,156 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Downloading; +using UUPDownload.Options; + +namespace UUPDownload.DownloadRequest.Drivers +{ + public partial class ProcessDrivers + { + internal static void ParseDownloadOptions(BSPDownloadRequestOptions opts) + { + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.BSPProductVersion, + opts.Manufacturer, + opts.Family, + opts.ProductName, + opts.SKUNumber, + opts.BIOSVendor, + opts.BaseboardManufacturer, + opts.BaseboardProduct, + opts.EnclosureType, + opts.BIOSVersion, + opts.BIOSMajorRelease, + opts.BIOSMinorRelease).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string BSPProductVersion, + string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) + { + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string[] ProductGUIDs = ComputerHardwareID.GenerateHardwareIds(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BaseboardManufacturer, BaseboardProduct, EnclosureType, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease); + + foreach (string ProductGUID in ProductGUIDs) + { + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V={BSPProductVersion}&Source=SMBIOS;"; + } + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = OutputFolder.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + BaseManifest firstCompDB = compDBs.First(); + string UUPProduct = firstCompDB.UUPProduct; + string UUPProductVersion = firstCompDB.UUPProductVersion; + + Logging.Log("BSP Product Name: " + UUPProduct); + Logging.Log("BSP Product Version: " + UUPProductVersion); + + string outputName = Path.Combine(outputFolder, $"{UUPProductVersion}_{UUPProduct}_{update.Xml.UpdateIdentity.UpdateID.Split("-").Last()}"); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputName, MachineType, new ReportProgress(), UseAutomaticDownloadFolder: false); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs new file mode 100644 index 00000000..eab37a13 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ComputerInformationFetcher.cs @@ -0,0 +1,60 @@ +using Microsoft.Management.Infrastructure; +using Microsoft.Management.Infrastructure.Options; +using System.Linq; + +namespace UUPDownload.DownloadRequest.DriversAuto +{ + public static class ComputerInformationFetcher + { + public static (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) FetchComputerInformation() + { + using DComSessionOptions dcomSessionOptions = new(); + using CimSession cimSession = CimSession.Create("localhost", dcomSessionOptions); + + CimInstance result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BIOS").Single(); + + string BIOSVendor = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BIOSVersionString = (string)result.CimInstanceProperties["SMBIOSBIOSVersion"].Value; + byte SystemBIOSMajorRelease = (byte)result.CimInstanceProperties["SystemBiosMajorVersion"].Value; + byte SystemBIOSMinorRelease = (byte)result.CimInstanceProperties["SystemBiosMinorVersion"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_ComputerSystem").Single(); + + string SystemManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string SystemFamily = (string)result.CimInstanceProperties["SystemFamily"].Value; + string SystemProductName = (string)result.CimInstanceProperties["Model"].Value; + string SKUNumber = (string)result.CimInstanceProperties["SystemSKUNumber"].Value; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_SystemEnclosure").Single(); + + ushort SystemEnclosureorChassisType = ((ushort[])result.CimInstanceProperties["ChassisTypes"].Value)[0]; + + result = cimSession.QueryInstances(@"root\cimv2", "WQL", "SELECT * FROM Win32_BaseBoard").Single(); + + string BaseboardManufacturer = (string)result.CimInstanceProperties["Manufacturer"].Value; + string BaseboardProductName = (string)result.CimInstanceProperties["Product"].Value; + + return (SystemManufacturer, + SystemFamily, + SystemProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProductName, + SystemEnclosureorChassisType, + BIOSVersionString, + SystemBIOSMajorRelease, + SystemBIOSMinorRelease); + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs new file mode 100644 index 00000000..a1c6e8af --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/DriversAuto/ProcessDrivers.cs @@ -0,0 +1,188 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Downloading; +using UUPDownload.Options; + +namespace UUPDownload.DownloadRequest.DriversAuto +{ + public partial class ProcessDrivers + { + public static OSPlatform GetOperatingSystem() + { + return RuntimeInformation.IsOSPlatform(OSPlatform.OSX) + ? OSPlatform.OSX + : RuntimeInformation.IsOSPlatform(OSPlatform.Linux) + ? OSPlatform.Linux + : RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? OSPlatform.Windows + : RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) + ? OSPlatform.FreeBSD + : throw new Exception("Cannot determine operating system!"); + } + + internal static void ParseDownloadOptions(BSPDownloadRequestOptions3 opts) + { + // APIs are only avalable in windows right now. + if (GetOperatingSystem() != OSPlatform.Windows) + { + throw new PlatformNotSupportedException(); + } + + (string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + ushort EnclosureType, + string BIOSVersion, + byte BIOSMajorRelease, + byte BIOSMinorRelease) = ComputerInformationFetcher.FetchComputerInformation(); + + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.BSPProductVersion, + Manufacturer, + Family, + ProductName, + SKUNumber, + BIOSVendor, + BaseboardManufacturer, + BaseboardProduct, + EnclosureType.ToString(), + BIOSVersion, + BIOSMajorRelease.ToString("X").ToLower(), + BIOSMinorRelease.ToString("X").ToLower()).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string BSPProductVersion, + string Manufacturer, + string Family, + string ProductName, + string SKUNumber, + string BIOSVendor, + string BaseboardManufacturer, + string BaseboardProduct, + string EnclosureType, + string BIOSVersion, + string BIOSMajorRelease, + string BIOSMinorRelease) + { + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string[] ProductGUIDs = ComputerHardwareID.GenerateHardwareIds(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BaseboardManufacturer, BaseboardProduct, EnclosureType, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease); + + foreach (string ProductGUID in ProductGUIDs) + { + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V={BSPProductVersion}&Source=SMBIOS;"; + } + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = OutputFolder.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + BaseManifest firstCompDB = compDBs.First(); + string UUPProduct = firstCompDB.UUPProduct; + string UUPProductVersion = firstCompDB.UUPProductVersion; + + Logging.Log("BSP Product Name: " + UUPProduct); + Logging.Log("BSP Product Version: " + UUPProductVersion); + + string outputName = Path.Combine(outputFolder, $"{UUPProductVersion}_{UUPProduct}_{update.Xml.UpdateIdentity.UpdateID.Split("-").Last()}"); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputName, MachineType, new ReportProgress(), UseAutomaticDownloadFolder: false); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/Process.cs b/src/Applications/UUPDownload/DownloadRequest/Process.cs index fdd9bd8d..c7695f23 100644 --- a/src/Applications/UUPDownload/DownloadRequest/Process.cs +++ b/src/Applications/UUPDownload/DownloadRequest/Process.cs @@ -30,7 +30,9 @@ using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; using UUPDownload.Downloading; +using UUPDownload.Options; namespace UUPDownload.DownloadRequest { @@ -102,7 +104,7 @@ private static async Task ApplyAppxFixUpAsync(UpdateData update, string appxRoot update.CompDBs = await update.GetCompDBsAsync(); } - CompDB canonicalCompdb = update.CompDBs + BaseManifest canonicalCompdb = update.CompDBs .Where(compDB => compDB.Tags.Tag .Find(x => x.Name .Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value? @@ -229,7 +231,7 @@ private static async Task ProcessUpdateAsync(UpdateData update, string pOutputFo Logging.Log("Gathering update metadata..."); - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); await Task.WhenAll( Task.Run(async () => buildstr = await update.GetBuildStringAsync()), @@ -248,9 +250,9 @@ await Task.WhenAll( // We need to fallback to CompDB (less accurate but we have no choice, due to CUs etc... // Loop through all CompDBs to find the highest version reported - CompDB selectedCompDB = null; + BaseManifest selectedCompDB = null; Version currentHighest = null; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest compDB in compDBs) { if (compDB.TargetOSVersion != null) { diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs new file mode 100644 index 00000000..310e4952 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/DriverPlan.cs @@ -0,0 +1,59 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public class DriverPlan + { + public string outputFolder + { + get; set; + } + public string guid + { + get; set; + } + public int[] filteredIds + { + get; set; + } + public int[] excludedIds + { + get; set; + } + public string Manufacturer + { + get; set; + } + public string Family + { + get; set; + } + public string Product + { + get; set; + } + public string Sku + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs new file mode 100644 index 00000000..0ea2e6d0 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.GenerateChangelog.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; + +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public partial class ProcessDrivers + { + private static async Task GenerateChangelog(UpdateData update, string changelogOutput, int i, BaseManifest pevCompDB) + { + File.AppendAllLines(changelogOutput, ["", $"## {update.Xml.LocalizedProperties.Title} - 200.0.{i}.0"]); + + HashSet compDBs = await update.GetCompDBsAsync(); + BaseManifest curCompDB = compDBs.First(); + + List added = []; + List updated = []; + List removed = []; + List modified = []; + + if (pevCompDB != null) + { + IEnumerable prevPackageList = pevCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + IEnumerable curPackageList = curCompDB.Packages.Package.Select(pkg => $"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"); + + foreach (string pkg in prevPackageList) + { + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInNewer = curPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!existsInNewer) + { + removed.Add(pkg); + } + } + + foreach (Package package in curCompDB.Packages.Package) + { + string pkg = $"| {package.Version} | {package.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase)} |"; + + string version = pkg.Split("|")[1]; + string id = pkg.Split("|")[2]; + + bool existsInOlder = prevPackageList.Any(x => id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (existsInOlder) + { + bool hasSameVersion = prevPackageList.Any(x => version.Equals(x.Split("|")[1], StringComparison.InvariantCultureIgnoreCase) && id.Equals(x.Split("|")[2], StringComparison.InvariantCultureIgnoreCase)); + + if (!hasSameVersion) + { + updated.Add(pkg); + } + else + { + bool hasSameHash = pevCompDB.Packages.Package.Any(x => x.Payload.PayloadItem[0].PayloadHash == package.Payload.PayloadItem[0].PayloadHash); + if (!hasSameHash) + { + modified.Add(pkg); + } + } + } + else + { + added.Add(pkg); + } + } + } + else + { + foreach (Package pkg in curCompDB.Packages.Package) + { + added.Add($"| {pkg.Version} | {pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.CurrentCultureIgnoreCase)} |"); + } + } + + added.Sort(); + updated.Sort(); + modified.Sort(); + removed.Sort(); + + if (added.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Added", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, added); + } + + + if (updated.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Updated", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, updated); + } + + + if (modified.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Modified", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, modified); + } + + + if (removed.Count > 0) + { + File.AppendAllLines(changelogOutput, ["", $"### Removed", ""]); + File.AppendAllLines(changelogOutput, ["| Driver version | Package |"]); + File.AppendAllLines(changelogOutput, ["|----------------|---------|"]); + File.AppendAllLines(changelogOutput, removed); + } + + return curCompDB; + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs new file mode 100644 index 00000000..ebfb3bf2 --- /dev/null +++ b/src/Applications/UUPDownload/DownloadRequest/ReferenceDriversRepo/ProcessDrivers.cs @@ -0,0 +1,244 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Downloading; +using UUPDownload.Options; + +namespace UUPDownload.DownloadRequest.ReferenceDriversRepo +{ + public partial class ProcessDrivers + { + internal static void ParseDownloadOptions(BSPDownloadRequestOptions2 opts) + { + CheckAndDownloadUpdates( + opts.ReportingSku, + opts.ReportingVersion, + opts.MachineType, + opts.FlightRing, + opts.FlightingBranchName, + opts.BranchReadinessLevel, + opts.CurrentBranch, + opts.ReleaseType, + opts.SyncCurrentVersionOnly, + opts.ContentType, + opts.Mail, + opts.Password, + opts.OutputFolder, + opts.Language, + opts.Edition).Wait(); + } + + private static async Task CheckAndDownloadUpdates(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string OutputFolder, + string Language, + string Edition) + { + if (!File.Exists("DriverConfig.json")) + { + Logging.Log("Driver Configuration file (DriverConfig.json) could not be found in the current working directory.", Logging.LoggingLevel.Error); + return; + } + + DriverPlan[] plans = System.Text.Json.JsonSerializer.Deserialize(File.ReadAllText("DriverConfig.json")); + + foreach (DriverPlan plan in plans) + { + Logging.Log(plan.outputFolder); + await ProcessDriverPlan(plan, ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType, Mail, Password, Language, Edition, OutputFolder); + } + + if (Debugger.IsAttached) + { + _ = Console.ReadLine(); + } + + Logging.Log("Completed."); + } + + private static async Task ProcessDriverPlan(DriverPlan DriverPlan, + OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + string ContentType, + string Mail, + string Password, + string Language, + string Edition, + string RepoLocation) + { + BaseManifest previousCompositionDatabase = null; + + Logging.Log("Checking for updates..."); + + CTAC NewestDriverProductCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, false, ContentType: ContentType, IsDriverCheck: true); + string token = string.Empty; + if (!string.IsNullOrEmpty(Mail) && !string.IsNullOrEmpty(Password)) + { + token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(Mail, Password); + } + + string ProductGUID = DriverPlan.guid; + if (string.IsNullOrEmpty(ProductGUID)) + { + ProductGUID = ComputerHardwareID.GenerateHardwareId5(DriverPlan.Manufacturer, DriverPlan.Family, DriverPlan.Product, DriverPlan.Sku); + } + + NewestDriverProductCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=0.0.0.0&Source=SMBIOS;"; + + IEnumerable NewestDriverProductUpdateData = await FE3Handler.GetUpdates(null, NewestDriverProductCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + string outputFolder = (RepoLocation + DriverPlan.outputFolder).Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + + if (!NewestDriverProductUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + return; + } + + string newestDriverVersion = "0.0.0.0"; + + for (int i = 0; i < NewestDriverProductUpdateData.Count(); i++) + { + UpdateData update = NewestDriverProductUpdateData.ElementAt(i); + + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log($"{i}: Title: {update.Xml.LocalizedProperties.Title}"); + Logging.Log($"{i}: Description: {update.Xml.LocalizedProperties.Description}"); + + Logging.Log("Gathering update metadata..."); + + HashSet compDBs = await update.GetCompDBsAsync(); + + newestDriverVersion = compDBs.First().UUPProductVersion; + } + + if (SyncCurrentVersionOnly) + { + foreach (UpdateData update in NewestDriverProductUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, outputFolder, MachineType, new ReportProgress(), Language: Language, Edition: Edition); + } + } + else + { + string newestDriverOutput = $"{outputFolder}{Path.DirectorySeparatorChar}{newestDriverVersion}"; + if (Directory.Exists(newestDriverOutput) && Directory.EnumerateFiles(newestDriverOutput).Any()) + { + return; + } + + string changelogOutput = $"{outputFolder}{Path.DirectorySeparatorChar}CHANGELOG.md"; + + if (File.Exists(changelogOutput)) + { + File.Delete(changelogOutput); + } + + int newestDriverBuildNumber = int.Parse(newestDriverVersion.Split(".")[2]); + + for (int driverBuildNumber = 0; driverBuildNumber <= newestDriverBuildNumber; driverBuildNumber++) + { + if (DriverPlan.filteredIds.Length != 0 && !DriverPlan.filteredIds.Contains(driverBuildNumber)) + { + continue; + } + + if (DriverPlan.excludedIds.Length != 0 && DriverPlan.excludedIds.Contains(driverBuildNumber)) + { + continue; + } + + CTAC PreciseDriverProductVersionCTAC = new(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, ContentType: ContentType, IsDriverCheck: true); + + PreciseDriverProductVersionCTAC.Products += $"PN={ProductGUID}_{MachineType}&V=200.0.{driverBuildNumber}.0&Source=SMBIOS;"; + PreciseDriverProductVersionCTAC.SyncCurrentVersionOnly = true; + + Logging.Log($"Checking for updates... 200.0.{driverBuildNumber}.0 / {newestDriverVersion}"); + IEnumerable PreciseDriverProductVersionUpdateData = await FE3Handler.GetUpdates(null, PreciseDriverProductVersionCTAC, token, FileExchangeV3UpdateFilter.ProductRelease); + + if (!PreciseDriverProductVersionUpdateData.Any()) + { + Logging.Log("No updates found that matched the specified criteria.", Logging.LoggingLevel.Error); + } + else + { + foreach (UpdateData update in PreciseDriverProductVersionUpdateData) + { + if (update.Xml.LocalizedProperties.Title.Contains("Windows")) + { + continue; + } + + Logging.Log("Title: " + update.Xml.LocalizedProperties.Title); + Logging.Log("Description: " + update.Xml.LocalizedProperties.Description); + + string fwOutput = $"{outputFolder}{Path.DirectorySeparatorChar}200.0.{driverBuildNumber}.0"; + if (!Directory.Exists(fwOutput) || !Directory.EnumerateFiles(fwOutput).Any()) + { + _ = await UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads.UpdateUtils.ProcessUpdateAsync(update, fwOutput, MachineType, new ReportProgress(), Language, Edition, false, false); + } + + previousCompositionDatabase = await GenerateChangelog(update, changelogOutput, driverBuildNumber, previousCompositionDatabase); + } + } + } + } + } + } +} diff --git a/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs b/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs index 78d73919..51bb715b 100644 --- a/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs +++ b/src/Applications/UUPDownload/DownloadRequest/UpdateScan.cs @@ -23,6 +23,7 @@ using System.Xml; using System.Xml.Serialization; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UUPDownload.DownloadRequest { diff --git a/src/Applications/UUPDownload/Downloading/ReportProgress.cs b/src/Applications/UUPDownload/Downloading/ReportProgress.cs index 9fab222b..3a8a5f43 100644 --- a/src/Applications/UUPDownload/Downloading/ReportProgress.cs +++ b/src/Applications/UUPDownload/Downloading/ReportProgress.cs @@ -28,13 +28,13 @@ namespace UUPDownload.Downloading { public class ReportProgress : IProgress, IDisposable { - private readonly Dictionary files = new(); + private readonly Dictionary files = []; private readonly Mutex mutex = new(); private static string FormatBytes(double bytes) { - string[] suffix = { "B", "KB", "MB", "GB", "TB" }; + string[] suffix = ["B", "KB", "MB", "GB", "TB"]; int i; double dblSByte = bytes; for (i = 0; i < suffix.Length && bytes >= 1024; i++, bytes /= 1024) diff --git a/src/Applications/UUPDownload/DriverConfig.json b/src/Applications/UUPDownload/DriverConfig.json new file mode 100644 index 00000000..848d94d2 --- /dev/null +++ b/src/Applications/UUPDownload/DriverConfig.json @@ -0,0 +1,186 @@ +[ + { + "outputFolder": "\\1000_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SDM1000", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7180_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [ + 1, + 9, + 10 + ], + "Manufacturer": "Qualcomm", + "Family": "SC7180", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7280_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC_KODIAK", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\7280_WINDOWS_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC_KODIAK_WINDOWS", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\8180_CLS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SC8180X", + "Product": "CLS", + "Sku": "6" + }, + { + "outputFolder": "\\8280_QRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_MAKENA", + "Product": "QRD", + "Sku": "6" + }, + { + "outputFolder": "\\8380_CRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_HAMOA", + "Product": "CRD", + "Sku": "6" + }, + { + "outputFolder": "\\8380_RUN", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_HAMOA", + "Product": "Snapdragon-Devkit", + "Sku": "6" + }, + { + "outputFolder": "\\8380PA_CRD", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Qualcomm", + "Family": "SCP_PURWA", + "Product": "CRD", + "Sku": "6" + }, + { + "outputFolder": "\\Surface\\8180_CAM", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_1876" + }, + { + "outputFolder": "\\Surface\\8180_CAR", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_H_1876" + }, + { + "outputFolder": "\\Surface\\8180_CAS", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro X", + "Sku": "Surface_Pro_X_2010" + }, + { + "outputFolder": "\\Surface\\8280_ARC_1996", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro 9", + "Sku": "Surface_Pro_9_With_5G_1996" + }, + { + "outputFolder": "\\Surface\\8280_ARC_1997", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Surface Pro 9", + "Sku": "Surface_Pro_9_With_5G_1997" + }, + { + "outputFolder": "\\Surface\\8280_BLK", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Windows Dev Kit 2023", + "Sku": "2043" + }, + { + "outputFolder": "\\Surface\\8380_ROM_2036", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Laptop, 7th Edition", + "Sku": "Surface_Laptop_7th_Edition_2036" + }, + { + "outputFolder": "\\Surface\\8380_ROM_2037", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Laptop, 7th Edition", + "Sku": "Surface_Laptop_7th_Edition_2037" + }, + { + "outputFolder": "\\Surface\\8380_DEN", + "guid": null, + "filteredIds": [], + "excludedIds": [], + "Manufacturer": "Microsoft Corporation", + "Family": "Surface", + "Product": "Microsoft Surface Pro, 11th Edition", + "Sku": "Surface_Pro_11th_Edition_2076" + } +] \ No newline at end of file diff --git a/src/Applications/UUPDownload/FeatureManifestService.cs b/src/Applications/UUPDownload/FeatureManifestService.cs index 8f6dbf23..b640ca5b 100644 --- a/src/Applications/UUPDownload/FeatureManifestService.cs +++ b/src/Applications/UUPDownload/FeatureManifestService.cs @@ -33,7 +33,7 @@ public static class FeatureManifestService public static IDictionary GetAppxPackageLicenseFileMapFromCabs(IList cabPaths) { - Dictionary licenseMap = new(); + Dictionary licenseMap = []; foreach (string cabPath in cabPaths) { if (new FileInfo(cabPath).Length > MAXIMUM_CANDIDATE_CAB_SIZE) diff --git a/src/Applications/UUPDownload/Logging.LoggingLevel.cs b/src/Applications/UUPDownload/Logging.LoggingLevel.cs new file mode 100644 index 00000000..541cb7e1 --- /dev/null +++ b/src/Applications/UUPDownload/Logging.LoggingLevel.cs @@ -0,0 +1,33 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UUPDownload +{ + internal static partial class Logging + { + public enum LoggingLevel + { + Information, + Warning, + Error + } + } +} \ No newline at end of file diff --git a/src/Applications/UUPDownload/Logging.cs b/src/Applications/UUPDownload/Logging.cs index 22bb85a8..ad3a8f04 100644 --- a/src/Applications/UUPDownload/Logging.cs +++ b/src/Applications/UUPDownload/Logging.cs @@ -23,14 +23,8 @@ namespace UUPDownload { - internal static class Logging + internal static partial class Logging { - public enum LoggingLevel - { - Information, - Warning, - Error - } private static readonly ConsoleColor Foreground; diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs new file mode 100644 index 00000000..782bf302 --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions.cs @@ -0,0 +1,199 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + + // Used above: + // a + // b + // c + // m + // n + // o + // p + // r + // s + // t + // v + // y + // z + + [Option('d', "bsp-product-version", HelpText = "", Required = false, Default = "0.0.0.0")] + public string BSPProductVersion + { + get; set; + } + + // + // Targeting for the BSP Product, see the ComputerHardwareIds.Windows project for knowing what these map to, programmatically + // + + [Option('e', "targeting-manufacturer", HelpText = "", Required = true)] + public string Manufacturer + { + get; set; + } + + [Option('f', "targeting-family", HelpText = "", Required = false, Default = null)] + public string Family + { + get; set; + } + + [Option('g', "targeting-productname", HelpText = "", Required = false, Default = null)] + public string ProductName + { + get; set; + } + + [Option('h', "targeting-skunumber", HelpText = "", Required = false, Default = null)] + public string SKUNumber + { + get; set; + } + + [Option('i', "targeting-biosvendor", HelpText = "", Required = false, Default = null)] + public string BIOSVendor + { + get; set; + } + + [Option('j', "targeting-baseboardmanufacturer", HelpText = "", Required = false, Default = null)] + public string BaseboardManufacturer + { + get; set; + } + + [Option('k', "targeting-baseboardproduct", HelpText = "", Required = false, Default = null)] + public string BaseboardProduct + { + get; set; + } + + [Option('l', "targeting-enclosuretype", HelpText = "", Required = false, Default = null)] + public string EnclosureType + { + get; set; + } + + [Option('q', "targeting-biosversion", HelpText = "", Required = false, Default = null)] + public string BIOSVersion + { + get; set; + } + + [Option('u', "targeting-biosmajorrelease", HelpText = "", Required = false, Default = null)] + public string BIOSMajorRelease + { + get; set; + } + + [Option('w', "targeting-biosminorrelease", HelpText = "", Required = false, Default = null)] + public string BIOSMinorRelease + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs new file mode 100644 index 00000000..c7dc10ba --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions2.cs @@ -0,0 +1,120 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download2", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions2 + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] + public string Edition + { + get; set; + } + + [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] + public string Language + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs new file mode 100644 index 00000000..f889b8e6 --- /dev/null +++ b/src/Applications/UUPDownload/Options/BSPDownloadRequestOptions3.cs @@ -0,0 +1,129 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("request-bsp-download3", HelpText = "Request a BSP download from zero using a number of different request parameters.")] + internal class BSPDownloadRequestOptions3 + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('v', "reporting-version", HelpText = "The version to report to the Windows Update servers. Example: 10.0.20152.1000", Required = true)] + public string ReportingVersion + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('r', "flight-ring", HelpText = "The ring to report to the Windows Update servers. Example: Retail, other example: External or Internal", Required = true)] + public string FlightRing + { + get; set; + } + + [Option('c', "current-branch", HelpText = "The branch to report to the Windows Update servers. Example: 19h1_release", Required = true)] + public string CurrentBranch + { + get; set; + } + + [Option('b', "flighting-branch-name", HelpText = "The flighting branch name to report to the Windows Update servers. Example: Retail, other example: CanaryChannel, Dev, Beta or ReleasePreview", Required = false, Default = "")] + public string FlightingBranchName + { + get; set; + } + + [Option('y', "sync-current-version-only", HelpText = "Only get updates for the current version, enables getting cumulative updates.", Required = false, Default = false)] + public bool SyncCurrentVersionOnly + { + get; set; + } + + [Option('a', "branch-readiness-level", HelpText = "The branch readiness level to report to the Windows Update servers. Example: CB", Required = false, Default = "CB")] + public string BranchReadinessLevel + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('z', "releasetype", HelpText = "The release type to report to the Windows Update servers. Example: Production", Required = false, Default = "Production")] + public string ReleaseType + { + get; set; + } + + [Option('n', "contenttype", HelpText = "The content type to report to the Windows Update servers. Example: Mainline, Custom", Required = false, Default = "Mainline")] + public string ContentType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + + // Used above: + // a + // b + // c + // m + // n + // o + // p + // r + // s + // t + // v + // y + // z + + [Option('d', "bsp-product-version", HelpText = "", Required = false, Default = "0.0.0.0")] + public string BSPProductVersion + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Options/DownloadReplayOptions.cs b/src/Applications/UUPDownload/Options/DownloadReplayOptions.cs new file mode 100644 index 00000000..9ab4ef33 --- /dev/null +++ b/src/Applications/UUPDownload/Options/DownloadReplayOptions.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("replay-download", isDefault: false, HelpText = "Replay a download from zero using a *.uupmcreplay file.")] + internal class DownloadReplayOptions + { + [Option('r', "replay-metadata", HelpText = @"The path to a *.uupmcreplay file to replay an older update and resume the download process. Example: D:\20236.1005.uupmcreplay", Required = true)] + public string ReplayMetadata + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] + public string OutputFolder + { + get; set; + } + + [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] + public string Edition + { + get; set; + } + + [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] + public string Language + { + get; set; + } + + [Option("fixup", HelpText = @"Applies a fixup to files in output folder. Example: Appx", Required = false)] + public Fixup? Fixup + { + get; set; + } + + [Option("appxroot", HelpText = @"The folder containing the appx files for use with the Appx fixup", Required = false)] + public string AppxRoot + { + get; set; + } + + [Option("cabsroot", HelpText = @"The folder containing the cab files for use with the Appx fixup", Required = false)] + public string CabsRoot + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/CLIOptions.cs b/src/Applications/UUPDownload/Options/DownloadRequestOptions.cs similarity index 59% rename from src/Applications/UUPDownload/CLIOptions.cs rename to src/Applications/UUPDownload/Options/DownloadRequestOptions.cs index 9c198b35..390a93b4 100644 --- a/src/Applications/UUPDownload/CLIOptions.cs +++ b/src/Applications/UUPDownload/Options/DownloadRequestOptions.cs @@ -20,9 +20,9 @@ * SOFTWARE. */ using CommandLine; -using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; -namespace UUPDownload +namespace UUPDownload.Options { [Verb("request-download", isDefault: true, HelpText = "Request a download from zero using a number of different request parameters.")] internal class DownloadRequestOptions @@ -117,90 +117,4 @@ public string Password get; set; } } - - [Verb("replay-download", isDefault: false, HelpText = "Replay a download from zero using a *.uupmcreplay file.")] - internal class DownloadReplayOptions - { - [Option('r', "replay-metadata", HelpText = @"The path to a *.uupmcreplay file to replay an older update and resume the download process. Example: D:\20236.1005.uupmcreplay", Required = true)] - public string ReplayMetadata - { - get; set; - } - - [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] - public MachineType MachineType - { - get; set; - } - - [Option('o', "output-folder", HelpText = "The folder to use for downloading the update files.", Required = false, Default = ".")] - public string OutputFolder - { - get; set; - } - - [Option('e', "edition", HelpText = "The edition to get. Must be used with the language parameter. Omit either of these to download everything. Example: Professional", Required = false, Default = "")] - public string Edition - { - get; set; - } - - [Option('l', "language", HelpText = "The language to get. Must be used with the edition parameter. Omit either of these to download everything. Example: en-US", Required = false, Default = "")] - public string Language - { - get; set; - } - - [Option("fixup", HelpText = @"Applies a fixup to files in output folder. Example: Appx", Required = false)] - public Fixup? Fixup - { - get; set; - } - - [Option("appxroot", HelpText = @"The folder containing the appx files for use with the Appx fixup", Required = false)] - public string AppxRoot - { - get; set; - } - - [Option("cabsroot", HelpText = @"The folder containing the cab files for use with the Appx fixup", Required = false)] - public string CabsRoot - { - get; set; - } - } - - [Verb("get-builds", isDefault: false, HelpText = "Get builds in all rings matching the request type")] - internal class GetBuildsOptions - { - [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] - public OSSkuId ReportingSku - { - get; set; - } - - [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] - public MachineType MachineType - { - get; set; - } - - [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] - public string Mail - { - get; set; - } - - [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] - public string Password - { - get; set; - } - - [Option("preview-targeting-attribute", HelpText = "The name of the set of targeting attributes to use. (Optional, Preview)", Required = false, Default = "")] - public string TargetingAttribute - { - get; set; - } - } } diff --git a/src/Applications/UUPDownload/Options/GetBuildsOptions.cs b/src/Applications/UUPDownload/Options/GetBuildsOptions.cs new file mode 100644 index 00000000..d35f25c3 --- /dev/null +++ b/src/Applications/UUPDownload/Options/GetBuildsOptions.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using CommandLine; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UUPDownload.Options +{ + [Verb("get-builds", isDefault: false, HelpText = "Get builds in all rings matching the request type")] + internal class GetBuildsOptions + { + [Option('s', "reporting-sku", HelpText = "The sku to report to the Windows Update servers. Example: Professional", Required = true)] + public OSSkuId ReportingSku + { + get; set; + } + + [Option('t', "machine-type", HelpText = "The architecture to report to the Windows Update servers. Example: amd64", Required = true)] + public MachineType MachineType + { + get; set; + } + + [Option('m', "mail", HelpText = "Email for the Windows Insider account to use to generate authorization tokens (Optional)", Required = false, Default = "")] + public string Mail + { + get; set; + } + + [Option('p', "password", HelpText = "Password for the Windows Insider account to use to generate authorization tokens (If 2FA, must be generated app password) (Optional)", Required = false, Default = "")] + public string Password + { + get; set; + } + + [Option("preview-targeting-attribute", HelpText = "The name of the set of targeting attributes to use. (Optional, Preview)", Required = false, Default = "")] + public string TargetingAttribute + { + get; set; + } + } +} diff --git a/src/Applications/UUPDownload/Program.cs b/src/Applications/UUPDownload/Program.cs index 898daa8f..8764418a 100644 --- a/src/Applications/UUPDownload/Program.cs +++ b/src/Applications/UUPDownload/Program.cs @@ -24,6 +24,7 @@ using System.Diagnostics; using System.Net; using System.Reflection; +using UUPDownload.Options; namespace UUPDownload { @@ -74,12 +75,27 @@ private static int Main(string[] args) { ServicePointManager.DefaultConnectionLimit = int.MaxValue; - return Parser.Default.ParseArguments(args).MapResult( + return Parser.Default.ParseArguments(args).MapResult( (DownloadRequestOptions opts) => { PrintLogo(); return WrapAction(() => DownloadRequest.Process.ParseDownloadOptions(opts)); }, + (BSPDownloadRequestOptions opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.Drivers.ProcessDrivers.ParseDownloadOptions(opts)); + }, + (BSPDownloadRequestOptions2 opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.ReferenceDriversRepo.ProcessDrivers.ParseDownloadOptions(opts)); + }, + (BSPDownloadRequestOptions3 opts) => + { + PrintLogo(); + return WrapAction(() => DownloadRequest.DriversAuto.ProcessDrivers.ParseDownloadOptions(opts)); + }, (DownloadReplayOptions opts) => { PrintLogo(); diff --git a/src/Applications/UUPDownload/Properties/launchSettings.json b/src/Applications/UUPDownload/Properties/launchSettings.json index 1c8bc178..aba8c7d5 100644 --- a/src/Applications/UUPDownload/Properties/launchSettings.json +++ b/src/Applications/UUPDownload/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "UnifiedUpdatePlatform.Media.Download": { "commandName": "Project", - "commandLineArgs": "-s Professional -v 10.0.22635.2483 -t amd64 -r External -b Dev -a CB -c ni_release -y" + "commandLineArgs": "request-bsp-download3 -s Professional -v 10.0.26200.2483 -t arm64 -r Retail -b Retail -a CB -c ge_release -o C:\\Users\\gus33\\Documents\\GitHub\\WOA-Project\\Reference\\Qualcomm-Reference-Drivers\\TESTING -y --bsp-product-version 200.0.9.0" } } } \ No newline at end of file diff --git a/src/Applications/UUPDownload/RingCheck.cs b/src/Applications/UUPDownload/RingCheck.cs index 53b5e756..975c06b5 100644 --- a/src/Applications/UUPDownload/RingCheck.cs +++ b/src/Applications/UUPDownload/RingCheck.cs @@ -24,6 +24,8 @@ using System.Linq; using System.Threading.Tasks; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; +using UUPDownload.Options; namespace UUPDownload { @@ -59,7 +61,7 @@ internal static void ParseGetBuildsOptions(GetBuildsOptions opts) private static async Task GetRingBuilds(GetBuildsOptions opts) { - Dictionary CTACs = new(); + Dictionary CTACs = []; CTACs = string.IsNullOrWhiteSpace(opts.TargetingAttribute) ? GetRingCTACs(opts.MachineType, opts.ReportingSku) diff --git a/src/Applications/UUPDownload/UUPDownload.csproj b/src/Applications/UUPDownload/UUPDownload.csproj index 4af18b76..892d52c9 100644 --- a/src/Applications/UUPDownload/UUPDownload.csproj +++ b/src/Applications/UUPDownload/UUPDownload.csproj @@ -9,6 +9,14 @@ MinimumRecommendedRules.ruleset AnyCPU;x64;x86;arm64 + + + + + + Always + + @@ -19,5 +27,6 @@ + \ No newline at end of file diff --git a/src/Applications/UUPDownload/UpdateUtils.cs b/src/Applications/UUPDownload/UpdateUtils.cs index f00a503d..2a35ddb4 100644 --- a/src/Applications/UUPDownload/UpdateUtils.cs +++ b/src/Applications/UUPDownload/UpdateUtils.cs @@ -30,7 +30,7 @@ namespace UUPDownload { public static class UpdateUtils { - public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static string GetFilenameForCEUIFile(UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) @@ -38,7 +38,7 @@ public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, I PayloadItem payload = payloadItems.First(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); return payload.Path.Replace('\\', Path.DirectorySeparatorChar); } - else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith("_") && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) + else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith('_') && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) { filename = filename[..filename.IndexOf('_')] + Path.DirectorySeparatorChar + filename[(filename.IndexOf('_') + 1)..]; return filename.TrimStart(Path.DirectorySeparatorChar); @@ -46,7 +46,7 @@ public static string GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, I return filename; } - public static bool ShouldFileGetDownloaded(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static bool ShouldFileGetDownloaded(UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) diff --git a/src/Applications/UUPMediaConverter/CLIOptions.cs b/src/Applications/UUPMediaConverter/CLIOptions.cs index bada263a..a83cc0fc 100644 --- a/src/Applications/UUPMediaConverter/CLIOptions.cs +++ b/src/Applications/UUPMediaConverter/CLIOptions.cs @@ -63,6 +63,9 @@ public UnifiedUpdatePlatform.Common.Messaging.Common.CompressionType Compression } [Option("no-key-prompt", HelpText = "Use the alternate efisys and cdboot implementations to suppress the 'press any key' prompt", Required = false)] - public bool SuppressAnyKeyPrompt { get; set; } + public bool SuppressAnyKeyPrompt + { + get; set; + } } } diff --git a/src/Cabinet/Cabinet.cs b/src/Cabinet/Cabinet.cs index e82ee1b5..ccb42de1 100644 --- a/src/Cabinet/Cabinet.cs +++ b/src/Cabinet/Cabinet.cs @@ -224,7 +224,7 @@ private CabinetHeader ReadHeader(Stream cabinetStream) { byte cbCFFolder = 0; byte cbCFData = 0; - byte[] AdditionalData = Array.Empty(); + byte[] AdditionalData = []; BinaryReader cabinetBinaryReader = new(cabinetStream); @@ -272,13 +272,13 @@ private IReadOnlyCollection ReadVolumes(Stream cabinetStream) { BinaryReader cabinetBinaryReader = new(cabinetStream); - List volumes = new(); + List volumes = []; for (int i = 0; i < cabinetHeader.CabinetFileHeader.cFolders; i++) { CabinetVolume volume = new() { CabinetFileVolume = cabinetStream.ReadStruct(), - AdditionalApplicationData = cabinetHeader.VolumeAdditionalApplicationDataSize > 0 ? cabinetBinaryReader.ReadBytes(cabinetHeader.VolumeAdditionalApplicationDataSize) : Array.Empty() + AdditionalApplicationData = cabinetHeader.VolumeAdditionalApplicationDataSize > 0 ? cabinetBinaryReader.ReadBytes(cabinetHeader.VolumeAdditionalApplicationDataSize) : [] }; if (volume.CabinetFileVolume.typeCompress is not CFFOLDER.CFTYPECOMPRESS.TYPE_LZX and @@ -311,7 +311,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr throw new Exception("Bad Cabinet: First File Block does not match header"); } - List files = new(); + List files = []; for (int i = 0; i < cabinetHeader.CabinetFileHeader.cFiles; i++) { CFFILE file = cabinetBinaryReader.BaseStream.ReadStruct(); @@ -330,7 +330,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr private List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> BuildDataMap(CabinetVolume volume) { - List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas = new(); + List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas = []; // Build Data Map using BinaryReader cabinetBinaryReader = new(InputStream, System.Text.Encoding.UTF8, true); @@ -351,7 +351,7 @@ private IReadOnlyCollection ReadVolumeFiles(Stream cabinetStr private List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> BuildBlockMap(int volumeIndex, List<(CFDATA dataStruct, int dataOffsetCabinet, int beginFolderOffset, int endFolderOffset, int index)> datas) { - List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> fileBlockMap = new(); + List<(CabinetVolumeFile file, int startingBlock, int startingBlockOffset, int endingBlock, int endingBlockOffset)> fileBlockMap = []; // Build Block Map foreach (CabinetVolumeFile file in files) diff --git a/src/CompDB/Applications/AppxInstallWorkload.cs b/src/CompDB/Applications/AppxInstallWorkload.cs index 87267f10..a5850280 100644 --- a/src/CompDB/Applications/AppxInstallWorkload.cs +++ b/src/CompDB/Applications/AppxInstallWorkload.cs @@ -1,12 +1,10 @@ -using System; - -namespace UnifiedUpdatePlatform.Services.Composition.Database.Applications +namespace UnifiedUpdatePlatform.Services.Composition.Database.Applications { public class AppxInstallWorkload { public string AppXPath { get; set; } = ""; public string LicensePath { get; set; } = ""; - public string[] DependenciesPath { get; set; } = Array.Empty(); + public string[] DependenciesPath { get; set; } = []; public string StubPackageOption { get; set; } = ""; public override string ToString() diff --git a/src/CompDB/Applications/AppxSelectionEngine.cs b/src/CompDB/Applications/AppxSelectionEngine.cs index 2eff4bd8..0956856a 100644 --- a/src/CompDB/Applications/AppxSelectionEngine.cs +++ b/src/CompDB/Applications/AppxSelectionEngine.cs @@ -37,7 +37,7 @@ public static class AppxSelectionEngine /// /// /// - private static (Dictionary preinstalledApps, Feature[] appsFeatures) SetupVariables(CompDB editionCdb, IEnumerable appsCdbs) + private static (Dictionary preinstalledApps, Feature[] appsFeatures) SetupVariables(BaseManifest editionCdb, IEnumerable appsCdbs) { Dictionary preinstalledApps = editionCdb.Features.Feature .First(x => x.Type == "DesktopMedia") @@ -48,9 +48,9 @@ private static (Dictionary preinstalledApps, Featu .Distinct() .ToDictionary(x => x, _ => new DeploymentProperties()); - List appsFeatures = new(); + List appsFeatures = []; - foreach (CompDB appsCdb in appsCdbs) + foreach (BaseManifest appsCdb in appsCdbs) { appsFeatures.AddRange(appsCdb.Features.Feature); } @@ -80,7 +80,7 @@ private static (Dictionary preinstalledApps, Featu continue; } - HashSet depsForApp = new(); + HashSet depsForApp = []; foreach (Feature dep in dependencies) { string depAppId = dep.FeatureID; @@ -108,7 +108,7 @@ private static (Dictionary preinstalledApps, Featu /// The edition Composition Database to generate licenses for /// The application Composition Database /// The path to the repository file set - public static void GenerateLicenseXmlFiles(CompDB editionCdb, IEnumerable appsCdbs, string repositoryPath) + public static void GenerateLicenseXmlFiles(BaseManifest editionCdb, IEnumerable appsCdbs, string repositoryPath) { (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); @@ -142,15 +142,15 @@ public static void GenerateLicenseXmlFiles(CompDB editionCdb, IEnumerableThe application Composition Database /// The path to the repository file set /// - public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionCdb, IEnumerable appsCdbs, string editionLanguage) + public static AppxInstallWorkload[] GetAppxInstallationWorkloads(BaseManifest editionCdb, IEnumerable appsCdbs, string editionLanguage) { - List workloads = new(); + List workloads = []; IEnumerable applicableLanguageTags = GetAllPossibleLanguageCombinations(editionLanguage); (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); - HashSet allPackageIDs = new(); + HashSet allPackageIDs = []; // Pick packages and dump licenses foreach (Feature ftr in appsFeatures) { @@ -184,8 +184,8 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC } } - Dictionary packageHashDict = new(); - foreach (CompDB appsCdb in appsCdbs) + Dictionary packageHashDict = []; + foreach (BaseManifest appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) { @@ -217,13 +217,13 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC if (deployProps.Dependencies != null) { - List dependencies = new(); + List dependencies = []; foreach (string dependency in deployProps.Dependencies) { DeploymentProperties dependProps = preinstalledApps[dependency]; dependencies.Add(packageHashDict[dependProps.MainPackageID].Path); } - workload.DependenciesPath = dependencies.ToArray(); + workload.DependenciesPath = [.. dependencies]; } if (deployProps.HasLicense) @@ -239,7 +239,7 @@ public static AppxInstallWorkload[] GetAppxInstallationWorkloads(CompDB editionC workloads.Add(workload); } - return workloads.ToArray(); + return [.. workloads]; } private static readonly Dictionary languageMap = new() @@ -496,13 +496,13 @@ private static IEnumerable GetAllPossibleLanguageCombinations(string edi /// The application Composition Database /// The path to the repository file set /// - public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumerable appsCdbs, string editionLanguage) + public static PackageProperties[] GetAppxFilesToKeep(BaseManifest editionCdb, IEnumerable appsCdbs, string editionLanguage) { IEnumerable applicableLanguageTags = GetAllPossibleLanguageCombinations(editionLanguage); (Dictionary preinstalledApps, Feature[] appsFeatures) = SetupVariables(editionCdb, appsCdbs); - HashSet allPackageIDs = new(); + HashSet allPackageIDs = []; // Pick packages and dump licenses foreach (Feature ftr in appsFeatures) { @@ -536,8 +536,8 @@ public static PackageProperties[] GetAppxFilesToKeep(CompDB editionCdb, IEnumera } } - Dictionary packageHashDict = new(); - foreach (CompDB appsCdb in appsCdbs) + Dictionary packageHashDict = []; + foreach (BaseManifest appsCdb in appsCdbs) { foreach (Package p in appsCdb.Packages.Package) { diff --git a/src/CompDB/Applications/DeploymentProperties.cs b/src/CompDB/Applications/DeploymentProperties.cs index d11667af..11407a80 100644 --- a/src/CompDB/Applications/DeploymentProperties.cs +++ b/src/CompDB/Applications/DeploymentProperties.cs @@ -57,7 +57,7 @@ public bool HasLicense public void AddApplicablePackages(IEnumerable packageElements, IEnumerable applicableLanguageTags) { - PackageIDs = new HashSet(); + PackageIDs = []; Dictionary scaleDictionary = null; foreach (Package package in packageElements) { diff --git a/src/CompDB/ApplyTo.cs b/src/CompDB/ApplyTo.cs index e2540b09..c8c5c370 100644 --- a/src/CompDB/ApplyTo.cs +++ b/src/CompDB/ApplyTo.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyTo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ApplyTo")] public class ApplyTo { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/ApplyToInfo.cs b/src/CompDB/ApplyToInfo.cs index e643ec57..7480b28c 100644 --- a/src/CompDB/ApplyToInfo.cs +++ b/src/CompDB/ApplyToInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ApplyToInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ApplyToInfo")] public class ApplyToInfo { - [XmlElement(ElementName = "ApplyTo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ApplyTo")] public List ApplyTo { get; set; diff --git a/src/CompDB/Appx.cs b/src/CompDB/Appx.cs index c10e58f2..5ef088f8 100644 --- a/src/CompDB/Appx.cs +++ b/src/CompDB/Appx.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppX", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "AppX")] public class Appx { - [XmlElement(ElementName = "AppXPackages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "AppXPackages")] public AppxPackages AppXPackages { get; set; diff --git a/src/CompDB/AppxPackage.cs b/src/CompDB/AppxPackage.cs index 921051b8..347d16c6 100644 --- a/src/CompDB/AppxPackage.cs +++ b/src/CompDB/AppxPackage.cs @@ -23,7 +23,7 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Package")] public class AppxPackage { [XmlAttribute(AttributeName = "AppXPackageType")] @@ -41,12 +41,12 @@ public string FamilyName { get; set; } - [XmlElement(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Payload")] public Payload Payload { get; set; } - [XmlElement(ElementName = "LicenseData", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "LicenseData")] public string LicenseData { get; set; diff --git a/src/CompDB/AppxPackages.cs b/src/CompDB/AppxPackages.cs index 36c6ab26..f882ec54 100644 --- a/src/CompDB/AppxPackages.cs +++ b/src/CompDB/AppxPackages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "AppXPackages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "AppXPackages")] public class AppxPackages { - [XmlElement(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Package")] public List Package { get; set; diff --git a/src/CompDB/BaseManifest.cs b/src/CompDB/BaseManifest.cs new file mode 100644 index 00000000..f0b23d79 --- /dev/null +++ b/src/CompDB/BaseManifest.cs @@ -0,0 +1,154 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.Composition.Database +{ + public class BaseManifest + { + [XmlElement(ElementName = "Tags")] + public Tags Tags + { + get; set; + } + [XmlElement(ElementName = "Features")] + public Features Features + { + get; set; + } + [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsi + { + get; set; + } + [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsd + { + get; set; + } + [XmlAttribute(AttributeName = "CreatedDate")] + public string CreatedDate + { + get; set; + } + [XmlAttribute(AttributeName = "Revision")] + public string Revision + { + get; set; + } + [XmlAttribute(AttributeName = "SchemaVersion")] + public string SchemaVersion + { + get; set; + } + [XmlAttribute(AttributeName = "Product")] + public string Product + { + get; set; + } + [XmlAttribute(AttributeName = "BuildID")] + public string BuildID + { + get; set; + } + [XmlAttribute(AttributeName = "BuildInfo")] + public string BuildInfo + { + get; set; + } + [XmlAttribute(AttributeName = "OSVersion")] + public string OSVersion + { + get; set; + } + [XmlAttribute(AttributeName = "BuildArch")] + public string BuildArch + { + get; set; + } + [XmlAttribute(AttributeName = "ReleaseType")] + public string ReleaseType + { + get; set; + } + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + [XmlElement(ElementName = "Packages")] + public Packages Packages + { + get; set; + } + [XmlElement(ElementName = "AppX")] + public Appx AppX + { + get; set; + } + [XmlElement(ElementName = "MSConditionalFeatures")] + public MSConditionalFeatures MSConditionalFeatures + { + get; set; + } + [XmlAttribute(AttributeName = "TargetBuildID")] + public string TargetBuildID + { + get; set; + } + [XmlAttribute(AttributeName = "TargetBuildInfo")] + public string TargetBuildInfo + { + get; set; + } + [XmlAttribute(AttributeName = "TargetOSVersion")] + public string TargetOSVersion + { + get; set; + } + [XmlAttribute(AttributeName = "UUPProduct")] + public string UUPProduct + { + get; set; + } + [XmlAttribute(AttributeName = "UUPProductVersion")] + public string UUPProductVersion + { + get; set; + } + + public override string ToString() + { + return Name; + } + } +} diff --git a/src/CompDB/CompDBExtensions.cs b/src/CompDB/BaseManifestExtensions.cs similarity index 53% rename from src/CompDB/CompDBExtensions.cs rename to src/CompDB/BaseManifestExtensions.cs index 159e22d0..b3110377 100644 --- a/src/CompDB/CompDBExtensions.cs +++ b/src/CompDB/BaseManifestExtensions.cs @@ -26,134 +26,134 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - public static class CompDBExtensions + public static class BaseManifestExtensions { public static string GetCommonlyUsedIncorrectFileName(this Package pkg) { return pkg.Payload.PayloadItem.First(x => !x.Path.EndsWith(".psf")).Path.Replace('\\', Path.DirectorySeparatorChar).Split(Path.DirectorySeparatorChar).Last().Replace("~31bf3856ad364e35", "").Replace("~.", ".").Replace("~", "-").Replace("-.", "."); } - public static CompDB GetNeutralCompDB(this IEnumerable compDBs) + public static BaseManifest GetNeutralCompDB(this IEnumerable BaseManifests) { - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { - if (compDB.Type != "Build") + if (BaseManifest.Type != "Build") { continue; } - if (compDB.Name?.Contains("Desktop_FOD") == true) + if (BaseManifest.Name?.Contains("Desktop_FOD") == true) { continue; } // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Neutral", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Features?.Feature != null && - compDB.Packages?.Package != null) + if (BaseManifest.Tags.Type.Equals("Neutral", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Features?.Feature != null && + BaseManifest.Packages?.Package != null) { - return compDB; + return BaseManifest; } } // - // Older style compdbs have no tag elements, we need to find out if it's a neutral compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's a neutral BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("BaseNeutral", StringComparison.InvariantCultureIgnoreCase) == true) != null) { - return compDB; + return BaseManifest; } } return null; } - public static HashSet GetEditionCompDBsForLanguage( - this IEnumerable compDBs, + public static HashSet GetEditionCompDBsForLanguage( + this IEnumerable BaseManifests, string LanguageCode) { - HashSet filteredCompDBs = new(); + HashSet filteredBaseManifests = []; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // TODO: Do not do contains // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Count == 3 && - compDB.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Find(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + if (BaseManifest.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Count == 3 && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } // - // Older style compdbs have no tag elements, we need to find out if it's an edition compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's an edition BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("DesktopMedia", StringComparison.InvariantCultureIgnoreCase) == true && x.FeatureID?.Contains(LanguageCode, StringComparison.InvariantCultureIgnoreCase) == true) != null && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } - return filteredCompDBs; + return filteredBaseManifests; } - public static HashSet GetEditionCompDBs(this IEnumerable compDBs) + public static HashSet GetEditionCompDBs(this IEnumerable BaseManifests) { - HashSet filteredCompDBs = new(); + HashSet filteredBaseManifests = []; - foreach (CompDB compDB in compDBs) + foreach (BaseManifest BaseManifest in BaseManifests) { // - // Newer style compdbs have a tag attribute, make use of it. + // Newer style BaseManifests have a tag attribute, make use of it. // TODO: Do not do contains // - if (compDB.Tags != null) + if (BaseManifest.Tags != null) { - if (compDB.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && - compDB.Tags.Tag?.Count == 3 && - compDB.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && - compDB.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + if (BaseManifest.Tags.Type.Equals("Edition", StringComparison.InvariantCultureIgnoreCase) && + BaseManifest.Tags.Tag?.Count == 3 && + BaseManifest.Tags.Tag.Find(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase))?.Value?.Equals("Canonical", StringComparison.InvariantCultureIgnoreCase) == true && + BaseManifest.Tags.Tag.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) && + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } // - // Older style compdbs have no tag elements, we need to find out if it's an edition compdb using another way + // Older style BaseManifests have no tag elements, we need to find out if it's an edition BaseManifest using another way // - else if (compDB.Features?.Feature?.FirstOrDefault(x => + else if (BaseManifest.Features?.Feature?.FirstOrDefault(x => x.Type?.Contains("DesktopMedia", StringComparison.InvariantCultureIgnoreCase) == true) != null && - compDB.Name?.EndsWith("~Desktop_Apps~~") != true && - compDB.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) + BaseManifest.Name?.EndsWith("~Desktop_Apps~~") != true && + BaseManifest.Name?.EndsWith("~Desktop_Apps_Moment~~") != true) { - _ = filteredCompDBs.Add(compDB); + _ = filteredBaseManifests.Add(BaseManifest); } } - return filteredCompDBs; + return filteredBaseManifests; } - public static IEnumerable GetAvailableLanguages(this IEnumerable compDBs) + public static IEnumerable GetAvailableLanguages(this IEnumerable BaseManifests) { - return compDBs.GetEditionCompDBs().Select(x => + return BaseManifests.GetEditionCompDBs().Select(x => { if (x.Tags != null) { @@ -171,22 +171,22 @@ public static IEnumerable GetAvailableLanguages(this IEnumerable }).Where(x => !string.IsNullOrEmpty(x)).Distinct(); } - public static Package GetEditionPackFromCompDBs(this IEnumerable compDBs) + public static Package GetEditionPackFromCompDBs(this IEnumerable BaseManifests) { - HashSet pkgs = new(); + HashSet pkgs = []; // // Get base editions that are available with all their files // - HashSet filteredCompDBs = compDBs.GetEditionCompDBs(); + HashSet filteredBaseManifests = BaseManifests.GetEditionCompDBs(); - if (filteredCompDBs.Count > 0) + if (filteredBaseManifests.Count > 0) { - foreach (CompDB compDB in filteredCompDBs) + foreach (BaseManifest BaseManifest in filteredBaseManifests) { - foreach (Package feature in filteredCompDBs.First().Features.Feature[0].Packages.Package) + foreach (Package feature in filteredBaseManifests.First().Features.Feature[0].Packages.Package) { - Package pkg = filteredCompDBs.First().Packages.Package.First(x => x.ID == feature.ID); + Package pkg = filteredBaseManifests.First().Packages.Package.First(x => x.ID == feature.ID); IEnumerable files = pkg.Payload.PayloadItem.Select(x => x.Path.Replace('\\', Path.DirectorySeparatorChar)); diff --git a/src/CompDB/CompDB.cs b/src/CompDB/CompDB.cs index a841ae40..18aeef74 100644 --- a/src/CompDB/CompDB.cs +++ b/src/CompDB/CompDB.cs @@ -24,133 +24,8 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CompDB", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public class CompDB + [XmlRoot(ElementName = "CompDB", Namespace = Constants.ImageUpdateNamespace)] + public class CompDB : BaseManifest { - [XmlElement(ElementName = "Tags", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public Tags Tags - { - get; set; - } - [XmlElement(ElementName = "Features", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public Features Features - { - get; set; - } - [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsi - { - get; set; - } - [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsd - { - get; set; - } - [XmlAttribute(AttributeName = "CreatedDate", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string CreatedDate - { - get; set; - } - [XmlAttribute(AttributeName = "Revision", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string Revision - { - get; set; - } - [XmlAttribute(AttributeName = "SchemaVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string SchemaVersion - { - get; set; - } - [XmlAttribute(AttributeName = "Product", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string Product - { - get; set; - } - [XmlAttribute(AttributeName = "BuildID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string BuildID - { - get; set; - } - [XmlAttribute(AttributeName = "BuildInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string BuildInfo - { - get; set; - } - [XmlAttribute(AttributeName = "OSVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string OSVersion - { - get; set; - } - [XmlAttribute(AttributeName = "BuildArch", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string BuildArch - { - get; set; - } - [XmlAttribute(AttributeName = "ReleaseType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string ReleaseType - { - get; set; - } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string Type - { - get; set; - } - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string Name - { - get; set; - } - [XmlAttribute(AttributeName = "xmlns", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string Xmlns - { - get; set; - } - [XmlElement(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public Packages Packages - { - get; set; - } - [XmlElement(ElementName = "AppX", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public Appx AppX - { - get; set; - } - [XmlElement(ElementName = "MSConditionalFeatures", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public MSConditionalFeatures MSConditionalFeatures - { - get; set; - } - [XmlAttribute(AttributeName = "TargetBuildID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string TargetBuildID - { - get; set; - } - [XmlAttribute(AttributeName = "TargetBuildInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string TargetBuildInfo - { - get; set; - } - [XmlAttribute(AttributeName = "TargetOSVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string TargetOSVersion - { - get; set; - } - [XmlAttribute(AttributeName = "UUPProduct", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string UUPProduct - { - get; set; - } - [XmlAttribute(AttributeName = "UUPProductVersion", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public string UUPProductVersion - { - get; set; - } - - public override string ToString() - { - return Name; - } } } \ No newline at end of file diff --git a/src/CompDB/Condition.cs b/src/CompDB/Condition.cs index 1b62c537..bba9ce2c 100644 --- a/src/CompDB/Condition.cs +++ b/src/CompDB/Condition.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Condition")] public class Condition { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Name")] public string Name { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Operator")] public string Operator { get; set; } - [XmlAttribute(AttributeName = "RegistryKey", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "RegistryKey")] public string RegistryKey { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; } - [XmlAttribute(AttributeName = "RegistryKeyType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "RegistryKeyType")] public string RegistryKeyType { get; set; } - [XmlAttribute(AttributeName = "Status", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Status")] public string Status { get; set; } - [XmlAttribute(AttributeName = "FeatureStatus", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureStatus")] public string FeatureStatus { get; set; diff --git a/src/CompDB/ConditionSet.cs b/src/CompDB/ConditionSet.cs index 6cb6b5a2..67f6214b 100644 --- a/src/CompDB/ConditionSet.cs +++ b/src/CompDB/ConditionSet.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionSet")] public class ConditionSet { - [XmlElement(ElementName = "Conditions", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Conditions")] public Conditions Conditions { get; set; } - [XmlAttribute(AttributeName = "Operator", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Operator")] public string Operator { get; set; } - [XmlElement(ElementName = "ConditionSets", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSets")] public ConditionSets ConditionSets { get; set; diff --git a/src/CompDB/ConditionSets.cs b/src/CompDB/ConditionSets.cs index 55d4fcf5..8dd9b71d 100644 --- a/src/CompDB/ConditionSets.cs +++ b/src/CompDB/ConditionSets.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionSets", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionSets")] public class ConditionSets { - [XmlElement(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSet")] public ConditionSet ConditionSet { get; set; diff --git a/src/CompDB/ConditionalFeature.cs b/src/CompDB/ConditionalFeature.cs index f3924f03..de9af0de 100644 --- a/src/CompDB/ConditionalFeature.cs +++ b/src/CompDB/ConditionalFeature.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "ConditionalFeature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "ConditionalFeature")] public class ConditionalFeature { - [XmlElement(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Condition")] public Condition Condition { get; set; } - [XmlAttribute(AttributeName = "InstallAction", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "InstallAction")] public string InstallAction { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureID")] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlElement(ElementName = "ConditionSet", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionSet")] public ConditionSet ConditionSet { get; set; } - [XmlAttribute(AttributeName = "UpdateAction", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UpdateAction")] public string UpdateAction { get; set; diff --git a/src/CompDB/Conditions.cs b/src/CompDB/Conditions.cs index 8d723b77..315ccbfc 100644 --- a/src/CompDB/Conditions.cs +++ b/src/CompDB/Conditions.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Conditions", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Conditions")] public class Conditions { - [XmlElement(ElementName = "Condition", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Condition")] public List Condition { get; set; diff --git a/src/CompDB/Constants.cs b/src/CompDB/Constants.cs new file mode 100644 index 00000000..1fb0239b --- /dev/null +++ b/src/CompDB/Constants.cs @@ -0,0 +1,28 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.Composition.Database +{ + public static class Constants + { + public const string ImageUpdateNamespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate"; + } +} \ No newline at end of file diff --git a/src/CompDB/CustomInfo.cs b/src/CompDB/CustomInfo.cs index 3273e602..55fb1cc7 100644 --- a/src/CompDB/CustomInfo.cs +++ b/src/CompDB/CustomInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "CustomInfo")] public class CustomInfo { - [XmlAttribute(AttributeName = "Key", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Key")] public string Key { get; set; diff --git a/src/CompDB/CustomInformation.cs b/src/CompDB/CustomInformation.cs index 830c28de..3331c8e2 100644 --- a/src/CompDB/CustomInformation.cs +++ b/src/CompDB/CustomInformation.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "CustomInformation", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "CustomInformation")] public class CustomInformation { - [XmlElement(ElementName = "CustomInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "CustomInfo")] public CustomInfo[] CustomInfo { get; set; diff --git a/src/CompDB/Declare.cs b/src/CompDB/Declare.cs index dea2c09c..cc681894 100644 --- a/src/CompDB/Declare.cs +++ b/src/CompDB/Declare.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Declare", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Declare")] public class Declare { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/DeclareInfo.cs b/src/CompDB/DeclareInfo.cs index e67d0e92..d679f251 100644 --- a/src/CompDB/DeclareInfo.cs +++ b/src/CompDB/DeclareInfo.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeclareInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "DeclareInfo")] public class DeclareInfo { - [XmlElement(ElementName = "Declare", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Declare")] public Declare Declare { get; set; diff --git a/src/CompDB/Dependencies.cs b/src/CompDB/Dependencies.cs index 0c76ac22..e4392439 100644 --- a/src/CompDB/Dependencies.cs +++ b/src/CompDB/Dependencies.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Dependencies", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Dependencies")] public class Dependencies { - [XmlElement(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Feature")] public List Feature { get; set; diff --git a/src/CompDB/DeviceManifest.cs b/src/CompDB/DeviceManifest.cs index b5f5f48f..db481657 100644 --- a/src/CompDB/DeviceManifest.cs +++ b/src/CompDB/DeviceManifest.cs @@ -23,8 +23,8 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "DeviceManifest", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] - public class DeviceManifest : CompDB + [XmlRoot(ElementName = "DeviceManifest")] + public class DeviceManifest : BaseManifest { } } \ No newline at end of file diff --git a/src/CompDB/Feature.cs b/src/CompDB/Feature.cs index acc5c34a..305b83ef 100644 --- a/src/CompDB/Feature.cs +++ b/src/CompDB/Feature.cs @@ -23,50 +23,50 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Feature")] public class Feature { - [XmlElement(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Packages")] public Packages Packages { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "FeatureID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FeatureID")] public string FeatureID { get; set; } - [XmlAttribute(AttributeName = "FMID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "FMID")] public string FMID { get; set; } - [XmlAttribute(AttributeName = "Group", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Group")] public string Group { get; set; } - [XmlElement(ElementName = "Dependencies", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Dependencies")] public Dependencies Dependencies { get; set; } - [XmlElement(ElementName = "InitialIntents", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "InitialIntents")] public InitialIntents InitialIntents { get; set; } - [XmlElement(ElementName = "CustomInformation", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "CustomInformation")] public CustomInformation CustomInformation { get; set; } - [XmlAttribute(AttributeName = "Family", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Family")] public string Family { get; set; diff --git a/src/CompDB/Features.cs b/src/CompDB/Features.cs index c6d93a16..2bdecdcd 100644 --- a/src/CompDB/Features.cs +++ b/src/CompDB/Features.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Features", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Features")] public class Features { - [XmlElement(ElementName = "Feature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Feature")] public Feature[] Feature { get; set; diff --git a/src/CompDB/InitialIntent.cs b/src/CompDB/InitialIntent.cs index 8e1f5fcc..6d2da505 100644 --- a/src/CompDB/InitialIntent.cs +++ b/src/CompDB/InitialIntent.cs @@ -23,10 +23,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntent", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "InitialIntent")] public class InitialIntent { - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/InitialIntents.cs b/src/CompDB/InitialIntents.cs index 26478725..3a0bdae3 100644 --- a/src/CompDB/InitialIntents.cs +++ b/src/CompDB/InitialIntents.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "InitialIntents", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "InitialIntents")] public class InitialIntents { - [XmlElement(ElementName = "InitialIntent", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "InitialIntent")] public List InitialIntent { get; set; diff --git a/src/CompDB/MSConditionalFeatures.cs b/src/CompDB/MSConditionalFeatures.cs index 49309015..bc41d323 100644 --- a/src/CompDB/MSConditionalFeatures.cs +++ b/src/CompDB/MSConditionalFeatures.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "MSConditionalFeatures", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "MSConditionalFeatures")] public class MSConditionalFeatures { - [XmlElement(ElementName = "ConditionalFeature", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ConditionalFeature")] public List ConditionalFeature { get; set; diff --git a/src/CompDB/Package.cs b/src/CompDB/Package.cs index ded84baa..5a2c9a94 100644 --- a/src/CompDB/Package.cs +++ b/src/CompDB/Package.cs @@ -23,40 +23,40 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Package")] public class Package { - [XmlAttribute(AttributeName = "ID", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "ID")] public string ID { get; set; } - [XmlAttribute(AttributeName = "PackageType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PackageType")] public string PackageType { get; set; } - [XmlElement(ElementName = "SatelliteInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "SatelliteInfo")] public SatelliteInfo SatelliteInfo { get; set; } - [XmlElement(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Payload")] public Payload Payload { get; set; } - [XmlAttribute(AttributeName = "InstalledSize", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "InstalledSize")] public string InstalledSize { get; set; } - [XmlAttribute(AttributeName = "Version", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Version")] public string Version { get; set; } - [XmlAttribute(AttributeName = "UpdateType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "UpdateType")] public string UpdateType { get; set; diff --git a/src/CompDB/Packages.cs b/src/CompDB/Packages.cs index 960a277c..80f05548 100644 --- a/src/CompDB/Packages.cs +++ b/src/CompDB/Packages.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Packages", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Packages")] public class Packages { - [XmlElement(ElementName = "Package", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Package")] public List Package { get; set; diff --git a/src/CompDB/Payload.cs b/src/CompDB/Payload.cs index 4d61d6d0..e38cd19a 100644 --- a/src/CompDB/Payload.cs +++ b/src/CompDB/Payload.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Payload", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Payload")] public class Payload { - [XmlElement(ElementName = "PayloadItem", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "PayloadItem")] public List PayloadItem { get; set; diff --git a/src/CompDB/PayloadItem.cs b/src/CompDB/PayloadItem.cs index 3449a4de..b0d958a2 100644 --- a/src/CompDB/PayloadItem.cs +++ b/src/CompDB/PayloadItem.cs @@ -23,35 +23,35 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "PayloadItem", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "PayloadItem")] public class PayloadItem { - [XmlAttribute(AttributeName = "PayloadHash", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadHash")] public string SourceHash { get; set; } - [XmlAttribute(AttributeName = "PayloadSize", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadSize")] public string PayloadSize { get; set; } - [XmlAttribute(AttributeName = "Path", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Path")] public string SourceName { get; set; } - [XmlAttribute(AttributeName = "PayloadType", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "PayloadType")] public string PayloadType { get; set; } - [XmlAttribute(AttributeName = "AltSourceName", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "AltSourceName")] public string AltSourceName { get; set; } - [XmlAttribute(AttributeName = "AltSourceHash", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "AltSourceHash")] public string AltSourceHash { get; set; diff --git a/src/CompDB/Require.cs b/src/CompDB/Require.cs index c952a0de..e29f54d4 100644 --- a/src/CompDB/Require.cs +++ b/src/CompDB/Require.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Require", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Require")] public class Require { - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/RequireInfo.cs b/src/CompDB/RequireInfo.cs index 4a8206e2..ddd73dcc 100644 --- a/src/CompDB/RequireInfo.cs +++ b/src/CompDB/RequireInfo.cs @@ -24,10 +24,10 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "RequireInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "RequireInfo")] public class RequireInfo { - [XmlElement(ElementName = "Require", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Require")] public List Require { get; set; diff --git a/src/CompDB/SatelliteInfo.cs b/src/CompDB/SatelliteInfo.cs index 1808885c..6fb45cb8 100644 --- a/src/CompDB/SatelliteInfo.cs +++ b/src/CompDB/SatelliteInfo.cs @@ -23,20 +23,20 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "SatelliteInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "SatelliteInfo")] public class SatelliteInfo { - [XmlElement(ElementName = "RequireInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "RequireInfo")] public RequireInfo RequireInfo { get; set; } - [XmlElement(ElementName = "ApplyToInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "ApplyToInfo")] public ApplyToInfo ApplyToInfo { get; set; } - [XmlElement(ElementName = "DeclareInfo", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "DeclareInfo")] public DeclareInfo DeclareInfo { get; set; diff --git a/src/CompDB/Tag.cs b/src/CompDB/Tag.cs index 3b93c561..33d4be89 100644 --- a/src/CompDB/Tag.cs +++ b/src/CompDB/Tag.cs @@ -23,15 +23,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tag", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Tag")] public class Tag { - [XmlAttribute(AttributeName = "Name", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Name")] public string Name { get; set; } - [XmlAttribute(AttributeName = "Value", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Value")] public string Value { get; set; diff --git a/src/CompDB/Tags.cs b/src/CompDB/Tags.cs index 36cb8146..ef2def51 100644 --- a/src/CompDB/Tags.cs +++ b/src/CompDB/Tags.cs @@ -24,15 +24,15 @@ namespace UnifiedUpdatePlatform.Services.Composition.Database { - [XmlRoot(ElementName = "Tags", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlRoot(ElementName = "Tags")] public class Tags { - [XmlElement(ElementName = "Tag", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlElement(ElementName = "Tag")] public List Tag { get; set; } - [XmlAttribute(AttributeName = "Type", Namespace = "http://schemas.microsoft.com/embedded/2004/10/ImageUpdate")] + [XmlAttribute(AttributeName = "Type")] public string Type { get; set; diff --git a/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj b/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj index 937a5f05..76cbed33 100644 --- a/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj +++ b/src/Microsoft.StoreServices.DisplayCatalog/Microsoft.StoreServices.DisplayCatalog.csproj @@ -1,14 +1,11 @@ - net8.0 AnyCPU;x64;x86;arm64 $(SolutionDir)build\$(Platform)\$(Configuration)\Microsoft.StoreServices.DisplayCatalog\ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\Microsoft.StoreServices.DisplayCatalog\ - - - + \ No newline at end of file diff --git a/src/TempManager/TempManager.cs b/src/TempManager/TempManager.cs index d77752a4..12c7ea4f 100644 --- a/src/TempManager/TempManager.cs +++ b/src/TempManager/TempManager.cs @@ -24,7 +24,7 @@ namespace UnifiedUpdatePlatform.Services.Temp public class TempManager : IDisposable { private ulong i = 0; - private readonly List tempPaths = new(); + private readonly List tempPaths = []; private bool disposed = false; private readonly string Temp = Environment.GetEnvironmentVariable("TEMP") ?? ""; diff --git a/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj b/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj index feb7253e..5f3dc4ae 100644 --- a/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj +++ b/src/TempManager/UnifiedUpdatePlatform.Services.Temp.csproj @@ -1,11 +1,8 @@ - net8.0 enable enable AnyCPU;x64;x86;arm64 - - - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj b/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj index 54250a0f..4865b2f2 100644 --- a/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj +++ b/src/UnifiedUpdatePlatform.Common.Messaging/UnifiedUpdatePlatform.Common.Messaging.csproj @@ -8,4 +8,4 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Common.Messaging\ MinimumRecommendedRules.ruleset - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj b/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj index c475edd1..154bc6c8 100644 --- a/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj +++ b/src/UnifiedUpdatePlatform.Imaging/UnifiedUpdatePlatform.Services.Imaging.csproj @@ -9,7 +9,7 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Imaging\ 9.0 MinimumRecommendedRules.ruleset - false + false @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs index 0a671661..7390de10 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/ConversionPlanBuilder.cs @@ -36,8 +36,8 @@ namespace UnifiedUpdatePlatform.Media.Creator.Planning public class EditionTarget { public PlannedEdition PlannedEdition { get; set; } = new PlannedEdition(); - public List NonDestructiveTargets = new(); - public List DestructiveTargets = new(); + public List NonDestructiveTargets = []; + public List DestructiveTargets = []; } public class PlannedEdition @@ -47,7 +47,7 @@ public AvailabilityType AvailabilityType { get; set; } - public AppxInstallWorkload[] AppXInstallWorkloads { get; set; } = Array.Empty(); + public AppxInstallWorkload[] AppXInstallWorkloads { get; set; } = []; } public enum AvailabilityType @@ -155,7 +155,7 @@ ref List editionsAdded // // Sort editions by name // - target.NonDestructiveTargets = target.NonDestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName).ToList(); + target.NonDestructiveTargets = [.. target.NonDestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName)]; // // Handle editions that we can upgrade to using a full upgrade process @@ -269,25 +269,25 @@ ref List editionsAdded } } - target.DestructiveTargets = target.DestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName).ToList(); + target.DestructiveTargets = [.. target.DestructiveTargets.OrderBy(x => x.PlannedEdition.EditionName)]; return target; } private static (List, List) GetEditionsThatCanBeTargetedUsingPackageDowngrade( string UUPPath, - IEnumerable compDBs, + IEnumerable compDBs, IEnumerable availableCanonicalEditions, List possibleEditionUpgrades, ProgressCallback? progressCallback = null) { - List availableEditionsByDowngradingInPriority = new(); - List availableEditionsByDowngrading = new(); + List availableEditionsByDowngradingInPriority = []; + List availableEditionsByDowngrading = []; // // Attempt to get the neutral Composition Database listing all available files // - CompDB? neutralCompDB = compDBs.GetNeutralCompDB(); + BaseManifest? neutralCompDB = compDBs.GetNeutralCompDB(); if (neutralCompDB != null && neutralCompDB.Features.Feature.FirstOrDefault(x => x.FeatureID == "BaseNeutral")? @@ -387,7 +387,7 @@ private static (List, List) GetEditionsThatCanBe } public static bool GetTargetedPlan( - IEnumerable compDBs, + IEnumerable compDBs, string EditionPack, string LanguageCode, bool IncludeServicingCapableOnlyTargets, @@ -400,10 +400,10 @@ public static bool GetTargetedPlan( public static List PrintEditionTarget(EditionTarget editionTarget, int padding = 0) { - List lines = new() - { + List lines = + [ $"-> Name: {editionTarget.PlannedEdition.EditionName}, Availability: {editionTarget.PlannedEdition.AvailabilityType}" - }; + ]; if (editionTarget.PlannedEdition.AppXInstallWorkloads?.Length > 0) { @@ -444,7 +444,7 @@ public static List PrintEditionTarget(EditionTarget editionTarget, int p public static bool GetTargetedPlan( string UUPPath, - IEnumerable compDBs, + IEnumerable compDBs, string EditionPack, string LanguageCode, bool IncludeServicingCapableOnlyTargets, @@ -454,7 +454,7 @@ public static bool GetTargetedPlan( { bool VerifyFiles = !string.IsNullOrEmpty(UUPPath); - EditionTargets = new List(); + EditionTargets = []; bool result = true; @@ -463,7 +463,7 @@ public static bool GetTargetedPlan( // // Get base editions that are available with all their files // - IEnumerable filteredCompDBs = compDBs.GetEditionCompDBsForLanguage(LanguageCode).Where(x => + IEnumerable filteredCompDBs = compDBs.GetEditionCompDBsForLanguage(LanguageCode).Where(x => { bool success = !VerifyFiles; if (!success) @@ -504,7 +504,7 @@ public static bool GetTargetedPlan( if (compDBs.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { - IEnumerable AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); + IEnumerable AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); edition.AppXInstallWorkloads = AppxSelectionEngine.GetAppxInstallationWorkloads(compDB, AppCompDBs, LanguageCode); } @@ -523,13 +523,13 @@ public static bool GetTargetedPlan( // This dictionary holds the possible virtual edition upgrades // Example: Professional -> ProfessionalEducation // - List virtualWindowsEditions = new(); + List virtualWindowsEditions = []; // // This dictionary holds the possible edition upgrades // Example: Core -> Professional // - List possibleEditionUpgrades = new(); + List possibleEditionUpgrades = []; if (!string.IsNullOrEmpty(EditionPack) && File.Exists(EditionPack)) { @@ -576,7 +576,7 @@ public static bool GetTargetedPlan( !string.IsNullOrEmpty(x.Virtual) && x.Virtual.Equals("true", StringComparison.InvariantCultureIgnoreCase)).OrderBy(x => x.ParentEdition); - virtualWindowsEditions = virtualeditions.ToList(); + virtualWindowsEditions = [.. virtualeditions]; } catch { } } @@ -648,7 +648,7 @@ public static bool GetTargetedPlan( progressCallback?.Invoke("Building Targets"); - List editionsAdded = new(); + List editionsAdded = []; foreach (PlannedEdition? ed in availableCanonicalEditions) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs index 6bf1cfea..c136f068 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator.Planning/FileLocator.cs @@ -34,9 +34,9 @@ namespace UnifiedUpdatePlatform.Media.Creator.Planning { public static class FileLocator { - public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager tempManager) + public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager tempManager) { - List compDBs = new(); + List compDBs = []; try { @@ -87,9 +87,9 @@ public static List GetCompDBsFromUUPFiles(string UUPPath, TempManager te return compDBs; } - public static (bool, HashSet) VerifyFilesAreAvailableForCompDB(CompDB compDB, string UUPPath) + public static (bool, HashSet) VerifyFilesAreAvailableForCompDB(BaseManifest compDB, string UUPPath) { - HashSet missingPackages = new(); + HashSet missingPackages = []; foreach (Package feature in compDB.Features.Feature[0].Packages.Package) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs index 9c2e3788..b848384e 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/BaseEditions/BaseEditionBuilder.cs @@ -45,7 +45,7 @@ public static bool CreateBaseEdition( string InputWindowsREPath, string OutputInstallImage, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { @@ -178,7 +178,7 @@ public static bool CreateBaseEditionWithAppXs( string OutputInstallImage, Common.Messaging.Common.CompressionType CompressionType, AppxInstallWorkload[] appxWorkloads, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, bool keepVhd, out string vhdPath, @@ -355,7 +355,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { @@ -398,7 +398,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) goto exit; } - Dictionary> iniSections = new(); + Dictionary> iniSections = []; foreach (string referencePackageToConvert in referencePackagesToConvert) { @@ -413,7 +413,7 @@ private static (bool result, string BaseESD, HashSet ReferencePackages) { if (!iniSections.ContainsKey(section.SectionName)) { - iniSections.Add(section.SectionName, new List()); + iniSections.Add(section.SectionName, []); } foreach (KeyData element in section.Keys) diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs b/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs index 20f62bd5..f17bfabc 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Constants.cs @@ -28,8 +28,8 @@ public static class Constants { internal static readonly IImaging imagingInterface = new WimLibImaging(); - internal static byte[] winpejpg = new byte[] - { + internal static byte[] winpejpg = + [ 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, @@ -111,7 +111,7 @@ public static class Constants 0xBE, 0x8A, 0x28, 0xAF, 0xEB, 0x03, 0xF8, 0xAC, 0x28, 0xA2, 0x8A, 0x00, 0x28, 0xA2, 0x8A, 0x00, 0x28, 0xA2, 0x8A, 0x00, 0xFF, 0xD9 - }; + ]; internal static string SOFTWARE_Hive_Location = Path.Combine("Windows", "System32", "config", "SOFTWARE"); diff --git a/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs b/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs index ac76ee4c..6061580a 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/DismOperations.cs @@ -41,7 +41,7 @@ private List GetRemovableREPackages(string mountDir) XDocument sessDoc = XDocument.Load(Path.Combine(mountDir, @"Windows\servicing\Sessions\Sessions.xml")); IEnumerable sessions = sessDoc.Element("Sessions").Elements("Session"); bool dupeFound = false; - List pkgsToRemove = new(); + List pkgsToRemove = []; foreach (XElement test in sessions) { bool phasesEmpty = !test.Element("Actions").Elements("Phase").First().Elements().Any(); @@ -79,7 +79,7 @@ public bool PerformAppxWorkloadInstallation(string ospath, string repositoryPath DismApi.AddProvisionedAppxPackage( session, Path.Combine(repositoryPath, workload.AppXPath), - workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? new List(), + workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? [], string.IsNullOrEmpty(workload.LicensePath) ? null : Path.Combine(licenseFolder, workload.LicensePath), null, string.IsNullOrEmpty(workload.StubPackageOption) ? DismStubPackageOption.None : DismStubPackageOption.InstallStub); // TODO: proper handling @@ -142,7 +142,7 @@ public bool PerformAppxWorkloadsInstallation(string ospath, string repositoryPat DismApi.AddProvisionedAppxPackage( session, Path.Combine(repositoryPath, workload.AppXPath), - workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? new List(), + workload.DependenciesPath?.Select(x => Path.Combine(repositoryPath, x)).ToList() ?? [], string.IsNullOrEmpty(workload.LicensePath) ? null : Path.Combine(licenseFolder, workload.LicensePath), null, string.IsNullOrEmpty(workload.StubPackageOption) ? DismStubPackageOption.None : DismStubPackageOption.InstallStub); // TODO: proper handling @@ -203,7 +203,7 @@ public bool UninstallPEComponents(string ospath, ProgressCallback progressCallba DismSession session = DismApi.OpenOfflineSession(ospath); DismPackageCollection packages = DismApi.GetPackages(session); - List componentsToRemove = new(); + List componentsToRemove = []; // // Queue components we don't need according to our hardcoded list for removal diff --git a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs index 2c5540d3..d001cb5c 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/FileLocator.cs @@ -32,11 +32,11 @@ namespace UnifiedUpdatePlatform.Media.Creator { internal static class FileLocator { - internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDatabases(HashSet CompositionDatabases, string UUPPath) + internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDatabases(HashSet CompositionDatabases, string UUPPath) { - HashSet missingPackages = new(); + HashSet missingPackages = []; - foreach (CompDB compDB in CompositionDatabases) + foreach (BaseManifest compDB in CompositionDatabases) { (bool succeeded, HashSet missingFiles) = Planning.FileLocator.VerifyFilesAreAvailableForCompDB(compDB, UUPPath); foreach (string? missingFile in missingFiles) @@ -51,12 +51,12 @@ internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDat return (missingPackages.Count == 0, missingPackages); } - internal static CompDB? GetEditionCompDBForLanguage( - IEnumerable CompositionDatabases, + internal static BaseManifest? GetEditionCompDBForLanguage( + IEnumerable CompositionDatabases, string Edition, string LanguageCode) { - foreach (CompDB? compDB in CompositionDatabases) + foreach (BaseManifest? compDB in CompositionDatabases) { // // Newer style compdbs have a tag attribute, make use of it. @@ -95,15 +95,15 @@ internal static (bool, HashSet) VerifyFilesAreAvailableForCompositionDat internal static (bool Succeeded, string BaseESD) LocateFilesForSetupMediaCreation( string UUPPath, string LanguageCode, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Looking up Composition Database in order to find a Base ESD image appropriate for building windows setup files."); - HashSet filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode); + HashSet filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode); if (filteredCompositionDatabases.Count > 0) { - foreach (CompDB? currentCompDB in filteredCompositionDatabases) + foreach (BaseManifest? currentCompDB in filteredCompositionDatabases) { foreach (Package feature in currentCompDB.Features.Feature[0].Packages.Package) { @@ -136,14 +136,14 @@ internal static bool GenerateAppXLicenseFiles( string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { bool success = true; progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Enumerating files"); - CompDB? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); + BaseManifest? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); if (compDB == null) { @@ -153,7 +153,7 @@ internal static bool GenerateAppXLicenseFiles( if (CompositionDatabases.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { - IEnumerable AppCompDBs = CompositionDatabases.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); + IEnumerable AppCompDBs = CompositionDatabases.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); AppxSelectionEngine.GenerateLicenseXmlFiles(compDB, AppCompDBs, UUPPath); } @@ -170,17 +170,17 @@ internal static (bool Succeeded, string BaseESD, HashSet ReferencePackag string UUPPath, string LanguageCode, string EditionID, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, ProgressCallback? progressCallback = null) { bool success = true; - HashSet ReferencePackages = new(); - HashSet referencePackagesToConvert = new(); + HashSet ReferencePackages = []; + HashSet referencePackagesToConvert = []; string? BaseESD = null; progressCallback?.Invoke(Common.Messaging.Common.ProcessPhase.ReadingMetadata, true, 0, "Enumerating files"); - CompDB? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); + BaseManifest? compDB = GetEditionCompDBForLanguage(CompositionDatabases, EditionID, LanguageCode); if (compDB == null) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs b/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs index a2284966..4a605e79 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Installer/SetupMediaCreator.cs @@ -35,7 +35,7 @@ public static bool CreateSetupMedia( string OutputMediaPath, string OutputWindowsREPath, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, ProgressCallback progressCallback = null) { diff --git a/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs b/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs index 3527e7da..bc2146f7 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/Installer/WindowsInstallerBuilder.cs @@ -282,11 +282,11 @@ private static bool IntegrateSetupFilesIntoImage( string winpejpgtmp = tempManager.GetTempPath(); File.WriteAllBytes(winpejpgtmp, Constants.winpejpg); - List<(string fileToAdd, string destination)> updateDirectives = new() - { + List<(string fileToAdd, string destination)> updateDirectives = + [ (bgfile, Path.Combine("Windows", "System32", "setup.bmp")), (winpejpgtmp, Path.Combine("Windows", "System32", "winpe.jpg")) - }; + ]; progressCallback?.Log("Backporting missing files"); @@ -383,10 +383,10 @@ private static bool PreparePEImage( string peshellini = Path.Combine(sys32, "winpeshl.ini"); progressCallback?.Log("Preparing PE for cleanup"); - List<(string fileToAdd, string destination)> updateDirectives = new() - { + List<(string fileToAdd, string destination)> updateDirectives = + [ (null, peshellini) - }; + ]; // // Cleanup log file from RE conversion phase mentions @@ -403,7 +403,7 @@ private static bool PreparePEImage( string[] lines = File.ReadAllLines(logfile); int bootsessioncount = 0; - List finallines = new(); + List finallines = []; foreach (string line in lines) { if (line.StartsWith("[Boot Session: ", StringComparison.InvariantCultureIgnoreCase)) diff --git a/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs b/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs index 566b366e..1495b8ea 100644 --- a/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs +++ b/src/UnifiedUpdatePlatform.Media.Creator/MediaCreator.cs @@ -48,7 +48,7 @@ private static bool HandleEditionPlan( string InstallWIMFilePath, string WinREWIMFilePath, Common.Messaging.Common.CompressionType CompressionType, - IEnumerable CompositionDatabases, + IEnumerable CompositionDatabases, TempManager tempManager, string VHDMountPath = null, string CurrentBackupVHD = null, @@ -285,7 +285,7 @@ void callback(string Operation, int ProgressPercentage, bool IsIndeterminate) public static bool GetTargetedPlan( string UUPPath, string LanguageCode, - List CompositionDatabases, + List CompositionDatabases, out List EditionTargets, TempManager tempManager, ProgressCallback progressCallback = null) @@ -297,7 +297,7 @@ public static bool GetTargetedPlan( // // Get base editions that are available with all their files // - IEnumerable filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode).Where(x => + IEnumerable filteredCompositionDatabases = CompositionDatabases.GetEditionCompDBsForLanguage(LanguageCode).Where(x => { (bool success, HashSet missingfiles) = Planning.FileLocator.VerifyFilesAreAvailableForCompDB(x, UUPPath); return success; @@ -388,7 +388,7 @@ public static void CreateISOMedia( try { - List CompositionDatabases = Planning.FileLocator.GetCompDBsFromUUPFiles(UUPPath, tempManager); + List CompositionDatabases = Planning.FileLocator.GetCompDBsFromUUPFiles(UUPPath, tempManager); result = GetTargetedPlan(UUPPath, LanguageCode, CompositionDatabases, out List editionTargets, tempManager, progressCallback); if (!result) diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs index f4941af0..f051e80b 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/DownloadHelpers.cs @@ -29,28 +29,96 @@ using UnifiedUpdatePlatform.Services.Composition.Database; using UnifiedUpdatePlatform.Services.Composition.Database.Applications; using UnifiedUpdatePlatform.Services.WindowsUpdate; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { public static partial class UpdateUtils { - public static string[] GetFilenameForCEUIFile(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static string[] GetFilenameForCEUIFile(Models.FE3.XML.ExtendedUpdateInfo.File extendedUpdateInfoFile, IEnumerable payloadItems) { - string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); - if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) + string filename = extendedUpdateInfoFile.FileName.Replace('\\', Path.DirectorySeparatorChar); + + if (payloadItems.Any(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest)) { - IEnumerable payloads = payloadItems.Where(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); - return payloads.Select(p => p.Path.Replace('\\', Path.DirectorySeparatorChar)).ToArray(); + IEnumerable payloads = payloadItems.Where(x => x.PayloadHash == extendedUpdateInfoFile.AdditionalDigest.Text || x.PayloadHash == extendedUpdateInfoFile.Digest); + return payloads.Select(p => p.Path.Replace('\\', Path.DirectorySeparatorChar)).DistinctBy(x => x.ToLower()).ToArray(); } else if (!payloadItems.Any() && filename.Contains('_') && !filename.StartsWith("_") && (!filename.Contains('-') || filename.IndexOf('-') > filename.IndexOf('_'))) { filename = filename[..filename.IndexOf('_')] + Path.DirectorySeparatorChar + filename[(filename.IndexOf('_') + 1)..]; - return new string[] { filename.TrimStart(Path.DirectorySeparatorChar) }; + return [filename.TrimStart(Path.DirectorySeparatorChar)]; + } + + return [filename]; + } + + public static string FixFilePath((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile, HashSet pathList, HashSet compDBs, string path) + { + string newPath = path; + + MatchCollection guidMatches = guidRegex().Matches(newPath); + + // Some file packages (especially for device manifests) contain guids as part of their name and often the actual name of the file after, so trim that right away + foreach (Match match in guidMatches.OrderByDescending(x => x.Index + x.Length)) + { + newPath = string.Concat(newPath.AsSpan(0, match.Index), newPath.AsSpan(match.Index + match.Length)); + } + + // It is possible that above operation caused the file to go empty, check for that and if thats the case, revert now. + if (newPath != path && (string.IsNullOrEmpty(newPath) || newPath.StartsWith('.'))) + { + newPath = path; + } + + try + { + foreach (BaseManifest compDb in compDBs) + { + foreach (Package pkg in compDb.Packages.Package) + { + string payloadHash = pkg.Payload.PayloadItem[0].PayloadHash; + if (payloadHash == boundFile.Item1.AdditionalDigest.Text || payloadHash == boundFile.Item1.Digest) + { + if (pkg.ID.Contains('-') && pkg.ID.Contains(".inf", StringComparison.InvariantCultureIgnoreCase)) + { + newPath = pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase); + } + break; + } + } + } + } + catch { } + + if (!pathList.Add(newPath.ToLower())) + { + string basePath, suffix; + + if (Path.HasExtension(newPath)) + { + basePath = Path.Combine(Path.GetDirectoryName(newPath), Path.GetFileNameWithoutExtension(newPath)); + suffix = Path.GetExtension(newPath); + } + else + { + basePath = Path.Combine(Path.GetDirectoryName(newPath), Path.GetFileName(newPath)); + suffix = ""; + } + + uint i = 1; + + do + { + newPath = $"{basePath} ({i++}){suffix}"; + } + while (!pathList.Add(newPath.ToLower())); } - return new string[] { filename }; + + return newPath; } - public static bool ShouldFileGetDownloaded(CExtendedUpdateInfoXml.File file2, IEnumerable payloadItems) + public static bool ShouldFileGetDownloaded(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable payloadItems) { string filename = file2.FileName.Replace('\\', Path.DirectorySeparatorChar); if (payloadItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest)) @@ -77,24 +145,24 @@ public static UpdateData TrimDeltasFromUpdateData(UpdateData update) return update; } - private static bool IsFileBanned(CExtendedUpdateInfoXml.File file2, IEnumerable bannedItems) + private static bool IsFileBanned(Models.FE3.XML.ExtendedUpdateInfo.File file2, IEnumerable bannedItems) { return bannedItems.Any(x => x.PayloadHash == file2.AdditionalDigest.Text || x.PayloadHash == file2.Digest); } private static ( - HashSet selectedCompDBs, - HashSet discardedCompDBs, - HashSet specificCompDBs + HashSet selectedCompDBs, + HashSet discardedCompDBs, + HashSet specificCompDBs ) - FilterCompDBs(HashSet compDBs, string Edition, string Language) + FilterCompDBs(HashSet compDBs, string Edition, string Language) { - HashSet selectedCompDBs = new(); - HashSet discardedCompDBs = new(); - HashSet specificCompDBs = new(); + HashSet selectedCompDBs = []; + HashSet discardedCompDBs = []; + HashSet specificCompDBs = []; - foreach (CompDB cdb in compDBs) + foreach (BaseManifest cdb in compDBs) { bool IsDiff = cdb.Tags?.Tag?.Any(x => x.Name.Equals("UpdateType", StringComparison.InvariantCultureIgnoreCase) && (x.Value.Equals("Diff", StringComparison.InvariantCultureIgnoreCase) || x.Value.Equals("Baseless", StringComparison.InvariantCultureIgnoreCase))) == true; @@ -151,7 +219,7 @@ HashSet specificCompDBs // Get edition + language case (true, true): { - if ((!hasEdition && !hasLang || !hasEdition && hasLang && langMatching || !hasLang && hasEdition && editionMatching || hasEdition && hasLang && langMatching && editionMatching) && !IsNeutral) + if (((!hasEdition && !hasLang) || (!hasEdition && hasLang && langMatching) || (!hasLang && hasEdition && editionMatching) || (hasEdition && hasLang && langMatching && editionMatching)) && !IsNeutral) { _ = specificCompDBs.Add(cdb); _ = selectedCompDBs.Add(cdb); @@ -174,26 +242,26 @@ private static HashSet payloadItems, HashSet bannedPayloadItems ) - BuildListOfPayloads(HashSet compDBs, string Edition, string Language) + BuildListOfPayloads(HashSet compDBs, string Edition, string Language) { - HashSet payloadItems = new(); - HashSet bannedPayloadItems = new(); + HashSet payloadItems = []; + HashSet bannedPayloadItems = []; if (compDBs == null) { return (payloadItems, bannedPayloadItems); } - IEnumerable AppCompDBs = null; + IEnumerable AppCompDBs = null; - (HashSet selectedCompDBs, HashSet discardedCompDBs, HashSet specificCompDBs) = FilterCompDBs(compDBs, Edition, Language); + (HashSet selectedCompDBs, HashSet discardedCompDBs, HashSet specificCompDBs) = FilterCompDBs(compDBs, Edition, Language); if (compDBs.Any(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true))) { AppCompDBs = compDBs.Where(x => x.Name?.StartsWith("Build~") == true && (x.Name?.EndsWith("~Desktop_Apps~~") == true || x.Name?.EndsWith("~Desktop_Apps_Moment~~") == true)); } - foreach (CompDB cdb in selectedCompDBs) + foreach (BaseManifest cdb in selectedCompDBs) { if (AppCompDBs?.Contains(cdb) == true || cdb.Packages == null) { @@ -234,7 +302,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB cdb in discardedCompDBs) + foreach (BaseManifest cdb in discardedCompDBs) { if (AppCompDBs?.Contains(cdb) == true || cdb.Packages == null) { @@ -273,14 +341,14 @@ HashSet bannedPayloadItems if (AppCompDBs != null) { - List payloadHashesToKeep = new(); + List payloadHashesToKeep = []; switch (!string.IsNullOrEmpty(Language), !string.IsNullOrEmpty(Edition)) { // Get everything case (false, false): { - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { foreach (Package pkg in AppCompDB.Packages.Package) { @@ -322,7 +390,7 @@ HashSet bannedPayloadItems // Get edition case (false, true): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasEdition = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -343,7 +411,7 @@ HashSet bannedPayloadItems // Get language case (true, false): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasLang = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -364,7 +432,7 @@ HashSet bannedPayloadItems // Get edition + language case (true, true): { - foreach (CompDB cdb in compDBs.GetEditionCompDBs().Where(cdb => + foreach (BaseManifest cdb in compDBs.GetEditionCompDBs().Where(cdb => { bool hasLang = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Language", StringComparison.InvariantCultureIgnoreCase)) == true; bool hasEdition = cdb.Tags?.Tag?.Any(x => x.Name.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) == true; @@ -386,7 +454,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { foreach (Package pkg in AppCompDB.Packages.Package) { @@ -402,7 +470,7 @@ HashSet bannedPayloadItems } } - foreach (CompDB AppCompDB in AppCompDBs) + foreach (BaseManifest AppCompDB in AppCompDBs) { if (AppCompDB.AppX?.AppXPackages?.Package != null) { @@ -430,7 +498,7 @@ HashSet bannedPayloadItems } else { - foreach (CompDB specificCompDB in specificCompDBs) + foreach (BaseManifest specificCompDB in specificCompDBs) { if (AppCompDBs?.Contains(specificCompDB) == true || specificCompDB.Packages == null) { @@ -478,9 +546,9 @@ public static async Task ProcessUpdateAsync(UpdateData update, string pO IEnumerable languages = null; int returnCode = 0; - IEnumerable filesToDownload = null; + IEnumerable filesToDownload = null; - HashSet compDBs = await update.GetCompDBsAsync(); + HashSet compDBs = await update.GetCompDBsAsync(); await Task.WhenAll( Task.Run(async () => buildstr = await update.GetBuildStringAsync()), @@ -510,6 +578,12 @@ await Task.WhenAll( (HashSet payloadItems, HashSet bannedPayloadItems) = BuildListOfPayloads(compDBs, Edition, Language); + JsonSerializerOptions jsonSerializerOptions = new() + { + WriteIndented = true, + IncludeFields = true + }; + do { IEnumerable fileUrls = await FE3Handler.GetFileUrls(update) ?? throw new Exception("Getting file urls failed."); @@ -518,61 +592,46 @@ await Task.WhenAll( _ = Directory.CreateDirectory(OutputFolder); } - string tmpname = update.Xml.LocalizedProperties.Title + " (" + MachineType.ToString() + ").uupmcreplay"; + string tmpname = $"{update.Xml.LocalizedProperties.Title} ({MachineType}).uupmcreplay"; illegalCharacters = invalidCharactersRegex(); tmpname = illegalCharacters.Replace(tmpname, ""); string filename = Path.Combine(OutputFolder, tmpname); if (WriteMetadata && !File.Exists(filename)) { - File.WriteAllText(filename, JsonSerializer.Serialize(update, new JsonSerializerOptions() { WriteIndented = true, IncludeFields = true })); + File.WriteAllText(filename, JsonSerializer.Serialize(update, jsonSerializerOptions)); } using HttpDownloader helperDl = new(OutputFolder, downloadThreads); - filesToDownload = update.Xml.Files.File.AsParallel().Where(x => !IsFileBanned(x, bannedPayloadItems)); + + filesToDownload = update.Xml.Files.File.DistinctBy(x => $"{x.Digest}|{x.DigestAlgorithm}|{x.AdditionalDigest.Algorithm}|{x.AdditionalDigest.Text}").AsParallel().Where(x => !IsFileBanned(x, bannedPayloadItems)); returnCode = 0; - IEnumerable<(CExtendedUpdateInfoXml.File, FileExchangeV3FileDownloadInformation)> boundList = filesToDownload + IEnumerable<(Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation)> boundList = filesToDownload .AsParallel() .Select(x => (x, fileUrls.First(y => y.Digest == x.Digest))) //.Where(x => UpdateUtils.ShouldFileGetDownloaded(x.x, payloadItems)) .OrderBy(x => x.Item2.ExpirationDate); - IEnumerable fileList = boundList.SelectMany(boundFile => + List fileList = []; + HashSet pathList = []; + + foreach ((Models.FE3.XML.ExtendedUpdateInfo.File, FileExchangeV3FileDownloadInformation) boundFile in boundList) { - return GetFilenameForCEUIFile(boundFile.Item1, payloadItems).Select(path => + string[] paths = GetFilenameForCEUIFile(boundFile.Item1, payloadItems); + foreach (string path in paths) { - /*try - { - foreach (CompDB compDb in compDBs) - { - foreach (Package pkg in compDb.Packages.Package) - { - string payloadHash = pkg.Payload.PayloadItem[0].PayloadHash; - if (payloadHash == boundFile.Item1.AdditionalDigest.Text || payloadHash == boundFile.Item1.Digest) - { - if (pkg.ID.Contains('-') && pkg.ID.Contains(".inf", StringComparison.InvariantCultureIgnoreCase)) - { - path = pkg.ID.Split("-")[1].Replace(".inf", ".cab", StringComparison.InvariantCultureIgnoreCase); - } - break; - } - } - } - } - catch { }*/ - - return new UUPFile( + fileList.Add(new UUPFile( boundFile.Item2, - path, + FixFilePath(boundFile, pathList, compDBs, path), long.Parse(boundFile.Item1.Size), boundFile.Item1.AdditionalDigest.Text, - boundFile.Item1.AdditionalDigest.Algorithm); - }); - }); + boundFile.Item1.AdditionalDigest.Algorithm)); + } + } - returnCode = await helperDl.DownloadAsync(fileList.ToList(), generalDownloadProgress) ? 0 : -1; + returnCode = await helperDl.DownloadAsync([.. fileList], generalDownloadProgress) ? 0 : -1; if (returnCode != 0) { @@ -586,5 +645,8 @@ await Task.WhenAll( [GeneratedRegex("[\\\\/:*?\"<>|]")] private static partial Regex invalidCharactersRegex(); + + [GeneratedRegex("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")] + private static partial Regex guidRegex(); } } diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs new file mode 100644 index 00000000..4d9eb288 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileDownloadStatus.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class FileDownloadStatus + { + public FileStatus FileStatus; + public long DownloadedBytes; + public long HashedBytes; + public UUPFile File; + public FileDownloadStatus(UUPFile file) + { + File = file; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs new file mode 100644 index 00000000..e9660d7b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/FileStatus.cs @@ -0,0 +1,33 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public enum FileStatus + { + Downloading, + Verifying, + Completed, + Expired, + Failed + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs new file mode 100644 index 00000000..76ed6d55 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/GeneralDownloadProgress.cs @@ -0,0 +1,35 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class GeneralDownloadProgress + { + public long EstimatedTotalBytes; + public long DownloadedTotalBytes; + public int NumFilesDownloadedSuccessfully; + public int NumFilesDownloadedUnsuccessfully; + public int NumFiles; + + public FileDownloadStatus[] DownloadedStatus; + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs index 27001f3d..c2d8072c 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/HttpDownloader.cs @@ -30,74 +30,11 @@ using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads { - public class GeneralDownloadProgress - { - public long EstimatedTotalBytes; - public long DownloadedTotalBytes; - public int NumFilesDownloadedSuccessfully; - public int NumFilesDownloadedUnsuccessfully; - public int NumFiles; - - public FileDownloadStatus[] DownloadedStatus; - } - - public enum FileStatus - { - Downloading, - Verifying, - Completed, - Expired, - Failed - } - - public class FileDownloadStatus - { - public FileStatus FileStatus; - public long DownloadedBytes; - public long HashedBytes; - public UUPFile File; - public FileDownloadStatus(UUPFile file) - { - File = file; - } - } - - public class UUPFile - { - public FileExchangeV3FileDownloadInformation WUFile - { - get; set; - } - public string FileName - { - get; set; - } - public long FileSize - { - get; set; - } - public string Hash - { - get; set; - } - public string HashAlgorithm - { - get; set; - } - - public UUPFile(FileExchangeV3FileDownloadInformation WUFile, string FileName, long FileSize, string Hash, string HashAlgorithm) - { - this.WUFile = WUFile; - this.FileName = FileName; - this.FileSize = FileSize; - this.Hash = Hash; - this.HashAlgorithm = HashAlgorithm; - } - } - public class HttpDownloader : IDisposable { private const long CHUNK_SIZE = 8_388_608 + 65_536; //Slice 8MB+64KB @@ -244,7 +181,7 @@ private static async ValueTask HttpDownload(string basePath, UUPFile downl int blockBufferSize = bufferSize; //These variables are used to decrypt files if esrp is available. - EsrpDecryptor esrpDecrypter = null; //Implements IDisposable + ESRPCryptography esrpDecrypter = null; //Implements IDisposable byte[] backBuffer = null; int backBufferLength = 0; long blockCount = 0; @@ -255,7 +192,7 @@ private static async ValueTask HttpDownload(string basePath, UUPFile downl { esrp = downloadFile.WUFile.EsrpDecryptionInformation; backBuffer = new byte[blockBufferSize]; - esrpDecrypter = new EsrpDecryptor(esrp); + esrpDecrypter = new ESRPCryptography(esrp); blockBufferSize = (int)esrp.EncryptionBufferSize; } @@ -704,4 +641,4 @@ public void Dispose() GC.SuppressFinalize(this); } } -} +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs new file mode 100644 index 00000000..5e3cb4c7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads/UUPFile.cs @@ -0,0 +1,57 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Downloads +{ + public class UUPFile + { + public FileExchangeV3FileDownloadInformation WUFile + { + get; set; + } + public string FileName + { + get; set; + } + public long FileSize + { + get; set; + } + public string Hash + { + get; set; + } + public string HashAlgorithm + { + get; set; + } + + public UUPFile(FileExchangeV3FileDownloadInformation WUFile, string FileName, long FileSize, string Hash, string HashAlgorithm) + { + this.WUFile = WUFile; + this.FileName = FileName; + this.FileSize = FileSize; + this.Hash = Hash; + this.HashAlgorithm = HashAlgorithm; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs similarity index 91% rename from src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs rename to src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs index 978dd210..9c2b3f02 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/EsrpDecryptor.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/ESRPCryptography.cs @@ -19,11 +19,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -using System; -using System.IO; using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; // // Source: https://raw.githubusercontent.com/ADeltaX/ProtoBuildBot/5cce37197c44792f3401b63d876795b5bc2072a4/src/BuildChecker/Classes/Helpers/EsrpDecryptor.cs @@ -31,17 +28,17 @@ // And Updated with original author input on 2021-04-15 // -namespace UnifiedUpdatePlatform.Services.WindowsUpdate +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP { - public class EsrpDecryptor : IDisposable + public class ESRPCryptography : IDisposable { - private readonly EsrpDecryptionInformation esrp; + private readonly EsrpDecryptionInformation ESRP; private readonly Aes aes; private readonly byte[] key; - public EsrpDecryptor(EsrpDecryptionInformation esrp) + public ESRPCryptography(EsrpDecryptionInformation esrp) { - this.esrp = esrp; + ESRP = esrp; key = new byte[32]; Array.Copy(Convert.FromBase64String(esrp.KeyData), 0, key, 0, 32); @@ -76,7 +73,7 @@ public async Task DecryptStreamFullAsync(Stream encryptedFile, Stream decryptedF CancellationToken cancellationToken = default) { int readBytes; - byte[] buffer = new byte[esrp.EncryptionBufferSize]; + byte[] buffer = new byte[ESRP.EncryptionBufferSize]; while ((readBytes = await encryptedFile.ReadAsync(buffer.AsMemory(0, buffer.Length), cancellationToken)) > 0) { bool needsPaddingMode = encryptedSize == (ulong)encryptedFile.Position; diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj new file mode 100644 index 00000000..225b4c10 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP/UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs new file mode 100644 index 00000000..6a7eb52b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/Constants.cs @@ -0,0 +1,29 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models +{ + public static class Constants + { + public const string ClientWebServiceServerNamespace = "http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService"; + public const string WindowsUpdateAuthorizationSchema = "http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization"; + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs new file mode 100644 index 00000000..4a91a334 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/AppxMetadataJson.cs @@ -0,0 +1,76 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class AppxMetadataJson + { + [JsonPropertyName("blob.version")] + public long BlobVersion + { + get; set; + } + + [JsonPropertyName("content.isMain")] + public bool ContentIsMain + { + get; set; + } + + [JsonPropertyName("content.packageId")] + public string ContentPackageId + { + get; set; + } + + [JsonPropertyName("content.productId")] + public Guid ContentProductId + { + get; set; + } + + [JsonPropertyName("content.targetPlatforms")] + public ContentTargetPlatform[] ContentTargetPlatforms + { + get; set; + } + + [JsonPropertyName("content.type")] + public long ContentType + { + get; set; + } + + [JsonPropertyName("policy")] + public Policy Policy + { + get; set; + } + + [JsonPropertyName("policy2")] + public Policy2 Policy2 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs new file mode 100644 index 00000000..40620581 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ContentTargetPlatform.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class ContentTargetPlatform + { + [JsonPropertyName("platform.maxVersionTested")] + public long PlatformMaxVersionTested + { + get; set; + } + + [JsonPropertyName("platform.minVersion")] + public long PlatformMinVersion + { + get; set; + } + + [JsonPropertyName("platform.target")] + public long PlatformTarget + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs new file mode 100644 index 00000000..0fdbebf2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy.cs @@ -0,0 +1,58 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class Policy + { + [JsonPropertyName("category.first")] + public string CategoryFirst + { + get; set; + } + + [JsonPropertyName("category.second")] + public string CategorySecond + { + get; set; + } + + [JsonPropertyName("category.third")] + public string CategoryThird + { + get; set; + } + + [JsonPropertyName("optOut.backupRestore")] + public bool OptOutBackupRestore + { + get; set; + } + + [JsonPropertyName("optOut.removeableMedia")] + public bool OptOutRemoveableMedia + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs new file mode 100644 index 00000000..5bb3635d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/Policy2.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class Policy2 + { + [JsonPropertyName("ageRating")] + public long AgeRating + { + get; set; + } + + [JsonPropertyName("optOut.DVR")] + public bool OptOutDvr + { + get; set; + } + + [JsonPropertyName("thirdPartyAppRatings")] + public ThirdPartyAppRating[] ThirdPartyAppRatings + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs new file mode 100644 index 00000000..6c50532c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/AppxMetadata/ThirdPartyAppRating.cs @@ -0,0 +1,40 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Text.Json.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata +{ + public partial class ThirdPartyAppRating + { + [JsonPropertyName("level")] + public long Level + { + get; set; + } + + [JsonPropertyName("systemId")] + public long SystemId + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs new file mode 100644 index 00000000..24ed6e82 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/JSON/ESRP/EsrpDecryptionInformation.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP +{ + public class EsrpDecryptionInformation + { + [DataMember(Name = "KeyData")] + public string KeyData + { + get; set; + } + + [DataMember(Name = "EncryptionBufferSize")] + public long EncryptionBufferSize + { + get; set; + } + + [DataMember(Name = "AlgorithmName")] + public string AlgorithmName + { + get; set; + } + + [DataMember(Name = "ChainingMode")] + public string ChainingMode + { + get; set; + } + + public static EsrpDecryptionInformation? DeserializeFromJson(string json) + { + using MemoryStream memoryStream = new(Encoding.UTF8.GetBytes(json)); + DataContractJsonSerializer serializer = new(typeof(EsrpDecryptionInformation)); + return serializer.ReadObject(memoryStream) as EsrpDecryptionInformation; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs new file mode 100644 index 00000000..7ec132e7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Action.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] + public class Action + { + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs new file mode 100644 index 00000000..cddba5eb --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Body.cs @@ -0,0 +1,98 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Body + { + [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsi + { + get; set; + } + + [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Xsd + { + get; set; + } + + // + // Requests + // + + [XmlElement(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetCookie.Request.GetCookie GetCookie + { + get; set; + } + + [XmlElement(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdates.Request.SyncUpdates SyncUpdates + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo.Request.GetExtendedUpdateInfo GetExtendedUpdateInfo + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2.Request.GetExtendedUpdateInfo2 GetExtendedUpdateInfo2 + { + get; set; + } + + // + // Responses + // + + [XmlElement(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetCookie.Response.GetCookieResponse GetCookieResponse + { + get; set; + } + + [XmlElement(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdates.Response.SyncUpdatesResponse SyncUpdatesResponse + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo.Response.GetExtendedUpdateInfoResponse GetExtendedUpdateInfoResponse + { + get; set; + } + + [XmlElement(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2.Response.GetExtendedUpdateInfo2Response GetExtendedUpdateInfo2Response + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs new file mode 100644 index 00000000..5afe4df9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Cookie.cs @@ -0,0 +1,41 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + public class Cookie + { + [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Expiration + { + get; set; + } + + [XmlElement(ElementName = "EncryptedData", Namespace = Constants.ClientWebServiceServerNamespace)] + public string EncryptedData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs new file mode 100644 index 00000000..67db59d6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Envelope.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Envelope", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Envelope + { + [XmlElement(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public Header Header + { + get; set; + } + + [XmlElement(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public Body Body + { + get; set; + } + + [XmlAttribute(AttributeName = "a", Namespace = "http://www.w3.org/2000/xmlns/")] + public string A + { + get; set; + } + + [XmlAttribute(AttributeName = "s", Namespace = "http://www.w3.org/2000/xmlns/")] + public string S + { + get; set; + } + + [XmlAttribute(AttributeName = "u", Namespace = "http://www.w3.org/2000/xmlns/")] + public string U + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs new file mode 100644 index 00000000..de8a7e1f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Header.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public class Header + { + [XmlElement(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] + public Action Action + { + get; set; + } + + [XmlElement(ElementName = "MessageID", Namespace = "http://www.w3.org/2005/08/addressing")] + public string MessageID + { + get; set; + } + + [XmlElement(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] + public To To + { + get; set; + } + + [XmlElement(ElementName = "RelatesTo", Namespace = "http://www.w3.org/2005/08/addressing")] + public string RelatesTo + { + get; set; + } + + [XmlElement(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] + public Security Security + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs new file mode 100644 index 00000000..d3f274a3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/InfoTypes.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public class InfoTypes + { + [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] XmlUpdateFragmentType + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs new file mode 100644 index 00000000..6623bc70 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Locales.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Locales + { + [XmlElement(ElementName = "string", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] String + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs new file mode 100644 index 00000000..fa512f56 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/OutOfScopeRevisionIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OutOfScopeRevisionIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs new file mode 100644 index 00000000..559e7603 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Security.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] + public class Security + { + [XmlNamespaceDeclarations] + public XmlSerializerNamespaces ns = new( + [ + new("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") + ] + ); + + [XmlElement(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public Timestamp Timestamp + { + get; set; + } + + [XmlElement(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] + public WindowsUpdateTicketsToken WindowsUpdateTicketsToken + { + get; set; + } + + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlAttribute(AttributeName = "o", Namespace = "http://www.w3.org/2000/xmlns/")] + public string O + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs new file mode 100644 index 00000000..0783f5d0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/TicketType.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "TicketType")] + public class TicketType + { + [XmlElement(ElementName = "User")] + public string User + { + get; set; + } + + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + + [XmlAttribute(AttributeName = "Version")] + public string Version + { + get; set; + } + + [XmlAttribute(AttributeName = "Policy")] + public string Policy + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs new file mode 100644 index 00000000..9947cf26 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Timestamp.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public class Timestamp + { + [XmlElement(ElementName = "Created", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Created + { + get; set; + } + + [XmlElement(ElementName = "Expires", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Expires + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + + [XmlAttribute(AttributeName = "Id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs new file mode 100644 index 00000000..298d7789 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/To.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] + public class To + { + [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] + public string MustUnderstand + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs new file mode 100644 index 00000000..36aa40af --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Update.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Update + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Xml + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs new file mode 100644 index 00000000..25b299fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/Updates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Updates + { + [XmlElement(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] + public Update[] Update + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs new file mode 100644 index 00000000..07f09c9e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/Common/WindowsUpdateTicketsToken.cs @@ -0,0 +1,68 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common +{ + [XmlRoot(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] + public class WindowsUpdateTicketsToken + { + [XmlNamespaceDeclarations] + public XmlSerializerNamespaces ns = new( + [ + new("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"), + new("wuws", Constants.WindowsUpdateAuthorizationSchema) + ] + ); + + [XmlElement(ElementName = "TicketType", Namespace = "")] + public TicketType[] TicketType + { + get; set; + } + + [XmlAttribute(AttributeName = "id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] + public string Id + { + get; set; + } + + [XmlAttribute(AttributeName = "wsu", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Wsu + { + get; set; + } + + [XmlAttribute(AttributeName = "wuws", Namespace = "http://www.w3.org/2000/xmlns/")] + public string Wuws + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs new file mode 100644 index 00000000..fa0316f8 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/GetCookie.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request +{ + [XmlRoot(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetCookie + { + [XmlElement(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public OldCookie OldCookie + { + get; set; + } + + [XmlElement(ElementName = "lastChange", Namespace = Constants.ClientWebServiceServerNamespace)] + public string LastChange + { + get; set; + } + + [XmlElement(ElementName = "currentTime", Namespace = Constants.ClientWebServiceServerNamespace)] + public string CurrentTime + { + get; set; + } + + [XmlElement(ElementName = "protocolVersion", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ProtocolVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs new file mode 100644 index 00000000..20dd02d7 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Request/OldCookie.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request +{ + [XmlRoot(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OldCookie + { + [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Expiration + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs new file mode 100644 index 00000000..ba000166 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetCookie/Response/GetCookieResponse.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Response +{ + [XmlRoot(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetCookieResponse + { + [XmlElement(ElementName = "GetCookieResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie GetCookieResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs new file mode 100644 index 00000000..fe6c626f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/GetExtendedUpdateInfo.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo + { + [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie Cookie + { + get; set; + } + + [XmlElement(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public RevisionIDs RevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public InfoTypes InfoTypes + { + get; set; + } + + [XmlElement(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public Locales Locales + { + get; set; + } + + [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs new file mode 100644 index 00000000..367e382b --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Request/RevisionIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request +{ + [XmlRoot(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class RevisionIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs new file mode 100644 index 00000000..89ae2180 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResponse.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfoResponse + { + [XmlElement(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfoResult GetExtendedUpdateInfoResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs new file mode 100644 index 00000000..b3c38701 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/GetExtendedUpdateInfoResult.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfoResult + { + [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OutOfScopeRevisionIDs OutOfScopeRevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public Updates Updates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs new file mode 100644 index 00000000..f2ff3f40 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo/Response/Verification.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response +{ + [XmlRoot(ElementName = "Verification", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Verification + { + [XmlAttribute(AttributeName = "Timestamp")] + public string Timestamp + { + get; set; + } + + [XmlAttribute(AttributeName = "LeafCertificateId")] + public string LeafCertificateId + { + get; set; + } + + [XmlAttribute(AttributeName = "Signature")] + public string Signature + { + get; set; + } + + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs new file mode 100644 index 00000000..32b80fce --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/GetExtendedUpdateInfo2.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2 + { + [XmlElement(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateIDs UpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public InfoTypes InfoTypes + { + get; set; + } + + [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs new file mode 100644 index 00000000..c66026c9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateIDs + { + [XmlElement(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateIdentity UpdateIdentity + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs new file mode 100644 index 00000000..db6de0c6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Request/UpdateIdentity.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request +{ + [XmlRoot(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateIdentity + { + [XmlElement(ElementName = "UpdateID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string UpdateID + { + get; set; + } + + [XmlElement(ElementName = "RevisionNumber", Namespace = Constants.ClientWebServiceServerNamespace)] + public string RevisionNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs new file mode 100644 index 00000000..6ceb5a4e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryption.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileDecryption + { + [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FileDigest + { + get; set; + } + + [XmlElement(ElementName = "DecryptionKey", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DecryptionKey + { + get; set; + } + + [XmlElement(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] + public SecurityData SecurityData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs new file mode 100644 index 00000000..d4e751b9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileDecryptionData.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileDecryptionData + { + [XmlElement(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileDecryption FileDecryption + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs new file mode 100644 index 00000000..160eef99 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocation.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileLocation + { + [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FileDigest + { + get; set; + } + + [XmlElement(ElementName = "Url", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Url + { + get; set; + } + + [XmlElement(ElementName = "PiecesHashUrl", Namespace = Constants.ClientWebServiceServerNamespace)] + public string PiecesHashUrl + { + get; set; + } + + [XmlElement(ElementName = "BlockMapUrl", Namespace = Constants.ClientWebServiceServerNamespace)] + public string BlockMapUrl + { + get; set; + } + + [XmlElement(ElementName = "EsrpDecryptionInformation", Namespace = Constants.ClientWebServiceServerNamespace)] + public string EsrpDecryptionInformation + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs new file mode 100644 index 00000000..2250ae32 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/FileLocations.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FileLocations + { + [XmlElement(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileLocation[] FileLocation + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs new file mode 100644 index 00000000..b96fe300 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Response.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2Response + { + [XmlElement(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] + public GetExtendedUpdateInfo2Result GetExtendedUpdateInfo2Result + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs new file mode 100644 index 00000000..6702bd15 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/GetExtendedUpdateInfo2Result.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] + public class GetExtendedUpdateInfo2Result + { + [XmlElement(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileLocations FileLocations + { + get; set; + } + + [XmlElement(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] + public FileDecryptionData FileDecryptionData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs new file mode 100644 index 00000000..21d1f122 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/GetExtendedUpdateInfo2/Response/SecurityData.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response +{ + [XmlRoot(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SecurityData + { + [XmlElement(ElementName = "base64Binary", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Base64Binary + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs new file mode 100644 index 00000000..1d5fa709 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/CategoryIdentifier.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] + public class CategoryIdentifier + { + [XmlElement(ElementName = "Id", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs new file mode 100644 index 00000000..1765d9ec --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ExtendedUpdateInfoParameters.cs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ExtendedUpdateInfoParameters + { + [XmlElement(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public XmlUpdateFragmentTypes XmlUpdateFragmentTypes + { + get; set; + } + + [XmlElement(ElementName = "Locales", Namespace = Constants.ClientWebServiceServerNamespace)] + public Locales Locales + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs new file mode 100644 index 00000000..4d31f7d0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/FilterAppCategoryIds.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] + public class FilterAppCategoryIds + { + [XmlElement(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] + public CategoryIdentifier CategoryIdentifier + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs new file mode 100644 index 00000000..971e532f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/InstalledNonLeafUpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class InstalledNonLeafUpdateIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs new file mode 100644 index 00000000..21095e51 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/OtherCachedUpdateIDs.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public class OtherCachedUpdateIDs + { + [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] Int + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs new file mode 100644 index 00000000..08ffa4e6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/Parameters.cs @@ -0,0 +1,96 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Parameters + { + [XmlElement(ElementName = "ExpressQuery", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ExpressQuery + { + get; set; + } + + [XmlElement(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public InstalledNonLeafUpdateIDs InstalledNonLeafUpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OtherCachedUpdateIDs OtherCachedUpdateIDs + { + get; set; + } + + [XmlElement(ElementName = "SkipSoftwareSync", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SkipSoftwareSync + { + get; set; + } + + [XmlElement(ElementName = "NeedTwoGroupOutOfScopeUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public string NeedTwoGroupOutOfScopeUpdates + { + get; set; + } + + [XmlElement(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] + public FilterAppCategoryIds FilterAppCategoryIds + { + get; set; + } + + [XmlElement(ElementName = "AlsoPerformRegularSync", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AlsoPerformRegularSync + { + get; set; + } + + [XmlElement(ElementName = "ComputerSpec", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ComputerSpec + { + get; set; + } + + [XmlElement(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public ExtendedUpdateInfoParameters ExtendedUpdateInfoParameters + { + get; set; + } + + [XmlElement(ElementName = "ClientPreferredLanguages", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ClientPreferredLanguages + { + get; set; + } + + [XmlElement(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public ProductsParameters ProductsParameters + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs new file mode 100644 index 00000000..a0442782 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/ProductsParameters.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ProductsParameters + { + [XmlElement(ElementName = "SyncCurrentVersionOnly", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SyncCurrentVersionOnly + { + get; set; + } + + [XmlElement(ElementName = "DeviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DeviceAttributes + { + get; set; + } + + [XmlElement(ElementName = "CallerAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] + public string CallerAttributes + { + get; set; + } + + [XmlElement(ElementName = "Products", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Products + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs new file mode 100644 index 00000000..a484c4b6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/SyncUpdates.cs @@ -0,0 +1,49 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdates + { + [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie Cookie + { + get; set; + } + + [XmlElement(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] + public Parameters Parameters + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs new file mode 100644 index 00000000..936acf60 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Request/XmlUpdateFragmentTypes.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request +{ + [XmlRoot(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] + public class XmlUpdateFragmentTypes + { + [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] + public string[] XmlUpdateFragmentType + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs new file mode 100644 index 00000000..40199e93 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/Deployment.cs @@ -0,0 +1,96 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] + public class Deployment + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Action", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Action2 + { + get; set; + } + + [XmlElement(ElementName = "IsAssigned", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsAssigned + { + get; set; + } + + [XmlElement(ElementName = "LastChangeTime", Namespace = Constants.ClientWebServiceServerNamespace)] + public string LastChangeTime + { + get; set; + } + + [XmlElement(ElementName = "AutoSelect", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AutoSelect + { + get; set; + } + + [XmlElement(ElementName = "AutoDownload", Namespace = Constants.ClientWebServiceServerNamespace)] + public string AutoDownload + { + get; set; + } + + [XmlElement(ElementName = "SupersedenceBehavior", Namespace = Constants.ClientWebServiceServerNamespace)] + public string SupersedenceBehavior + { + get; set; + } + + [XmlElement(ElementName = "Priority", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Priority + { + get; set; + } + + [XmlElement(ElementName = "HandlerSpecificAction", Namespace = Constants.ClientWebServiceServerNamespace)] + public string HandlerSpecificAction + { + get; set; + } + + [XmlElement(ElementName = "FlightId", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FlightId + { + get; set; + } + + [XmlElement(ElementName = "FlightMetadata", Namespace = Constants.ClientWebServiceServerNamespace)] + public string FlightMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs new file mode 100644 index 00000000..5109ce7a --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/ExtendedUpdateInfo.cs @@ -0,0 +1,37 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class ExtendedUpdateInfo + { + [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] + public Updates Updates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs new file mode 100644 index 00000000..33101ded --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/NewUpdates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public class NewUpdates + { + [XmlElement(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public UpdateInfo[] UpdateInfo + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs new file mode 100644 index 00000000..ed89c16c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResponse.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdatesResponse + { + [XmlElement(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public SyncUpdatesResult SyncUpdatesResult + { + get; set; + } + + [XmlAttribute(AttributeName = "xmlns")] + public string Xmlns + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs new file mode 100644 index 00000000..eedbbaaf --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/SyncUpdatesResult.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] + public class SyncUpdatesResult + { + [XmlElement(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] + public NewUpdates NewUpdates + { + get; set; + } + + [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] + public OutOfScopeRevisionIDs OutOfScopeRevisionIDs + { + get; set; + } + + [XmlElement(ElementName = "Truncated", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Truncated + { + get; set; + } + + [XmlElement(ElementName = "NewCookie", Namespace = Constants.ClientWebServiceServerNamespace)] + public Cookie NewCookie + { + get; set; + } + + [XmlElement(ElementName = "DriverSyncNotNeeded", Namespace = Constants.ClientWebServiceServerNamespace)] + public string DriverSyncNotNeeded + { + get; set; + } + + [XmlElement(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public ExtendedUpdateInfo ExtendedUpdateInfo + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs new file mode 100644 index 00000000..86094e90 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/SOAP/SyncUpdates/Response/UpdateInfo.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response +{ + [XmlRoot(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] + public class UpdateInfo + { + [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] + public string ID + { + get; set; + } + + [XmlElement(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] + public Deployment Deployment + { + get; set; + } + + [XmlElement(ElementName = "IsLeaf", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsLeaf + { + get; set; + } + + [XmlElement(ElementName = "IsShared", Namespace = Constants.ClientWebServiceServerNamespace)] + public string IsShared + { + get; set; + } + + [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] + public string Xml + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs new file mode 100644 index 00000000..cd0f3778 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AdditionalDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AdditionalDigest")] + public class AdditionalDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs new file mode 100644 index 00000000..421e8d20 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/And.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "And")] + public class And + { + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion[] BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "Not")] + public Not[] Not + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword[] BRegDword + { + get; set; + } + + [XmlElement(ElementName = "Or")] + public Or[] Or + { + get; set; + } + + [XmlElement(ElementName = "b.SystemMetric")] + public BSystemMetric[] BSystemMetric + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs new file mode 100644 index 00000000..155cab77 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ApplicabilityRules.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "ApplicabilityRules")] + public class ApplicabilityRules + { + [XmlElement(ElementName = "IsInstalled")] + public IsInstalled IsInstalled + { + get; set; + } + + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "Metadata")] + public Metadata Metadata + { + get; set; + } + + [XmlElement(ElementName = "IsInstallable")] + public IsInstallable IsInstallable + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs new file mode 100644 index 00000000..14febf62 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxFamilyMetadata.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxFamilyMetadata")] + public class AppxFamilyMetadata + { + [XmlAttribute(AttributeName = "Name")] + public string Name + { + get; set; + } + + [XmlAttribute(AttributeName = "Publisher")] + public string Publisher + { + get; set; + } + + [XmlAttribute(AttributeName = "LegacyMobileProductId")] + public string LegacyMobileProductId + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs new file mode 100644 index 00000000..077d8019 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxMetadata.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxMetadata")] + public class AppxMetadata + { + [XmlElement(ElementName = "ApplicabilityBlob")] + public string ApplicabilityBlob + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageType")] + public string PackageType + { + get; set; + } + + [XmlAttribute(AttributeName = "IsAppxBundle")] + public string IsAppxBundle + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageMoniker")] + public string PackageMoniker + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs new file mode 100644 index 00000000..1a64ae4a --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageInstallData.cs @@ -0,0 +1,47 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxPackageInstallData")] + public class AppxPackageInstallData + { + [XmlAttribute(AttributeName = "PackageFileName")] + public string PackageFileName + { + get; set; + } + + [XmlAttribute(AttributeName = "MainPackage")] + public string MainPackage + { + get; set; + } + + public override string ToString() + { + return PackageFileName ?? base.ToString(); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs new file mode 100644 index 00000000..dad3277e --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AppxPackageMetadata.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AppxPackageMetadata")] + public class AppxPackageMetadata + { + [XmlElement(ElementName = "AppxFamilyMetadata")] + public AppxFamilyMetadata AppxFamilyMetadata + { + get; set; + } + + [XmlElement(ElementName = "AppxMetadata")] + public AppxMetadata AppxMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs new file mode 100644 index 00000000..d482d956 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/AtLeastOne.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "AtLeastOne")] + public class AtLeastOne + { + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity[] UpdateIdentity + { + get; set; + } + + [XmlAttribute(AttributeName = "IsCategory")] + public string IsCategory + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs new file mode 100644 index 00000000..e5919d23 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BCamera.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Camera")] + public class BCamera + { + [XmlAttribute(AttributeName = "Location")] + public string Location + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs new file mode 100644 index 00000000..593790cf --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BDirect3D.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Direct3D")] + public class BDirect3D + { + [XmlAttribute(AttributeName = "HardwareVersion")] + public string HardwareVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "FeatureLevelMajor")] + public string FeatureLevelMajor + { + get; set; + } + + [XmlAttribute(AttributeName = "FeatureLevelMinor")] + public string FeatureLevelMinor + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs new file mode 100644 index 00000000..81a40ad3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BMemory.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.Memory")] + public class BMemory + { + [XmlAttribute(AttributeName = "MinSizeInMB")] + public string MinSizeInMB + { + get; set; + } + + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs new file mode 100644 index 00000000..9ea6e174 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BNFC.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.NFC")] + public class BNFC + { + [XmlAttribute(AttributeName = "Capability")] + public string Capability + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs new file mode 100644 index 00000000..c17b831d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegDword.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegDword")] + public class BRegDword + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Data")] + public string Data + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs new file mode 100644 index 00000000..b2b67964 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegSz.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegSz")] + public class BRegSz + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Data")] + public string Data + { + get; set; + } + + [XmlAttribute(AttributeName = "RegType32")] + public string RegType32 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs new file mode 100644 index 00000000..7e88f4fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BRegValueExists.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.RegValueExists")] + public class BRegValueExists + { + [XmlAttribute(AttributeName = "Key")] + public string Key + { + get; set; + } + + [XmlAttribute(AttributeName = "Subkey")] + public string Subkey + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + + [XmlAttribute(AttributeName = "Type")] + public string Type + { + get; set; + } + + [XmlAttribute(AttributeName = "RegType32")] + public string RegType32 + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs new file mode 100644 index 00000000..aa0d78da --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSensorById.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.SensorById")] + public class BSensorById + { + [XmlAttribute(AttributeName = "Id")] + public string Id + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs new file mode 100644 index 00000000..019efe1d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BSystemMetric.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.SystemMetric")] + public class BSystemMetric + { + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "Index")] + public string Index + { + get; set; + } + + [XmlAttribute(AttributeName = "Value")] + public string Value + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs new file mode 100644 index 00000000..a79b1e1f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BVideoMemory.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.VideoMemory")] + public class BVideoMemory + { + [XmlAttribute(AttributeName = "MinSizeInMB")] + public string MinSizeInMB + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs new file mode 100644 index 00000000..e769e912 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWindowsVersion.cs @@ -0,0 +1,54 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.WindowsVersion")] + public class BWindowsVersion + { + [XmlAttribute(AttributeName = "Comparison")] + public string Comparison + { + get; set; + } + + [XmlAttribute(AttributeName = "MajorVersion")] + public string MajorVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "MinorVersion")] + public string MinorVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "BuildNumber")] + public string BuildNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs new file mode 100644 index 00000000..77147928 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BWmiQuery.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "b.WmiQuery")] + public class BWmiQuery + { + [XmlAttribute(AttributeName = "Namespace")] + public string Namespace + { + get; set; + } + + [XmlAttribute(AttributeName = "WqlQuery")] + public string WqlQuery + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs new file mode 100644 index 00000000..66a59af2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BlockMapDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "BlockMapDigest")] + public class BlockMapDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs new file mode 100644 index 00000000..bd62d5de --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/BundledUpdates.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "BundledUpdates")] + public class BundledUpdates + { + [XmlElement(ElementName = "AtLeastOne")] + public AtLeastOne AtLeastOne + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs new file mode 100644 index 00000000..89d27559 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/CategoryInformation.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "CategoryInformation")] + public class CategoryInformation + { + [XmlAttribute(AttributeName = "CategoryType")] + public string CategoryType + { + get; set; + } + + [XmlAttribute(AttributeName = "ProhibitsSubcategories")] + public string ProhibitsSubcategories + { + get; set; + } + + [XmlAttribute(AttributeName = "ProhibitsUpdates")] + public string ProhibitsUpdates + { + get; set; + } + + [XmlAttribute(AttributeName = "DisplayOrder")] + public string DisplayOrder + { + get; set; + } + + [XmlAttribute(AttributeName = "ExcludedByDefault")] + public string ExcludedByDefault + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs new file mode 100644 index 00000000..056933f3 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/ExtendedProperties.cs @@ -0,0 +1,132 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "ExtendedProperties")] + public class ExtendedProperties + { + [XmlAttribute(AttributeName = "DefaultPropertiesLanguage")] + public string DefaultPropertiesLanguage + { + get; set; + } + + [XmlAttribute(AttributeName = "Handler")] + public string Handler + { + get; set; + } + + [XmlAttribute(AttributeName = "CreationDate")] + public string CreationDate + { + get; set; + } + + [XmlAttribute(AttributeName = "IsAppxFramework")] + public string IsAppxFramework + { + get; set; + } + + [XmlAttribute(AttributeName = "CompatibleProtocolVersion")] + public string CompatibleProtocolVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "FromStoreService")] + public string FromStoreService + { + get; set; + } + + [XmlAttribute(AttributeName = "ContentType")] + public string ContentType + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageIdentityName")] + public string PackageIdentityName + { + get; set; + } + + [XmlAttribute(AttributeName = "LegacyMobileProductId")] + public string LegacyMobileProductId + { + get; set; + } + + [XmlElement(ElementName = "InstallationBehavior")] + public string InstallationBehavior + { + get; set; + } + + [XmlAttribute(AttributeName = "MaxDownloadSize")] + public string MaxDownloadSize + { + get; set; + } + + [XmlAttribute(AttributeName = "MinDownloadSize")] + public string MinDownloadSize + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageContentId")] + public string PackageContentId + { + get; set; + } + + [XmlAttribute(AttributeName = "ProductName")] + public string ProductName + { + get; set; + } + + [XmlAttribute(AttributeName = "ReleaseVersion")] + public string ReleaseVersion + { + get; set; + } + + [XmlAttribute(AttributeName = "AutoSelectOnWebsites")] + public string AutoSelectOnWebsites + { + get; set; + } + + [XmlAttribute(AttributeName = "BrowseOnly")] + public string BrowseOnly + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs new file mode 100644 index 00000000..8b7bff80 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/File.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "File")] + public class File + { + [XmlElement(ElementName = "AdditionalDigest")] + public AdditionalDigest AdditionalDigest + { + get; set; + } + + [XmlElement(ElementName = "PiecesHashDigest")] + public PiecesHashDigest PiecesHashDigest + { + get; set; + } + + [XmlElement(ElementName = "BlockMapDigest")] + public BlockMapDigest BlockMapDigest + { + get; set; + } + + [XmlAttribute(AttributeName = "FileName")] + public string FileName + { + get; set; + } + + [XmlAttribute(AttributeName = "Digest")] + public string Digest + { + get; set; + } + + [XmlAttribute(AttributeName = "DigestAlgorithm")] + public string DigestAlgorithm + { + get; set; + } + + [XmlAttribute(AttributeName = "Size")] + public string Size + { + get; set; + } + + [XmlAttribute(AttributeName = "Modified")] + public string Modified + { + get; set; + } + + [XmlAttribute(AttributeName = "InstallerSpecificIdentifier")] + public string InstallerSpecificIdentifier + { + get; set; + } + + [XmlAttribute(AttributeName = "PatchingType")] + public string PatchingType + { + get; set; + } + + public override string? ToString() + { + return !string.IsNullOrEmpty(FileName) ? PatchingType + ":" + FileName : base.ToString(); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs new file mode 100644 index 00000000..b825c0fe --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Files.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Files")] + public class Files + { + [XmlElement(ElementName = "File")] + public File[] File + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs new file mode 100644 index 00000000..80448494 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/HandlerSpecificData.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "HandlerSpecificData")] + public class HandlerSpecificData + { + [XmlElement(ElementName = "CategoryInformation")] + public CategoryInformation CategoryInformation + { + get; set; + } + + [XmlAttribute(AttributeName = "type")] + public string Type + { + get; set; + } + + [XmlElement(ElementName = "AppxPackageInstallData")] + public AppxPackageInstallData AppxPackageInstallData + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs new file mode 100644 index 00000000..7020f1a6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstallable.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "IsInstallable")] + public class IsInstallable + { + [XmlElement(ElementName = "AppxPackageInstallable")] + public string AppxPackageInstallable + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs new file mode 100644 index 00000000..545bcff0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/IsInstalled.cs @@ -0,0 +1,114 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "IsInstalled")] + public class IsInstalled + { + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + [XmlElement(ElementName = "True")] + public string True + { + get; set; + } + + [XmlElement(ElementName = "Or")] + public Or Or + { + get; set; + } + + [XmlElement(ElementName = "And")] + public And And + { + get; set; + } + + [XmlElement(ElementName = "b.WmiQuery")] + public BWmiQuery BWmiQuery + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + + [XmlElement(ElementName = "b.SystemMetric")] + public BSystemMetric BSystemMetric + { + get; set; + } + + [XmlElement(ElementName = "b.Memory")] + public BMemory BMemory + { + get; set; + } + + [XmlElement(ElementName = "b.Direct3D")] + public BDirect3D BDirect3D + { + get; set; + } + + [XmlElement(ElementName = "b.SensorById")] + public BSensorById BSensorById + { + get; set; + } + + [XmlElement(ElementName = "b.Camera")] + public BCamera BCamera + { + get; set; + } + + [XmlElement(ElementName = "b.NFC")] + public BNFC BNFC + { + get; set; + } + + [XmlElement(ElementName = "b.VideoMemory")] + public BVideoMemory BVideoMemory + { + get; set; + } + + [XmlElement(ElementName = "AppxPackageInstalled")] + public string AppxPackageInstalled + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs new file mode 100644 index 00000000..d2e55388 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/LocalizedProperties.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "LocalizedProperties")] + public class LocalizedProperties + { + [XmlElement(ElementName = "Language")] + public string Language + { + get; set; + } + + [XmlElement(ElementName = "Title")] + public string Title + { + get; set; + } + + [XmlElement(ElementName = "Description")] + public string Description + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs new file mode 100644 index 00000000..c3a2df7f --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Metadata.cs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Metadata")] + public class Metadata + { + [XmlElement(ElementName = "AppxPackageMetadata")] + public AppxPackageMetadata AppxPackageMetadata + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs new file mode 100644 index 00000000..a8e45d01 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Not.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Not")] + public class Not + { + [XmlElement(ElementName = "b.RegValueExists")] + public BRegValueExists BRegValueExists + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword BRegDword + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs new file mode 100644 index 00000000..3059cb41 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Or.cs @@ -0,0 +1,63 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Or")] + public class Or + { + [XmlElement(ElementName = "Not")] + public Not Not + { + get; set; + } + + [XmlElement(ElementName = "b.RegDword")] + public BRegDword BRegDword + { + get; set; + } + + [XmlElement(ElementName = "And")] + public And[] And + { + get; set; + } + + [XmlElement(ElementName = "b.RegSz")] + public BRegSz BRegSz + { + get; set; + } + + [XmlElement(ElementName = "b.WindowsVersion")] + public BWindowsVersion BWindowsVersion + { + get; set; + } + + /*[XmlElement(ElementName = "Or")] + public Or Or { get; set; }*/ // TODO: fix + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs new file mode 100644 index 00000000..49205010 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/PiecesHashDigest.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "PiecesHashDigest")] + public class PiecesHashDigest + { + [XmlAttribute(AttributeName = "Algorithm")] + public string Algorithm + { + get; set; + } + + [XmlText] + public string Text + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs new file mode 100644 index 00000000..1298b822 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Prerequisites.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Prerequisites")] + public class Prerequisites + { + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity[] UpdateIdentity + { + get; set; + } + + [XmlElement(ElementName = "AtLeastOne")] + public AtLeastOne[] AtLeastOne + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs new file mode 100644 index 00000000..a3528334 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Properties.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Properties")] + public class Properties + { + [XmlAttribute(AttributeName = "UpdateType")] + public string UpdateType + { + get; set; + } + + [XmlAttribute(AttributeName = "PerUser")] + public string PerUser + { + get; set; + } + + [XmlElement(ElementName = "SecuredFragment")] + public string SecuredFragment + { + get; set; + } + + [XmlAttribute(AttributeName = "PackageRank")] + public string PackageRank + { + get; set; + } + + [XmlAttribute(AttributeName = "ExplicitlyDeployable")] + public string ExplicitlyDeployable + { + get; set; + } + + [XmlAttribute(AttributeName = "ApplyPackageRank")] + public string ApplyPackageRank + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs new file mode 100644 index 00000000..68761fe2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Relationships.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Relationships")] + public class Relationships + { + [XmlElement(ElementName = "Prerequisites")] + public Prerequisites Prerequisites + { + get; set; + } + + [XmlElement(ElementName = "BundledUpdates")] + public BundledUpdates BundledUpdates + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs new file mode 100644 index 00000000..18d765c8 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/UpdateIdentity.cs @@ -0,0 +1,42 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "UpdateIdentity")] + public class UpdateIdentity + { + [XmlAttribute(AttributeName = "UpdateID")] + public string UpdateID + { + get; set; + } + + [XmlAttribute(AttributeName = "RevisionNumber")] + public string RevisionNumber + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs new file mode 100644 index 00000000..1d752ad6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/FE3/XML/ExtendedUpdateInfo/Xml.cs @@ -0,0 +1,78 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Xml; +using System.Xml.Serialization; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo +{ + [XmlRoot(ElementName = "Xml")] + public class Xml + { + [XmlElement(ElementName = "LocalizedProperties")] + public LocalizedProperties LocalizedProperties + { + get; set; + } + + [XmlElement(ElementName = "UpdateIdentity")] + public UpdateIdentity UpdateIdentity + { + get; set; + } + + [XmlElement(ElementName = "Properties")] + public Properties Properties + { + get; set; + } + + [XmlElement(ElementName = "ApplicabilityRules")] + public ApplicabilityRules ApplicabilityRules + { + get; set; + } + + [XmlElement(ElementName = "ExtendedProperties")] + public ExtendedProperties ExtendedProperties + { + get; set; + } + + [XmlElement(ElementName = "HandlerSpecificData")] + public HandlerSpecificData HandlerSpecificData + { + get; set; + } + + [XmlElement(ElementName = "Relationships")] + public Relationships Relationships + { + get; set; + } + + [XmlElement(ElementName = "Files")] + public Files Files + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Models/UnifiedUpdatePlatform.Services.WindowsUpdate.Models.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs new file mode 100644 index 00000000..0ba555ab --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/ComputerHardwareIDUnitTests.cs @@ -0,0 +1,176 @@ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests +{ + [TestClass] + public class ComputerHardwareIDUnitTests + { + private readonly string BIOSVendor; + private readonly string BIOSVersionString; + private readonly string SystemBIOSMajorRelease; + private readonly string SystemBIOSMinorRelease; + + private readonly string SystemManufacturer; + private readonly string SystemFamily; + private readonly string SystemProductName; + private readonly string SKUNumber; + + private readonly string SystemEnclosureorChassisType; + + private readonly string BaseboardManufacturer; + private readonly string BaseboardProductName; + + private readonly string HardwareId1; + private readonly string HardwareId2; + private readonly string HardwareId3; + private readonly string HardwareId4; + private readonly string HardwareId5; + private readonly string HardwareId6; + private readonly string HardwareId7; + private readonly string HardwareId8; + private readonly string HardwareId9; + private readonly string HardwareId10; + private readonly string HardwareId11; + private readonly string HardwareId12; + private readonly string HardwareId13; + private readonly string HardwareId14; + private readonly string HardwareId15; + + public ComputerHardwareIDUnitTests() + { + BIOSVendor = "Microsoft Corporation"; + BIOSVersionString = "160.2002.235"; + SystemBIOSMajorRelease = "ff"; + SystemBIOSMinorRelease = "ff"; + + SystemManufacturer = "Microsoft Corporation"; + SystemFamily = "Surface"; + SystemProductName = "Microsoft Surface Pro, 11th Edition"; + SKUNumber = "Surface_Pro_11th_Edition_2076"; + + SystemEnclosureorChassisType = "9"; + + BaseboardManufacturer = "Microsoft Corporation"; + BaseboardProductName = "Microsoft Surface Pro, 11th Edition"; + + HardwareId1 = "{2a25cf22-7385-57f4-a540-83e187999901}"; + HardwareId2 = "{ca17c43e-840f-5ce5-8dfb-8b847cc3c9da}"; + HardwareId3 = "{83dfc1ca-dad7-5529-9805-3b4d4468b2a1}"; + HardwareId4 = "{aca467c0-5fc2-59ad-8ed5-1b7a0988d11c}"; + HardwareId5 = "{95971fb3-d478-591f-9ea3-eb0af0d1dfb5}"; + HardwareId6 = "{c9c14db9-2b61-597a-a4ba-84397fe75f63}"; + HardwareId7 = "{7cef06f5-e7e6-56d7-b123-a6d640a5d302}"; + HardwareId8 = "{48b86a5e-1955-5799-9577-150f9e1a69e4}"; + HardwareId9 = "{06128fee-87dc-50f6-8a3f-97cd9a6d8bf6}"; + HardwareId10 = "{84b2e1d1-e695-5f41-8c41-cf1f059c616a}"; + HardwareId11 = "{16a47337-1f8b-5bd3-b3bd-8e50b31cb1c9}"; + HardwareId12 = "{ca2e5189-1d32-509f-88a0-d4ebcc721899}"; + HardwareId13 = "{aca387a9-183e-5da9-8f9d-f460c3f50f54}"; + HardwareId14 = "{fdef4ae0-6bfb-5706-8aae-a565639505f5}"; + HardwareId15 = "{cc0aea32-ad2c-5013-8bed-cede6be8c9f4}"; + } + + [TestMethod] + public void Test_GenerateHardwareId1_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId1(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId1, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId2_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId2(SystemManufacturer, SystemFamily, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId2, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId3_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId3(SystemManufacturer, SystemProductName, BIOSVendor, BIOSVersionString, SystemBIOSMajorRelease, SystemBIOSMinorRelease); + Assert.AreEqual(HardwareId3, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId4_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId4(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId4, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId5_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId5(SystemManufacturer, SystemFamily, SystemProductName, SKUNumber); + Assert.AreEqual(HardwareId5, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId6_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId6(SystemManufacturer, SystemFamily, SystemProductName); + Assert.AreEqual(HardwareId6, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId7_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId7(SystemManufacturer, SKUNumber, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId7, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId8_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId8(SystemManufacturer, SKUNumber); + Assert.AreEqual(HardwareId8, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId9_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId9(SystemManufacturer, SystemProductName, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId9, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId10_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId10(SystemManufacturer, SystemProductName); + Assert.AreEqual(HardwareId10, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId11_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId11(SystemManufacturer, SystemFamily, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId11, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId12_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId12(SystemManufacturer, SystemFamily); + Assert.AreEqual(HardwareId12, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId13_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId13(SystemManufacturer, SystemEnclosureorChassisType); + Assert.AreEqual(HardwareId13, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId14_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId14(SystemManufacturer, BaseboardManufacturer, BaseboardProductName); + Assert.AreEqual(HardwareId14, GeneratedComputerHardwareID); + } + + [TestMethod] + public void Test_GenerateHardwareId15_Equals_Reference_Data() + { + string GeneratedComputerHardwareID = ComputerHardwareID.GenerateHardwareId15(SystemManufacturer); + Assert.AreEqual(HardwareId15, GeneratedComputerHardwareID); + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj new file mode 100644 index 00000000..49446e7d --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.Tests.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + + + + + + + + + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs new file mode 100644 index 00000000..0257b024 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/CTAC.cs @@ -0,0 +1,354 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public class CTAC + { + public string DeviceAttributes + { + get; set; + } + public string CallerAttributes + { + get; set; + } + public string Products + { + get; set; + } + public bool SyncCurrentVersionOnly + { + get; set; + } + + public CTAC() + { + } + + public CTAC(OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + bool IsStore = false, + string ContentType = "Mainline", + bool IsVbsEnabled = true, + bool IsDriverCheck = false, + string DriverPartnerRing = "Drivers") : base() + { + BuildCTAC(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, IsStore, ContentType, IsVbsEnabled, IsDriverCheck, DriverPartnerRing); + } + + private void BuildCTAC( + OSSkuId ReportingSku, + string ReportingVersion, + MachineType MachineType, + string FlightRing, + string FlightingBranchName, + string BranchReadinessLevel, + string CurrentBranch, + string ReleaseType, + bool SyncCurrentVersionOnly, + bool IsStore = false, + string content = "Mainline", + bool IsVbsEnabled = true, + bool IsDriverCheck = false, + string DriverPartnerRing = "Drivers" + ) + { + int flightEnabled = FlightRing == "Retail" ? 0 : 1; + string App = IsStore ? "WU_STORE" : "WU_OS"; + + string InstallType = "Client"; + string ReportingPFN = "Client.OS.rs2"; + string DeviceFamily = "Windows.Desktop"; + + if (ReportingSku == OSSkuId.Holographic) + { + InstallType = "FactoryOS"; + ReportingPFN = "HOLOLENS.OS.rs2"; + DeviceFamily = "Windows.Holographic"; + } + else if (ReportingSku == OSSkuId.IoTUAP) + { + InstallType = "IoTUAP"; + ReportingPFN = "IoTCore.OS.rs2"; + DeviceFamily = "Windows.IoTUAP"; + } + else if (ReportingSku == OSSkuId.MobileCore) + { + InstallType = "MobileCore"; + ReportingPFN = "Mobile.OS.rs2"; + DeviceFamily = "Windows.Mobile"; + } + else if (ReportingSku == OSSkuId.Lite) + { + InstallType = "FactoryOS"; + ReportingPFN = "WCOSDevice0.OS"; + DeviceFamily = "Windows.Core"; + } + else if (ReportingSku == OSSkuId.Andromeda) + { + InstallType = "FactoryOS"; + ReportingPFN = "WCOSDevice1.OS"; + DeviceFamily = "Windows.Core"; + } + else if (ReportingSku == OSSkuId.HubOS) + { + InstallType = "FactoryOS"; + ReportingPFN = "WCOSDevice2.OS"; + DeviceFamily = "Windows.Core"; + } + else if (ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase) && ReportingSku.ToString().Contains("Core", StringComparison.InvariantCultureIgnoreCase)) + { + InstallType = "Server Core"; + ReportingPFN = "Server.OS"; + DeviceFamily = "Windows.Server"; + } + else if (ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase) && !ReportingSku.ToString().Contains("Core", StringComparison.InvariantCultureIgnoreCase)) + { + InstallType = "Server"; + ReportingPFN = "Server.OS"; + DeviceFamily = "Windows.Server"; + } + else if (ReportingSku == OSSkuId.PPIPro) + { + DeviceFamily = "Windows.Team"; + } + + Dictionary deviceAttributeDictionary = []; + + if (IsDriverCheck) + { + deviceAttributeDictionary.Add("ActivationChannel", "OEM:DM"); + deviceAttributeDictionary.Add("App", App); + deviceAttributeDictionary.Add("AppVer", ReportingVersion); + deviceAttributeDictionary.Add("AttrDataVer", "264"); + deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); + deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); + deviceAttributeDictionary.Add("DefaultUserRegion", "244"); + deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); + if (!string.IsNullOrEmpty(DriverPartnerRing)) + { + deviceAttributeDictionary.Add("DriverPartnerRing", DriverPartnerRing); + } + deviceAttributeDictionary.Add("FirmwareVersion", "7.31.139"); + deviceAttributeDictionary.Add("FlightContent", content); + deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); + deviceAttributeDictionary.Add("FlightRing", FlightRing); + deviceAttributeDictionary.Add("HidparseDriversVer", ReportingVersion); + deviceAttributeDictionary.Add("InstallationType", InstallType); + deviceAttributeDictionary.Add("InstallDate", "1677314327"); + deviceAttributeDictionary.Add("InstallLanguage", "en-US"); + deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); + deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); + deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); + deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); + deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); + deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); + deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + deviceAttributeDictionary.Add("OEMModel", "Windows Dev Kit 2023"); + deviceAttributeDictionary.Add("OEMModelBaseBoard", "Windows Dev Kit 2023"); + deviceAttributeDictionary.Add("OEMName_Uncleaned", "Microsoft Corporation"); + deviceAttributeDictionary.Add("OEMSubModel", "2043"); + deviceAttributeDictionary.Add("OSArchitecture", "ARM64"); + deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); + deviceAttributeDictionary.Add("OSUILocale", "en-US"); + deviceAttributeDictionary.Add("OSVersion", ReportingVersion); + deviceAttributeDictionary.Add("ProcessorClockSpeed", "1440"); + deviceAttributeDictionary.Add("ProcessorCores", "8"); + deviceAttributeDictionary.Add("ProcessorIdentifier", "ARMv8 (64-bit) Family 8 Model D4B Revision 0"); + deviceAttributeDictionary.Add("ProcessorManufacturer", "Qualcomm Technologies Inc"); + deviceAttributeDictionary.Add("ProcessorModel", "Snapdragon Compute Platform"); + deviceAttributeDictionary.Add("SecureBootCapable", "1"); + deviceAttributeDictionary.Add("TelemetryLevel", "3"); + deviceAttributeDictionary.Add("TotalPhysicalRAM", "32768"); + deviceAttributeDictionary.Add("TPMVersion", "2"); + deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); + deviceAttributeDictionary.Add("WuClientVer", "1101.2301.31021.0"); + } + else + { + deviceAttributeDictionary.Add("IsContainerMgrInstalled", "1"); + deviceAttributeDictionary.Add("FlightRing", FlightRing); + deviceAttributeDictionary.Add("TelemetryLevel", "3"); + deviceAttributeDictionary.Add("HidOverGattReg", "C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll"); + deviceAttributeDictionary.Add("AppVer", "0.0.0.0"); + deviceAttributeDictionary.Add("IsAutopilotRegistered", "0"); + deviceAttributeDictionary.Add("ProcessorIdentifier", "Intel64 Family 6 Model 151 Stepping 2"); + deviceAttributeDictionary.Add("OEMModel", "RM-1085_1045"); + deviceAttributeDictionary.Add("ProcessorManufacturer", "GenuineIntel"); + deviceAttributeDictionary.Add("InstallDate", "1577722757"); + deviceAttributeDictionary.Add("OEMModelBaseBoard", "OEM Board Name"); + deviceAttributeDictionary.Add("BranchReadinessLevel", BranchReadinessLevel); + deviceAttributeDictionary.Add("DataExpDateEpoch_20H1", "1593425114"); + deviceAttributeDictionary.Add("IsCloudDomainJoined", "0"); + deviceAttributeDictionary.Add("Bios", "2019"); + deviceAttributeDictionary.Add("DchuAmdGrfxVen", "4098"); + deviceAttributeDictionary.Add("IsDeviceRetailDemo", "0"); + deviceAttributeDictionary.Add("FlightingBranchName", FlightingBranchName); + deviceAttributeDictionary.Add("OSUILocale", "en-US"); + deviceAttributeDictionary.Add("DeviceFamily", DeviceFamily); + deviceAttributeDictionary.Add("UpgEx_20H1", "Green"); + deviceAttributeDictionary.Add("WuClientVer", ReportingVersion); + deviceAttributeDictionary.Add("IsFlightingEnabled", flightEnabled.ToString()); + deviceAttributeDictionary.Add("OSSkuId", ((int)ReportingSku).ToString()); + deviceAttributeDictionary.Add("GStatus_20H1", "2"); + deviceAttributeDictionary.Add("App", App); + deviceAttributeDictionary.Add("CurrentBranch", CurrentBranch); + deviceAttributeDictionary.Add("InstallLanguage", "en-US"); + deviceAttributeDictionary.Add("OEMName_Uncleaned", "MICROSOFTMDG"); + deviceAttributeDictionary.Add("InstallationType", InstallType); + deviceAttributeDictionary.Add("AttrDataVer", "264"); + deviceAttributeDictionary.Add("IsEdgeWithChromiumInstalled", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_20H1", "1593425114"); + deviceAttributeDictionary.Add("OSVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsMDMEnrolled", "0"); + deviceAttributeDictionary.Add("TencentType", "1"); + deviceAttributeDictionary.Add("FlightContent", content); + deviceAttributeDictionary.Add("ActivationChannel", "Retail"); + deviceAttributeDictionary.Add("Steam", "URL:steam protocol"); + deviceAttributeDictionary.Add("Free", "gt64"); + deviceAttributeDictionary.Add("TencentReg", "79 d0 01 d7 9f 54 d5 01"); + deviceAttributeDictionary.Add("FirmwareVersion", "7704"); + deviceAttributeDictionary.Add("DchuAmdGrfxExists", "1"); + deviceAttributeDictionary.Add("SdbVer_20H1", "2000000000"); + deviceAttributeDictionary.Add("UpgEx_CO21H2", "Green"); + //deviceAttributeDictionary.Add("OSArchitecture", MachineType.ToString().ToUpper()); + deviceAttributeDictionary.Add("OSArchitecture", "AMD64"); + deviceAttributeDictionary.Add("DefaultUserRegion", "244"); + deviceAttributeDictionary.Add("ReleaseType", ReleaseType); + deviceAttributeDictionary.Add("UpdateManagementGroup", "2"); + deviceAttributeDictionary.Add("MobileOperatorCommercialized", "000-88"); + deviceAttributeDictionary.Add("PhoneTargetingName", "Lumia 950 XL"); + deviceAttributeDictionary.Add("AllowInPlaceUpgrade", "1"); + deviceAttributeDictionary.Add("AllowUpgradesWithUnsupportedTPMOrCPU", "1"); + deviceAttributeDictionary.Add("CloudPBR", "1"); + deviceAttributeDictionary.Add("DataExpDateEpoch_19H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H1", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("DataExpDateEpoch_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("DataVer_RS5", "2000000000"); + deviceAttributeDictionary.Add("DUScan", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallCount", "1"); + deviceAttributeDictionary.Add("EKB19H2InstallTimeEpoch", "1255000000"); + deviceAttributeDictionary.Add("GenTelRunTimestamp_19H1", "1593425114"); + deviceAttributeDictionary.Add("GStatus_19H1", "2"); + deviceAttributeDictionary.Add("GStatus_19H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_20H1Setup", "2"); + deviceAttributeDictionary.Add("GStatus_21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2", "2"); + deviceAttributeDictionary.Add("GStatus_CO21H2Setup", "2"); + deviceAttributeDictionary.Add("GStatus_RS5", "2"); + deviceAttributeDictionary.Add("MediaBranch", ""); + deviceAttributeDictionary.Add("ProcessorModel", "12th Gen Intel(R) Core(TM) i9-12900K"); + deviceAttributeDictionary.Add("SdbVer_19H1", "2000000000"); + deviceAttributeDictionary.Add("SecureBootCapable", "1"); + deviceAttributeDictionary.Add("TimestampEpochString_19H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H1", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2", "1593425114"); + deviceAttributeDictionary.Add("TimestampEpochString_CO21H2Setup", "1593425114"); + deviceAttributeDictionary.Add("TPMVersion", "2"); + deviceAttributeDictionary.Add("UpdateOfferedDays", "0"); + deviceAttributeDictionary.Add("UpgEx_19H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H1", "Green"); + deviceAttributeDictionary.Add("UpgEx_21H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_NI22H2", "Green"); + deviceAttributeDictionary.Add("UpgEx_RS5", "Green"); + deviceAttributeDictionary.Add("UpgradeEligible", "1"); + deviceAttributeDictionary.Add("Version_RS5", "2000000000"); + deviceAttributeDictionary.Add("IsRetailOS", (FlightRing == "Retail").ToString()); + deviceAttributeDictionary.Add("MediaVersion", ReportingVersion); + deviceAttributeDictionary.Add("IsVbsEnabled", (IsVbsEnabled ? 1 : 0).ToString()); + } + + DeviceAttributes = $"E:{string.Join("&", deviceAttributeDictionary.Select(x => $"{x.Key}={x.Value}"))}"; + + if (ReportingSku is OSSkuId.EnterpriseS or OSSkuId.EnterpriseSN || ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase)) + { + DeviceAttributes += "&BlockFeatureUpdates=1"; + } + + if (ReportingSku == OSSkuId.Holographic) + { + DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + + $"OneCoreSwV={ReportingVersion}&" + + "OneCoreManufacturerModelName=HoloLens&" + + "OneCoreManufacturer=Microsoft Corporation&" + + "OneCoreOperatorName=000-88"; + } + else if (ReportingSku == OSSkuId.HubOS) + { + DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + + $"OneCoreSwV={ReportingVersion}&" + + "OneCoreManufacturerModelName=Surface Hub 2X&" + + "OneCoreManufacturer=Microsoft Corporation&" + + "OneCoreOperatorName=000-88"; + } + else if (ReportingSku == OSSkuId.Andromeda) + { + DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + + $"OneCoreSwV={ReportingVersion}&" + + "OneCoreManufacturerModelName=Andromeda&" + + "OneCoreManufacturer=Microsoft Corporation&" + + "OneCoreOperatorName=000-88"; + } + else if (ReportingSku == OSSkuId.Lite) + { + DeviceAttributes += "&Product=ModernPC"; + DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + + $"OneCoreSwV={ReportingVersion}&" + + "OneCoreManufacturerModelName=Santorini&" + + "OneCoreManufacturer=Microsoft Corporation&" + + "OneCoreOperatorName=000-88"; + } + + CallerAttributes = "E:Interactive=1&IsSeeker=1&SheddingAware=1&"; + if (IsStore) + { + CallerAttributes += "Acquisition=1&Id=Acquisition%3BMicrosoft.WindowsStore_8wekyb3d8bbwe&"; + } + else + { + CallerAttributes += "Id=UpdateOrchestrator&"; + } + + Products = ""; + if (!IsStore) + { + Products = $"PN={ReportingPFN}.{MachineType}&Branch={CurrentBranch}&PrimaryOSProduct=1&Repairable=1&V={ReportingVersion};"; + } + + this.SyncCurrentVersionOnly = SyncCurrentVersionOnly; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs new file mode 100644 index 00000000..8de61ec9 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareID.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public class ComputerHardwareID + { + public static string GenerateHardwareId1(string Manufacturer, string Family, string ProductName, string SKUNumber, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId2(string Manufacturer, string Family, string ProductName, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId3(string Manufacturer, string ProductName, string BIOSVendor, string BIOSVersion, string BIOSMajorRelease, string BIOSMinorRelease) + { + return GenerateHardwareId([Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease]); + } + + public static string GenerateHardwareId4(string Manufacturer, string Family, string ProductName, string SKUNumber, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId5(string Manufacturer, string Family, string ProductName, string SKUNumber) + { + return GenerateHardwareId([Manufacturer, Family, ProductName, SKUNumber]); + } + + public static string GenerateHardwareId6(string Manufacturer, string Family, string ProductName) + { + return GenerateHardwareId([Manufacturer, Family, ProductName]); + } + + public static string GenerateHardwareId7(string Manufacturer, string SKUNumber, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId8(string Manufacturer, string SKUNumber) + { + return GenerateHardwareId([Manufacturer, SKUNumber]); + } + + public static string GenerateHardwareId9(string Manufacturer, string ProductName, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId10(string Manufacturer, string ProductName) + { + return GenerateHardwareId([Manufacturer, ProductName]); + } + + public static string GenerateHardwareId11(string Manufacturer, string Family, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, Family, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId12(string Manufacturer, string Family) + { + return GenerateHardwareId([Manufacturer, Family]); + } + + public static string GenerateHardwareId13(string Manufacturer, string EnclosureType) + { + return GenerateHardwareId([Manufacturer, EnclosureType]); + } + + public static string GenerateHardwareId14(string Manufacturer, string BaseboardManufacturer, string BaseboardProduct) + { + return GenerateHardwareId([Manufacturer, BaseboardManufacturer, BaseboardProduct]); + } + + public static string GenerateHardwareId15(string Manufacturer) + { + return GenerateHardwareId([Manufacturer]); + } + + public static string[] GenerateHardwareIds(string Manufacturer, string Family = null, string ProductName = null, string SKUNumber = null, string BIOSVendor = null, string BaseboardManufacturer = null, string BaseboardProduct = null, string EnclosureType = null, string BIOSVersion = null, string BIOSMajorRelease = null, string BIOSMinorRelease = null) + { + List HardwareIds = []; + + if (Manufacturer == null) + { + throw new Exception("At least a non null Manufacturer value is required"); + } + + if (Family != null && ProductName != null && SKUNumber != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId1(Manufacturer, Family, ProductName, SKUNumber, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (Family != null && ProductName != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId2(Manufacturer, Family, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (ProductName != null && BIOSVendor != null && BIOSVersion != null && BIOSMajorRelease != null && BIOSMinorRelease != null) + { + HardwareIds.Add(GenerateHardwareId3(Manufacturer, ProductName, BIOSVendor, BIOSVersion, BIOSMajorRelease, BIOSMinorRelease)); + } + + if (Family != null && ProductName != null && SKUNumber != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId4(Manufacturer, Family, ProductName, SKUNumber, BaseboardManufacturer, BaseboardProduct)); + } + + if (Family != null && ProductName != null && SKUNumber != null) + { + HardwareIds.Add(GenerateHardwareId5(Manufacturer, Family, ProductName, SKUNumber)); + } + + if (Family != null && ProductName != null) + { + HardwareIds.Add(GenerateHardwareId6(Manufacturer, Family, ProductName)); + } + + if (SKUNumber != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId7(Manufacturer, SKUNumber, BaseboardManufacturer, BaseboardProduct)); + } + + if (SKUNumber != null) + { + HardwareIds.Add(GenerateHardwareId8(Manufacturer, SKUNumber)); + } + + if (ProductName != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId9(Manufacturer, ProductName, BaseboardManufacturer, BaseboardProduct)); + } + + if (ProductName != null) + { + HardwareIds.Add(GenerateHardwareId10(Manufacturer, ProductName)); + } + + if (Family != null && BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId11(Manufacturer, Family, BaseboardManufacturer, BaseboardProduct)); + } + + if (Family != null) + { + HardwareIds.Add(GenerateHardwareId12(Manufacturer, Family)); + } + + if (EnclosureType != null) + { + HardwareIds.Add(GenerateHardwareId13(Manufacturer, EnclosureType)); + } + + if (BaseboardManufacturer != null && BaseboardProduct != null) + { + HardwareIds.Add(GenerateHardwareId14(Manufacturer, BaseboardManufacturer, BaseboardProduct)); + } + + HardwareIds.Add(GenerateHardwareId15(Manufacturer)); + + return [.. HardwareIds]; + } + + public static string GenerateHardwareId(string[] BIOSFields) + { + string inputString = string.Join('&', BIOSFields); + Guid guidFromString = ComputerHardwareIDProvider.Class5GuidFromString(inputString); + string guidString = $"{{{guidFromString}}}"; + return guidString; + } + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs similarity index 68% rename from src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs rename to src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs index 3936d187..0a0f3f83 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/ComputerHardwareIDProvider.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/ComputerHardwareIDProvider.cs @@ -2,11 +2,11 @@ using System.Security.Cryptography; using System.Text; -namespace UnifiedUpdatePlatform.Services.WindowsUpdate +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting { public static class ComputerHardwareIDProvider { - private static readonly byte[] hwidIv = { 0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + private static readonly byte[] hardwareIDIv = [0x70, 0xFF, 0xD8, 0x12, 0x4C, 0x7F, 0x4C, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; public static Guid Class5GuidFromString(string input) { @@ -19,14 +19,17 @@ public static Guid Class5GuidFromString(string input) private static byte[] GetPartialHash(string input) { byte[] partialHash; - using (SHA1 sha1Csp = SHA1.Create()) - { - _ = sha1Csp.TransformBlock(hwidIv, 0, hwidIv.Length, null, 0); - byte[] dataBin = Encoding.Unicode.GetBytes(input); - _ = sha1Csp.TransformFinalBlock(dataBin, 0, dataBin.Length); - partialHash = new byte[16]; - Array.Copy(sha1Csp.Hash, partialHash, partialHash.Length); - } + + using SHA1 sha1Csp = SHA1.Create(); + + _ = sha1Csp.TransformBlock(hardwareIDIv, 0, hardwareIDIv.Length, null, 0); + + byte[] dataBin = Encoding.Unicode.GetBytes(input); + _ = sha1Csp.TransformFinalBlock(dataBin, 0, dataBin.Length); + + partialHash = new byte[16]; + Array.Copy(sha1Csp.Hash, partialHash, partialHash.Length); + return partialHash; } @@ -54,4 +57,4 @@ private static uint SwapBytes32(uint x) return ((x & 0xFF00FF00) >> 8) | ((x & 0x00FF00FF) << 8); } } -} +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs new file mode 100644 index 00000000..0ea195b0 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/MachineType.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public enum MachineType : ushort + { + unknown = 0x0, + x86 = 0x14c, + r4000 = 0x166, + wcemipsv2 = 0x169, + axp = 0x184, + sh3 = 0x1a2, + sh3dsp = 0x1a3, + sh4 = 0x1a6, + sh5 = 0x1a8, + arm = 0x1c0, + thumb = 0x1c2, + woa = 0x1c4, + am33 = 0x1d3, + powerpc = 0x1f0, + powerpcfp = 0x1f1, + ia64 = 0x200, + mips16 = 0x266, + mipsfpu = 0x366, + mipsfpu16 = 0x466, + ebc = 0xebc, + amd64 = 0x8664, + m32r = 0x9041, + arm64 = 0xaa64, + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs new file mode 100644 index 00000000..1dc604b6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/OSSkuId.cs @@ -0,0 +1,229 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting +{ + public enum OSSkuId + { + Undefined = 0x00000000, + Ultimate = 0x00000001, + HomeBasic = 0x00000002, + HomePremium = 0x00000003, + Enterprise = 0x00000004, + HomeBasicN = 0x00000005, + Business = 0x00000006, + StandardServer = 0x00000007, + DatacenterServer = 0x00000008, + SmallBusinessServer = 0x00000009, + EnterpriseServer = 0x0000000A, + Starter = 0x0000000B, + DatacenterServerCore = 0x0000000C, + StandardServerCore = 0x0000000D, + EnterpriseServerCore = 0x0000000E, + EnterpriseServerIA64 = 0x0000000F, + BusinessN = 0x00000010, + WebServer = 0x00000011, + ClusterServer = 0x00000012, + HomeServer = 0x00000013, + StorageExpressServer = 0x00000014, + StorageStandardServer = 0x00000015, + StorageWorkgroupServer = 0x00000016, + StorageEnterpriseServer = 0x00000017, + ServerForSmallBusiness = 0x00000018, + SmallBusinessServerPremium = 0x00000019, + HomePremiumN = 0x0000001A, + EnterpriseN = 0x0000001B, + UltimateN = 0x0000001C, + WebServerCore = 0x0000001D, + MediumBusinessServerManagement = 0x0000001E, + MediumBusinessServerSecurity = 0x0000001F, + MediumBusinessServerMessaging = 0x00000020, + ServerFoundation = 0x00000021, + HomePremiumServer = 0x00000022, + ServerForSmallBusinessV = 0x00000023, + StandardServerV = 0x00000024, + DatacenterServerV = 0x00000025, + EnterpriseServerV = 0x00000026, + DatacenterServerCoreV = 0x00000027, + StandardServerCoreV = 0x00000028, + EnterpriseServerCoreV = 0x00000029, + HyperV = 0x0000002A, + StorageExpressServerCore = 0x0000002B, + StorageServerStandardCore = 0x0000002C, + StorageWorkgroupServerCore = 0x0000002D, + StorageEnterpriseServerCore = 0x0000002E, + StarterN = 0x0000002F, + Professional = 0x00000030, + ProfessionalN = 0x00000031, + SBSolutionServer = 0x00000032, + ServerForSBSolutions = 0x00000033, + StandardServerSolutions = 0x00000034, + StandardServerSolutionsCore = 0x00000035, + SBSolutionServerEM = 0x00000036, + ServerForSBSolutionsEM = 0x00000037, + SolutionEmbeddedServer = 0x00000038, + SolutionEmbeddedServerCore = 0x00000039, + ProfessionalEmbedded = 0x0000003A, + EssentialBusinessServerMGMT = 0x0000003B, + EssentialBusinessServerADDL = 0x0000003C, + EssentialBusinessServerMGMTSVC = 0x0000003D, + EssentialBusinessServerADDLSVC = 0x0000003E, + SmallBusinessServerPremiumCore = 0x0000003F, + ClusterServerV = 0x00000040, + Embedded = 0x00000041, + StarterE = 0x00000042, + HomeBasicE = 0x00000043, + HomePremiumE = 0x00000044, + ProfessionalE = 0x00000045, + EnterpriseE = 0x00000046, + UltimateE = 0x00000047, + EnterpriseEvaluation = 0x00000048, + Unknown49, + Prerelease = 0x0000004A, + Unknown4B, + MultipointStandardServer = 0x0000004C, + MultipointPremiumServer = 0x0000004D, + Unknown4E = 0x0000004E, + StandardEvaluationServer = 0x0000004F, + DatacenterEvaluationServer = 0x00000050, + PrereleaseARM = 0x00000051, + PrereleaseN = 0x00000052, + Unknown53, + EnterpriseNEvaluation = 0x00000054, + EmbeddedAutomotive = 0x00000055, + EmbeddedIndustryA = 0x00000056, + ThinPC = 0x00000057, + EmbeddedA = 0x00000058, + EmbeddedIndustry = 0x00000059, + EmbeddedE = 0x0000005A, + EmbeddedIndustryE = 0x0000005B, + EmbeddedIndustryAE = 0x0000005C, + Unknown5D, + Unknown5E, + StorageWorkgroupEvaluationServer = 0x0000005F, + StorageStandardEvaluationServer = 0x00000060, + CoreARM = 0x00000061, + CoreN = 0x00000062, + CoreCountrySpecific = 0x00000063, + CoreSingleLanguage = 0x00000064, + Core = 0x00000065, + Unknown66, + ProfessionalWMC = 0x00000067, + MobileCore = 0x00000068, + EmbeddedIndustryEval = 0x00000069, + EmbeddedIndustryEEval = 0x0000006A, + EmbeddedEval = 0x0000006B, + EmbeddedEEval = 0x0000006C, + NanoServer = 0x0000006D, + CloudStorageServer = 0x0000006E, + CoreConnected = 0x0000006F, + ProfessionalStudent = 0x00000070, + CoreConnectedN = 0x00000071, + ProfessionalStudentN = 0x00000072, + CoreConnectedSingleLanguage = 0x00000073, + CoreConnectedCountrySpecific = 0x00000074, + ConnectedCAR = 0x00000075, + IndustryHandheld = 0x00000076, + PPIPro = 0x00000077, + ARM64Server = 0x00000078, + Education = 0x00000079, + EducationN = 0x0000007A, + IoTUAP = 0x0000007B, + CloudHostInfrastructureServer = 0x0000007C, + EnterpriseS = 0x0000007D, + EnterpriseSN = 0x0000007E, + ProfessionalS = 0x0000007F, + ProfessionalSN = 0x00000080, + EnterpriseSEvaluation = 0x00000081, + EnterpriseSNEvaluation = 0x00000082, + Unknown83, + Unknown84, + Unknown85, + Unknown86, + Holographic = 0x00000087, + HolographicBusiness = 0x00000088, + Unknown89 = 0x00000089, + ProSingleLanguage = 0x0000008A, + ProChina = 0x0000008B, + EnterpriseSubscription = 0x0000008C, + EnterpriseSubscriptionN = 0x0000008D, + Unknown8E, + DatacenterNanoServer = 0x0000008F, + StandardNanoServer = 0x00000090, + DatacenterAServerCore = 0x00000091, + StandardAServerCore = 0x00000092, + DatacenterWSServerCore = 0x00000093, + StandardWSServerCore = 0x00000094, + UtilityVM = 0x00000095, + Unknown96, + Unknown97, + Unknown98, + Unknown99, + Unknown9A, + Unknown9B, + Unknown9C, + Unknown9D, + Unknown9E, + DatacenterEvaluationServerCore = 0x0000009F, + StandardEvaluationServerCore = 0x000000A0, + ProWorkstation = 0x000000A1, + ProWorkstationN = 0x000000A2, + UnknownA3, + ProForEducation = 0x000000A4, + ProForEducationN = 0x000000A5, + UnknownA6, + UnknownA7, + AzureServerCore = 0x000000A8, + AzureNanoServer = 0x000000A9, + UnknownAA = 0x000000AA, + EnterpriseG = 0x000000AB, + EnterpriseGN = 0x000000AC, + UnknownAD, + UnknownAE, + ServerRDSH = 0x000000AF, + UnknownB0, + UnknownB1, + Cloud = 0x000000B2, + CloudN = 0x000000B3, + HubOS = 0x000000B4, + UnknownB5, + OneCoreUpdateOS = 0x000000B6, + CloudE = 0x000000B7, + Andromeda = 0x000000B8, + IoTOS = 0x000000B9, + CloudEN = 0x000000BA, + IoTEdgeOS = 0x000000BB, + IoTEnterprise = 0x000000BC, + Lite = 0x000000BD, + UnknownBE, + IoTEnterpriseS = 0x000000BF, + XboxSystemOS = 0x000000C0, + XboxNativeOS = 0x000000C1, + XboxGameOS = 0x000000C2, + XboxERAOS = 0x000000C3, + XboxDurangoHostOS = 0x000000C4, + XboxScarlettHostOS = 0x000000C5, + XboxKeystone = 0x000000C6, + AzureStackHCIServerCore = 0x00000196, + DatacenterServerAzureEdition = 0x00000197, + DatacenterServerCoreAzureEdition = 0x00000198 + } +} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj new file mode 100644 index 00000000..356526b2 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting/UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting.csproj @@ -0,0 +1,9 @@ + + + net8.0 + AnyCPU;x64;x86;arm64 + $(SolutionDir)build\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\ + $(SolutionDir)intermediate\$(Platform)\$(Configuration)\UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting\ + true + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs new file mode 100644 index 00000000..6c185310 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuild.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableBuild + { + public UpdateData UpdateData + { + get; set; + } + public string Title + { + get; set; + } + public string BuildString + { + get; set; + } + public string Description + { + get; set; + } + public string Created + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs new file mode 100644 index 00000000..e62da88c --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableBuildLanguages.cs @@ -0,0 +1,44 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableBuildLanguages + { + public string Title + { + get; set; + } + public string LanguageCode + { + get; set; + } + public Uri FlagUri + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs new file mode 100644 index 00000000..48344ec6 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.AvailableEdition.cs @@ -0,0 +1,34 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static partial class BuildFetcher + { + public class AvailableEdition + { + public string Edition + { + get; set; + } + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs index 543f90ce..11514482 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/BuildFetcher.cs @@ -27,101 +27,15 @@ using System.Linq; using System.Net; using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate { - public static class StringExtensions + public static partial class BuildFetcher { - public static bool Contains(this string str, string substring, - StringComparison comp) - { - if (substring == null) - { - throw new ArgumentNullException(nameof(substring), - "substring cannot be null."); - } - else if (!Enum.IsDefined(typeof(StringComparison), comp)) - { - throw new ArgumentException("comp is not a member of StringComparison", - nameof(comp)); - } - - return str.Contains(substring, comp); - } - - public static string Replace(this string originalString, string oldValue, string newValue, StringComparison comparisonType) - { - int startIndex = 0; - while (true) - { - startIndex = originalString.IndexOf(oldValue, startIndex, comparisonType); - if (startIndex == -1) - { - break; - } - - originalString = originalString[..startIndex] + newValue + originalString[(startIndex + oldValue.Length)..]; - - startIndex += newValue.Length; - } - - return originalString; - } - } - - public static class BuildFetcher - { - public class AvailableBuild - { - public UpdateData UpdateData - { - get; set; - } - public string Title - { - get; set; - } - public string BuildString - { - get; set; - } - public string Description - { - get; set; - } - public string Created - { - get; set; - } - } - - public class AvailableBuildLanguages - { - public string Title - { - get; set; - } - public string LanguageCode - { - get; set; - } - public Uri FlagUri - { - get; set; - } - } - - public class AvailableEdition - { - public string Edition - { - get; set; - } - } - public static async Task GetAvailableBuildsAsync(MachineType machineType) { - List availableBuilds = new(); + List availableBuilds = []; IEnumerable updates = await GetUpdates(machineType); @@ -145,7 +59,7 @@ public static async Task GetAvailableBuildsAsync(MachineType m availableBuilds.Add(availableBuild); } - return availableBuilds.OrderBy(x => x.Title).ToArray(); + return [.. availableBuilds.OrderBy(x => x.Title)]; } public static async Task GetAvailableBuildLanguagesAsync(UpdateData UpdateData) @@ -159,16 +73,16 @@ public static async Task GetAvailableBuildLanguagesAs availableBuildLanguages.Sort((x, y) => x.Title.CompareTo(y.Title)); - return availableBuildLanguages.ToArray(); + return [.. availableBuildLanguages]; } public static async Task GetAvailableEditions(UpdateData UpdateData, string languagecode) { - List availableEditions = new(); + List availableEditions = []; - List metadataCabs = new(); + List metadataCabs = []; - foreach (CExtendedUpdateInfoXml.File file in UpdateData.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in UpdateData.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -203,7 +117,7 @@ public static async Task GetAvailableEditions(UpdateData Upd availableEditions.Add(new AvailableEdition() { Edition = edition }); } - foreach (CExtendedUpdateInfoXml.File metadataCab in metadataCabs) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File metadataCab in metadataCabs) { FileExchangeV3FileDownloadInformation fileDownloadInfo = await FE3Handler.GetFileUrl(UpdateData, metadataCabs.First().Digest); if (fileDownloadInfo == null) @@ -271,7 +185,7 @@ public static async Task GetAvailableEditions(UpdateData Upd availableEditions.Sort((x, y) => x.Edition.CompareTo(y.Edition)); exit: - return availableEditions.ToArray(); + return [.. availableEditions]; } private static UpdateData TrimDeltasFromUpdateData(UpdateData update) @@ -292,9 +206,9 @@ private static void AddUpdatesIfNotPresentAlready(ICollection update { IEnumerable potentialDupes = updates.Where(x => x.Xml.Files.File.Length == update.Xml.Files.File.Length); - CExtendedUpdateInfoXml.File metadataCab = null; + Models.FE3.XML.ExtendedUpdateInfo.File metadataCab = null; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -312,9 +226,9 @@ private static void AddUpdatesIfNotPresentAlready(ICollection update foreach (UpdateData potentialDupe in potentialDupes) { - CExtendedUpdateInfoXml.File metadataCab2 = null; + Models.FE3.XML.ExtendedUpdateInfo.File metadataCab2 = null; - foreach (CExtendedUpdateInfoXml.File file in potentialDupe.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in potentialDupe.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -371,11 +285,11 @@ private static Dictionary GetRingCTACs(MachineType machineType, OS private static async Task> GetUpdates(MachineType MachineType) { - HashSet updates = new(); + HashSet updates = []; CTAC[] ctacs = GetRingCTACs(MachineType, OSSkuId.Professional).Union(GetRingCTACs(MachineType, OSSkuId.PPIPro)).Select(x => x.Key).ToArray(); - List>> tasks = new(); + List>> tasks = []; foreach (CTAC ctac in ctacs) { tasks.Add(GetUpdatesFor(ctac)); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs deleted file mode 100644 index a2aa5866..00000000 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CTAC.cs +++ /dev/null @@ -1,539 +0,0 @@ -/* - * Copyright (c) Gustave Monce and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -using System; - -namespace UnifiedUpdatePlatform.Services.WindowsUpdate -{ - public enum MachineType : ushort - { - unknown = 0x0, - x86 = 0x14c, - r4000 = 0x166, - wcemipsv2 = 0x169, - axp = 0x184, - sh3 = 0x1a2, - sh3dsp = 0x1a3, - sh4 = 0x1a6, - sh5 = 0x1a8, - arm = 0x1c0, - thumb = 0x1c2, - woa = 0x1c4, - am33 = 0x1d3, - powerpc = 0x1f0, - powerpcfp = 0x1f1, - ia64 = 0x200, - mips16 = 0x266, - mipsfpu = 0x366, - mipsfpu16 = 0x466, - ebc = 0xebc, - amd64 = 0x8664, - m32r = 0x9041, - arm64 = 0xaa64, - } - - public enum OSSkuId - { - Undefined = 0x00000000, - Ultimate = 0x00000001, - HomeBasic = 0x00000002, - HomePremium = 0x00000003, - Enterprise = 0x00000004, - HomeBasicN = 0x00000005, - Business = 0x00000006, - StandardServer = 0x00000007, - DatacenterServer = 0x00000008, - SmallBusinessServer = 0x00000009, - EnterpriseServer = 0x0000000A, - Starter = 0x0000000B, - DatacenterServerCore = 0x0000000C, - StandardServerCore = 0x0000000D, - EnterpriseServerCore = 0x0000000E, - EnterpriseServerIA64 = 0x0000000F, - BusinessN = 0x00000010, - WebServer = 0x00000011, - ClusterServer = 0x00000012, - HomeServer = 0x00000013, - StorageExpressServer = 0x00000014, - StorageStandardServer = 0x00000015, - StorageWorkgroupServer = 0x00000016, - StorageEnterpriseServer = 0x00000017, - ServerForSmallBusiness = 0x00000018, - SmallBusinessServerPremium = 0x00000019, - HomePremiumN = 0x0000001A, - EnterpriseN = 0x0000001B, - UltimateN = 0x0000001C, - WebServerCore = 0x0000001D, - MediumBusinessServerManagement = 0x0000001E, - MediumBusinessServerSecurity = 0x0000001F, - MediumBusinessServerMessaging = 0x00000020, - ServerFoundation = 0x00000021, - HomePremiumServer = 0x00000022, - ServerForSmallBusinessV = 0x00000023, - StandardServerV = 0x00000024, - DatacenterServerV = 0x00000025, - EnterpriseServerV = 0x00000026, - DatacenterServerCoreV = 0x00000027, - StandardServerCoreV = 0x00000028, - EnterpriseServerCoreV = 0x00000029, - HyperV = 0x0000002A, - StorageExpressServerCore = 0x0000002B, - StorageServerStandardCore = 0x0000002C, - StorageWorkgroupServerCore = 0x0000002D, - StorageEnterpriseServerCore = 0x0000002E, - StarterN = 0x0000002F, - Professional = 0x00000030, - ProfessionalN = 0x00000031, - SBSolutionServer = 0x00000032, - ServerForSBSolutions = 0x00000033, - StandardServerSolutions = 0x00000034, - StandardServerSolutionsCore = 0x00000035, - SBSolutionServerEM = 0x00000036, - ServerForSBSolutionsEM = 0x00000037, - SolutionEmbeddedServer = 0x00000038, - SolutionEmbeddedServerCore = 0x00000039, - ProfessionalEmbedded = 0x0000003A, - EssentialBusinessServerMGMT = 0x0000003B, - EssentialBusinessServerADDL = 0x0000003C, - EssentialBusinessServerMGMTSVC = 0x0000003D, - EssentialBusinessServerADDLSVC = 0x0000003E, - SmallBusinessServerPremiumCore = 0x0000003F, - ClusterServerV = 0x00000040, - Embedded = 0x00000041, - StarterE = 0x00000042, - HomeBasicE = 0x00000043, - HomePremiumE = 0x00000044, - ProfessionalE = 0x00000045, - EnterpriseE = 0x00000046, - UltimateE = 0x00000047, - EnterpriseEvaluation = 0x00000048, - Unknown49, - Prerelease = 0x0000004A, - Unknown4B, - MultipointStandardServer = 0x0000004C, - MultipointPremiumServer = 0x0000004D, - Unknown4E = 0x0000004E, - StandardEvaluationServer = 0x0000004F, - DatacenterEvaluationServer = 0x00000050, - PrereleaseARM = 0x00000051, - PrereleaseN = 0x00000052, - Unknown53, - EnterpriseNEvaluation = 0x00000054, - EmbeddedAutomotive = 0x00000055, - EmbeddedIndustryA = 0x00000056, - ThinPC = 0x00000057, - EmbeddedA = 0x00000058, - EmbeddedIndustry = 0x00000059, - EmbeddedE = 0x0000005A, - EmbeddedIndustryE = 0x0000005B, - EmbeddedIndustryAE = 0x0000005C, - Unknown5D, - Unknown5E, - StorageWorkgroupEvaluationServer = 0x0000005F, - StorageStandardEvaluationServer = 0x00000060, - CoreARM = 0x00000061, - CoreN = 0x00000062, - CoreCountrySpecific = 0x00000063, - CoreSingleLanguage = 0x00000064, - Core = 0x00000065, - Unknown66, - ProfessionalWMC = 0x00000067, - MobileCore = 0x00000068, - EmbeddedIndustryEval = 0x00000069, - EmbeddedIndustryEEval = 0x0000006A, - EmbeddedEval = 0x0000006B, - EmbeddedEEval = 0x0000006C, - NanoServer = 0x0000006D, - CloudStorageServer = 0x0000006E, - CoreConnected = 0x0000006F, - ProfessionalStudent = 0x00000070, - CoreConnectedN = 0x00000071, - ProfessionalStudentN = 0x00000072, - CoreConnectedSingleLanguage = 0x00000073, - CoreConnectedCountrySpecific = 0x00000074, - ConnectedCAR = 0x00000075, - IndustryHandheld = 0x00000076, - PPIPro = 0x00000077, - ARM64Server = 0x00000078, - Education = 0x00000079, - EducationN = 0x0000007A, - IoTUAP = 0x0000007B, - CloudHostInfrastructureServer = 0x0000007C, - EnterpriseS = 0x0000007D, - EnterpriseSN = 0x0000007E, - ProfessionalS = 0x0000007F, - ProfessionalSN = 0x00000080, - EnterpriseSEvaluation = 0x00000081, - EnterpriseSNEvaluation = 0x00000082, - Unknown83, - Unknown84, - Unknown85, - Unknown86, - Holographic = 0x00000087, - HolographicBusiness = 0x00000088, - Unknown89 = 0x00000089, - ProSingleLanguage = 0x0000008A, - ProChina = 0x0000008B, - EnterpriseSubscription = 0x0000008C, - EnterpriseSubscriptionN = 0x0000008D, - Unknown8E, - DatacenterNanoServer = 0x0000008F, - StandardNanoServer = 0x00000090, - DatacenterAServerCore = 0x00000091, - StandardAServerCore = 0x00000092, - DatacenterWSServerCore = 0x00000093, - StandardWSServerCore = 0x00000094, - UtilityVM = 0x00000095, - Unknown96, - Unknown97, - Unknown98, - Unknown99, - Unknown9A, - Unknown9B, - Unknown9C, - Unknown9D, - Unknown9E, - DatacenterEvaluationServerCore = 0x0000009F, - StandardEvaluationServerCore = 0x000000A0, - ProWorkstation = 0x000000A1, - ProWorkstationN = 0x000000A2, - UnknownA3, - ProForEducation = 0x000000A4, - ProForEducationN = 0x000000A5, - UnknownA6, - UnknownA7, - AzureServerCore = 0x000000A8, - AzureNanoServer = 0x000000A9, - UnknownAA = 0x000000AA, - EnterpriseG = 0x000000AB, - EnterpriseGN = 0x000000AC, - UnknownAD, - UnknownAE, - ServerRDSH = 0x000000AF, - UnknownB0, - UnknownB1, - Cloud = 0x000000B2, - CloudN = 0x000000B3, - HubOS = 0x000000B4, - UnknownB5, - OneCoreUpdateOS = 0x000000B6, - CloudE = 0x000000B7, - Andromeda = 0x000000B8, - IoTOS = 0x000000B9, - CloudEN = 0x000000BA, - IoTEdgeOS = 0x000000BB, - IoTEnterprise = 0x000000BC, - Lite = 0x000000BD, - UnknownBE, - IoTEnterpriseS = 0x000000BF, - XboxSystemOS = 0x000000C0, - XboxNativeOS = 0x000000C1, - XboxGameOS = 0x000000C2, - XboxERAOS = 0x000000C3, - XboxDurangoHostOS = 0x000000C4, - XboxScarlettHostOS = 0x000000C5, - XboxKeystone = 0x000000C6, - WNC = 0x000000D2, - AzureStackHCIServerCore = 0x00000196, - DatacenterServerAzureEdition = 0x00000197, - DatacenterServerCoreAzureEdition = 0x00000198 - } - - public class CTAC - { - public string DeviceAttributes - { - get; set; - } - public string CallerAttributes - { - get; set; - } - public string Products - { - get; set; - } - public bool SyncCurrentVersionOnly - { - get; set; - } - - public CTAC() - { - } - - public CTAC(OSSkuId ReportingSku, - string ReportingVersion, - MachineType MachineType, - string FlightRing, - string FlightingBranchName, - string BranchReadinessLevel, - string CurrentBranch, - string ReleaseType, - bool SyncCurrentVersionOnly, - bool IsStore = false, - string ContentType = "Mainline", - bool IsVbsEnabled = true) : base() - { - BuildCTAC(ReportingSku, ReportingVersion, MachineType, FlightRing, FlightingBranchName, BranchReadinessLevel, CurrentBranch, ReleaseType, SyncCurrentVersionOnly, IsStore, ContentType, IsVbsEnabled); - } - - private void BuildCTAC( - OSSkuId ReportingSku, - string ReportingVersion, - MachineType MachineType, - string FlightRing, - string FlightingBranchName, - string BranchReadinessLevel, - string CurrentBranch, - string ReleaseType, - bool SyncCurrentVersionOnly, - bool IsStore = false, - string content = "Mainline", - bool IsVbsEnabled = true - ) - { - int flightEnabled = FlightRing == "Retail" ? 0 : 1; - string App = IsStore ? "WU_STORE" : "WU_OS"; - - string InstallType = "Client"; - string ReportingPFN = "Client.OS.rs2"; - string DeviceFamily = "Windows.Desktop"; - - if (ReportingSku == OSSkuId.Holographic) - { - InstallType = "FactoryOS"; - ReportingPFN = "HOLOLENS.OS.rs2"; - DeviceFamily = "Windows.Holographic"; - } - else if (ReportingSku == OSSkuId.IoTUAP) - { - InstallType = "IoTUAP"; - ReportingPFN = "IoTCore.OS.rs2"; - DeviceFamily = "Windows.IoTUAP"; - } - else if (ReportingSku == OSSkuId.MobileCore) - { - InstallType = "MobileCore"; - ReportingPFN = "Mobile.OS.rs2"; - DeviceFamily = "Windows.Mobile"; - } - else if (ReportingSku == OSSkuId.Lite) - { - InstallType = "FactoryOS"; - ReportingPFN = "WCOSDevice0.OS"; - DeviceFamily = "Windows.Core"; - } - else if (ReportingSku == OSSkuId.WNC) - { - InstallType = "Client"; - ReportingPFN = "WNC.OS"; - DeviceFamily = "Windows.Desktop"; - } - else if (ReportingSku == OSSkuId.Andromeda) - { - InstallType = "FactoryOS"; - ReportingPFN = "WCOSDevice1.OS"; - DeviceFamily = "Windows.Core"; - } - else if (ReportingSku == OSSkuId.HubOS) - { - InstallType = "FactoryOS"; - ReportingPFN = "WCOSDevice2.OS"; - DeviceFamily = "Windows.Core"; - } - else if (ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase) && ReportingSku.ToString().Contains("Core", StringComparison.InvariantCultureIgnoreCase)) - { - InstallType = "Server Core"; - ReportingPFN = "Server.OS"; - DeviceFamily = "Windows.Server"; - } - else if (ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase) && !ReportingSku.ToString().Contains("Core", StringComparison.InvariantCultureIgnoreCase)) - { - InstallType = "Server"; - ReportingPFN = "Server.OS"; - DeviceFamily = "Windows.Server"; - } - else if (ReportingSku == OSSkuId.PPIPro) - { - DeviceFamily = "Windows.Team"; - } - - DeviceAttributes = "E:IsContainerMgrInstalled=1&" + - $"FlightRing={FlightRing}&" + - "TelemetryLevel=3&" + - "HidOverGattReg=C:\\WINDOWS\\System32\\DriverStore\\FileRepository\\hidbthle.inf_amd64_0fc6b7cd4ccbc55c\\Microsoft.Bluetooth.Profiles.HidOverGatt.dll&" + - "AppVer=0.0.0.0&" + - "IsAutopilotRegistered=0&" + - "ProcessorIdentifier=Intel64 Family 6 Model 151 Stepping 2&" + - "OEMModel=RM-1085_1045&" + - "ProcessorManufacturer=GenuineIntel&" + - "InstallDate=1577722757&" + - "OEMModelBaseBoard=OEM Board Name&" + - $"BranchReadinessLevel={BranchReadinessLevel}&" + - "DataExpDateEpoch_20H1=1593425114&" + - "IsCloudDomainJoined=0&" + - "Bios=2019&" + - "DchuAmdGrfxVen=4098&" + - "IsDeviceRetailDemo=0&" + - $"FlightingBranchName={FlightingBranchName}&" + - "OSUILocale=en-US&" + - $"DeviceFamily={DeviceFamily}&" + - "UpgEx_20H1=Green&" + - $"WuClientVer={ReportingVersion}&" + - $"IsFlightingEnabled={flightEnabled}&" + - $"OSSkuId={(int)ReportingSku}&" + - "GStatus_20H1=2&" + - $"App={App}&" + - $"CurrentBranch={CurrentBranch}&" + - "InstallLanguage=en-US&" + - "OEMName_Uncleaned=MICROSOFTMDG&" + - $"InstallationType={InstallType}&" + - "AttrDataVer=264&" + - "IsEdgeWithChromiumInstalled=1&" + - "TimestampEpochString_20H1=1593425114&" + - $"OSVersion={ReportingVersion}&" + - "IsMDMEnrolled=0&" + - "TencentType=1&" + - $"FlightContent={content}&" + - "ActivationChannel=Retail&" + - "Steam=URL:steam protocol&" + - "Free=gt64&" + - "TencentReg=79 d0 01 d7 9f 54 d5 01&" + - "FirmwareVersion=7704&" + - "DchuAmdGrfxExists=1&" + - "SdbVer_20H1=2000000000&" + - "UpgEx_CO21H2=Green&" + - //$"OSArchitecture={MachineType.ToString().ToUpper()}&" + - $"OSArchitecture=AMD64&" + - "DefaultUserRegion=244&" + - $"ReleaseType={ReleaseType}&" + - "UpdateManagementGroup=2&" + - "MobileOperatorCommercialized=000-88&" + - "PhoneTargetingName=Lumia 950 XL&" + - "AllowInPlaceUpgrade=1&" + - "AllowUpgradesWithUnsupportedTPMOrCPU=1&" + - "CloudPBR=1&" + - "DataExpDateEpoch_19H1=1593425114&" + - "DataExpDateEpoch_21H1=1593425114&" + - "DataExpDateEpoch_21H2=1593425114&" + - "DataExpDateEpoch_CO21H2=1593425114&" + - "DataExpDateEpoch_CO21H2Setup=1593425114&" + - "DataVer_RS5=2000000000&" + - "DUScan=1&" + - "EKB19H2InstallCount=1&" + - "EKB19H2InstallTimeEpoch=1255000000&" + - "GenTelRunTimestamp_19H1=1593425114&" + - "GStatus_19H1=2&" + - "GStatus_19H1Setup=2&" + - "GStatus_20H1Setup=2&" + - "GStatus_21H2=2&" + - "GStatus_CO21H2=2&" + - "GStatus_CO21H2Setup=2&" + - "GStatus_RS5=2&" + - "MediaBranch=&" + - "ProcessorModel=12th Gen Intel(R) Core(TM) i9-12900K&" + - "SdbVer_19H1=2000000000&" + - "SecureBootCapable=1&" + - "TimestampEpochString_19H1=1593425114&" + - "TimestampEpochString_21H1=1593425114&" + - "TimestampEpochString_21H2=1593425114&" + - "TimestampEpochString_CO21H2=1593425114&" + - "TimestampEpochString_CO21H2Setup=1593425114&" + - "TPMVersion=2&" + - "UpdateOfferedDays=0&" + - "UpgEx_19H1=Green&" + - "UpgEx_21H1=Green&" + - "UpgEx_21H2=Green&" + - "UpgEx_NI22H2=Green&" + - "UpgEx_RS5=Green&" + - "UpgradeEligible=1&" + - "Version_RS5=2000000000&" + - $"IsRetailOS={FlightRing == "Retail"}&" + - $"MediaVersion={ReportingVersion}" + - $"IsVbsEnabled={(IsVbsEnabled ? 1 : 0)}"; - - if (ReportingSku is OSSkuId.EnterpriseS or OSSkuId.EnterpriseSN || ReportingSku.ToString().Contains("Server", StringComparison.InvariantCultureIgnoreCase)) - { - DeviceAttributes += "&BlockFeatureUpdates=1"; - } - - if (ReportingSku == OSSkuId.Holographic) - { - DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + - $"OneCoreSwV={ReportingVersion}&" + - "OneCoreManufacturerModelName=HoloLens&" + - "OneCoreManufacturer=Microsoft Corporation&" + - "OneCoreOperatorName=000-88"; - } - else if (ReportingSku == OSSkuId.HubOS) - { - DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + - $"OneCoreSwV={ReportingVersion}&" + - "OneCoreManufacturerModelName=Surface Hub 2X&" + - "OneCoreManufacturer=Microsoft Corporation&" + - "OneCoreOperatorName=000-88"; - } - else if (ReportingSku == OSSkuId.Andromeda) - { - DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + - $"OneCoreSwV={ReportingVersion}&" + - "OneCoreManufacturerModelName=Andromeda&" + - "OneCoreManufacturer=Microsoft Corporation&" + - "OneCoreOperatorName=000-88"; - } - else if (ReportingSku == OSSkuId.Lite) - { - DeviceAttributes += "&Product=ModernPC"; - DeviceAttributes += $"&OneCoreFwV={ReportingVersion}&" + - $"OneCoreSwV={ReportingVersion}&" + - "OneCoreManufacturerModelName=Santorini&" + - "OneCoreManufacturer=Microsoft Corporation&" + - "OneCoreOperatorName=000-88"; - } - - CallerAttributes = "E:Interactive=1&IsSeeker=1&SheddingAware=1&"; - if (IsStore) - { - CallerAttributes += "Acquisition=1&Id=Acquisition%3BMicrosoft.WindowsStore_8wekyb3d8bbwe&"; - } - else - { - CallerAttributes += "Id=UpdateOrchestrator&"; - } - Products = ""; - if (!IsStore) - { - Products = $"PN={ReportingPFN}.{MachineType}&Branch={CurrentBranch}&PrimaryOSProduct=1&Repairable=1&V={ReportingVersion};"; - } - - this.SyncCurrentVersionOnly = SyncCurrentVersionOnly; - } - - public static string GenerateDeviceId(string Manufacturer, string Family, string Product, string Sku) - { - string inputString = Manufacturer + "&" + Family + "&" + Product + "&" + Sku; - Guid guidFromString = ComputerHardwareIDProvider.Class5GuidFromString(inputString); - string guidString = $"{{{guidFromString}}}"; - return guidString; - } - } -} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs index d80a6203..6ee970b0 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/Constants.cs @@ -23,18 +23,16 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate { public static class Constants { - public const string ClientWebServiceServerNamespace = "http://www.microsoft.com/SoftwareDistribution/Server/ClientWebService"; - public const string WindowsUpdateAuthorizationSchema = "http://schemas.microsoft.com/msus/2014/10/WindowsUpdateAuthorization"; public const string Endpoint = "https://fe3cr.delivery.mp.microsoft.com/ClientWebService/client.asmx"; public const string ClientProtocolVersion = "2.50"; public const string OldCookieExpiration = "2016-07-27T07:18:09Z"; public const string LastChangeDate = "2015-10-21T17:01:07.1472913Z"; public const string SecurityExpirationTimestamp = "2044-08-02T20:09:03Z"; - public static readonly string Action = $"{ClientWebServiceServerNamespace}/"; + public static readonly string Action = $"{Models.Constants.ClientWebServiceServerNamespace}/"; public static readonly string UserAgent = $"Windows-Update-Agent/10.0.10011.16384 Client-Protocol/{ClientProtocolVersion}"; - public static readonly int[] InstalledNonLeafUpdateIDs = new int[] - { + public static readonly int[] InstalledNonLeafUpdateIDs = + [ 1, 2, 3, @@ -111,6 +109,6 @@ public static class Constants 161870057, 161870058, 161870059 - }; + ]; } } \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs new file mode 100644 index 00000000..e57ec8fc --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.Settings.cs @@ -0,0 +1,57 @@ +/* + * Copyright (c) ADeltaX and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +// +// Source: https://raw.githubusercontent.com/ADeltaX/ProtoBuildBot/main/src/BuildChecker/Classes/Helpers/CorrelationVector.cs +// Released under the MIT License (as of 2020-11-04) +// + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + internal partial class CorrelationVector + { + internal enum Settings + { + SYNCREFRESHINTERVAL, + QUEUEDRAININTERVAL, + SNAPSHOTSCHEDULEINTERVAL, + MAXEVENTSIZEINBYTES, + MAXEVENTSPERPOST, + SAMPLERATE, + MAXFILESSPACE, + UPLOADENABLED, + PERSISTENCE, + LATENCY, + HTTPTIMEOUTINTERVAL, + THREADSTOUSEWITHEXECUTOR, + MAXCORRELATIONVECTORLENGTH, + MAXCRITICALCANADDATTEMPTS, + MAXRETRYPERIOD, + BASERETRYPERIOD, + CONSTANTFORRETRYPERIOD, + NORMALEVENTMEMORYQUEUESIZE, + CLLSETTINGSURL, + HOSTSETTINGSETAG, + CLLSETTINGSETAG, + VORTEXPRODURL + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs index 76038ee2..93196776 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/CorrelationVector.cs @@ -28,7 +28,7 @@ namespace UnifiedUpdatePlatform.Services.WindowsUpdate { - internal class CorrelationVector + internal partial class CorrelationVector { private string baseVector; private int currentVector; @@ -37,32 +37,6 @@ internal class CorrelationVector private readonly int id0Length = 16; private bool isInitialized = false; - internal enum Settings - { - SYNCREFRESHINTERVAL, - QUEUEDRAININTERVAL, - SNAPSHOTSCHEDULEINTERVAL, - MAXEVENTSIZEINBYTES, - MAXEVENTSPERPOST, - SAMPLERATE, - MAXFILESSPACE, - UPLOADENABLED, - PERSISTENCE, - LATENCY, - HTTPTIMEOUTINTERVAL, - THREADSTOUSEWITHEXECUTOR, - MAXCORRELATIONVECTORLENGTH, - MAXCRITICALCANADDATTEMPTS, - MAXRETRYPERIOD, - BASERETRYPERIOD, - CONSTANTFORRETRYPERIOD, - NORMALEVENTMEMORYQUEUESIZE, - CLLSETTINGSURL, - HOSTSETTINGSETAG, - CLLSETTINGSETAG, - VORTEXPRODURL - } - internal void Init() { baseVector = SeedCorrelationVector(); diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs index af5053ba..bfe1abbf 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Handler.cs @@ -26,11 +26,21 @@ using System.Net; using System.Net.Http; using System.Text.Json; -using System.Text.Json.Serialization; using System.Threading.Tasks; using System.Xml; using System.Xml.Serialization; -using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetCookie.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Request; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; namespace UnifiedUpdatePlatform.Services.WindowsUpdate { @@ -76,7 +86,7 @@ private static async Task PostToWindowsUpdateAsync(string method, string return resultString; } - private static CSOAPCommon.Envelope GetEnveloppe(string method, string authorizationToken, bool secured) + private static Envelope GetEnveloppe(string method, string authorizationToken, bool secured) { string _endpoint = Constants.Endpoint; if (secured) @@ -84,42 +94,42 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza _endpoint += "/secured"; } - CSOAPCommon.Envelope envelope = new() + Envelope envelope = new() { - Header = new CSOAPCommon.Header() + Header = new Header() { - Action = new CSOAPCommon.Action() + Action = new Models.FE3.SOAP.Common.Action() { MustUnderstand = "1", Text = Constants.Action + method }, MessageID = $"urn:uuid:{Guid.NewGuid():D}", - To = new CSOAPCommon.To() + To = new To() { MustUnderstand = "1", Text = _endpoint }, - Security = new CSOAPCommon.Security() + Security = new Security() { MustUnderstand = "1", - Timestamp = new CSOAPCommon.Timestamp() + Timestamp = new Timestamp() { Created = DateTime.Now.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"), Expires = Constants.SecurityExpirationTimestamp }, - WindowsUpdateTicketsToken = new CSOAPCommon.WindowsUpdateTicketsToken() + WindowsUpdateTicketsToken = new WindowsUpdateTicketsToken() { Id = "ClientMSA" } } }, - Body = new CSOAPCommon.Body() + Body = new Body() }; if (!string.IsNullOrEmpty(authorizationToken)) { - envelope.Header.Security.WindowsUpdateTicketsToken.TicketType = new CSOAPCommon.TicketType[] - { + envelope.Header.Security.WindowsUpdateTicketsToken.TicketType = + [ new() { Name = "MSA", @@ -133,7 +143,7 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza Version = "1.0", Policy = "MBI_SSL" } - }; + ]; } else { @@ -143,14 +153,14 @@ private static CSOAPCommon.Envelope GetEnveloppe(string method, string authoriza return envelope; } - private static string SerializeSOAPEnvelope(CSOAPCommon.Envelope envelope) + private static string SerializeSOAPEnvelope(Envelope envelope) { if (envelope == null) { return string.Empty; } - XmlSerializer xmlSerializer = new(typeof(CSOAPCommon.Envelope)); + XmlSerializer xmlSerializer = new(typeof(Envelope)); XmlSerializerNamespaces ns = new(); ns.Add("s", "http://www.w3.org/2003/05/soap-envelope"); @@ -162,20 +172,20 @@ private static string SerializeSOAPEnvelope(CSOAPCommon.Envelope envelope) return stringWriter.ToString().Replace("\r\n", "").Replace("\n", ""); } - private static CSOAPCommon.Envelope DeserializeSOAPEnvelope(string message) + private static Envelope DeserializeSOAPEnvelope(string message) { if (message == null) { return null; } - XmlSerializer xmlSerializer = new(typeof(CSOAPCommon.Envelope)); + XmlSerializer xmlSerializer = new(typeof(Envelope)); using StringReader stringReader = new(message); - return (CSOAPCommon.Envelope)xmlSerializer.Deserialize(stringReader); + return (Envelope)xmlSerializer.Deserialize(stringReader); } - private static CExtendedUpdateInfoXml.Xml DeserializeInfoXML(string xml) + private static Xml DeserializeInfoXML(string xml) { if (xml == null) { @@ -184,28 +194,28 @@ private static CExtendedUpdateInfoXml.Xml DeserializeInfoXML(string xml) string message = "" + xml + ""; - XmlSerializer xmlSerializer = new(typeof(CExtendedUpdateInfoXml.Xml)); + XmlSerializer xmlSerializer = new(typeof(Xml)); using StringReader stringReader = new(message); - return (CExtendedUpdateInfoXml.Xml)xmlSerializer.Deserialize(stringReader); + return (Xml)xmlSerializer.Deserialize(stringReader); } - private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string json) + private static AppxMetadataJson DeserializeAppxJSON(string json) { - return JsonSerializer.Deserialize(json); + return JsonSerializer.Deserialize(json); } #endregion Data manipulation #region WU functions - private static async Task<(CGetCookieResponse.GetCookieResponse, string)> GetCookie() + private static async Task<(GetCookieResponse, string)> GetCookie() { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetCookie", null, false); + Envelope envelope = GetEnveloppe("GetCookie", null, false); - envelope.Body.GetCookie = new CGetCookieRequest.GetCookie() + envelope.Body.GetCookie = new GetCookie() { - OldCookie = new CGetCookieRequest.OldCookie() + OldCookie = new OldCookie() { Expiration = Constants.OldCookieExpiration }, @@ -218,30 +228,30 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso string response = await PostToWindowsUpdateAsync("GetCookie", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetCookieResponse, response); } - private static async Task<(CGetExtendedUpdateInfoResponse.GetExtendedUpdateInfoResponse, string)> GetExtendedUpdateInfo( - CSOAPCommon.Cookie cookie, + private static async Task<(GetExtendedUpdateInfoResponse, string)> GetExtendedUpdateInfo( + Models.FE3.SOAP.Common.Cookie cookie, string token, string[] revisionId, CTAC ctac) { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo", token, false); + Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo", token, false); - envelope.Body.GetExtendedUpdateInfo = new CGetExtendedUpdateInfoRequest.GetExtendedUpdateInfo() + envelope.Body.GetExtendedUpdateInfo = new GetExtendedUpdateInfo() { Cookie = cookie, - RevisionIDs = new CGetExtendedUpdateInfoRequest.RevisionIDs() + RevisionIDs = new RevisionIDs() { Int = revisionId }, - InfoTypes = new CSOAPCommon.InfoTypes() + InfoTypes = new InfoTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "FileUrl", "FileDecryption", "Extended", @@ -250,11 +260,11 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso "Published", "Core", "VerificationRule" - } + ] }, - Locales = new CSOAPCommon.Locales() + Locales = new Locales() { - String = new string[] { "en-US", "en" } + String = ["en-US", "en"] }, DeviceAttributes = ctac.DeviceAttributes }; @@ -263,40 +273,40 @@ private static CAppxMetadataJSON.AppxMetadataJson DeserializeAppxJSON(string jso string response = await PostToWindowsUpdateAsync("GetCookie", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetExtendedUpdateInfoResponse, response); } - public static async Task<(CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string)> GetExtendedUpdateInfo2( + public static async Task<(GetExtendedUpdateInfo2Response, string)> GetExtendedUpdateInfo2( string token, string UpdateID, string RevisionNumber, CTAC ctac ) { - CSOAPCommon.Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo2", token, true); + Envelope envelope = GetEnveloppe("GetExtendedUpdateInfo2", token, true); - envelope.Body.GetExtendedUpdateInfo2 = new CGetExtendedUpdateInfo2Request.GetExtendedUpdateInfo2() + envelope.Body.GetExtendedUpdateInfo2 = new GetExtendedUpdateInfo2() { - UpdateIDs = new CGetExtendedUpdateInfo2Request.UpdateIDs() + UpdateIDs = new UpdateIDs() { - UpdateIdentity = new CGetExtendedUpdateInfo2Request.UpdateIdentity() + UpdateIdentity = new Models.FE3.SOAP.GetExtendedUpdateInfo2.Request.UpdateIdentity() { UpdateID = UpdateID, RevisionNumber = RevisionNumber } }, - InfoTypes = new CSOAPCommon.InfoTypes() + InfoTypes = new InfoTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "FileUrl", "FileDecryption", "EsrpDecryptionInformation", "PiecesHashUrl", "BlockMapUrl" - } + ] }, DeviceAttributes = ctac.DeviceAttributes }; @@ -305,13 +315,13 @@ CTAC ctac string response = await PostToWindowsUpdateAsync("GetExtendedUpdateInfo2", message, true); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope renvelope = DeserializeSOAPEnvelope(response); return (renvelope.Body.GetExtendedUpdateInfo2Response, response); } - private static async Task<(CSyncUpdatesResponse.SyncUpdatesResponse, string)> SyncUpdates( - CSOAPCommon.Cookie cookie, + private static async Task<(SyncUpdatesResponse, string)> SyncUpdates( + Models.FE3.SOAP.Common.Cookie cookie, string token, IEnumerable InstalledNonLeafUpdateIDs, IEnumerable OtherCachedUpdateIDs, @@ -323,58 +333,58 @@ CTAC ctac if (InstalledNonLeafUpdateIDs != null) { - List tmplist = _InstalledNonLeafUpdateIDs.ToList(); + List tmplist = [.. _InstalledNonLeafUpdateIDs]; tmplist.AddRange(InstalledNonLeafUpdateIDs); - _InstalledNonLeafUpdateIDs = tmplist.ToArray(); + _InstalledNonLeafUpdateIDs = [.. tmplist]; } - CSOAPCommon.Envelope envelope = GetEnveloppe("SyncUpdates", token, false); + Envelope envelope = GetEnveloppe("SyncUpdates", token, false); - envelope.Body.SyncUpdates = new CSyncUpdatesRequest.SyncUpdates() + envelope.Body.SyncUpdates = new SyncUpdates() { Cookie = cookie, - Parameters = new CSyncUpdatesRequest.Parameters() + Parameters = new Parameters() { ExpressQuery = "false", - InstalledNonLeafUpdateIDs = new CSyncUpdatesRequest.InstalledNonLeafUpdateIDs() + InstalledNonLeafUpdateIDs = new InstalledNonLeafUpdateIDs() { Int = _InstalledNonLeafUpdateIDs }, - OtherCachedUpdateIDs = new CSyncUpdatesRequest.OtherCachedUpdateIDs() + OtherCachedUpdateIDs = new OtherCachedUpdateIDs() { - Int = OtherCachedUpdateIDs != null ? OtherCachedUpdateIDs.ToArray() : Array.Empty() + Int = OtherCachedUpdateIDs != null ? OtherCachedUpdateIDs.ToArray() : [] }, SkipSoftwareSync = "false", NeedTwoGroupOutOfScopeUpdates = "true", - FilterAppCategoryIds = CategoryIdentifiers != null && CategoryIdentifiers.Length != 0 ? new CSyncUpdatesRequest.FilterAppCategoryIds() + FilterAppCategoryIds = CategoryIdentifiers != null && CategoryIdentifiers.Length != 0 ? new FilterAppCategoryIds() { - CategoryIdentifier = new CSyncUpdatesRequest.CategoryIdentifier() + CategoryIdentifier = new CategoryIdentifier() { - Id = CategoryIdentifiers ?? Array.Empty() + Id = CategoryIdentifiers ?? [] } } : null, AlsoPerformRegularSync = "false", ComputerSpec = "", - ExtendedUpdateInfoParameters = new CSyncUpdatesRequest.ExtendedUpdateInfoParameters() + ExtendedUpdateInfoParameters = new ExtendedUpdateInfoParameters() { - XmlUpdateFragmentTypes = new CSyncUpdatesRequest.XmlUpdateFragmentTypes() + XmlUpdateFragmentTypes = new XmlUpdateFragmentTypes() { - XmlUpdateFragmentType = new string[] - { + XmlUpdateFragmentType = + [ "Extended", "LocalizedProperties", "Eula", "Published", "Core" - } + ] }, - Locales = new CSOAPCommon.Locales() + Locales = new Locales() { - String = new string[] { "en-US", "en" } + String = ["en-US", "en"] } }, ClientPreferredLanguages = "", - ProductsParameters = new CSyncUpdatesRequest.ProductsParameters() + ProductsParameters = new ProductsParameters() { SyncCurrentVersionOnly = ctac.SyncCurrentVersionOnly ? "true" : "false", DeviceAttributes = ctac.DeviceAttributes, @@ -388,9 +398,9 @@ CTAC ctac string response = await PostToWindowsUpdateAsync("SyncUpdates", message, false); - CSOAPCommon.Envelope renvelope = DeserializeSOAPEnvelope(response); + Envelope responseEnvelope = DeserializeSOAPEnvelope(response); - return (renvelope.Body.SyncUpdatesResponse, response); + return (responseEnvelope.Body.SyncUpdatesResponse, response); } #endregion WU functions @@ -399,12 +409,12 @@ CTAC ctac public static async Task> GetUpdates(string[] categoryIds, CTAC ctac, string token, FileExchangeV3UpdateFilter filter = FileExchangeV3UpdateFilter.Application) // Or ProductRelease { - (CGetCookieResponse.GetCookieResponse cookie, string cookieresp) = await GetCookie(); + (GetCookieResponse cookie, string cookieresp) = await GetCookie(); - HashSet InstalledNonLeafUpdateIDs = new(); - HashSet OtherCachedUpdateIDs = new(); + HashSet InstalledNonLeafUpdateIDs = []; + HashSet OtherCachedUpdateIDs = []; - HashSet<(CSyncUpdatesResponse.SyncUpdatesResponse, string)> responses = new(); + HashSet<(SyncUpdatesResponse, string)> responses = []; // // Scan all updates @@ -413,7 +423,7 @@ public static async Task> GetUpdates(string[] categoryId // while (true) { - (CSyncUpdatesResponse.SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? Array.Empty(), ctac); + (SyncUpdatesResponse, string) result = await SyncUpdates(cookie.GetCookieResult, token, InstalledNonLeafUpdateIDs, OtherCachedUpdateIDs, categoryIds ?? [], ctac); // Refresh the cookie cookie.GetCookieResult.EncryptedData = result.Item1.SyncUpdatesResult.NewCookie.EncryptedData; @@ -424,7 +434,7 @@ public static async Task> GetUpdates(string[] categoryId break; } - foreach (CSOAPCommon.Update update in result.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) + foreach (Update update in result.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) { _ = InstalledNonLeafUpdateIDs.Add(update.ID); _ = OtherCachedUpdateIDs.Add(update.ID); @@ -433,18 +443,18 @@ public static async Task> GetUpdates(string[] categoryId _ = responses.Add(result); } - HashSet updateDatas = new(); + HashSet updateDatas = []; - foreach ((CSyncUpdatesResponse.SyncUpdatesResponse, string) response in responses) + foreach ((SyncUpdatesResponse, string) response in responses) { - foreach (CSOAPCommon.Update update in response.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) + foreach (Update update in response.Item1.SyncUpdatesResult.ExtendedUpdateInfo.Updates.Update) { UpdateData data = new() { Update = update }; - foreach (CSyncUpdatesResponse.UpdateInfo updateInfo in response.Item1.SyncUpdatesResult.NewUpdates.UpdateInfo) + foreach (UpdateInfo updateInfo in response.Item1.SyncUpdatesResult.NewUpdates.UpdateInfo) { if (ulong.Parse(update.ID) == ulong.Parse(updateInfo.ID)) { @@ -453,7 +463,7 @@ public static async Task> GetUpdates(string[] categoryId } } - CExtendedUpdateInfoXml.Xml updateXml = DeserializeInfoXML(data.Update.Xml + data.UpdateInfo.Xml); + Xml updateXml = DeserializeInfoXML(data.Update.Xml + data.UpdateInfo.Xml); data.Xml = updateXml; if (data.Xml.ApplicabilityRules?.Metadata?.AppxPackageMetadata?.AppxMetadata != null) @@ -466,7 +476,7 @@ public static async Task> GetUpdates(string[] categoryId UpdateData updateData = updateDatas.First(x => x.Update.ID == update.ID); if (data.Xml.LocalizedProperties == null) { - CExtendedUpdateInfoXml.Xml backup = updateData.Xml; + Xml backup = updateData.Xml; updateData.Xml = data.Xml; updateData.Xml.LocalizedProperties = backup.LocalizedProperties; @@ -486,7 +496,7 @@ public static async Task> GetUpdates(string[] categoryId } } - HashSet relevantUpdateDatas = new(); + HashSet relevantUpdateDatas = []; foreach (UpdateData updateData in updateDatas) { @@ -509,16 +519,16 @@ public static async Task> GetUpdates(string[] categoryId public static async Task GetFileUrl(UpdateData updateData, string fileDigest, string token = null) { - (CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); + (GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); - if (updateData.Xml?.Files?.File?.FirstOrDefault(x => x.AdditionalDigest?.Text == fileDigest) is CExtendedUpdateInfoXml.File file) + if (updateData.Xml?.Files?.File?.FirstOrDefault(x => x.AdditionalDigest?.Text == fileDigest) is Models.FE3.XML.ExtendedUpdateInfo.File file) { fileDigest = file.Digest; } if (result.Item1.GetExtendedUpdateInfo2Result.FileLocations != null) { - foreach (CGetExtendedUpdateInfo2Response.FileLocation fileLocation in result.Item1.GetExtendedUpdateInfo2Result.FileLocations.FileLocation) + foreach (FileLocation fileLocation in result.Item1.GetExtendedUpdateInfo2Result.FileLocations.FileLocation) { if (fileLocation.FileDigest == fileDigest) { @@ -532,7 +542,7 @@ public static async Task GetFileUrl(Updat public static async Task> GetFileUrls(UpdateData updateData, string token = null) { - (CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); + (GetExtendedUpdateInfo2Response, string) result = await GetExtendedUpdateInfo2(token, updateData.Xml.UpdateIdentity.UpdateID, updateData.Xml.UpdateIdentity.RevisionNumber, updateData.CTAC); updateData.GEI2Response = result.Item2; @@ -541,136 +551,4 @@ public static async Task> Get #endregion File url specific functions } - - public enum FileExchangeV3UpdateFilter - { - ProductRelease, - Application, - OSFlight - } - - public class FileExchangeV3FileDownloadInformation - { - public string DownloadUrl - { - get; - } - - public bool IsEncrypted => EsrpDecryptionInformation != null; - - public DateTime ExpirationDate - { - get - { - DateTime dateTime = DateTime.MaxValue; - try - { - long value = long.Parse(DownloadUrl.Split("P1=")[1].Split("&")[0]); - dateTime = DateTimeOffset.FromUnixTimeSeconds(value).ToLocalTime().DateTime; - } - catch { } - return dateTime; - } - } - - public bool IsDownloadable => ExpirationDate > DateTime.Now; - - public TimeSpan TimeLeft => IsDownloadable ? DateTime.Now - ExpirationDate : new TimeSpan(0); - - public EsrpDecryptionInformation EsrpDecryptionInformation { get; set; } = null; - - public string Digest - { - get; - } - - internal FileExchangeV3FileDownloadInformation(CGetExtendedUpdateInfo2Response.FileLocation fileLocation) - { - DownloadUrl = fileLocation.Url; - if (!string.IsNullOrEmpty(fileLocation.EsrpDecryptionInformation)) - { - EsrpDecryptionInformation = EsrpDecryptionInformation.DeserializeFromJson(fileLocation.EsrpDecryptionInformation); - } - Digest = fileLocation.FileDigest; - } - - public override bool Equals(object obj) - { - return obj is FileExchangeV3FileDownloadInformation info && info.Digest == Digest; - } - - public override int GetHashCode() - { - return Digest.GetHashCode(); - } - - public async Task DecryptAsync(string InputFile, string OutputFile) - { - if (!IsEncrypted) - { - return false; - } - - try - { - using EsrpDecryptor esrp = new(EsrpDecryptionInformation); - await esrp.DecryptFileAsync(InputFile, OutputFile); - return true; - } - catch { } - - return false; - } - } - - public class UpdateData - { - [JsonPropertyName("UpdateInfo")] - public CSyncUpdatesResponse.UpdateInfo UpdateInfo - { - get; set; - } - - [JsonPropertyName("Update")] - public CSOAPCommon.Update Update - { - get; set; - } - - [JsonPropertyName("Xml")] - public CExtendedUpdateInfoXml.Xml Xml - { - get; set; - } - - [JsonPropertyName("AppxMetadata")] - public CAppxMetadataJSON.AppxMetadataJson AppxMetadata - { - get; set; - } - - [JsonPropertyName("CTAC")] - public CTAC CTAC - { - get; set; - } - - [JsonPropertyName("SyncUpdatesResponse")] - public string SyncUpdatesResponse - { - get; set; - } - - [JsonPropertyName("GEI2Response")] - public string GEI2Response - { - get; set; - } - - [JsonPropertyName("CompDBs")] - public HashSet CompDBs - { - get; set; - } - } } \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs deleted file mode 100644 index 9afb681f..00000000 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FE3Objects.cs +++ /dev/null @@ -1,2375 +0,0 @@ -/* - * Copyright (c) Gustave Monce and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Json; -using System.Text; -using System.Text.Json.Serialization; -using System.Xml; -using System.Xml.Serialization; - -namespace UnifiedUpdatePlatform.Services.WindowsUpdate -{ - #region XML Objects - public static class CSOAPCommon - { - [XmlRoot(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] - public class Action - { - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Update - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Xml - { - get; set; - } - } - - [XmlRoot(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Updates - { - [XmlElement(ElementName = "Update", Namespace = Constants.ClientWebServiceServerNamespace)] - public Update[] Update - { - get; set; - } - } - - [XmlRoot(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public class InfoTypes - { - [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] XmlUpdateFragmentType - { - get; set; - } - } - - [XmlRoot(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OutOfScopeRevisionIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Locales - { - [XmlElement(ElementName = "string", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] String - { - get; set; - } - } - - public class Cookie - { - [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Expiration - { - get; set; - } - - [XmlElement(ElementName = "EncryptedData", Namespace = Constants.ClientWebServiceServerNamespace)] - public string EncryptedData - { - get; set; - } - } - - [XmlRoot(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] - public class To - { - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public class Timestamp - { - [XmlElement(ElementName = "Created", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Created - { - get; set; - } - - [XmlElement(ElementName = "Expires", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Expires - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - - [XmlAttribute(AttributeName = "Id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Id - { - get; set; - } - } - - [XmlRoot(ElementName = "TicketType")] - public class TicketType - { - [XmlElement(ElementName = "User")] - public string User - { - get; set; - } - - [XmlAttribute(AttributeName = "Name")] - public string Name - { - get; set; - } - - [XmlAttribute(AttributeName = "Version")] - public string Version - { - get; set; - } - - [XmlAttribute(AttributeName = "Policy")] - public string Policy - { - get; set; - } - } - - [XmlRoot(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] - public class WindowsUpdateTicketsToken - { - [XmlNamespaceDeclarations] - public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { - new("wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"), - new("wuws", Constants.WindowsUpdateAuthorizationSchema) - } - ); - - [XmlElement(ElementName = "TicketType", Namespace = "")] - public TicketType[] TicketType - { - get; set; - } - - [XmlAttribute(AttributeName = "id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public string Id - { - get; set; - } - - [XmlAttribute(AttributeName = "wsu", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Wsu - { - get; set; - } - - [XmlAttribute(AttributeName = "wuws", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Wuws - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] - public class Security - { - [XmlNamespaceDeclarations] - public XmlSerializerNamespaces ns = new( - new XmlQualifiedName[] - { - new("o", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") - } - ); - - [XmlElement(ElementName = "Timestamp", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] - public Timestamp Timestamp - { - get; set; - } - - [XmlElement(ElementName = "WindowsUpdateTicketsToken", Namespace = Constants.WindowsUpdateAuthorizationSchema)] - public WindowsUpdateTicketsToken WindowsUpdateTicketsToken - { - get; set; - } - - [XmlAttribute(AttributeName = "mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public string MustUnderstand - { - get; set; - } - - [XmlAttribute(AttributeName = "o", Namespace = "http://www.w3.org/2000/xmlns/")] - public string O - { - get; set; - } - } - - [XmlRoot(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Header - { - [XmlElement(ElementName = "Action", Namespace = "http://www.w3.org/2005/08/addressing")] - public Action Action - { - get; set; - } - - [XmlElement(ElementName = "MessageID", Namespace = "http://www.w3.org/2005/08/addressing")] - public string MessageID - { - get; set; - } - - [XmlElement(ElementName = "To", Namespace = "http://www.w3.org/2005/08/addressing")] - public To To - { - get; set; - } - - [XmlElement(ElementName = "RelatesTo", Namespace = "http://www.w3.org/2005/08/addressing")] - public string RelatesTo - { - get; set; - } - - [XmlElement(ElementName = "Security", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] - public Security Security - { - get; set; - } - } - - [XmlRoot(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Body - { - [XmlAttribute(AttributeName = "xsi", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsi - { - get; set; - } - - [XmlAttribute(AttributeName = "xsd", Namespace = "http://www.w3.org/2000/xmlns/")] - public string Xsd - { - get; set; - } - - // - // Requests - // - - [XmlElement(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetCookieRequest.GetCookie GetCookie - { - get; set; - } - - [XmlElement(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSyncUpdatesRequest.SyncUpdates SyncUpdates - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfoRequest.GetExtendedUpdateInfo GetExtendedUpdateInfo - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfo2Request.GetExtendedUpdateInfo2 GetExtendedUpdateInfo2 - { - get; set; - } - - // - // Responses - // - - [XmlElement(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetCookieResponse.GetCookieResponse GetCookieResponse - { - get; set; - } - - [XmlElement(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSyncUpdatesResponse.SyncUpdatesResponse SyncUpdatesResponse - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfoResponse.GetExtendedUpdateInfoResponse GetExtendedUpdateInfoResponse - { - get; set; - } - - [XmlElement(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] - public CGetExtendedUpdateInfo2Response.GetExtendedUpdateInfo2Response GetExtendedUpdateInfo2Response - { - get; set; - } - } - - [XmlRoot(ElementName = "Envelope", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public class Envelope - { - [XmlElement(ElementName = "Header", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public Header Header - { - get; set; - } - - [XmlElement(ElementName = "Body", Namespace = "http://www.w3.org/2003/05/soap-envelope")] - public Body Body - { - get; set; - } - - [XmlAttribute(AttributeName = "a", Namespace = "http://www.w3.org/2000/xmlns/")] - public string A - { - get; set; - } - - [XmlAttribute(AttributeName = "s", Namespace = "http://www.w3.org/2000/xmlns/")] - public string S - { - get; set; - } - - [XmlAttribute(AttributeName = "u", Namespace = "http://www.w3.org/2000/xmlns/")] - public string U - { - get; set; - } - } - } - - public static class CGetCookieRequest - { - [XmlRoot(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OldCookie - { - [XmlElement(ElementName = "Expiration", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Expiration - { - get; set; - } - } - - [XmlRoot(ElementName = "GetCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetCookie - { - [XmlElement(ElementName = "oldCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public OldCookie OldCookie - { - get; set; - } - - [XmlElement(ElementName = "lastChange", Namespace = Constants.ClientWebServiceServerNamespace)] - public string LastChange - { - get; set; - } - - [XmlElement(ElementName = "currentTime", Namespace = Constants.ClientWebServiceServerNamespace)] - public string CurrentTime - { - get; set; - } - - [XmlElement(ElementName = "protocolVersion", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ProtocolVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetCookieResponse - { - [XmlRoot(ElementName = "GetCookieResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetCookieResponse - { - [XmlElement(ElementName = "GetCookieResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie GetCookieResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CSyncUpdatesRequest - { - [XmlRoot(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class InstalledNonLeafUpdateIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class OtherCachedUpdateIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] - public class CategoryIdentifier - { - [XmlElement(ElementName = "Id", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Id - { - get; set; - } - } - - [XmlRoot(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FilterAppCategoryIds - { - [XmlElement(ElementName = "CategoryIdentifier", Namespace = Constants.ClientWebServiceServerNamespace)] - public CategoryIdentifier CategoryIdentifier - { - get; set; - } - } - - [XmlRoot(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public class XmlUpdateFragmentTypes - { - [XmlElement(ElementName = "XmlUpdateFragmentType", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] XmlUpdateFragmentType - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ExtendedUpdateInfoParameters - { - [XmlElement(ElementName = "XmlUpdateFragmentTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public XmlUpdateFragmentTypes XmlUpdateFragmentTypes - { - get; set; - } - - [XmlElement(ElementName = "Locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Locales Locales - { - get; set; - } - } - - [XmlRoot(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ProductsParameters - { - [XmlElement(ElementName = "SyncCurrentVersionOnly", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SyncCurrentVersionOnly - { - get; set; - } - - [XmlElement(ElementName = "DeviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlElement(ElementName = "CallerAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string CallerAttributes - { - get; set; - } - - [XmlElement(ElementName = "Products", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Products - { - get; set; - } - } - - [XmlRoot(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Parameters - { - [XmlElement(ElementName = "ExpressQuery", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ExpressQuery - { - get; set; - } - - [XmlElement(ElementName = "InstalledNonLeafUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public InstalledNonLeafUpdateIDs InstalledNonLeafUpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "OtherCachedUpdateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public OtherCachedUpdateIDs OtherCachedUpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "SkipSoftwareSync", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SkipSoftwareSync - { - get; set; - } - - [XmlElement(ElementName = "NeedTwoGroupOutOfScopeUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public string NeedTwoGroupOutOfScopeUpdates - { - get; set; - } - - [XmlElement(ElementName = "FilterAppCategoryIds", Namespace = Constants.ClientWebServiceServerNamespace)] - public FilterAppCategoryIds FilterAppCategoryIds - { - get; set; - } - - [XmlElement(ElementName = "AlsoPerformRegularSync", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AlsoPerformRegularSync - { - get; set; - } - - [XmlElement(ElementName = "ComputerSpec", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ComputerSpec - { - get; set; - } - - [XmlElement(ElementName = "ExtendedUpdateInfoParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public ExtendedUpdateInfoParameters ExtendedUpdateInfoParameters - { - get; set; - } - - [XmlElement(ElementName = "ClientPreferredLanguages", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ClientPreferredLanguages - { - get; set; - } - - [XmlElement(ElementName = "ProductsParameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public ProductsParameters ProductsParameters - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdates - { - [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie Cookie - { - get; set; - } - - [XmlElement(ElementName = "parameters", Namespace = Constants.ClientWebServiceServerNamespace)] - public Parameters Parameters - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CSyncUpdatesResponse - { - [XmlRoot(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Deployment - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Action", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Action2 - { - get; set; - } - - [XmlElement(ElementName = "IsAssigned", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsAssigned - { - get; set; - } - - [XmlElement(ElementName = "LastChangeTime", Namespace = Constants.ClientWebServiceServerNamespace)] - public string LastChangeTime - { - get; set; - } - - [XmlElement(ElementName = "AutoSelect", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AutoSelect - { - get; set; - } - - [XmlElement(ElementName = "AutoDownload", Namespace = Constants.ClientWebServiceServerNamespace)] - public string AutoDownload - { - get; set; - } - - [XmlElement(ElementName = "SupersedenceBehavior", Namespace = Constants.ClientWebServiceServerNamespace)] - public string SupersedenceBehavior - { - get; set; - } - - [XmlElement(ElementName = "Priority", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Priority - { - get; set; - } - - [XmlElement(ElementName = "HandlerSpecificAction", Namespace = Constants.ClientWebServiceServerNamespace)] - public string HandlerSpecificAction - { - get; set; - } - - [XmlElement(ElementName = "FlightId", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FlightId - { - get; set; - } - - [XmlElement(ElementName = "FlightMetadata", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FlightMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateInfo - { - [XmlElement(ElementName = "ID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string ID - { - get; set; - } - - [XmlElement(ElementName = "Deployment", Namespace = Constants.ClientWebServiceServerNamespace)] - public Deployment Deployment - { - get; set; - } - - [XmlElement(ElementName = "IsLeaf", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsLeaf - { - get; set; - } - - [XmlElement(ElementName = "IsShared", Namespace = Constants.ClientWebServiceServerNamespace)] - public string IsShared - { - get; set; - } - - [XmlElement(ElementName = "Xml", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Xml - { - get; set; - } - } - - [XmlRoot(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public class NewUpdates - { - [XmlElement(ElementName = "UpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateInfo[] UpdateInfo - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class ExtendedUpdateInfo - { - [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Updates Updates - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdatesResult - { - [XmlElement(ElementName = "NewUpdates", Namespace = Constants.ClientWebServiceServerNamespace)] - public NewUpdates NewUpdates - { - get; set; - } - - [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.OutOfScopeRevisionIDs OutOfScopeRevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "Truncated", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Truncated - { - get; set; - } - - [XmlElement(ElementName = "NewCookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie NewCookie - { - get; set; - } - - [XmlElement(ElementName = "DriverSyncNotNeeded", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DriverSyncNotNeeded - { - get; set; - } - - [XmlElement(ElementName = "ExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public ExtendedUpdateInfo ExtendedUpdateInfo - { - get; set; - } - } - - [XmlRoot(ElementName = "SyncUpdatesResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SyncUpdatesResponse - { - [XmlElement(ElementName = "SyncUpdatesResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public SyncUpdatesResult SyncUpdatesResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfo2Request - { - [XmlRoot(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateIdentity - { - [XmlElement(ElementName = "UpdateID", Namespace = Constants.ClientWebServiceServerNamespace)] - public string UpdateID - { - get; set; - } - - [XmlElement(ElementName = "RevisionNumber", Namespace = Constants.ClientWebServiceServerNamespace)] - public string RevisionNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class UpdateIDs - { - [XmlElement(ElementName = "UpdateIdentity", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateIdentity UpdateIdentity - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2 - { - [XmlElement(ElementName = "updateIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public UpdateIDs UpdateIDs - { - get; set; - } - - [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.InfoTypes InfoTypes - { - get; set; - } - - [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfo2Response - { - [XmlRoot(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileLocation - { - [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FileDigest - { - get; set; - } - - [XmlElement(ElementName = "Url", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Url - { - get; set; - } - - [XmlElement(ElementName = "PiecesHashUrl", Namespace = Constants.ClientWebServiceServerNamespace)] - public string PiecesHashUrl - { - get; set; - } - - [XmlElement(ElementName = "BlockMapUrl", Namespace = Constants.ClientWebServiceServerNamespace)] - public string BlockMapUrl - { - get; set; - } - - [XmlElement(ElementName = "EsrpDecryptionInformation", Namespace = Constants.ClientWebServiceServerNamespace)] - public string EsrpDecryptionInformation - { - get; set; - } - } - - [XmlRoot(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileLocations - { - [XmlElement(ElementName = "FileLocation", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileLocation[] FileLocation - { - get; set; - } - } - - [XmlRoot(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileDecryptionData - { - [XmlElement(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileDecryption FileDecryption - { - get; set; - } - } - - [XmlRoot(ElementName = "FileDecryption", Namespace = Constants.ClientWebServiceServerNamespace)] - public class FileDecryption - { - [XmlElement(ElementName = "FileDigest", Namespace = Constants.ClientWebServiceServerNamespace)] - public string FileDigest - { - get; set; - } - - [XmlElement(ElementName = "DecryptionKey", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DecryptionKey - { - get; set; - } - - [XmlElement(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] - public SecurityData SecurityData - { - get; set; - } - } - - [XmlRoot(ElementName = "SecurityData", Namespace = Constants.ClientWebServiceServerNamespace)] - public class SecurityData - { - [XmlElement(ElementName = "base64Binary", Namespace = Constants.ClientWebServiceServerNamespace)] - public string Base64Binary - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2Result - { - [XmlElement(ElementName = "FileLocations", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileLocations FileLocations - { - get; set; - } - - [XmlElement(ElementName = "FileDecryptionData", Namespace = Constants.ClientWebServiceServerNamespace)] - public FileDecryptionData FileDecryptionData - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo2Response", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo2Response - { - [XmlElement(ElementName = "GetExtendedUpdateInfo2Result", Namespace = Constants.ClientWebServiceServerNamespace)] - public GetExtendedUpdateInfo2Result GetExtendedUpdateInfo2Result - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfoRequest - { - [XmlRoot(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public class RevisionIDs - { - [XmlElement(ElementName = "int", Namespace = Constants.ClientWebServiceServerNamespace)] - public string[] Int - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfo", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfo - { - [XmlElement(ElementName = "cookie", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Cookie Cookie - { - get; set; - } - - [XmlElement(ElementName = "revisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public RevisionIDs RevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "infoTypes", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.InfoTypes InfoTypes - { - get; set; - } - - [XmlElement(ElementName = "locales", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Locales Locales - { - get; set; - } - - [XmlElement(ElementName = "deviceAttributes", Namespace = Constants.ClientWebServiceServerNamespace)] - public string DeviceAttributes - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - } - - public static class CGetExtendedUpdateInfoResponse - { - [XmlRoot(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfoResult - { - [XmlElement(ElementName = "OutOfScopeRevisionIDs", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.OutOfScopeRevisionIDs OutOfScopeRevisionIDs - { - get; set; - } - - [XmlElement(ElementName = "Updates", Namespace = Constants.ClientWebServiceServerNamespace)] - public CSOAPCommon.Updates Updates - { - get; set; - } - } - - [XmlRoot(ElementName = "GetExtendedUpdateInfoResponse", Namespace = Constants.ClientWebServiceServerNamespace)] - public class GetExtendedUpdateInfoResponse - { - [XmlElement(ElementName = "GetExtendedUpdateInfoResult", Namespace = Constants.ClientWebServiceServerNamespace)] - public GetExtendedUpdateInfoResult GetExtendedUpdateInfoResult - { - get; set; - } - - [XmlAttribute(AttributeName = "xmlns")] - public string Xmlns - { - get; set; - } - } - - [XmlRoot(ElementName = "Verification", Namespace = Constants.ClientWebServiceServerNamespace)] - public class Verification - { - [XmlAttribute(AttributeName = "Timestamp")] - public string Timestamp - { - get; set; - } - - [XmlAttribute(AttributeName = "LeafCertificateId")] - public string LeafCertificateId - { - get; set; - } - - [XmlAttribute(AttributeName = "Signature")] - public string Signature - { - get; set; - } - - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - } - } - - public static class CExtendedUpdateInfoXml - { - [XmlRoot(ElementName = "LocalizedProperties")] - public class LocalizedProperties - { - [XmlElement(ElementName = "Language")] - public string Language - { - get; set; - } - - [XmlElement(ElementName = "Title")] - public string Title - { - get; set; - } - - [XmlElement(ElementName = "Description")] - public string Description - { - get; set; - } - } - - [XmlRoot(ElementName = "UpdateIdentity")] - public class UpdateIdentity - { - [XmlAttribute(AttributeName = "UpdateID")] - public string UpdateID - { - get; set; - } - - [XmlAttribute(AttributeName = "RevisionNumber")] - public string RevisionNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "Properties")] - public class Properties - { - [XmlAttribute(AttributeName = "UpdateType")] - public string UpdateType - { - get; set; - } - - [XmlAttribute(AttributeName = "PerUser")] - public string PerUser - { - get; set; - } - - [XmlElement(ElementName = "SecuredFragment")] - public string SecuredFragment - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageRank")] - public string PackageRank - { - get; set; - } - - [XmlAttribute(AttributeName = "ExplicitlyDeployable")] - public string ExplicitlyDeployable - { - get; set; - } - - [XmlAttribute(AttributeName = "ApplyPackageRank")] - public string ApplyPackageRank - { - get; set; - } - } - - [XmlRoot(ElementName = "b.WindowsVersion")] - public class BWindowsVersion - { - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "MajorVersion")] - public string MajorVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "MinorVersion")] - public string MinorVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "BuildNumber")] - public string BuildNumber - { - get; set; - } - } - - [XmlRoot(ElementName = "IsInstalled")] - public class IsInstalled - { - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "True")] - public string True - { - get; set; - } - - [XmlElement(ElementName = "Or")] - public Or Or - { - get; set; - } - - [XmlElement(ElementName = "And")] - public And And - { - get; set; - } - - [XmlElement(ElementName = "b.WmiQuery")] - public BWmiQuery BWmiQuery - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - - [XmlElement(ElementName = "b.SystemMetric")] - public BSystemMetric BSystemMetric - { - get; set; - } - - [XmlElement(ElementName = "b.Memory")] - public BMemory BMemory - { - get; set; - } - - [XmlElement(ElementName = "b.Direct3D")] - public BDirect3D BDirect3D - { - get; set; - } - - [XmlElement(ElementName = "b.SensorById")] - public BSensorById BSensorById - { - get; set; - } - - [XmlElement(ElementName = "b.Camera")] - public BCamera BCamera - { - get; set; - } - - [XmlElement(ElementName = "b.NFC")] - public BNFC BNFC - { - get; set; - } - - [XmlElement(ElementName = "b.VideoMemory")] - public BVideoMemory BVideoMemory - { - get; set; - } - - [XmlElement(ElementName = "AppxPackageInstalled")] - public string AppxPackageInstalled - { - get; set; - } - } - - [XmlRoot(ElementName = "ApplicabilityRules")] - public class ApplicabilityRules - { - [XmlElement(ElementName = "IsInstalled")] - public IsInstalled IsInstalled - { - get; set; - } - - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "Metadata")] - public Metadata Metadata - { - get; set; - } - - [XmlElement(ElementName = "IsInstallable")] - public IsInstallable IsInstallable - { - get; set; - } - } - - [XmlRoot(ElementName = "Xml")] - public class Xml - { - [XmlElement(ElementName = "LocalizedProperties")] - public LocalizedProperties LocalizedProperties - { - get; set; - } - - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity UpdateIdentity - { - get; set; - } - - [XmlElement(ElementName = "Properties")] - public Properties Properties - { - get; set; - } - - [XmlElement(ElementName = "ApplicabilityRules")] - public ApplicabilityRules ApplicabilityRules - { - get; set; - } - - [XmlElement(ElementName = "ExtendedProperties")] - public ExtendedProperties ExtendedProperties - { - get; set; - } - - [XmlElement(ElementName = "HandlerSpecificData")] - public HandlerSpecificData HandlerSpecificData - { - get; set; - } - - [XmlElement(ElementName = "Relationships")] - public Relationships Relationships - { - get; set; - } - - [XmlElement(ElementName = "Files")] - public Files Files - { - get; set; - } - } - - [XmlRoot(ElementName = "ExtendedProperties")] - public class ExtendedProperties - { - [XmlAttribute(AttributeName = "DefaultPropertiesLanguage")] - public string DefaultPropertiesLanguage - { - get; set; - } - - [XmlAttribute(AttributeName = "Handler")] - public string Handler - { - get; set; - } - - [XmlAttribute(AttributeName = "CreationDate")] - public string CreationDate - { - get; set; - } - - [XmlAttribute(AttributeName = "IsAppxFramework")] - public string IsAppxFramework - { - get; set; - } - - [XmlAttribute(AttributeName = "CompatibleProtocolVersion")] - public string CompatibleProtocolVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "FromStoreService")] - public string FromStoreService - { - get; set; - } - - [XmlAttribute(AttributeName = "ContentType")] - public string ContentType - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageIdentityName")] - public string PackageIdentityName - { - get; set; - } - - [XmlAttribute(AttributeName = "LegacyMobileProductId")] - public string LegacyMobileProductId - { - get; set; - } - - [XmlElement(ElementName = "InstallationBehavior")] - public string InstallationBehavior - { - get; set; - } - - [XmlAttribute(AttributeName = "MaxDownloadSize")] - public string MaxDownloadSize - { - get; set; - } - - [XmlAttribute(AttributeName = "MinDownloadSize")] - public string MinDownloadSize - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageContentId")] - public string PackageContentId - { - get; set; - } - - [XmlAttribute(AttributeName = "ProductName")] - public string ProductName - { - get; set; - } - - [XmlAttribute(AttributeName = "ReleaseVersion")] - public string ReleaseVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "AutoSelectOnWebsites")] - public string AutoSelectOnWebsites - { - get; set; - } - - [XmlAttribute(AttributeName = "BrowseOnly")] - public string BrowseOnly - { - get; set; - } - } - - [XmlRoot(ElementName = "CategoryInformation")] - public class CategoryInformation - { - [XmlAttribute(AttributeName = "CategoryType")] - public string CategoryType - { - get; set; - } - - [XmlAttribute(AttributeName = "ProhibitsSubcategories")] - public string ProhibitsSubcategories - { - get; set; - } - - [XmlAttribute(AttributeName = "ProhibitsUpdates")] - public string ProhibitsUpdates - { - get; set; - } - - [XmlAttribute(AttributeName = "DisplayOrder")] - public string DisplayOrder - { - get; set; - } - - [XmlAttribute(AttributeName = "ExcludedByDefault")] - public string ExcludedByDefault - { - get; set; - } - } - - [XmlRoot(ElementName = "HandlerSpecificData")] - public class HandlerSpecificData - { - [XmlElement(ElementName = "CategoryInformation")] - public CategoryInformation CategoryInformation - { - get; set; - } - - [XmlAttribute(AttributeName = "type")] - public string Type - { - get; set; - } - - [XmlElement(ElementName = "AppxPackageInstallData")] - public AppxPackageInstallData AppxPackageInstallData - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegValueExists")] - public class BRegValueExists - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Type")] - public string Type - { - get; set; - } - - [XmlAttribute(AttributeName = "RegType32")] - public string RegType32 - { - get; set; - } - } - - [XmlRoot(ElementName = "Not")] - public class Not - { - [XmlElement(ElementName = "b.RegValueExists")] - public BRegValueExists BRegValueExists - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword BRegDword - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegDword")] - public class BRegDword - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Data")] - public string Data - { - get; set; - } - } - - [XmlRoot(ElementName = "Or")] - public class Or - { - [XmlElement(ElementName = "Not")] - public Not Not - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword BRegDword - { - get; set; - } - - [XmlElement(ElementName = "And")] - public And[] And - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion BWindowsVersion - { - get; set; - } - - /*[XmlElement(ElementName = "Or")] - public Or Or { get; set; }*/ // TODO: fix - } - - [XmlRoot(ElementName = "And")] - public class And - { - [XmlElement(ElementName = "b.WindowsVersion")] - public BWindowsVersion[] BWindowsVersion - { - get; set; - } - - [XmlElement(ElementName = "Not")] - public Not[] Not - { - get; set; - } - - [XmlElement(ElementName = "b.RegDword")] - public BRegDword[] BRegDword - { - get; set; - } - - [XmlElement(ElementName = "Or")] - public Or[] Or - { - get; set; - } - - [XmlElement(ElementName = "b.SystemMetric")] - public BSystemMetric[] BSystemMetric - { - get; set; - } - - [XmlElement(ElementName = "b.RegSz")] - public BRegSz BRegSz - { - get; set; - } - } - - [XmlRoot(ElementName = "b.WmiQuery")] - public class BWmiQuery - { - [XmlAttribute(AttributeName = "Namespace")] - public string Namespace - { - get; set; - } - - [XmlAttribute(AttributeName = "WqlQuery")] - public string WqlQuery - { - get; set; - } - } - - [XmlRoot(ElementName = "b.SystemMetric")] - public class BSystemMetric - { - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Index")] - public string Index - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - } - - [XmlRoot(ElementName = "b.RegSz")] - public class BRegSz - { - [XmlAttribute(AttributeName = "Key")] - public string Key - { - get; set; - } - - [XmlAttribute(AttributeName = "Subkey")] - public string Subkey - { - get; set; - } - - [XmlAttribute(AttributeName = "Value")] - public string Value - { - get; set; - } - - [XmlAttribute(AttributeName = "Comparison")] - public string Comparison - { - get; set; - } - - [XmlAttribute(AttributeName = "Data")] - public string Data - { - get; set; - } - - [XmlAttribute(AttributeName = "RegType32")] - public string RegType32 - { - get; set; - } - } - - [XmlRoot(ElementName = "Prerequisites")] - public class Prerequisites - { - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity[] UpdateIdentity - { - get; set; - } - - [XmlElement(ElementName = "AtLeastOne")] - public AtLeastOne[] AtLeastOne - { - get; set; - } - } - - [XmlRoot(ElementName = "Relationships")] - public class Relationships - { - [XmlElement(ElementName = "Prerequisites")] - public Prerequisites Prerequisites - { - get; set; - } - - [XmlElement(ElementName = "BundledUpdates")] - public BundledUpdates BundledUpdates - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Memory")] - public class BMemory - { - [XmlAttribute(AttributeName = "MinSizeInMB")] - public string MinSizeInMB - { - get; set; - } - - [XmlAttribute(AttributeName = "Type")] - public string Type - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Direct3D")] - public class BDirect3D - { - [XmlAttribute(AttributeName = "HardwareVersion")] - public string HardwareVersion - { - get; set; - } - - [XmlAttribute(AttributeName = "FeatureLevelMajor")] - public string FeatureLevelMajor - { - get; set; - } - - [XmlAttribute(AttributeName = "FeatureLevelMinor")] - public string FeatureLevelMinor - { - get; set; - } - } - - [XmlRoot(ElementName = "b.SensorById")] - public class BSensorById - { - [XmlAttribute(AttributeName = "Id")] - public string Id - { - get; set; - } - } - - [XmlRoot(ElementName = "AtLeastOne")] - public class AtLeastOne - { - [XmlElement(ElementName = "UpdateIdentity")] - public UpdateIdentity[] UpdateIdentity - { - get; set; - } - - [XmlAttribute(AttributeName = "IsCategory")] - public string IsCategory - { - get; set; - } - } - - [XmlRoot(ElementName = "b.Camera")] - public class BCamera - { - [XmlAttribute(AttributeName = "Location")] - public string Location - { - get; set; - } - } - - [XmlRoot(ElementName = "b.NFC")] - public class BNFC - { - [XmlAttribute(AttributeName = "Capability")] - public string Capability - { - get; set; - } - } - - [XmlRoot(ElementName = "b.VideoMemory")] - public class BVideoMemory - { - [XmlAttribute(AttributeName = "MinSizeInMB")] - public string MinSizeInMB - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxFamilyMetadata")] - public class AppxFamilyMetadata - { - [XmlAttribute(AttributeName = "Name")] - public string Name - { - get; set; - } - - [XmlAttribute(AttributeName = "Publisher")] - public string Publisher - { - get; set; - } - - [XmlAttribute(AttributeName = "LegacyMobileProductId")] - public string LegacyMobileProductId - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxPackageMetadata")] - public class AppxPackageMetadata - { - [XmlElement(ElementName = "AppxFamilyMetadata")] - public AppxFamilyMetadata AppxFamilyMetadata - { - get; set; - } - - [XmlElement(ElementName = "AppxMetadata")] - public AppxMetadata AppxMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "Metadata")] - public class Metadata - { - [XmlElement(ElementName = "AppxPackageMetadata")] - public AppxPackageMetadata AppxPackageMetadata - { - get; set; - } - } - - [XmlRoot(ElementName = "IsInstallable")] - public class IsInstallable - { - [XmlElement(ElementName = "AppxPackageInstallable")] - public string AppxPackageInstallable - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxMetadata")] - public class AppxMetadata - { - [XmlElement(ElementName = "ApplicabilityBlob")] - public string ApplicabilityBlob - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageType")] - public string PackageType - { - get; set; - } - - [XmlAttribute(AttributeName = "IsAppxBundle")] - public string IsAppxBundle - { - get; set; - } - - [XmlAttribute(AttributeName = "PackageMoniker")] - public string PackageMoniker - { - get; set; - } - } - - [XmlRoot(ElementName = "BundledUpdates")] - public class BundledUpdates - { - [XmlElement(ElementName = "AtLeastOne")] - public AtLeastOne AtLeastOne - { - get; set; - } - } - - [XmlRoot(ElementName = "AdditionalDigest")] - public class AdditionalDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "PiecesHashDigest")] - public class PiecesHashDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "BlockMapDigest")] - public class BlockMapDigest - { - [XmlAttribute(AttributeName = "Algorithm")] - public string Algorithm - { - get; set; - } - - [XmlText] - public string Text - { - get; set; - } - } - - [XmlRoot(ElementName = "File")] - public class File - { - [XmlElement(ElementName = "AdditionalDigest")] - public AdditionalDigest AdditionalDigest - { - get; set; - } - - [XmlElement(ElementName = "PiecesHashDigest")] - public PiecesHashDigest PiecesHashDigest - { - get; set; - } - - [XmlElement(ElementName = "BlockMapDigest")] - public BlockMapDigest BlockMapDigest - { - get; set; - } - - [XmlAttribute(AttributeName = "FileName")] - public string FileName - { - get; set; - } - - [XmlAttribute(AttributeName = "Digest")] - public string Digest - { - get; set; - } - - [XmlAttribute(AttributeName = "DigestAlgorithm")] - public string DigestAlgorithm - { - get; set; - } - - [XmlAttribute(AttributeName = "Size")] - public string Size - { - get; set; - } - - [XmlAttribute(AttributeName = "Modified")] - public string Modified - { - get; set; - } - - [XmlAttribute(AttributeName = "InstallerSpecificIdentifier")] - public string InstallerSpecificIdentifier - { - get; set; - } - - [XmlAttribute(AttributeName = "PatchingType")] - public string PatchingType - { - get; set; - } - - public override string ToString() - { - return !string.IsNullOrEmpty(FileName) ? (PatchingType + ":" + FileName) : base.ToString(); - } - } - - [XmlRoot(ElementName = "Files")] - public class Files - { - [XmlElement(ElementName = "File")] - public File[] File - { - get; set; - } - } - - [XmlRoot(ElementName = "AppxPackageInstallData")] - public class AppxPackageInstallData - { - [XmlAttribute(AttributeName = "PackageFileName")] - public string PackageFileName - { - get; set; - } - - [XmlAttribute(AttributeName = "MainPackage")] - public string MainPackage - { - get; set; - } - - public override string ToString() - { - return PackageFileName ?? base.ToString(); - } - } - } - #endregion XML Objects - - #region JSON Objects - public class EsrpDecryptionInformation - { - [DataMember(Name = "KeyData")] - public string KeyData - { - get; set; - } - - [DataMember(Name = "EncryptionBufferSize")] - public long EncryptionBufferSize - { - get; set; - } - - [DataMember(Name = "AlgorithmName")] - public string AlgorithmName - { - get; set; - } - - [DataMember(Name = "ChainingMode")] - public string ChainingMode - { - get; set; - } - - public static EsrpDecryptionInformation DeserializeFromJson(string json) - { - using MemoryStream memoryStream = new(Encoding.UTF8.GetBytes(json)); - DataContractJsonSerializer serializer = new(typeof(EsrpDecryptionInformation)); - return serializer.ReadObject(memoryStream) as EsrpDecryptionInformation; - } - } - - public static class CAppxMetadataJSON - { - public partial class AppxMetadataJson - { - [JsonPropertyName("blob.version")] - public long BlobVersion - { - get; set; - } - - [JsonPropertyName("content.isMain")] - public bool ContentIsMain - { - get; set; - } - - [JsonPropertyName("content.packageId")] - public string ContentPackageId - { - get; set; - } - - [JsonPropertyName("content.productId")] - public Guid ContentProductId - { - get; set; - } - - [JsonPropertyName("content.targetPlatforms")] - public ContentTargetPlatform[] ContentTargetPlatforms - { - get; set; - } - - [JsonPropertyName("content.type")] - public long ContentType - { - get; set; - } - - [JsonPropertyName("policy")] - public Policy Policy - { - get; set; - } - - [JsonPropertyName("policy2")] - public Policy2 Policy2 - { - get; set; - } - } - - public partial class ContentTargetPlatform - { - [JsonPropertyName("platform.maxVersionTested")] - public long PlatformMaxVersionTested - { - get; set; - } - - [JsonPropertyName("platform.minVersion")] - public long PlatformMinVersion - { - get; set; - } - - [JsonPropertyName("platform.target")] - public long PlatformTarget - { - get; set; - } - } - - public partial class Policy - { - [JsonPropertyName("category.first")] - public string CategoryFirst - { - get; set; - } - - [JsonPropertyName("category.second")] - public string CategorySecond - { - get; set; - } - - [JsonPropertyName("category.third")] - public string CategoryThird - { - get; set; - } - - [JsonPropertyName("optOut.backupRestore")] - public bool OptOutBackupRestore - { - get; set; - } - - [JsonPropertyName("optOut.removeableMedia")] - public bool OptOutRemoveableMedia - { - get; set; - } - } - - public partial class Policy2 - { - [JsonPropertyName("ageRating")] - public long AgeRating - { - get; set; - } - - [JsonPropertyName("optOut.DVR")] - public bool OptOutDvr - { - get; set; - } - - [JsonPropertyName("thirdPartyAppRatings")] - public ThirdPartyAppRating[] ThirdPartyAppRatings - { - get; set; - } - } - - public partial class ThirdPartyAppRating - { - [JsonPropertyName("level")] - public long Level - { - get; set; - } - - [JsonPropertyName("systemId")] - public long SystemId - { - get; set; - } - } - } - #endregion JSON Objects -} diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs new file mode 100644 index 00000000..66e33ae5 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3FileDownloadInformation.cs @@ -0,0 +1,103 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; +using System.Threading.Tasks; +using UnifiedUpdatePlatform.Services.WindowsUpdate.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.ESRP; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.GetExtendedUpdateInfo2.Response; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public class FileExchangeV3FileDownloadInformation + { + public string DownloadUrl + { + get; + } + + public bool IsEncrypted => EsrpDecryptionInformation != null; + + public DateTime ExpirationDate + { + get + { + DateTime dateTime = DateTime.MaxValue; + try + { + long value = long.Parse(DownloadUrl.Split("P1=")[1].Split("&")[0]); + dateTime = DateTimeOffset.FromUnixTimeSeconds(value).ToLocalTime().DateTime; + } + catch { } + return dateTime; + } + } + + public bool IsDownloadable => ExpirationDate > DateTime.Now; + + public TimeSpan TimeLeft => IsDownloadable ? DateTime.Now - ExpirationDate : new TimeSpan(0); + + public EsrpDecryptionInformation EsrpDecryptionInformation { get; set; } = null; + + public string Digest + { + get; + } + + internal FileExchangeV3FileDownloadInformation(FileLocation fileLocation) + { + DownloadUrl = fileLocation.Url; + if (!string.IsNullOrEmpty(fileLocation.EsrpDecryptionInformation)) + { + EsrpDecryptionInformation = EsrpDecryptionInformation.DeserializeFromJson(fileLocation.EsrpDecryptionInformation); + } + Digest = fileLocation.FileDigest; + } + + public override bool Equals(object obj) + { + return obj is FileExchangeV3FileDownloadInformation info && info.Digest == Digest; + } + + public override int GetHashCode() + { + return Digest.GetHashCode(); + } + + public async Task DecryptAsync(string InputFile, string OutputFile) + { + if (!IsEncrypted) + { + return false; + } + + try + { + using ESRPCryptography esrp = new(EsrpDecryptionInformation); + await esrp.DecryptFileAsync(InputFile, OutputFile); + return true; + } + catch { } + + return false; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs new file mode 100644 index 00000000..2e936735 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/FileExchangeV3UpdateFilter.cs @@ -0,0 +1,30 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public enum FileExchangeV3UpdateFilter + { + ProductRelease, + Application, + OSFlight + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs new file mode 100644 index 00000000..ea466ed5 --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/StringExtensions.cs @@ -0,0 +1,64 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public static class StringExtensions + { + public static bool Contains(this string str, string substring, + StringComparison comp) + { + if (substring == null) + { + throw new ArgumentNullException(nameof(substring), + "substring cannot be null."); + } + else if (!Enum.IsDefined(typeof(StringComparison), comp)) + { + throw new ArgumentException("comp is not a member of StringComparison", + nameof(comp)); + } + + return str.Contains(substring, comp); + } + + public static string Replace(this string originalString, string oldValue, string newValue, StringComparison comparisonType) + { + int startIndex = 0; + while (true) + { + startIndex = originalString.IndexOf(oldValue, startIndex, comparisonType); + if (startIndex == -1) + { + break; + } + + originalString = originalString[..startIndex] + newValue + originalString[(startIndex + oldValue.Length)..]; + + startIndex += newValue.Length; + } + + return originalString; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj index 1cd9b795..fa1d7c95 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UnifiedUpdatePlatform.Services.WindowsUpdate.csproj @@ -1,4 +1,4 @@ - + net8.0 Library @@ -10,6 +10,9 @@ True + + + diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs new file mode 100644 index 00000000..200ab5bc --- /dev/null +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateData.cs @@ -0,0 +1,83 @@ +/* + * Copyright (c) Gustave Monce and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +using System.Collections.Generic; +using System.Text.Json.Serialization; +using UnifiedUpdatePlatform.Services.Composition.Database; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.JSON.AppxMetadata; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.Common; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.SOAP.SyncUpdates.Response; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Models.FE3.XML.ExtendedUpdateInfo; +using UnifiedUpdatePlatform.Services.WindowsUpdate.Targeting; + +namespace UnifiedUpdatePlatform.Services.WindowsUpdate +{ + public class UpdateData + { + [JsonPropertyName("UpdateInfo")] + public UpdateInfo UpdateInfo + { + get; set; + } + + [JsonPropertyName("Update")] + public Update Update + { + get; set; + } + + [JsonPropertyName("Xml")] + public Xml Xml + { + get; set; + } + + [JsonPropertyName("AppxMetadata")] + public AppxMetadataJson AppxMetadata + { + get; set; + } + + [JsonPropertyName("CTAC")] + public CTAC CTAC + { + get; set; + } + + [JsonPropertyName("SyncUpdatesResponse")] + public string SyncUpdatesResponse + { + get; set; + } + + [JsonPropertyName("GEI2Response")] + public string GEI2Response + { + get; set; + } + + [JsonPropertyName("CompDBs")] + public HashSet CompDBs + { + get; set; + } + } +} \ No newline at end of file diff --git a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs index 4fc90446..d48b8725 100644 --- a/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs +++ b/src/UnifiedUpdatePlatform.Services.WindowsUpdate/UpdateDataExtensions.cs @@ -77,9 +77,9 @@ public static async Task GetBuildStringAsync(this UpdateData update) try { - CExtendedUpdateInfoXml.File deploymentCab = null; + Models.FE3.XML.ExtendedUpdateInfo.File deploymentCab = null; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.FileName.Replace('\\', Path.DirectorySeparatorChar).EndsWith("deployment.cab", StringComparison.InvariantCultureIgnoreCase)) { @@ -142,8 +142,8 @@ public static async Task GetBuildStringAsync(this UpdateData update) { try { - HashSet compDBs = await update.GetCompDBsAsync(); - CompDB firstCompDB = compDBs.First(); + HashSet compDBs = await update.GetCompDBsAsync(); + BaseManifest firstCompDB = compDBs.First(); // example: // BuildInfo="co_release.21382.1.210511-1416" OSVersion="10.0.21382.1" TargetBuildInfo="co_release.21382.1.210511-1416" TargetOSVersion="10.0.21382.1" @@ -168,13 +168,13 @@ public static async Task GetBuildStringAsync(this UpdateData update) private static string GetBuildStringFromUpdateAgent(byte[] updateAgentFile) { - byte[] sign = new byte[] { + byte[] sign = [ 0x46, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00 - }; + ]; int fIndex = IndexOf(updateAgentFile, sign) + sign.Length; - int lIndex = IndexOf(updateAgentFile, new byte[] { 0x00, 0x00, 0x00 }, fIndex) + 1; + int lIndex = IndexOf(updateAgentFile, [0x00, 0x00, 0x00], fIndex) + 1; byte[] sliced = SliceByteArray(updateAgentFile, lIndex - fIndex, fIndex); @@ -227,12 +227,12 @@ public static async Task> GetAvailableLanguagesAsync(this Up return (await update.GetCompDBsAsync()).GetAvailableLanguages(); } - private static async Task> GetCompDBs(UpdateData update) + private static async Task> GetCompDBs(UpdateData update) { - HashSet neutralCompDB = new(); - HashSet metadataCabs = new(); + HashSet neutralCompDB = []; + HashSet metadataCabs = []; - foreach (CExtendedUpdateInfoXml.File file in update.Xml.Files.File) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File file in update.Xml.Files.File) { if (file.PatchingType.Equals("metadata", StringComparison.InvariantCultureIgnoreCase)) { @@ -245,7 +245,7 @@ private static async Task> GetCompDBs(UpdateData update) return neutralCompDB; } - foreach (CExtendedUpdateInfoXml.File metadataCab in metadataCabs) + foreach (Models.FE3.XML.ExtendedUpdateInfo.File metadataCab in metadataCabs) { FileExchangeV3FileDownloadInformation fileDownloadInfo = await FE3Handler.GetFileUrl(update, metadataCab.Digest); if (fileDownloadInfo == null) @@ -328,7 +328,7 @@ private static async Task> GetCompDBs(UpdateData update) return neutralCompDB; } - public static async Task> GetCompDBsAsync(this UpdateData update) + public static async Task> GetCompDBsAsync(this UpdateData update) { return update.CompDBs ??= await GetCompDBs(update); } diff --git a/src/Windows.Internal.Flighting/NativeMethods.cs b/src/Windows.Internal.Flighting/NativeMethods.cs index 5b6eb565..68503ef1 100644 --- a/src/Windows.Internal.Flighting/NativeMethods.cs +++ b/src/Windows.Internal.Flighting/NativeMethods.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Windows.Internal.Flighting diff --git a/src/Windows.Internal.Flighting/PlatformCTAC.cs b/src/Windows.Internal.Flighting/PlatformCTAC.cs index 769e002f..b7991fb6 100644 --- a/src/Windows.Internal.Flighting/PlatformCTAC.cs +++ b/src/Windows.Internal.Flighting/PlatformCTAC.cs @@ -1,11 +1,10 @@ -using System.Collections.Generic; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; namespace Windows.Internal.Flighting { public class PlatformCTAC : IEquatable { - private static ClientAttributes ClientAttributes; + private static ClientAttributes? ClientAttributes; public string JSON { @@ -68,9 +67,9 @@ public bool Equals(PlatformCTAC other) public override int GetHashCode() { int hashCode = 1698843082; - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(JSON); - hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(UriQuery); - hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(AttributeErrors); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(JSON); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(UriQuery); + hashCode = (hashCode * -1521134295) + EqualityComparer>.Default.GetHashCode(AttributeErrors); return hashCode; } diff --git a/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs b/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs index c86a8f00..4593151f 100644 --- a/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs +++ b/thirdparty/Microsoft.Dism/DismApi.AddCapability.cs @@ -53,7 +53,7 @@ public static void AddCapability(DismSession session, string capabilityName, boo public static void AddCapability(DismSession session, string capabilityName, bool limitAccess, List? sourcePaths, Microsoft.Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); diff --git a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs index d23e0f4c..d2f46276 100644 --- a/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs +++ b/thirdparty/Microsoft.Dism/DismApi.AddProvisionedAppxPackage.cs @@ -26,7 +26,7 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath appPath, dependencyPackages, optionalPackages: null, - licensePaths: string.IsNullOrEmpty(licensePath) ? null : new List { licensePath! }, + licensePaths: string.IsNullOrEmpty(licensePath) ? null : [licensePath!], customDataPath: customDataPath, regions: "all", stubPackageOption: stubPackageOption); @@ -48,7 +48,7 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath appPath, dependencyPackages, optionalPackages: null, - licensePaths: string.IsNullOrEmpty(licensePath) ? null : new List { licensePath! }, + licensePaths: string.IsNullOrEmpty(licensePath) ? null : [licensePath!], customDataPath: customDataPath, regions: null); } @@ -94,11 +94,11 @@ public static void AddProvisionedAppxPackage(DismSession session, string appPath int hresult = NativeMethods._DismAddProvisionedAppxPackage( session, appPath, - dependencyPackages?.ToArray() ?? new string[0], + dependencyPackages?.ToArray() ?? [], (uint)(dependencyPackages?.Count ?? 0), - optionalPackages?.ToArray() ?? new string[0], + optionalPackages?.ToArray() ?? [], (uint)(optionalPackages?.Count ?? 0), - licensePaths?.ToArray() ?? new string[0], + licensePaths?.ToArray() ?? [], (uint)(licensePaths?.Count ?? 0), SkipLicense: licensePaths == null || licensePaths.Count == 0, customDataPath, diff --git a/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs b/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs index ca76d46e..95dbf49d 100644 --- a/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs +++ b/thirdparty/Microsoft.Dism/DismApi.EnableFeature.cs @@ -221,7 +221,7 @@ public static void EnableFeature(DismSession session, string featureName, bool l private static void EnableFeature(DismSession session, string featureName, string? identifier, DismPackageIdentifier packageIdentifier, bool limitAccess, bool enableAll, List? sourcePaths, Microsoft.Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); diff --git a/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs b/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs index a9514806..57c06021 100644 --- a/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs +++ b/thirdparty/Microsoft.Dism/DismApi.RestoreImageHealth.cs @@ -65,7 +65,7 @@ public static void RestoreImageHealth(DismSession session, bool limitAccess, Lis public static void RestoreImageHealth(DismSession session, bool limitAccess, List? sourcePaths, Dism.DismProgressCallback? progressCallback, object? userData) { // Get the list of source paths as an array - string[] sourcePathsArray = sourcePaths?.ToArray() ?? new string[0]; + string[] sourcePathsArray = sourcePaths?.ToArray() ?? []; // Create a DismProgress object to wrap the callback and allow cancellation DismProgress progress = new(progressCallback, userData); diff --git a/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj b/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj index 013fff1f..58748822 100644 --- a/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj +++ b/thirdparty/Microsoft.Dism/Microsoft.Dism.csproj @@ -10,7 +10,5 @@ - - - + \ No newline at end of file diff --git a/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj b/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj index b186b663..dafb1ccc 100644 --- a/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj +++ b/thirdparty/Microsoft.Wim/Microsoft.Wim.csproj @@ -10,6 +10,5 @@ - - + \ No newline at end of file diff --git a/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs b/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs index 9411ffaf..49463e87 100644 --- a/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs +++ b/thirdparty/Microsoft.Wim/WimRegisteredCallbacks.cs @@ -19,12 +19,12 @@ internal sealed class WimRegisteredCallbacks /// /// Stores a list of registered callbacks by their WimHandle. /// - private readonly Dictionary> _registeredCallbacksByHandle = new(); + private readonly Dictionary> _registeredCallbacksByHandle = []; /// /// Stores a list of globally registered callbacks. /// - private readonly Dictionary _registeredCallbacksGlobal = new(); + private readonly Dictionary _registeredCallbacksGlobal = []; /// /// Gets a native callback for passing to the WIMGAPI for the specified registered callback associated with the @@ -121,7 +121,7 @@ public bool RegisterCallback(WimHandle wimHandle, WimMessageCallback messageCall if (!_registeredCallbacksByHandle.ContainsKey(wimHandle)) { // Add an item for the wimHandle to the dictionary - _registeredCallbacksByHandle.Add(wimHandle, new Dictionary()); + _registeredCallbacksByHandle.Add(wimHandle, []); } // Create a callback wrapper and add the callback to the list diff --git a/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs b/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs index 0250fcce..8d2c4cc5 100644 --- a/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs +++ b/thirdparty/Microsoft.Wim/WimgApi.GetMountedImageInfo.cs @@ -49,7 +49,7 @@ public static WimMountInfoCollection GetMountedImageInfo() case 0: // Return an empty list because there are no images - return new WimMountInfoCollection(new List()); + return new WimMountInfoCollection([]); case WimgApi.ERROR_INSUFFICIENT_BUFFER: @@ -63,7 +63,7 @@ public static WimMountInfoCollection GetMountedImageInfo() } // Create a collection of WimMountInfo objects - List wimMountInfos = new(); + List wimMountInfos = []; // Allocate enough memory for the return array IntPtr mountInfoPtr = Marshal.AllocHGlobal((int)returnLength); diff --git a/thirdparty/Privileges/Privilege.cs b/thirdparty/Privileges/Privilege.cs index 0a16013d..500505f8 100644 --- a/thirdparty/Privileges/Privilege.cs +++ b/thirdparty/Privileges/Privilege.cs @@ -14,8 +14,8 @@ public sealed class Privilege : IDisposable #region Private static members private static readonly LocalDataStoreSlot tlsSlot = Thread.AllocateDataSlot(); - private static readonly HybridDictionary privileges = new(); - private static readonly HybridDictionary luids = new(); + private static readonly HybridDictionary privileges = []; + private static readonly HybridDictionary luids = []; private static readonly ReaderWriterLock privilegeLock = new(); #endregion Private static members diff --git a/thirdparty/Privileges/PrivilegeNotHeldException.cs b/thirdparty/Privileges/PrivilegeNotHeldException.cs index 17dfaaa8..8a62dc60 100644 --- a/thirdparty/Privileges/PrivilegeNotHeldException.cs +++ b/thirdparty/Privileges/PrivilegeNotHeldException.cs @@ -31,6 +31,7 @@ private PrivilegeNotHeldException(SerializationInfo info, StreamingContext conte public string PrivilegeName { get; } = null; + [Obsolete] public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) diff --git a/thirdparty/Privileges/Privileges.csproj b/thirdparty/Privileges/Privileges.csproj index ac2f18d1..dc3d9881 100644 --- a/thirdparty/Privileges/Privileges.csproj +++ b/thirdparty/Privileges/Privileges.csproj @@ -8,4 +8,4 @@ $(SolutionDir)intermediate\$(Platform)\$(Configuration)\Privileges\ true - + \ No newline at end of file