Beispiel #1
0
 public void EntryPoint(ILeafUI ui, IDevice device, IClassTextReader textReader)
 {
     using (ui)
     {
         ui.Title = this.GetName();
         ui.Icon  = this.GetIconBytes();
         ui.Show();
         var textManager = textReader.Read(this);
         if (!ui.DoYN(textManager["warn"]))
         {
             return;
         }
         if (!ui.DoYN(textManager["warn2"]))
         {
             return;
         }
         CommandExecutor executor = new CommandExecutor();
         executor.OutputReceived += (s, e) => ui.WriteOutput(e.Text);
         var exitCode = executor.Fastboot(device, "oem lock").ExitCode;
         ui.Finish(exitCode);
     }
 }
Beispiel #2
0
 public void EntryPoint(ILeafUI ui, IDevice device, IClassTextReader textReader)
 {
     using (ui)
     {
         var textManager = textReader.Read(this);
         ui.Title = this.GetName();
         ui.Icon  = this.GetIconBytes();
         ui.Show();
         OpenFileDialog fileDialog = new OpenFileDialog();
         fileDialog.Reset();
         fileDialog.Title       = textManager["Title"];
         fileDialog.Filter      = textManager["Filter"];
         fileDialog.Multiselect = false;
         if (fileDialog.ShowDialog() != true)
         {
             ui.EFinish();
         }
         CommandExecutor executor = new CommandExecutor();
         executor.OutputReceived += (s, e) => ui.WriteOutput(e.Text);
         executor.Fastboot(device, $"flash recovery \"{fileDialog.FileName}\"");
         var result = executor.Fastboot(device, $"boot \"{fileDialog.FileName}\"");
         ui.Finish(result.ExitCode);
     }
 }