Esempio n. 1
0
        public void Visual_Closed(object sender, EventArgs e)
        {
            oConfigMng.Config.StartPos  = Location;
            oConfigMng.Config.StartSize = Size;
            oConfigMng.SaveConfig();
            android.Dispose();
            Adb.FastbootExecuteCommand("adb ", "kill-server");
            Process myprocess = new Process();
            string  arg       = @"/c taskkill /f";

            try
            {
                foreach (Process p in Process.GetProcessesByName("RedmiNote7Tool"))
                {
                    arg += " /pid " + p.Id;
                }
                ProcessStartInfo process = new ProcessStartInfo("cmd");
                process.UseShellExecute = false;
                process.CreateNoWindow  = true;
                process.Verb            = "runas";
                process.Arguments       = arg;
                Process.Start(process);
            }
            catch (Exception er)
            {
                MessageBox.Show("Killing process failed: {0} " + er.Message, "Error: Killing Process", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            Application.ExitThread();
            base.Dispose(Disposing);
        }
Esempio n. 2
0
        private void flashStockSplashToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to Flash Stock Splash? Caused by: Maybe another ROM has flashed other Splash", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                if (!File.Exists(@"C:\adb\.settings\splash.img"))
                {
                    MessageBox.Show("Can´t find Splash image...", "Splash Missing", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Downloads.downloadcall("Downloading MI Splash...", "https://bitbucket.org/Franco28/flashtool-motorola-moto-g5-g5plus/downloads/splash.img", @"C:\adb\.settings\splash.img");
                }
                else
                {
                    TextBox2.Text = "Checking device connection...";
                    if (IsConnected())
                    {
                        System.Threading.Thread.Sleep(1000);
                        TextBox2.Text = "Flashing Persist Image...";
                        System.Threading.Thread.Sleep(1000);
                        TextBox2.Text = USB_HUB_NODE.UsbHub.ToString();
                        Adb.FastbootExecuteCommand(@"fastboot ", @"flash splash C:\adb\.settings\splash.img");
                        Adb.FastbootExecuteCommand(@"fastboot ", @"reboot");
                        System.Threading.Thread.Sleep(3000);
                    }
                    else
                    {
                        TextBox2.Text = "Please connect your device...";
                        System.Threading.Thread.Sleep(1000);
                        MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "Flash: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                visual_reLoad();
            }
            visual_reLoad();
        }
Esempio n. 3
0
 private void flashStockRecoveryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!File.Exists(@"C:\adb\.settings\splash.img"))
     {
         MessageBox.Show("Can´t find Stock Recovery image...", "Recovery Missing", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         Downloads.downloadcall("Downloading MI Recovery GLOBAL-V11.0.4.0.PFGMIXM...", "https://bitbucket.org/Franco28/flashtool-motorola-moto-g5-g5plus/downloads/recovery.img", @"C:\adb\.settings\recovery.img");
     }
     else
     {
         TextBox2.Text = "Checking device connection...";
         if (IsConnected())
         {
             System.Threading.Thread.Sleep(1000);
             TextBox2.Text = "Flashing Stock Recovery...";
             System.Threading.Thread.Sleep(1000);
             TextBox2.Text = USB_HUB_NODE.UsbHub.ToString();
             Adb.FastbootExecuteCommand(@"fastboot ", @"flash splash C:\adb\.settings\recovery.img");
             Adb.FastbootExecuteCommand(@"fastboot ", @"reboot");
             System.Threading.Thread.Sleep(3000);
         }
         else
         {
             TextBox2.Text = "Please connect your device...";
             System.Threading.Thread.Sleep(1000);
             MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "Flash: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     visual_reLoad();
 }
Esempio n. 4
0
        private void EnterEDLModeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Are you sure that you wan to enter to EDL mode?", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                TextBox2.Text = "Checking device connection...";
                if (IsConnected())
                {
                    System.Threading.Thread.Sleep(1000);
                    TextBox2.Text = "Entering to EDL mode...";
                    System.Threading.Thread.Sleep(1000);
                    Adb.FastbootExecuteCommand(@"\fastboot_edl.exe ", @" reboot-edl");
                    System.Threading.Thread.Sleep(500);
                    TextBox2.Text = "Remember to always Backup your efs and persist folders!";
                }
                else
                {
                    TextBox2.Text = "Please connect your device...";
                    System.Threading.Thread.Sleep(1000);
                    MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "EDL: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    TextBox2.Text = "Remember to always Backup your efs and persist folders!";
                }
            }
            else
            {
                MessageBox.Show("EDL canceled...", "EDL", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                System.Threading.Thread.Sleep(500);
            }
        }
Esempio n. 5
0
        private void LockBootloader_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to Lock the bootloader? This will erase all your data!", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                TextBox2.Text = "Checking device connection...";
                if (IsConnected())
                {
                    System.Threading.Thread.Sleep(1000);
                    TextBox2.Text = "Locking bootloader...";
                    System.Threading.Thread.Sleep(1000);
                    Adb.FastbootExecuteCommand(@"\fastboot.exe", @"oem lock");
                    System.Threading.Thread.Sleep(500);
                    visual_reLoad();
                }
                else
                {
                    TextBox2.Text = "Please connect your device...";
                    System.Threading.Thread.Sleep(1000);
                    MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "Bootloader: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    visual_reLoad();
                }
            }
            else
            {
                MessageBox.Show("Lock Bootloader canceled...", "Bootloader", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                System.Threading.Thread.Sleep(1000);
            }
        }
Esempio n. 6
0
 private void rebootRecoveryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TextBox2.Text = "Checking device connection...";
     if (IsConnected())
     {
         System.Threading.Thread.Sleep(1000);
         TextBox2.Text = "Entering to Recovery mode...";
         System.Threading.Thread.Sleep(1000);
         Adb.FastbootExecuteCommand(@"\adb.exe ", @" reboot recovery");
         System.Threading.Thread.Sleep(500);
         TextBox2.Text = "Remember to always Backup your efs and persist folders!";
     }
     else
     {
         TextBox2.Text = "Please connect your device...";
         System.Threading.Thread.Sleep(1000);
         MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "RECOVERY: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         TextBox2.Text = "Remember to always Backup your efs and persist folders!";
     }
 }
Esempio n. 7
0
 private void flashtwrp_Click(object sender, EventArgs e)
 {
     if (!File.Exists(@"C:\adb\TWRP\OrangeFox-R10.1_01-Stable-lavender.zip"))
     {
         MessageBox.Show("Can´t find TWRP OrangeFox image...", "TWRP Missing", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         Downloads.downloadcall("Downloading OrangeFox-R10.1_01-Stable-lavender...", "https://files.orangefox.tech/OrangeFox-Stable/lavender/OrangeFox-R10.1_01-Stable-lavender.zip", @"C:\adb\TWRP\OrangeFox-R10.1_01-Stable-lavender.zip");
     }
     else
     {
         if (!File.Exists(@"C:\adb\TWRP\recovery.img"))
         {
             CheckFileSize.TWRP();
         }
         else
         {
             TextBox2.Text = "Checking device connection...";
             if (IsConnected())
             {
                 System.Threading.Thread.Sleep(1000);
                 TextBox2.Text = "Flashing TWRP OrangeFox...";
                 System.Threading.Thread.Sleep(1000);
                 Adb.FastbootExecuteCommand(@"\fastboot.exe ", @"flash recovery C:\adb\TWRP\recovery.img");
                 System.Threading.Thread.Sleep(3000);
                 Adb.FastbootExecuteCommand(@"\adb.exe ", @"reboot recovery");
                 TextBox2.Text = "Booting into OrangeFox...";
                 System.Threading.Thread.Sleep(2000);
                 MessageBox.Show("TWRP Installed!", "Flash: TWRP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 visual_reLoad();
             }
             else
             {
                 TextBox2.Text = "Please connect your device...";
                 System.Threading.Thread.Sleep(1000);
                 MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "Flash: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 visual_reLoad();
             }
         }
         visual_reLoad();
     }
 }
Esempio n. 8
0
        private void toolStripMenuItemFixPersist_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Do you want to fix Persist img? Caused by: Find Device Storage Corrupted, Your Device is Unsafe Now", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                if (!File.Exists(@"C:\adb\.settings\Persist-Fix-Lavender-GLOBAL-V11.0.4.0.PFGMIXM.zip"))
                {
                    MessageBox.Show("Can´t find Persist image...", "Persist Missing", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Downloads.downloadcall("Downloading Persist-Fix-Lavender-GLOBAL-V11.0.4.0.PFGMIXM...", "https://bitbucket.org/Franco28/flashtool-motorola-moto-g5-g5plus/downloads/Persist-Fix-Lavender-GLOBAL-V11.0.4.0.PFGMIXM.zip", @"C:\adb\.settings\Persist-Fix-Lavender-GLOBAL-V11.0.4.0.PFGMIXM.zip");
                }
                else
                {
                    TextBox2.Text = "Checking device connection...";
                    if (IsConnected())
                    {
                        System.Threading.Thread.Sleep(1000);
                        TextBox2.Text = "Entering to Recovery mode...";
                        System.Threading.Thread.Sleep(1000);
                        Adb.FastbootExecuteCommand(@"\adb.exe ", @" reboot recovery");
                        System.Threading.Thread.Sleep(500);
                        MessageBox.Show("Hey! Now flash this Persist-Fix-Lavender-GLOBAL-V11.0.4.0.PFGMIXM.zip, this will fix the sensors problems!", "IMPORTANT READ!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Franco28Tool.Engine.Folders.OpenFolder(@"adb\.settings");
                        TextBox2.Text = "Remember to always Backup your efs and persist folders!";
                    }
                    else
                    {
                        TextBox2.Text = "Please connect your device...";
                        System.Threading.Thread.Sleep(1000);
                        MessageBox.Show("Device doesn´t found, Please connect the phone and check if developer (adb) options are enabled", "RECOVERY: Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        TextBox2.Text = "Remember to always Backup your efs and persist folders!";
                    }
                }
            }
            visual_reLoad();
        }