private void changePhoneComboBox_SelectionChangeCommitted(object sender, EventArgs e)
        {
            try
            {
                switch (changePhoneComboBox.Text)
                {
                    case "Amaze":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "Amaze";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "HTC Amaze";
                            secondTWRPButton.Enabled = false;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "Option Two";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "Desire HD":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "Desire HD";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "HTC Desire HD";
                            secondTWRPButton.Enabled = false;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "Option Two";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "Desire X":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "Desire X";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "Hboot 1.25 (JB)";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "Hboot 1.24 (ICS)";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "Droid DNA":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "Droid DNA";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = true;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "HTC Droid DNA";
                            secondTWRPButton.Enabled = false;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "Option Two";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "EVO 4G LTE":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "EVO 4G LTE";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "EVO 4G LTE";
                            secondTWRPButton.Enabled = false;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "Option Two";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One (M7)":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One (M7)";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "GSM One (M7)";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "Verizon";
                            secondRecoveriesGroupBox.Text = "CDMA One (M7)";
                            thirdTWRPButton.Enabled = true;
                            thirdTWRPButton.Text = "Sprint";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One (M8)":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One (M8)";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "GSM One (M8)";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "Verizon";
                            secondRecoveriesGroupBox.Text = "CDMA One (M8)";
                            thirdTWRPButton.Enabled = true;
                            thirdTWRPButton.Text = "Sprint";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One S":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One S";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "One S (S4)";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "One S (S3_C2)";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One V":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One V";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "PrimoU (GSM)";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "PrimoC (CDMA)";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One X":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One X";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = true;
                            gainSuperCIDButton.Text = "AT&&T One X ONLY";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "HTC One X";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "AT&&T One X";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "One X+":
                        {
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "One X+";
                            phoneDownload.Show();
                            gainSuperCIDButton.Enabled = false;
                            gainSuperCIDButton.Text = "Gain SuperCID";
                            firstTWRPButton.Enabled = true;
                            firstRecoveriesGroupBox.Text = "International X+";
                            secondTWRPButton.Enabled = true;
                            secondTWRPButton.Text = "TWRP";
                            secondRecoveriesGroupBox.Text = "AT&&T One X+";
                            thirdTWRPButton.Enabled = false;
                            thirdTWRPButton.Text = "CWM";
                            mainTabControl.SelectedIndex = 0;
                        }
                        break;

                    case "Other":
                        gainSuperCIDButton.Enabled = false;
                        firstTWRPButton.Enabled = false;
                        firstRecoveriesGroupBox.Text = "Option One";
                        secondTWRPButton.Enabled = false;
                        thirdTWRPButton.Enabled = false;
                        secondRecoveriesGroupBox.Text = "Option Two";
                        secondTWRPButton.Text = "TWRP";
                        thirdTWRPButton.Text = "CWM";
                        mainTabControl.SelectedIndex = 0;
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    "An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
                    "Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
                var file = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
                file.WriteLine(ex);
                file.Close();
            }
        }
 private void gainSuperCIDButton_Click(object sender, EventArgs e)
 {
     try
     {
         using (var sr = new StreamReader("./Data/Settings/Phone.ini"))
         {
             String line = sr.ReadToEnd();
             if (line == "Droid DNA")
             {
                 if (statusLabel.Text == @"Status: Online")
                 {
                     DialogResult dialogResult =
                         MessageBox.Show(
                             @"This is an app to be installed on your phone that will automatically give you SuperCID. Would you like to download and install it now?",
                             @"SuperCID", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                     if (dialogResult == DialogResult.Yes)
                     {
                         var phoneDownload = new PhoneDownload();
                         PhoneDownload.AndroidLib.Selector = "Droid DNA SuperCID";
                         phoneDownload.mainLabel.Text = "Downloading SuperCID Files...";
                         phoneDownload.Show();
                     }
                     if (dialogResult == DialogResult.No)
                     {
                         Process.Start("http://forum.xda-developers.com/showthread.php?t=2109862");
                     }
                 }
                 else
                 {
                     MessageBox.Show(
                         @"A phone has not been recognized by the toolkit!",
                         @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
             if (line == "One X")
             {
                 if (statusLabel.Text == @"Status: Online")
                 {
                     DialogResult dialogResult =
                         MessageBox.Show(
                             @"To unlock your bootloader, you must gain SuperCID on your phone through a special program. Would you like to download it now?",
                             @"SuperCID", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                     if (dialogResult == DialogResult.Yes)
                     {
                         var phoneDownload = new PhoneDownload();
                         PhoneDownload.AndroidLib.Selector = "One X SuperCID";
                         phoneDownload.mainLabel.Text = "Downloading SuperCID...";
                         phoneDownload.Show();
                     }
                     if (dialogResult == DialogResult.No)
                     {
                         Process.Start("http://forum.xda-developers.com/showthread.php?t=2285086");
                     }
                 }
                 else
                 {
                     MessageBox.Show(
                         @"A phone has not been recognized by the toolkit! Please click the Reload button to check again!",
                         @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             @"An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
             @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
         var file = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
         file.WriteLine(ex);
         file.Close();
     }
 }
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                deviceRecognition.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this,
                    @"An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
                    @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
                var file = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
                file.WriteLine(ex);
                file.Close();
            }

            CheckFileSystem();

            try
            {
                switch (Properties.Settings.Default.SelectedDevice)
                {
                    case "None":
                        {
                            DialogResult pickDeviceDialogResult = MessageBox.Show(this,
                                @"Thanks for choosing the WinDroid Toolkit." + "\n" +
                                @"A specific phone has not been chosen." + "\n" +
                                @"Some toolkit features may not function correctly." + "\n" +
                                @"Would you like to choose one at this time?" + "\n",
                                @"Welcome To WinDroid!", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Information);
                            if (pickDeviceDialogResult == DialogResult.Yes)
                            {
                                changePhoneComboBox.Text = "Choose";
                                mainTabControl.SelectedIndex = 3;
                            }
                        }
                        break;

                    case "Amaze":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "Amaze";
                        changePhoneComboBox.Text = "Amaze";
                        break;

                    case "Desire HD":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "Desire HD";
                        changePhoneComboBox.Text = "Desire HD";
                        break;

                    case "Desire X":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "Hboot 1.25 (JB)";
                        secondTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "Hboot 1.24 (ICS)";
                        changePhoneComboBox.Text = "Desire X";
                        break;

                    case "Droid DNA":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "Droid DNA";
                        gainSuperCIDButton.Enabled = true;
                        changePhoneComboBox.Text = "Droid DNA";
                        break;

                    case "EVO 4G LTE":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "EVO 4G LTE";
                        changePhoneComboBox.Text = "EVO 4G LTE";
                        break;

                    case "One (M7)":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "GSM One (M7)";
                        secondTWRPButton.Enabled = true;
                        thirdTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "CDMA One (M7)";
                        secondTWRPButton.Text = "Verizon";
                        thirdTWRPButton.Text = "Sprint";
                        changePhoneComboBox.Text = "One (M7)";
                        break;

                    case "One (M8)":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "GSM One (M8)";
                        secondTWRPButton.Enabled = true;
                        thirdTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "CDMA One (M8)";
                        secondTWRPButton.Text = "Verizon";
                        thirdTWRPButton.Text = "Sprint";
                        changePhoneComboBox.Text = "One (M8)";
                        break;

                    case "One S":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "One S (S4)";
                        secondTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "One S (S3_C2) ";
                        changePhoneComboBox.Text = "Desire X";
                        break;

                    case "One V":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "PrimoU (GSM)";
                        secondTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "PrimoC (CDMA)";
                        changePhoneComboBox.Text = "One V";
                        break;

                    case "One X":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "HTC One X";
                        secondTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "AT&&T One X";
                        gainSuperCIDButton.Enabled = true;
                        gainSuperCIDButton.Text = "AT&&T One X ONLY";
                        changePhoneComboBox.Text = "One X";
                        break;

                    case "One X+":
                        firstTWRPButton.Enabled = true;
                        firstRecoveriesGroupBox.Text = "International X+";
                        secondTWRPButton.Enabled = true;
                        secondRecoveriesGroupBox.Text = "AT&&T One X+";
                        changePhoneComboBox.Text = "One X+";
                        break;

                    case "Other":
                        changePhoneComboBox.Text = "Other";
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    @"An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
                    @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
                var file = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
                file.WriteLine(ex);
                file.Close();
            }

            try
            {
                if (!Directory.Exists("C:/Program Files (x86)/ClockworkMod/Universal Adb Driver") &&
                    !Directory.Exists("C:/Program Files/ClockworkMod/Universal Adb Driver"))
                {
                    if (!Properties.Settings.Default.AdbDriverReminderEnabled) return;
                    DialogResult installDriversDialogResult =
                        MessageBox.Show(this,
                            @"You are missing some ADB Drivers!" + "\n" +
                            @"They are required for your phone to connect properly with the computer. Would you like to install them now?",
                            @"Hang on a second!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    switch (installDriversDialogResult)
                    {
                        case DialogResult.Yes:
                            var phoneDownload = new PhoneDownload();
                            PhoneDownload.AndroidLib.Selector = "ADB";
                            phoneDownload.Show();
                            break;

                        case DialogResult.No:
                            DialogResult adbreminderEnabledDialogResult =
                                MessageBox.Show(this,
                                    @"Would you like to be reminded of this the next time you open the toolkit?",
                                    @"Just double checking.", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question);

                            Properties.Settings.Default.AdbDriverReminderEnabled = adbreminderEnabledDialogResult ==
                                                                                   DialogResult.Yes;
                            Properties.Settings.Default.Save();

                            break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    @"An error has occured! A log file has been placed in the Logs folder within the Data folder. Please send the file to WindyCityRockr or post the file in the toolkit thread.",
                    @"Houston, we have a problem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
                var file = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
                file.WriteLine(ex);
                file.Close();
            }
        }