Exemple #1
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();
            }
        }
 private void download_Click(object sender, EventArgs e)
 {
     if (oConfigMng.Config.DeviceCodenmae == oConfigMng.Config.DeviceCodenmae)
     {
         LoadDeviceServer.CheckDevice(oConfigMng.Config.DeviceCodenmae + ".xml", oConfigMng.Config.DeviceCodenmae);
     }
     download.Enabled = true;
     downloadcall("/TWRPINSTALLER.xml", "TWRP");
 }
Exemple #3
0
 private void ExtractFile_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     //Set the maximum vaue to int.MaxValue because the process is completed
     oConfigMng.LoadConfig();
     progressBar_Individual.Value = int.MaxValue;
     progressBar_Total.Value      = int.MaxValue;
     Dialogs.InfoDialog("INFO: Unzip", "The zip has been extracted well!");
     oConfigMng.Config.FirmwareExtracted = "1";
     oConfigMng.SaveConfig();
     LoadDeviceServer.CheckDevice(oConfigMng.Config.DeviceCodenmae + ".xml", oConfigMng.Config.DeviceCodenmae);
     if (File.Exists(DownloadsMng.SAVEPathname))
     {
         File.Delete(DownloadsMng.SAVEPathname);
     }
     this.Dispose();
 }
        private void TWRPPermanent_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;
            }

            if (oConfigMng.Config.DeviceCodenmae == oConfigMng.Config.DeviceCodenmae)
            {
                LoadDeviceServer.CheckDevice(oConfigMng.Config.DeviceCodenmae + ".xml", oConfigMng.Config.DeviceCodenmae);
            }
            string fileName = @"C:\adb\TWRP\" + LoadDeviceServer.twrpinstallername;

            if (File.Exists(fileName))
            {
                long   length = new FileInfo(fileName).Length;
                string vIn    = oConfigMng.Config.DownloadFileSizeTWRPPermanent;
                long   vOut   = Convert.ToInt64(vIn);
                if (length == vOut)
                {
                    DownloadsMng.TOOLDOWNLOAD(oConfigMng.Config.DeviceCodenmae, "/TWRPINSTALLER.xml", "TWRP");
                    label1.Text = "Hey! " + LoadDeviceServer.twrpinstallername + " it's already downloaded, first you need to boot TWRP and then flash it!";
                    cancel.Text = "OK";
                    return;
                }
                else
                {
                    oConfigMng.Config.DownloadFileSizeTWRPPermanent = "";
                    label1.Text      = "Hey! " + LoadDeviceServer.twrpinstallername + " it's already downloaded but file is corrupted!, download again please!";
                    download.Enabled = true;
                    return;
                }
            }
            else
            {
                download.Enabled = true;
            }
        }
Exemple #5
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 + "}");
            }
        }