Exemple #1
0
        public async Task GetPartitions()
        {
            var sut        = new LowLevelApi();
            var partitions = await sut.GetPartitions(await sut.GetPhoneDisk());

            Assert.NotNull(partitions);
        }
Exemple #2
0
        public async Task GetPhoneDisk()
        {
            var sut  = new LowLevelApi();
            var disk = await sut.GetPhoneDisk();

            Assert.NotNull(disk);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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');
        }
Exemple #6
0
        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");
        }
Exemple #7
0
        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));
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }