Exemplo n.º 1
0
        public async Task ExtractToFolder(Stream stream, string folderPath)
        {
            var temp = FileUtils.GetTempDirectoryName();

            await Observable.Start(() =>
            {
                using (var zip = new ZipArchive(stream, ZipArchiveMode.Read, false))
                {
                    zip.ExtractToDirectory(temp);
                }
            });

            var folderName = Path.GetFileName(folderPath);

            if (fileSystemOperations.DirectoryExists(folderPath))
            {
                await fileSystemOperations.DeleteDirectory(folderPath);
            }

            var firstChild = Path.Combine(temp, folderName);

            await fileSystemOperations.CopyDirectory(firstChild, folderPath);

            await fileSystemOperations.DeleteDirectory(temp);
        }
Exemplo n.º 2
0
        public async Task Execute()
        {
            var efiespVolume = await phone.GetEfiespVolume();

            var rootDir    = efiespVolume.RootDir.Name;
            var bcdInvoker = bcdInvokerFactory.Create(Path.Combine(rootDir, "EFI", "Microsoft", "Boot", "BCD"));

            var destination = Path.Combine(rootDir, "Windows", "System32", "BOOT");
            await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destination);

            var guid = FormattingUtils.GetGuid(bcdInvoker.Invoke(@"/create /d ""Developer Menu"" /application BOOTAPP"));

            bcdInvoker.Invoke($@"/set {{{guid}}} path \Windows\System32\BOOT\developermenu.efi");
            bcdInvoker.Invoke($@"/set {{{guid}}} device partition={rootDir}");
            bcdInvoker.Invoke($@"/set {{{guid}}} testsigning on");
            bcdInvoker.Invoke($@"/set {{{guid}}} nointegritychecks on");
            bcdInvoker.Invoke($@"/displayorder {{{guid}}} /addlast");
        }
Exemplo n.º 3
0
 private async Task CopyDevMenuFiles()
 {
     await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destinationFolder);
 }
Exemplo n.º 4
0
 protected override Task ExecuteCore()
 {
     return(fileSystemOperations.CopyDirectory(origin, destination));
 }
Exemplo n.º 5
0
 public Task Execute(string origin, string destination)
 {
     return(fileSystemOperations.CopyDirectory(origin, destination));
 }
Exemplo n.º 6
0
 private async Task CopyDevMenuFiles(string mainOsPath)
 {
     var destinationFolder = Path.Combine(mainOsPath, PartitionName.EfiEsp, "Windows", "System32", "BOOT");
     await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destinationFolder);
 }