public async Task Execute()
        {
            var efiespVolume = await phone.GetEfiespVolume();

            var bcdInvoker = bcdInvokerFactory.Create(efiespVolume.GetBcdFullFilename());

            new BcdConfigurator(bcdInvoker, efiespVolume).SetupBcd();
        }
Ejemplo 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");
        }
Ejemplo n.º 3
0
        public async Task <string> Replace(string str)
        {
            IDictionary <string, Func <Task <string> > > mappings = new Dictionary <string, Func <Task <string> > >()
            {
                { "EFIESP", async() => (await phone.GetEfiespVolume()).RootDir.Name },
                { "WindowsARM", async() => (await phone.GetWindowsVolume()).RootDir.Name },
            };

            var matching = mappings.Keys.FirstOrDefault(s => str.StartsWith(s, StringComparison.OrdinalIgnoreCase));

            if (matching != null)
            {
                var replacement = await mappings[matching]();
                var replaced    = Regex.Replace(str, $"^{matching}", replacement, RegexOptions.IgnoreCase);
                return(Regex.Replace(replaced, $@"\\+", @"\", RegexOptions.IgnoreCase));
            }

            return(str);
        }