private void btnUnlocked_Click(object sender, RoutedEventArgs e) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to set your "; config.Content = "This will unlock your bootloader." + ""; config.ExpandedInfo = "The banner is: **UNLOCKED**"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne \"HTCU\" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796'")); ciddiag.Show(); ADB.Instance().Reboot(AndroidCtrl.IDBoot.BOOTLOADER); } else { //Nothing } }
private void btnHtcDev_Click(object sender, RoutedEventArgs e) { if (deviceselector.Items.Count == 0) { MessageBox.Show("A device has not been detected as of yet. Wait 10 seconds or diagnose the issue.", "No Device", MessageBoxButton.OK, MessageBoxImage.Error); } IDDeviceState state = General.CheckDeviceState(ADB.Instance().DeviceID); if (state == IDDeviceState.DEVICE) { ADB.Instance().Reboot(IDBoot.BOOTLOADER); CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken()); ciddiag.Show(); MessageBox.Show("You must continue from the HTC Dev website.", "Redirecting to HTCDev.com", MessageBoxButton.OK, MessageBoxImage.Information); System.Diagnostics.Process.Start("http://www.htcdev.com/bootloader/"); } else if (state == IDDeviceState.FASTBOOT) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken()); ciddiag.Show(); MessageBox.Show("You must continue from the HTC Dev website.", "Redirecting to HTCDev.com", MessageBoxButton.OK, MessageBoxImage.Information); System.Diagnostics.Process.Start("http://www.htcdev.com/bootloader/"); } }
private void btnPushSU_Click(object sender, RoutedEventArgs e) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().Push("./Data/SuperSU.zip", "/sdcard/")); ciddiag.Show(); }
private void btnAdbShell_Click(object sender, RoutedEventArgs e) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(ADB.Instance().ShellCmd(tbAdbShell.Text)); }
private void btnFbtGo_Click(object sender, RoutedEventArgs e) { if (cBFbtCmds.Text == "Reboot") { Fastboot.Instance().Reboot(IDBoot.REBOOT); } else if (cBFbtCmds.Text == "Reboot Bootloader") { Fastboot.Instance().Reboot(IDBoot.BOOTLOADER); } else if (cBFbtCmds.Text == "RebootRUU") { Fastboot.Instance().OEM.RebootRUU(); } else if (cBFbtCmds.Text == "Read CID") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.ReadCid()); ciddiag.Show(); } else if (cBFbtCmds.Text == "Show Identifier Token") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.GetIdentifierToken()); ciddiag.Show(); } else if (cBFbtCmds.Text == "Relock Bootloader") { if (MessageBox.Show("Are you sure you want to relock the bootloader?", "Are you sure you want to relock?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.Lock()); ciddiag.Show(); } else { //No } } else if (cBFbtCmds.Text == "S-On Bootloader") { if (MessageBox.Show("Are you sure you want to S-On?", "Are you sure you want to S-On?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(Fastboot.Instance().OEM.WriteSecureFlag("3")); ciddiag.Show(); } else { //No } } else { MessageBox.Show("You have not selected a command.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void btnExec_Click(object sender, RoutedEventArgs e) { if (cBFbtOem.Text == "") { MessageBox.Show("You must select a command to execute!"); } else if (cBFbtOem.Text == "RebootRUU") { Fastboot.Instance().OEM.RebootRUU(); } else if (cBFbtOem.Text == "Lock Bootloader") { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure?"; config.MainInstruction = "You are about to RELOCK the bootloader."; config.Content = "You will need to go through an unlocking procedure again" + "to unlock the bootloader. (Either through HTCDev or the ADB Bootloader Commands)"; config.CommandButtons = new string[] { "No", "No", "Yes" }; config.MainIcon = VistaTaskDialogIcon.Information; TaskDialogResult res = TaskDialog.Show(config); if (res.CommandButtonResult == 0) { } else if (res.CommandButtonResult == 1) { } else if (res.CommandButtonResult == 2) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().OEM.Lock()); } } }
private void btnPushFw_Click(object sender, RoutedEventArgs e) { if (tBFwPath.Text == "") { if (MessageBox.Show("You have not selected firewater to complete the command. \nWould you like to locate it now?", "Missing File", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = "firewater"; dlg.Filter = "All Files (*.*)|*.*"; dlg.Title = "Locate Firewater"; // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { // Open document string filename = dlg.FileName; tBFwPath.Text = filename; } } else { MessageBox.Show("You cannot continue unless you select a file.", "Missing File", MessageBoxButton.OK, MessageBoxImage.Information); } } else { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().Push(tBFwPath.Text, "/data/local/tmp/firewater")); ciddiag.Show(); } }
private void btnBoot_Click(object sender, RoutedEventArgs e) { if (tBFbtPath.Text == "") { if (MessageBox.Show("You have not selected a file. Would you like to select one now?", "Missing File", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = ""; dlg.Filter = "All Files (*.*)|*.*"; dlg.Title = "Locate Files"; // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { // Open document string filename = dlg.FileName; tBFbtPath.Text = filename; } } else { //nothing } } else { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Boot(tBFbtPath.Text, "", 10)); } }
///<summary> /// Clean exit ///</summary> private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e) { _instance = null; }
private void btnMidGo_Click(object sender, RoutedEventArgs e) { if (lbMidList.SelectedIndex == 0) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "AT&T, Developer and Unlocked Editions of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B12000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(ADB.Instance().ShellCmd("su '-ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x32\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384'")); } else { //Nothing } } else if (lbMidList.SelectedIndex == 1) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "Google Play Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B17000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x37\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384'")); ciddiag.Show(); } else { //Nothing } } else if (lbMidList.SelectedIndex == 2) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "T-Mobile Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B13000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x33\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384'")); ciddiag.Show(); } else { //Nothing } } else if (lbMidList.SelectedIndex == 3) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "HTC Europe Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B10000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x30\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384")); ciddiag.Show(); } else { //Nothing } } else if (lbMidList.SelectedIndex == 4) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "Rogers Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B16000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x36\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384")); ciddiag.Show(); } else { //Nothing } } else if (lbMidList.SelectedIndex == 5) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "Wind (Canada) Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B13000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x33\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384")); ciddiag.Show(); } else { //Nothing } } else if (lbMidList.SelectedIndex == 6) { TaskDialogOptions config = new TaskDialogOptions(); config.Owner = this; config.Title = "Are you sure about your selection?"; config.MainInstruction = "You have chosen to change the Model ID of your device"; config.Content = "The Model ID you have chosen is the one for the " + "0P6B11000 Edition of the phone. Click 'Show Details' to show the MID number."; config.ExpandedInfo = "The Model ID is: 0P6B11000"; //config.VerificationText = "Don't show me this message again"; config.CustomButtons = new string[] { "&Continue", "&Cancel" }; config.MainIcon = VistaTaskDialogIcon.Information; //config.FooterText = "Optional footer text with an icon can be included."; //config.FooterIcon = VistaTaskDialogIcon.Warning; TaskDialogResult res = TaskDialog.Show(config); if (res.CustomButtonResult == 0) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Add(ADB.Instance().ShellCmd("su -c 'echo -ne '\x30\x00\x50\x00\x36\x00\x42\x00\x31\x00\x31\x00\x30\x00\x30\x00\x30' | dd of=/dev/block/mmcblk0p5 bs=1 seek=16384")); ciddiag.Show(); } else { //Nothing } } else { MessageBox.Show("You have not selected anything. You cannot continue."); } }
private void button1_Click(object sender, RoutedEventArgs e) { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); }
private void btnErase_Click(object sender, RoutedEventArgs e) { if (deviceselector.Text == "") { MessageBox.Show("A device has not been detected! Please wait 10 seconds or diagnose the issue!", "No device detected", MessageBoxButton.OK, MessageBoxImage.Error); } else { if (cBFbtPart.Text == "") { MessageBox.Show("You cannot continue unless you select a partition.", "Partition not Selected", MessageBoxButton.OK, MessageBoxImage.Information); } else { if (cBFbtPart.Text == "Boot") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.BOOT)); } else if (cBFbtPart.Text == "Cache") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.CACHE)); } else if (cBFbtPart.Text == "Data") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.DATA)); } else if (cBFbtPart.Text == "Hboot") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.HBOOT)); } else if (cBFbtPart.Text == "Kernel") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.KERNEL)); } else if (cBFbtPart.Text == "Misc") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.MISC)); } else if (cBFbtPart.Text == "Radio") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.RADIO)); } else if (cBFbtPart.Text == "Ramdisk") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.RAMDISK)); } else if (cBFbtPart.Text == "Recovery") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.RECOVERY)); } else if (cBFbtPart.Text == "System") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.SYSTEM)); } else if (cBFbtPart.Text == "Unlock Token") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.UNLOCKTOKEN)); } else if (cBFbtPart.Text == "Zip") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Erase(IDDevicePartition.ZIP)); } } } }
private void btnFbtFlash_Click(object sender, RoutedEventArgs e) { if (tBFbtPath.Text == "") { if (MessageBox.Show("You have not selected a file to complete the command. \nWould you like to locate one now?", "Missing File", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = ""; dlg.Filter = "All Files (*.*)|*.*"; dlg.Title = "Locate Files"; // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); // Get the selected file name and display in a TextBox if (result == true) { // Open document string filename = dlg.FileName; tBFbtPath.Text = filename; } } else { MessageBox.Show("You cannot continue unless you select a file.", "Missing File", MessageBoxButton.OK, MessageBoxImage.Information); } } else if (cBFbtPart.Text == "") { MessageBox.Show("You cannot continue unless you select a partition.", "Partition not Selected", MessageBoxButton.OK, MessageBoxImage.Information); } else { if (cBFbtPart.Text == "Boot") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.BOOT, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Cache") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.CACHE, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Data") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.DATA, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Hboot") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.HBOOT, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Kernel") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.KERNEL, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Misc") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.MISC, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Radio") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.RADIO, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Ramdisk") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.RAMDISK, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Recovery") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.RECOVERY, tBFbtPath.Text)); } else if (cBFbtPart.Text == "System") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.SYSTEM, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Unlock Token") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.UNLOCKTOKEN, tBFbtPath.Text)); } else if (cBFbtPart.Text == "Zip") { CidDialog ciddiag = CidDialog.Instance; ciddiag.Show(); ciddiag.Add(Fastboot.Instance().Flash(IDDevicePartition.ZIP, tBFbtPath.Text)); } } }