Example #1
0
        private void UntetherWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            untetherWorker.ReportProgress(0, "Gathering IP Address...");
            String IP_Address = ADBUtility.GatherIPAddress(deviceForOperation);

            untetherWorker.ReportProgress(0, "Changing ADB mode to TCP/IP...");
            ADBUtility.ChangeADBModeToTCPIP(deviceForOperation);
            untetherWorker.ReportProgress(0, $"Connecting ADB to {IP_Address}");
            ADBUtility.ConnectADBToRemoteDevice(IP_Address);
            untetherWorker.ReportProgress(0, "Waiting...");
            Thread.Sleep(5000);
            this.Invoke(new Action(() =>
            {
                RefreshDevices();
            }));
        }
Example #2
0
 private void comboBoxDevices_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxDevices.SelectedItem != null)
     {
         ADBDevice selectedDevice = (ADBDevice)comboBoxDevices.SelectedItem;
         if (selectedDevice.DEVICE_ID.Contains("."))
         {
             buttonUntether.Text = "Disconnect";
             statusLabel.Text    = "This is a remote device connected to this computer.";
         }
         else if (ADBUtility.IsDeviceAlreadyConnected(ADBUtility.GatherIPAddress(selectedDevice)))
         {
             buttonUntether.Text = "Disconnect";
             statusLabel.Text    = "This device is already connected to this computer over WiFi.";
         }
         else
         {
             buttonUntether.Text = "Untether";
             String Network_Interface = ADBUtility.GatherInterface(selectedDevice);
             buttonUntether.Enabled = Network_Interface.Contains("wlan");
             statusLabel.Text       = Network_Interface.Contains("wlan") ? "Ready" : "The selecte device is not connected to a WiFi network.";
         }
     }
 }