public async Task GetPartitions() { var sut = new LowLevelApi(); var partitions = await sut.GetPartitions(await sut.GetPhoneDisk()); Assert.NotNull(partitions); }
public static MainViewModel GetMainViewModel(IObservable <LogEvent> logEvents) { var visualizerService = new ExtendedWpfUIVisualizerService(); visualizerService.Register("TextViewer", typeof(TextViewerWindow)); IDictionary <PhoneModel, IDeployer> deployerDict = new Dictionary <PhoneModel, IDeployer> { { PhoneModel.Lumia950Xl, GetDeployer(Path.Combine("Files", "Lumia 950 XL")) }, { PhoneModel.Lumia950, GetDeployer(Path.Combine("Files", "Lumia 950")) }, }; var api = new LowLevelApi(); var deployersItems = deployerDict.Select(pair => new DeployerItem(pair.Key, pair.Value)).ToList(); var importerItems = new List <DriverPackageImporterItem>() { new DriverPackageImporterItem("7z", new DriverPackageImporter <SevenZipArchiveEntry, SevenZipVolume, SevenZipArchive>( s => SevenZipArchive.Open(s), "Files")), new DriverPackageImporterItem("zip", new DriverPackageImporter <ZipArchiveEntry, ZipVolume, ZipArchive>(s => ZipArchive.Open(s), "Files")) }; var mainViewModel = new MainViewModel(logEvents, deployersItems, importerItems, new ViewServices(new WpfOpenFileService(), DialogCoordinator.Instance, visualizerService), async() => new Phone(await api.GetPhoneDisk())); return(mainViewModel); }
public async Task GetPhoneDisk() { var sut = new LowLevelApi(); var disk = await sut.GetPhoneDisk(); Assert.NotNull(disk); }
public async Task GetVolume() { var sut = new LowLevelApi(); var partition = (await sut.GetPartitions(await sut.GetPhoneDisk())).Skip(2).First(); var volume = await sut.GetVolume(partition); Assert.NotNull(volume); }
public async Task CheckOobeCompleted() { var sut = new LowLevelApi(); var volume = await sut.GetWindowsVolume(); var completed = sut.GetIsOobeCompleted(volume); }
public async Task <Partition> GetBootEfiEspPartition() { var parts = await LowLevelApi.GetPartitions(this); return(parts .OrderByDescending(x => x.Number) .FirstOrDefault(x => Equals(x.PartitionType, PartitionType.Esp))); }
public async Task ResizePartition() { var api = new LowLevelApi(); var phoneDisk = await api.GetPhoneDisk(); var phone = new Phone(phoneDisk); var dataVol = await phone.GetDataVolume(); await dataVol.Partition.Resize(ByteSize.FromGigaBytes(10)); }
public async Task InjectDrivers() { var sut = new DismImageService(); var lowlevel = new LowLevelApi(); var volumes = await lowlevel.GetVolumes(await lowlevel.GetPhoneDisk()); var winVolume = volumes.Single(v => v.Label == "WindowsARM"); await sut.InjectDrivers(@"C:\Users\super\source\repos\Install\Application\bin\Debug\bin\Debug\Files\Drivers\Stable", winVolume); }
public async Task Format() { var sut = new LowLevelApi(); var phoneDisk = await sut.GetPhoneDisk(); var partitionToFormat = (await sut.GetPartitions(phoneDisk)).Single(x => x.Number == 6); var toFormat = await sut.GetVolume(partitionToFormat); await sut.Format(toFormat, FileSystemFormat.Ntfs, "Test"); }
public async Task AssignLetter() { var sut = new LowLevelApi(); var phoneDisk = await sut.GetPhoneDisk(); var partitionToFormat = (await sut.GetPartitions(phoneDisk)).Single(x => x.Number == 6); var toAssign = await sut.GetVolume(partitionToFormat); await sut.AssignDriveLetter(toAssign, 'I'); }
public async Task SetPartitionType() { var sut = new LowLevelApi(); var disk = await sut.GetPhoneDisk(); var volumes = await sut.GetVolumes(disk); var volume = volumes.Single(x => x.Label == "BOOT"); await sut.SetPartitionType(volume.Partition, PartitionType.Esp); }
public override async Task <Disk> GetDeviceDisk() { if (disk == null) { var disks = await LowLevelApi.GetDisks(); return(disks.First(x => x.Number == diskNumber)); } return(disk); }
public async Task MakeBootable() { var lowLevelApi = new LowLevelApi(); var sut = new WindowsDeployer(new DismImageService(), new DriverPaths("")); var lowlevel = lowLevelApi; var volumes = await lowlevel.GetVolumes(await lowlevel.GetPhoneDisk()); var winVolume = volumes.Single(v => v.Label == "WindowsARM"); var bootVolume = volumes.Single(v => v.Label == "BOOT"); //await sut.MakeBootable(new WindowsVolumes()); }
public override async Task <Disk> GetDeviceDisk() { var disks = await LowLevelApi.GetDisks(); foreach (var disk in disks.Where(x => x.Number != 0)) { if (true) { var volumes = await disk.GetVolumes(); var mainOsVol = volumes.FirstOrDefault(x => x.Label == MainOsLabel); if (mainOsVol != null) { return(disk); } } } throw new PhoneDiskNotFoundException("Cannot get the Phone Disk. Please, verify that the Phone is in Mass Storage Mode."); }
public async Task GetAvailableLetter() { var sut = new LowLevelApi(); var letter = sut.GetFreeDriveLetter(); }
public async Task <IList <Volume> > GetVolumes() { var volumes = await LowLevelApi.GetVolumes(this); return(volumes); }
public Task <List <Partition> > GetPartitions() { return(LowLevelApi.GetPartitions(this)); }
public Task <Partition> CreateReservedPartition(ulong sizeInBytes) { return(LowLevelApi.CreateReservedPartition(this, sizeInBytes)); }
public async Task <Partition> GetReservedPartition() { var parts = await LowLevelApi.GetPartitions(this); return(parts.FirstOrDefault(x => Equals(x.PartitionType, PartitionType.Reserved))); }
public async Task DeployWindows() { var api = new LowLevelApi(); var deployer = new WindowsDeployer(new DismImageService(), new DriverPaths("")); await deployer.Deploy(new InstallOptions(@"F:\sources\install.wim"), new Phone(null)); }