Esempio n. 1
0
        public void StartProcess(Controls.NVForm.FormEventArgs args)
        {
            var worker = new BackgroundWorker();

            worker.DoWork             += Worker_DoWork;
            worker.RunWorkerCompleted += (sender, e) => RunWorkerCompleted();
            worker.RunWorkerAsync(args);
        }
Esempio n. 2
0
        private void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            args = e.Argument as Controls.NVForm.FormEventArgs;
            fb   = new Fastboot();

            try
            {
                if (args.TargetMode == UsbController.Device.DMode.DownloadVCOM)
                {
                    Log.Info("--> Flashing bootloader");
                    FlashBootloader(args.Bootloader, args.Target.Split(':')[0]);

                    Log.Info("Waiting for any device...");
                    fb.Wait();
                }

                Log.Info("--> Reading information");
                Log.Info("Connecting to fastboot device...");

                fb.Connect();
                ReadInfo();

                Log.Info("--> Updating NVME");
                WriteNVME();

                Log.Success("Update done!");
                Log.Info("Rebooting...");

                fb.Command("reboot");

                Log.Info($"Bootloader unlock code: {args.UnlockCode}");

                fb.Disconnect();
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                Log.Debug(ex.StackTrace);
            }
        }
Esempio n. 3
0
        private void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            args = e.Argument as Controls.NVForm.FormEventArgs;
            fb   = new Fastboot();

            try
            {
                if (args.TargetMode == UsbController.Device.DMode.DownloadVCOM)
                {
                    FlashBootloader(args.Bootloader, args.Target.Split(':')[0]);

                    Log.Info("Waiting for any device...");
                    fb.Wait();
                }

                Log.Info("Connecting...");

                fb.Connect();
                ReadInfo();
                WriteNVME();

                Log.Info("Finalizing...");
                LogResponse(fb.Command($"oem unlock {args.UnlockCode}"));

                if (args.Reboot)
                {
                    Log.Info("Rebooting...");
                    fb.Command("reboot");
                }

                Log.Info($"Bootloader unlock code: {args.UnlockCode}");

                fb.Disconnect();
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                Log.Debug(ex.StackTrace);
            }
        }
Esempio n. 4
0
 private void NvFrom_OnFormSubmit(Controls.NVForm.FormEventArgs formEventArgs)
 {
     SetupLog();
     core.StartProcess(formEventArgs);
 }