Ejemplo n.º 1
0
        private void muiChange_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Please restart the application after it has finished downloading your selected device's recoveries to see effects.", "Restart required", MessageBoxButton.OK, MessageBoxImage.Information);
            var selector = new DeviceSelector();

            selector.ShowDialog();
        }
Ejemplo n.º 2
0
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            #region FileStrucCheck

            CheckFileSystem();

            #endregion

            #region Select Device

            try
            {
                if (Properties.Settings.Default["Device"].ToString() == "None")
                {
                    MessageBox.Show("Please select your device on the next screen.", "No device selected", MessageBoxButton.OK, MessageBoxImage.Information);
                    var select = new DeviceSelector();
                    select.ShowDialog();
                }
                else
                {
                    //Continue
                }

                #region Restarting ADB server
                //Stopping of ADB server
                try
                {
                    foreach (Process proc in Process.GetProcessesByName("adb"))
                    {
                        proc.Kill();
                    }

                    foreach (Process proc in Process.GetProcessesByName("fastboot"))
                    {
                        proc.Kill();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                Thread.Sleep(2000);

                //Deployment of ADB
                Deploy.ADB();

                //After deployment of adb and fastboot files we load the main form.

                Main main = new Main();
                main.Show();

                //After loading the main form, we close this one.

                this.Close();
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    "An error has occured! A log file has been placed in the Logs folder. Please report this error, with the log file, in the toolkit thread on XDA. Links in the 'File' menu!",
                    "Critical Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                string fileDateTime = DateTime.Now.ToString("MMddyyyy") + "_" + DateTime.Now.ToString("HHmmss");
                var    file         = new StreamWriter("./Data/Logs/" + fileDateTime + ".txt");
                file.WriteLine(ex);
                file.Close();
            }

            #endregion
        }