public static async Task <string[]> DownloadPackageAsync(string[] categoryIds, CTAC ctac, DirectoryInfo downloadDirectory, DownloadProgress progress, string msaToken = "") { var updates = await FE3Handler.GetUpdates(categoryIds, ctac, msaToken, FileExchangeV3UpdateFilter.Application); return(await DownloadPackageAsync(updates, downloadDirectory, progress, msaToken)); }
private static async Task GetRingBuilds(GetBuildsOptions opts) { var CTACs = GetRingCTACs(opts.MachineType, opts.ReportingSku); foreach (var CTAC in CTACs) { var ctac = CTAC.Key; string token = string.Empty; if (!string.IsNullOrEmpty(opts.Mail) && !string.IsNullOrEmpty(opts.Password)) { token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(opts.Mail, opts.Password); } IEnumerable <UpdateData> data = await FE3Handler.GetUpdates(null, ctac, token, FileExchangeV3UpdateFilter.ProductRelease); data = data.Select(x => UpdateUtils.TrimDeltasFromUpdateData(x)); for (int i = 0; i < data.Count(); i++) { string buildStr = await data.ToList()[i].GetBuildStringAsync(); if (string.IsNullOrEmpty(buildStr)) { buildStr = data.ToList()[i].Xml.LocalizedProperties.Title; } Console.WriteLine($"\"{CTAC.Value}\"[{i}]=\"{buildStr}\""); } } }
private static async Task PerformOperation(DownloadRequestOptions o) { Logging.Log("Checking for updates..."); CTAC ctac = new(o.ReportingSku, o.ReportingVersion, o.MachineType, o.FlightRing, o.FlightingBranchName, o.BranchReadinessLevel, o.CurrentBranch, o.ReleaseType, o.SyncCurrentVersionOnly, ContentType : o.ContentType); string token = string.Empty; if (!string.IsNullOrEmpty(o.Mail) && !string.IsNullOrEmpty(o.Password)) { token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(o.Mail, o.Password); } IEnumerable <UpdateData> data = await FE3Handler.GetUpdates(null, ctac, token, FileExchangeV3UpdateFilter.ProductRelease); data = data.Select(x => UpdateUtils.TrimDeltasFromUpdateData(x)); foreach (UpdateData update in data) { await ProcessUpdateAsync(update, o.OutputFolder, o.MachineType, o.Language, o.Edition, true); //await BuildUpdateXml(update, o.MachineType); } Logging.Log("Completed."); if (Debugger.IsAttached) { Console.ReadLine(); } }
public async Task GetPackagesAndNamesForNetflix() { DisplayCatalogHandler displayCatalog = DisplayCatalogHandler.ProductionConfig(); await displayCatalog.QueryDCATAsync("9wzdncrfj3tj"); Assert.True(displayCatalog.IsFound); string xml = await FE3Handler.SyncUpdatesAsync(displayCatalog.ProductListing.Product.DisplaySkuAvailabilities[0].Sku.Properties.FulfillmentData.WuCategoryId); IList <string> RevisionIds = new List <string>(); IList <string> PackageNames = new List <string>(); IList <string> UpdateIDs = new List <string>(); FE3Handler.ProcessUpdateIDs(xml, out RevisionIds, out PackageNames, out UpdateIDs); IList <Uri> FileUris = await FE3Handler.GetFileUrlsAsync(UpdateIDs, RevisionIds); }
private static async Task PerformOperation(DownloadRequestOptions o) { Logging.Log("Checking for updates..."); CTAC ctac = new CTAC(o.ReportingSku, o.ReportingVersion, o.MachineType, o.FlightRing, o.FlightingBranchName, o.BranchReadinessLevel, o.CurrentBranch, o.ReleaseType, o.SyncCurrentVersionOnly); IEnumerable <UpdateData> data = await FE3Handler.GetUpdates(null, ctac, null, FileExchangeV3UpdateFilter.ProductRelease); data = data.Select(x => UpdateUtils.TrimDeltasFromUpdateData(x)); foreach (UpdateData update in data) { await ProcessUpdateAsync(update, o.OutputFolder, o.MachineType, o.Language, o.Edition, true); //await BuildUpdateXml(update, o.MachineType); } Logging.Log("Completed."); if (Debugger.IsAttached) { Console.ReadLine(); } }
public async Task GetPackagesForNetflix() { DisplayCatalogHandler displayCatalog = new DisplayCatalogHandler(DCatEndpoint.Production, new Locale(Market.US, Lang.en, true)); await displayCatalog.QueryDCATAsync("9wzdncrfj3tj"); Assert.True(displayCatalog.IsFound); string xml = await FE3Handler.SyncUpdatesAsync(displayCatalog.ProductListing.Product.DisplaySkuAvailabilities[0].Sku.Properties.FulfillmentData.WuCategoryId); IList <string> RevisionIds = new List <string>(); IList <string> PackageNames = new List <string>(); IList <string> UpdateIDs = new List <string>(); FE3Handler.ProcessUpdateIDs(xml, out RevisionIds, out PackageNames, out UpdateIDs); IList <Uri> FileUris = await FE3Handler.GetFileUrlsAsync(UpdateIDs, RevisionIds); foreach (Uri fileuri in FileUris) { _output.WriteLine($"GetPackagesForNetflix: {fileuri}"); } }
public static async Task <string[]> DownloadPackageAsync(IEnumerable <UpdateData> updates, DirectoryInfo downloadDirectory, DownloadProgress progress, string msaToken = "") { List <ApplicationFile> appfiles = new(); List <ApplicationFile> appdepfiles = new(); foreach (var updateData in updates) { foreach (var file in updateData.Xml.Files.File) { if (file.FileName.EndsWith(".cab", StringComparison.InvariantCultureIgnoreCase)) { continue; } var filename = updateData.AppxMetadata.ContentPackageId + "." + file.FileName.Split(".")[file.FileName.Count(x => x == '.')]; if (string.IsNullOrEmpty(updateData.AppxMetadata.ContentPackageId)) { filename = file.FileName; } var datetime = DateTime.Parse(file.Modified); if (!appfiles.Any(x => x.Filename == filename)) { ApplicationFile appfile = new() { UpdateID = updateData.Xml.UpdateIdentity.UpdateID, RevisionNumber = updateData.Xml.UpdateIdentity.RevisionNumber, Token = msaToken, Digest = file.Digest, Filename = filename, UpdateData = updateData, Modified = datetime, CTAC = updateData.CTAC, Size = file.Size }; List <string> descs = new(); if (updateData != null && updateData.AppxMetadata != null && updateData.AppxMetadata.ContentTargetPlatforms != null) { foreach (var plat in updateData.AppxMetadata.ContentTargetPlatforms) { var max = GetFriendlyVersionFromULong((ulong)plat.PlatformMaxVersionTested); var min = GetFriendlyVersionFromULong((ulong)plat.PlatformMinVersion); var target = GetFriendlyPlatformNameFromLong(plat.PlatformTarget); var desc = $"{target} - Minimum: {min} Maximum: {max}"; descs.Add(desc); } } appfile.Targets = descs.ToArray(); if (updateData.Xml.ExtendedProperties.IsAppxFramework == "true") { appdepfiles.Add(appfile); } else { appfiles.Add(appfile); } } } } appfiles.Sort((x, y) => x.Modified.CompareTo(y.Modified)); List <FileExchangeV3FileDownloadInformation> files = new(); foreach (var update in updates) { files.AddRange(await FE3Handler.GetFileUrls(update, msaToken)); } List <UUPFile> fileList = appfiles.Where(app => !app.Targets.Any(t => t.Contains("Xbox"))).Select(boundApp => { return(new UUPFile( files.First(x => x.Digest == boundApp.Digest), boundApp.Filename, long.Parse(boundApp.Size), boundApp.Digest, "sha1")); }).ToList(); using var helperDl = new HttpDownloader(downloadDirectory.FullName); return(await helperDl.DownloadAsync(fileList, progress).ConfigureAwait(false) ? fileList.Select(f => f.FileName).ToArray() : null); }
public async Task GetCookie() { string cookie = await FE3Handler.GetCookieAsync(); Assert.NotNull(cookie); }