Пример #1
0
 /// <summary>
 /// Updates Internal Device List
 /// </summary>
 /// <remarks>Call this before checking for Devices, or setting a new Device, for most updated results</remarks>
 public void UpdateDeviceList()
 {
     connectedDevices.Clear();
     if (SN(AdbCmd.Devices().Replace("List of devices attached", "")).Length > 0 || SN(Fastboot.Devices()).Length > 0)
     {
         IsConnected = true;
     }
     else if (Miuidl.Port().Length > 0)
     {
         connectedDevices.Add(Miuidl.Port());
         IsConnected = true;
     }
     else
     {
         IsConnected = false;
     }
 }
Пример #2
0
        private DeviceState SetState()
        {
            string state = null;

            getstate(AdbCmd.Devices());
            getstate(Fastboot.Devices());
            if (state == null)
            {
                state = mode;
            }
            if (state == null)
            {
                IsEdl();
                state = mode.ToString();
            }
            switch (state)
            {
            case "device":
                return(DeviceState.ONLINE);

            case "recovery":
                return(DeviceState.RECOVERY);

            case "fastboot":
                OemInfo();
                return(DeviceState.FASTBOOT);

            case "sideload":
                return(DeviceState.SIDELOAD);

            case "unauthorized":
                return(DeviceState.UNAUTHORIZED);

            case "9008":
                return(DeviceState.EDL);

            case "900E":
                return(DeviceState.QDL);

            default:
                return(DeviceState.UNKNOWN);
            }
        }