예제 #1
0
 private void materialButtonAdd_Click(object sender, EventArgs e)
 {
     if (textBoxCodename.Text != string.Empty || textBoxChannel.Text != string.Empty)
     {
         try
         {
             oConfigMng.LoadConfig();
             oConfigMng.Config.DeviceCodenmae = textBoxCodename.Text.ToLower().Trim();
             oConfigMng.Config.DeviceFirmware = textBoxChannel.Text.ToUpper().Trim();
             cAppend("Added new device codename: " + oConfigMng.Config.DeviceCodenmae);
             cAppend("Added new device channel: " + oConfigMng.Config.DeviceFirmware);
             oConfigMng.SaveConfig();
             cAppend("Added new device codename: " + oConfigMng.Config.DeviceCodenmae + "{OK}");
             cAppend("Added new device channel: " + oConfigMng.Config.DeviceFirmware + "{OK}");
         }
         catch (Exception er)
         {
             Dialogs.ErrorDialog("ERROR adding new device", er.ToString());
             cAppend("Added new device codename: " + oConfigMng.Config.DeviceCodenmae + "{ERROR} " + er);
             cAppend("Added new device channel: " + oConfigMng.Config.DeviceFirmware + "{ERROR} " + er);
         }
     }
     else
     {
         cAppend("Add New Device: The boxes can't be empty!");
         Dialogs.WarningDialog("Add New Device", "The boxes can't be empty!");
     }
 }
예제 #2
0
        private async void TextBox2_DragDrop(object sender, DragEventArgs e)
        {
            string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
            string   s        = "";

            foreach (string File in FileList)
            {
                s = s + " " + File;
            }
            TextBox2.Text = s;

            if (IDDeviceState.RECOVERY == state)
            {
                cAppend("Copying " + " " + s + " " + " to /sdcard...");
                await Task.Run(() => ADB.Instance().Push(s, "/sdcard"));

                Dialogs.InfoDialog("Move Files: Info", "File copied" + " " + s + " " + " into /sdcard!");
            }
            else
            {
                Thread.Sleep(1000);
                cAppend("MOVE FILES TO TWRP: Your device is in the wrong state. Please put your device in recovery mode.\n");
                Dialogs.WarningDialog("Move Files: " + s, "Please plug your device on booted TWRP!");
                Invalidate();
            }
        }
예제 #3
0
        public async void RemoveApp(string appname)
        {
            if (AppIndex == 0)
            {
                cAppendDebloat("MOTO DEBLOAT: Please select an app!");
                Dialogs.WarningDialog("Moto Debloat", "Please select an app!");
                Invalidate();
            }
            else
            {
                if (IDDeviceState.DEVICE == state)
                {
                    await Task.Run(() => DeviceDetectionService());

                    cAppend("MOTO DEBLOAT: Waiting for device...");
                    await Task.Run(() => ADB.WaitForDevice());

                    cAppendDebloat("MOTO DEBLOAT: Removing app: " + appname + "...");
                    await Task.Run(() => ADB.Instance().Execute("shell pm uninstall -k --user 0 " + appname));

                    cAppendDebloat("MOTO DEBLOAT: Removing app: " + appname + " {OK}");
                }
                else
                {
                    cAppendDebloat("MOTO DEBLOAT: Your device is in the wrong state. " + state);
                    Strings.MSGBOXBootloaderWarning();
                    Invalidate();
                }
            }
            Invalidate();
        }
예제 #4
0
        private async void debloatrom_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != string.Empty)
            {
                if (IDDeviceState.DEVICE == state)
                {
                    await Task.Run(() => DeviceDetectionService());

                    cAppendDebloat("MOTO DEBLOAT: Waiting for device...");
                    await Task.Run(() => ADB.WaitForDevice());

                    cAppendDebloat("MOTO DEBLOAT: Removing app: " + textBox1.Text + "...");
                    await Task.Run(() => ADB.Instance().Execute("shell pm uninstall -k --user 0 " + textBox1.Text));

                    cAppendDebloat("MOTO DEBLOAT: Removing app: " + textBox1.Text + " {OK}");
                }
                else
                {
                    Thread.Sleep(1000);
                    Strings.MSGBOXBootloaderWarning();
                    cAppendDebloat("MOTO DEBLOAT: Please, write the app package like this: -com.google.android.apps.translate -");
                    textBox3.Text = "Please, write the app package like this: -com.google.android.apps.translate-";
                }
            }
            else
            {
                Dialogs.WarningDialog("Moto Debloater", "The box can't be empty!");
            }
        }
예제 #5
0
        public void DCSelected()
        {
            if (activeForm != null)
            {
                activeForm.Dispose();
            }
            if (oConfigMng.Config.DeviceCodenmae == "")
            {
                cAppend("Please connect your device to read firmwares!");
                Dialogs.WarningDialog("Device Check", "Please connect your device to read firmwares!");
                return;
            }
            if (oConfigMng.Config.DeviceCodenmae == oConfigMng.Config.DeviceCodenmae)
            {
                cAppend("Loading device...");
                LoadDeviceServer.CheckDevice(oConfigMng.Config.DeviceCodenmae + ".xml", oConfigMng.Config.DeviceCodenmae);
                cAppend("Loading device... {OK}");
                string tr   = "true";
                var    main = new ToolMaintenance();
                if (LoadDeviceServer.fserverMaintenance == tr)
                {
                    cAppend("Firmware is on maintenance!");
                    openChildForm(main);
                }

                cAppend("Selected Device Channel: {" + oConfigMng.Config.DeviceFirmware + "}" + "\nDownloading " + oConfigMng.Config.DeviceFirmware + " Firmware");
                Dialogs.InfoDialog("Device Channel", "Selected Device Channel: {" + oConfigMng.Config.DeviceFirmware + "}" + "\nDownloading " + oConfigMng.Config.DeviceFirmware + " Firmware");
                oConfigMng.Config.FirmwareExtracted = "0";
                oConfigMng.SaveConfig();
                downloadstart();
            }
        }
예제 #6
0
        public static void MotoDrivers()
        {
            Dialogs.ErrorDialog("Error: Motrola Drivers", "Error on loading Motorola drivers... Now Tool will install it!");
            Process          process          = new Process();
            ProcessStartInfo processStartInfo = new ProcessStartInfo(@"C:\Program Files\MotoTool\MotorolaDeviceManager_2.5.4.exe");

            process.StartInfo = processStartInfo;
            Dialogs.WarningDialog("Motrola Drivers: Warning", "Please install the following drivers! MotoTool will be closed!");
            if (!process.Start())
            {
                try
                {
                    Process myprocess = new Process();
                    string  arg       = @"/c taskkill /f";
                    try
                    {
                        foreach (Process p in Process.GetProcessesByName("adb.exe"))
                        {
                            arg += " /pid " + p.Id;
                        }
                        ProcessStartInfo process2 = new ProcessStartInfo("cmd");
                        process2.UseShellExecute = false;
                        process2.CreateNoWindow  = true;
                        process2.Verb            = "runas";
                        process2.Arguments       = arg;
                        Process.Start(process2);
                    }
                    catch (Exception er)
                    {
                        Logs.DebugErrorLogs(er);
                        Dialogs.ErrorDialog("Error: Killing Process {0}", "Killing process failed: {ADB} " + er.Message);
                    }
                    process.WaitForExit();
                    Application.Restart();
                }
                catch (Exception er)
                {
                    Logs.DebugErrorLogs(er);
                    Dialogs.ErrorDialog("Error: Exit Process", "Exit failed: {MotoToolUI} " + er.Message);
                }
            }
        }
예제 #7
0
 private void YES_Click(object sender, EventArgs e)
 {
     try
     {
         if (bw.IsBusy != true)
         {
             bw.RunWorkerAsync();
         }
         Dialogs.WarningDialog("CHECK: Please select yes on uninstaller box!", "Uninstall Warning: Please select yes on uninstaller box!");
         Process unins    = Process.Start(@"C:\Program Files\MotoTool\unins000.exe");
         int     id       = unins.Id;
         Process tempProc = Process.GetProcessById(id);
         this.Visible = false;
         tempProc.WaitForExit();
         Application.Exit();
     }
     catch (Exception ex)
     {
         Logs.DebugErrorLogs(ex);
         Dialogs.ErrorDialog("Error: Uninstall", "Uninstall failed: {0} " + ex.Message);
     }
 }
예제 #8
0
        private async void flash_Click(object sender, EventArgs e)
        {
            try
            {
                if (materialSwitchFlashAll.Checked == false && materialSwitchFlashAllExceptModem.Checked == false)
                {
                    cAppend("MOTO FLASH: Please select an option!");
                    Dialogs.WarningDialog("Moto Flash", "Please select an option!");
                    return;
                }

                string firmwarepath = @"C:\\adb\\Firmware\\" + oConfigMng.Config.DeviceFirmware + oConfigMng.Config.DeviceFirmwareInfo;
                Thread.Sleep(3000);

                if (state == IDDeviceState.FASTBOOT || state == IDDeviceState.BOOTLOADER)
                {
                    try
                    {
                        cAppend("MOTO FLASH: Settings firmware path: " + firmwarepath);
                        Directory.SetCurrentDirectory(firmwarepath);
                        cAppend("MOTO FLASH: Waiting for device...");
                        await Task.Run(() => ADB.WaitForDevice());

                        cAppend("MOTO FLASH: Rebooting into bootloader mode.");
                        await Task.Run(() => ADB.Instance().Reboot(IDBoot.BOOTLOADER));

                        if (materialSwitchFlashAll.Checked == true)
                        {
                            cAppend("Device Info: Waiting for device...");
                            await Task.Run(() => ADB.WaitForDevice());

                            if (oConfigMng.Config.DeviceCodenmae == "sofiar" && oConfigMng.Config.DeviceCodenmae == "doha" && oConfigMng.Config.DeviceCodenmae == "ocean" && oConfigMng.Config.DeviceCodenmae == "evert")
                            {
                                FFlash(FirmwareFlashRead.set_a);
                            }

                            FFlash(FirmwareFlashRead.getvar);
                            FFlash(FirmwareFlashRead.oem);
                            FFlash(FirmwareFlashRead.gpt);
                            FFlash(FirmwareFlashRead.bootloader);

                            if (oConfigMng.Config.DeviceCodenmae == "sanders")
                            {
                                FFlash(FirmwareFlashRead.fsg_a);
                                FFlash(FirmwareFlashRead.modemst1);
                                FFlash(FirmwareFlashRead.modemst2);
                                FFlash(FirmwareFlashRead.bluetooth_a);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_a_6);
                                FFlash(FirmwareFlashRead.system_a_7);
                                FFlash(FirmwareFlashRead.system_a_8);
                                FFlash(FirmwareFlashRead.system_a_9);
                                FFlash(FirmwareFlashRead.system_a_10);
                                FFlash(FirmwareFlashRead.oem_a);
                            }
                            if (oConfigMng.Config.DeviceCodenmae == "potter")
                            {
                                FFlash(FirmwareFlashRead.fsg_a);
                                FFlash(FirmwareFlashRead.modemst1);
                                FFlash(FirmwareFlashRead.modemst2);
                                FFlash(FirmwareFlashRead.bluetooth_a);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_a_6);
                                FFlash(FirmwareFlashRead.system_a_7);
                                FFlash(FirmwareFlashRead.system_a_8);
                                FFlash(FirmwareFlashRead.oem_a);
                            }
                            if (oConfigMng.Config.DeviceCodenmae == "ocean")
                            {
                                FFlash(FirmwareFlashRead.modem_a);
                                FFlash(FirmwareFlashRead.modem_b);
                                FFlash(FirmwareFlashRead.fsg_a);
                                FFlash(FirmwareFlashRead.fsg_b);
                                FFlash(FirmwareFlashRead.modemst1);
                                FFlash(FirmwareFlashRead.modemst2);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.dsp_b);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.logo_b);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.boot_b);
                                FFlash(FirmwareFlashRead.dtbo_a);
                                FFlash(FirmwareFlashRead.dtbo_b);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_a_6);
                                FFlash(FirmwareFlashRead.system_a_7);
                                FFlash(FirmwareFlashRead.system_a_8);
                                FFlash(FirmwareFlashRead.system_a_9);
                                FFlash(FirmwareFlashRead.system_b_0);
                                FFlash(FirmwareFlashRead.system_b_1);
                                FFlash(FirmwareFlashRead.system_b_2);
                                FFlash(FirmwareFlashRead.vendor_a_0);
                                FFlash(FirmwareFlashRead.vendor_a_1);
                                FFlash(FirmwareFlashRead.vendor_b_0);
                                FFlash(FirmwareFlashRead.vendor_b_1);
                                FFlash(FirmwareFlashRead.oem_a);
                                FFlash(FirmwareFlashRead.oem_b);
                            }
                            if (oConfigMng.Config.DeviceCodenmae == "sofiar")
                            {
                                FFlash(FirmwareFlashRead.vbmeta_a);
                                FFlash(FirmwareFlashRead.vbmeta_b);
                                FFlash(FirmwareFlashRead.radio_a);
                                FFlash(FirmwareFlashRead.radio_b);
                                FFlash(FirmwareFlashRead.bluetooth_a);
                                FFlash(FirmwareFlashRead.bluetooth_b);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.dsp_b);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.logo_b);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.boot_b);
                                FFlash(FirmwareFlashRead.dtbo_a);
                                FFlash(FirmwareFlashRead.dtbo_b);
                                FFlash(FirmwareFlashRead.recovery_a);
                                FFlash(FirmwareFlashRead.recovery_b);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_a_6);
                                FFlash(FirmwareFlashRead.system_a_7);
                                FFlash(FirmwareFlashRead.system_a_8);
                                FFlash(FirmwareFlashRead.system_a_9);
                                FFlash(FirmwareFlashRead.system_a_10);
                                FFlash(FirmwareFlashRead.system_a_11);
                                FFlash(FirmwareFlashRead.system_a_12);
                                FFlash(FirmwareFlashRead.system_a_13);
                                FFlash(FirmwareFlashRead.system_a_14);
                            }
                            if (oConfigMng.Config.DeviceCodenmae == "doha")
                            {
                                FirmwareFlashRead.ReadFirmwareFlashAB(oConfigMng.Config.DeviceCodenmae);
                                FFlash(FirmwareFlashRead.vbmeta_a);
                                FFlash(FirmwareFlashRead.vbmeta_b);
                                FFlash(FirmwareFlashRead.modem_a);
                                FFlash(FirmwareFlashRead.modem_b);
                                FFlash(FirmwareFlashRead.fsg_a);
                                FFlash(FirmwareFlashRead.fsg_b);
                                FFlash(FirmwareFlashRead.modemst1);
                                FFlash(FirmwareFlashRead.modemst2);
                                FFlash(FirmwareFlashRead.bluetooth_a);
                                FFlash(FirmwareFlashRead.bluetooth_b);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.dsp_b);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.logo_b);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.boot_b);
                                FFlash(FirmwareFlashRead.dtbo_a);
                                FFlash(FirmwareFlashRead.dtbo_b);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_b_0);
                                FFlash(FirmwareFlashRead.system_b_1);
                                FFlash(FirmwareFlashRead.oem_a);
                                FFlash(FirmwareFlashRead.oem_b);
                                FFlash(FirmwareFlashRead.vendor_a);
                                FFlash(FirmwareFlashRead.vendor_b);
                            }
                            if (oConfigMng.Config.DeviceCodenmae == "beckham")
                            {
                                FirmwareFlashRead.ReadFirmwareFlashAB(oConfigMng.Config.DeviceCodenmae);
                                FFlash(FirmwareFlashRead.modem_a);
                                FFlash(FirmwareFlashRead.fsg_a);
                                FFlash(FirmwareFlashRead.modemst1);
                                FFlash(FirmwareFlashRead.modemst2);
                                FFlash(FirmwareFlashRead.bluetooth_a);
                                FFlash(FirmwareFlashRead.dsp_a);
                                FFlash(FirmwareFlashRead.logo_a);
                                FFlash(FirmwareFlashRead.boot_a);
                                FFlash(FirmwareFlashRead.system_a_0);
                                FFlash(FirmwareFlashRead.system_a_1);
                                FFlash(FirmwareFlashRead.system_a_2);
                                FFlash(FirmwareFlashRead.system_a_3);
                                FFlash(FirmwareFlashRead.system_a_4);
                                FFlash(FirmwareFlashRead.system_a_5);
                                FFlash(FirmwareFlashRead.system_b_0);
                                FFlash(FirmwareFlashRead.oem_a);
                                FFlash(FirmwareFlashRead.oem_b);
                                FFlash(FirmwareFlashRead.vendor_a);
                                FFlash(FirmwareFlashRead.vendor_b);
                            }
                            FFlash(FirmwareFlashRead.erasecarrier);
                            FFlash(FirmwareFlashRead.eraseuserdata);
                            FFlash(FirmwareFlashRead.eraseddr);
                            FFlash(FirmwareFlashRead.oemclear);
                            FFlash(FirmwareFlashRead.reboot);
                            Dialogs.InfoDialog("FIRMWARE Installed!", "FIRMWARE: " + oConfigMng.Config.DeviceFirmwareInfo + " installed!");
                        }

                        // no modem
                        if (materialSwitchFlashAllExceptModem.Checked == true)
                        {
                            cAppend("Moto Flash: Flash No Modem: This option is not ready yet...");
                            Dialogs.WarningDialog("Moto Flash: Flash No Modem", "This option is not ready yet...");
                            materialSwitchFlashAllExceptModem.Checked = false;
                            return;
                        }
                    }
                    catch (Exception er)
                    {
                        Logs.DebugErrorLogs(er);
                        Dialogs.WarningDialog("Moto Flash: ERROR", er.Message);
                    }
                }
                else
                {
                    Dialogs.WarningDialog("Moto Flash", "Please plug your device! Remember to plug your phone on Fastboot Mode!");
                }
            }
            catch (Exception er)
            {
                Logs.DebugErrorLogs(er);
                Dialogs.ErrorDialog("ERROR: Moto Flash", "Error: " + er);
                return;
            }
        }
예제 #9
0
        private async void MotoFlash_Load(object sender, EventArgs e)
        {
            oConfigMng.LoadConfig();
            cAppend("STARTING MOTO FLASH: Starting DeviceDetectionService...");
            await Task.Run(() => DeviceDetectionService());

            cAppend("STARTING MOTO FLASH: Starting DeviceDetectionService... {OK}");
            if (oConfigMng.Config.ToolTheme == "light")
            {
                materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
            }
            if (oConfigMng.Config.ToolTheme == "dark")
            {
                materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
            }
            if (oConfigMng.Config.DeviceCodenmae == "")
            {
                cAppend("STARTING MOTO FLASH: Please connect your device, so MotoTool can check your device!");
                Dialogs.WarningDialog("MotoFlash", "Please connect your device, so MotoTool can check your device!");
                materialButtonDowngradeMoto.Enabled = false;
                materialButtonFlashMoto.Enabled     = false;
                groupBox1.Enabled = false;
                return;
            }

            if (oConfigMng.Config.DeviceCodenmae != "beckham" &&
                oConfigMng.Config.DeviceCodenmae != "doha" &&
                oConfigMng.Config.DeviceCodenmae != "sanders" &&
                oConfigMng.Config.DeviceCodenmae != "potter" &&
                oConfigMng.Config.DeviceCodenmae != "ocean" &&
                oConfigMng.Config.DeviceCodenmae != "sofiar")
            {
                cAppend("STARTING MOTO FLASH: Device not compatible yet! Current device: " + oConfigMng.Config.DeviceCodenmae);
                materialButtonDowngradeMoto.Enabled = false;
                materialButtonFlashMoto.Enabled     = false;
                groupBox1.Enabled = false;
                Dialogs.WarningDialog("MotoFlash: Device not compatible yet!", "Hey! im working to make compatible your device! device compatible for now: Beckham, Doha, Potter, Sanders, Ocean and Sofiar");
                return;
            }
            else
            {
                string firmwarepath = @"C:\\adb\\Firmware\\" + oConfigMng.Config.DeviceFirmware + oConfigMng.Config.DeviceFirmwareInfo;
                if (Directory.Exists(firmwarepath) && oConfigMng.Config.FirmwareExtracted == "1")
                {
                    if (oConfigMng.Config.DeviceFirmware == oConfigMng.Config.DeviceFirmware)
                    {
                        cAppend("STARTING MOTO FLASH: Setting firmware path: " + firmwarepath);
                        Directory.SetCurrentDirectory(firmwarepath);
                    }
                }
                else
                {
                    cAppend("STARTING MOTO FLASH: Please download your firmware! - Device Channel: " + "{ " + oConfigMng.Config.DeviceFirmware + "}");
                    materialButtonDowngradeMoto.Enabled = false;
                    materialButtonFlashMoto.Enabled     = false;
                    groupBox1.Enabled = false;
                    Dialogs.WarningDialog("Moto Flash", "Please download your firmware! - Device Channel: " + "{" + oConfigMng.Config.DeviceFirmware + "}");
                    return;
                }
            }
        }
예제 #10
0
        private void Firmwares_Load(object sender, EventArgs e)
        {
            oConfigMng.LoadConfig();

            if (oConfigMng.Config.ToolTheme == "light")
            {
                materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
            }
            if (oConfigMng.Config.ToolTheme == "dark")
            {
                materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
            }
            cAppend("FIRMWARE STARTING: Checking internet connection...");
            if (InternetCheck.ConnectToInternet() == true)
            {
                cAppend("FIRMWARE STARTING: Checking internet connection... {OK}");
                label2.Text = " Internet Connection: Online";
            }
            else
            {
                cAppend("FIRMWARE STARTING: Checking internet connection... {ERROR}");
                label2.Text = " Internet Connection: Offline";
            }

            if (oConfigMng.Config.DeviceCodenmae == "")
            {
                cAppend("FIRMWARE STARTING: Please connect your device, so MotoTool can read firmwares!");
                Dialogs.WarningDialog("Device Check", "Please connect your device, so MotoTool can read firmwares!");
                return;
            }

            if (oConfigMng.Config.DeviceCodenmae == oConfigMng.Config.DeviceCodenmae)
            {
                LoadDeviceServer.CheckDevice(oConfigMng.Config.DeviceCodenmae + ".xml", oConfigMng.Config.DeviceCodenmae);
                string tr = "true";
                cAppend("FIRMWARE STARTING: Checking server...");
                if (LoadDeviceServer.fserverMaintenance == tr)
                {
                    cAppend("FIRMWARE STARTING: Firmware server is on maintenance! Please this will be back soon...");
                    Dialogs.WarningDialog("Firmware server is on maintenance", "Please this will be back soon...");
                    return;
                }
                else
                {
                    materialButtonFirmwareServer.Enabled = true;
                    cAppend("FIRMWARE STARTING: Checking server... {OK}");
                }
            }

            cAppend("FIRMWARE STARTING: Checking device info... ");
            if (oConfigMng.Config.DeviceCodenmae == "lima")
            {
                materialButtonRETAIL.Enabled  = true;
                materialButtonRETAPAC.Enabled = true;
                materialButtonRETAR.Enabled   = true;
                materialButtonRETIN.Enabled   = true;
                materialButtonRETBR.Enabled   = true;
                materialButtonRETCA.Enabled   = true;
                materialButtonRETEU.Enabled   = true;
                materialButtonRETLA.Enabled   = true;
                materialButtonRETGB.Enabled   = true;
                materialButtonRETCL.Enabled   = true;
                materialButtonTEFBR.Enabled   = true;
                materialButtonOPENCL.Enabled  = true;
                materialButtonOPENMX.Enabled  = true;
                materialButtonOPENLA.Enabled  = true;
                materialButtonOPENPE.Enabled  = true;
                materialButtonEEGB.Enabled    = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
            if (oConfigMng.Config.DeviceCodenmae == "sofiar")
            {
                materialButtonAMXLA.Enabled  = true;
                materialButtonAMXCL.Enabled  = true;
                materialButtonAMXCO.Enabled  = true;
                materialButtonATTMX.Enabled  = true;
                materialButtonOPENMX.Enabled = true;
                materialButtonRETLA.Enabled  = true;
                materialButtonRETAR.Enabled  = true;
                materialButtonRETEU.Enabled  = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
            if (oConfigMng.Config.DeviceCodenmae == "beckham")
            {
                materialButtonAMXBR.Enabled   = true;
                materialButtonAMXLA.Enabled   = true;
                materialButtonAMXM.Enabled    = true;
                materialButtonAMZ.Enabled     = true;
                materialButtonRETAIL.Enabled  = true;
                materialButtonRETAPAC.Enabled = true;
                materialButtonRETAR.Enabled   = true;
                materialButtonRETBR.Enabled   = true;
                materialButtonRETCA.Enabled   = true;
                materialButtonRETEU.Enabled   = true;
                materialButtonRETUS.Enabled   = true;
                materialButtonRETLA.Enabled   = true;
                materialButtonTEFBR.Enabled   = true;
                materialButtonTEFCL.Enabled   = true;
                materialButtonTEFCO.Enabled   = true;
                materialButtonTEFPE.Enabled   = true;
                materialButtonATTMX.Enabled   = true;
                materialButtonBWACA.Enabled   = true;
                materialButtonDTEU.Enabled    = true;
                materialButtonNIIPE.Enabled   = true;
                materialButtonOPENCL.Enabled  = true;
                materialButtonOPENMX.Enabled  = true;
                materialButtonSprint.Enabled  = true;
                materialButtonTIGCO.Enabled   = true;
                materialButtonTIMBR.Enabled   = true;
                materialButtonUSC.Enabled     = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
            if (oConfigMng.Config.DeviceCodenmae == "doha")
            {
                materialButtonAMXBR.Enabled   = true;
                materialButtonAMXLA.Enabled   = true;
                materialButtonAMXM.Enabled    = true;
                materialButtonAMXCL.Enabled   = true;
                materialButtonAMXPE.Enabled   = true;
                materialButtonRETIN.Enabled   = true;
                materialButtonRETRU.Enabled   = true;
                materialButtonRETAIL.Enabled  = true;
                materialButtonRETAPAC.Enabled = true;
                materialButtonRETAR.Enabled   = true;
                materialButtonRETBR.Enabled   = true;
                materialButtonRETEU.Enabled   = true;
                materialButtonTEFMX.Enabled   = true;
                materialButtonORAEU.Enabled   = true;
                materialButtonPLUSPL.Enabled  = true;
                materialButtonTIGCA.Enabled   = true;
                materialButtonATTMX.Enabled   = true;
                materialButtonOPENCL.Enabled  = true;
                materialButtonOPENMX.Enabled  = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
            if (oConfigMng.Config.DeviceCodenmae == "evert" &&
                oConfigMng.Config.DeviceCodenmae == "potter" &&
                oConfigMng.Config.DeviceCodenmae == "lake")
            {
                materialButtonAMXBR.Enabled = true;
                materialButtonAMXLA.Enabled = true;
                materialButtonAMXM.Enabled  = true;
                materialButtonAMXCL.Enabled = true;
                materialButtonAMXPE.Enabled = true;
                materialButtonAMXCO.Enabled = true;
                materialButtonTEFBR.Enabled = true;
                materialButtonTEFCO.Enabled = true;
                materialButtonTEFMX.Enabled = true;
                materialButtonTEFES.Enabled = true;

                if (oConfigMng.Config.DeviceCodenmae == "evert")
                {
                    materialButtonRETUS.Enabled    = true;
                    materialButtonRETGB.Enabled    = true;
                    materialButtonRETIN.Enabled    = true;
                    materialButtonRETAIL.Enabled   = true;
                    materialButtonRETAPAC.Enabled  = true;
                    materialButtonRETAR.Enabled    = true;
                    materialButtonRETBR.Enabled    = true;
                    materialButtonRETEU.Enabled    = true;
                    materialButtonRETLA.Enabled    = true;
                    materialButtonRETLA1ST.Enabled = true;
                    materialButtonWOMCL.Enabled    = true;
                    materialButtonTIMBR.Enabled    = true;
                    materialButtonTIGCO.Enabled    = true;
                    materialButtonENTCL.Enabled    = true;
                    cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
                }
                if (oConfigMng.Config.DeviceCodenmae == "potter")
                {
                    materialButtonRETUS.Enabled    = true;
                    materialButtonRETGB.Enabled    = true;
                    materialButtonRETIN.Enabled    = true;
                    materialButtonRETAIL.Enabled   = true;
                    materialButtonRETAPAC.Enabled  = true;
                    materialButtonRETAR.Enabled    = true;
                    materialButtonRETBR.Enabled    = true;
                    materialButtonRETEU.Enabled    = true;
                    materialButtonRETLA.Enabled    = true;
                    materialButtonRETLA1ST.Enabled = true;
                    materialButtonRETMX.Enabled    = true;
                    materialButtonTIMBR.Enabled    = true;
                    materialButtonTIGCO.Enabled    = true;
                    cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
                }
                if (oConfigMng.Config.DeviceCodenmae == "lake")
                {
                    materialButtonRETGB.Enabled   = true;
                    materialButtonRETAIL.Enabled  = true;
                    materialButtonRETAPAC.Enabled = true;
                    materialButtonRETAR.Enabled   = true;
                    materialButtonRETBR.Enabled   = true;
                    materialButtonRETEU.Enabled   = true;
                    materialButtonRETLA.Enabled   = true;
                    materialButtonRETRU.Enabled   = true;
                    materialButtonTEFBR.Enabled   = true;
                    materialButtonTEFCO.Enabled   = true;
                    materialButtonTEFMX.Enabled   = true;
                    materialButtonEEGB.Enabled    = true;
                    materialButtonORAEU.Enabled   = true;
                    materialButtonTMO.Enabled     = true;
                    materialButtonENTCL.Enabled   = true;
                    materialButtonTIMBR.Enabled   = true;
                    materialButtonWOMCL.Enabled   = true;
                    materialButtonTIGCO.Enabled   = true;
                    cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
                }
            }
            if (oConfigMng.Config.DeviceCodenmae == "river")
            {
                materialButtonAMXBR.Enabled   = true;
                materialButtonAMZ.Enabled     = true;
                materialButtonRETGB.Enabled   = true;
                materialButtonRETAIL.Enabled  = true;
                materialButtonRETAPAC.Enabled = true;
                materialButtonRETAR.Enabled   = true;
                materialButtonRETBR.Enabled   = true;
                materialButtonRETEU.Enabled   = true;
                materialButtonRETLA.Enabled   = true;
                materialButtonRETRU.Enabled   = true;
                materialButtonRETUS.Enabled   = true;
                materialButtonRETIN.Enabled   = true;
                materialButtonTEFBR.Enabled   = true;
                materialButtonTEFCO.Enabled   = true;
                materialButtonTEFPE.Enabled   = true;
                materialButtonOPENCL.Enabled  = true;
                materialButtonOPENMX.Enabled  = true;
                materialButtonTIMBR.Enabled   = true;
                materialButtonNIIPE.Enabled   = true;
                materialButtonTIGCO.Enabled   = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
            if (oConfigMng.Config.DeviceCodenmae == "sanders")
            {
                materialButtonAMXBR.Enabled   = true;
                materialButtonRETGB.Enabled   = true;
                materialButtonRETAIL.Enabled  = true;
                materialButtonRETAPAC.Enabled = true;
                materialButtonRETAR.Enabled   = true;
                materialButtonRETBR.Enabled   = true;
                materialButtonRETLA.Enabled   = true;
                materialButtonRETRU.Enabled   = true;
                materialButtonRETUS.Enabled   = true;
                materialButtonRETIN.Enabled   = true;
                materialButtonTEFBR.Enabled   = true;
                materialButtonOPENMX.Enabled  = true;
                materialButtonTIMBR.Enabled   = true;
                cAppend("FIRMWARE STARTING: Checking device info... {" + oConfigMng.Config.DeviceCodenmae + "}");
            }
        }