/// <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; } }
/// <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); }
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); } }
private void RebootTempRecoveryThread() { Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "boot", recovery)); }
private void OemlockThread() { Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "oem lock")); }
private void FastbootRebootEdlThread() { Fastboot.EDL(); }
private void FastbootRebootThread() { Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "reboot")); }
/// <summary> /// erase specifik partition over fastboot mode /// </summary> public void FastbootErase(string file) { Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "erase", file)); }
private void FastbootFlashImgThread() { Fastboot.ExecuteFastbootCommandNoReturn(Fastboot.FormFastbootCommand(this, "flash", FlashImgCmd)); }
/// <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; } }