Example #1
0
        /// <summary>
        /// oem device-info  to check devices is unlocked or not
        /// </summary>
        private void OemInfo()
        {
            string sts   = Fastboot.info();
            string param = ".*?";

            param += "Device unlocked: true";
            Regex r = new Regex(param, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            Match m = r.Match(sts);

            if (m.Success)
            {
                unlocked = true;
            }
        }
Example #2
0
        /// <summary>
        /// send command based current device state
        /// </summary>
        public string Commander(string command)
        {
            var res = "";

            if (State == DeviceState.ONLINE || State == DeviceState.RECOVERY)
            {
                res = AdbCmd.ExecuteAdbCommand(AdbCmd.FormAdbCommand(command));
            }
            else if (State == DeviceState.FASTBOOT)
            {
                res = Fastboot.ExecuteFastbootCommand(Fastboot.FormFastbootCommand(command));
            }
            return(res);
        }
Example #3
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);
            }
        }
Example #4
0
 private void RebootTempRecoveryThread()
 {
     Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "boot", recovery));
 }
Example #5
0
 private void OemlockThread()
 {
     Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "oem lock"));
 }
Example #6
0
 private void FastbootRebootEdlThread()
 {
     Fastboot.EDL();
 }
Example #7
0
 private void FastbootRebootThread()
 {
     Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "reboot"));
 }
Example #8
0
 /// <summary>
 /// erase specifik partition over fastboot mode
 /// </summary>
 public void FastbootErase(string file)
 {
     Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "erase", file));
 }
Example #9
0
 private void FastbootFlashImgThread()
 {
     Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "flash", FlashImgCmd));
 }
Example #10
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;
     }
 }