public async Task ListApps(TextBox context2, bool createNoWindow, string target = null) { await Context.Dispatcher.InvokeAsync(async() => { if (!string.IsNullOrEmpty(target)) { await Task.Run(async() => { string logcat = StringLinesRemover.ForgetLastLine( StringLinesRemover.RemoveLine( await _executor.Execute( new Command(string.Format("adb -s {0} shell pm list packages", target)), createNoWindow), 4)); await context2.Dispatcher.InvokeAsync(() => context2.Text = logcat); }); } else { await Task.Run(async() => { string logcat = StringLinesRemover.ForgetLastLine( StringLinesRemover.RemoveLine( await _executor.Execute(new Command(string.Format("adb shell pm list packages")), createNoWindow), 4)); await context2.Dispatcher.InvokeAsync(() => context2.Text = logcat); }); } }); }
void _bw_DoWork(object sender, DoWorkEventArgs e) { _adbDevices = StringLinesRemover.RemoveLine(_adb.ListAdbDevices(false), 5); _fastbootDevices = StringLinesRemover.RemoveLine(_fastboot.ListFastbootDevices(false), 4); }
void _osWorker_DoWork(object sender, DoWorkEventArgs e) { e.Result = _adb.DeviceOsVersion(createWindow, _target); _osVersion = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(e.Result.ToString(), 4)); }
void _deviceNameWorker_DoWork(object sender, DoWorkEventArgs e) { e.Result = _adb.DeviceName(createWindow, _target); _deviceName = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(e.Result.ToString(), 4)); }
void appsList_DoWork(object sender, DoWorkEventArgs e) { e.Result = _adb.ListApps(createWindow, _target); _appOutput = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(e.Result.ToString(), 4)); }
public async Task <string> GetCid(bool createNoWindow = true) { return(StringLinesRemover.FitString(StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(await Task.Run(async() => await _executor.Execute(new Command("fastboot oem getvar cid"))), 5)))); }
void _logcatWorker_DoWork(object sender, DoWorkEventArgs e) { e.Result = _advanced.Logcat(string.Format(@"""{0}\logcat.txt""", _logcatLocation), _createWindow); _logcat = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(e.Result.ToString(), 4)); }
public async Task <string> ListDevices(bool createNoWindow) { return(StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(await _executor.Execute(new Command("fastboot devices")), 5))); }
public async Task ListDevices(TextBox context, bool createNoWindow) { await context.Dispatcher.InvokeAsync(async() => context.Text = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(await _executor.Execute(new Command("fastboot devices")), 5))); }
public async Task <DeviceInfo> DeviceInfo(bool createWindow, string target = null) { Timer timer = new Timer(6000); timer.Elapsed += (sender, e) => { KillAdb(); timer.Dispose(); }; timer.Enabled = true; string name = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine( await DeviceName(createWindow, target), 4)); string codename = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine( await DeviceCodename(createWindow, target), 4)); string manufacturer = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine( await DeviceManufacturer(createWindow, target), 4)); string os = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(await DeviceOsVersion(createWindow, target), 4)); string osDetails = string.Empty; string root = string.Empty; Parallel.Invoke(async() => { try { root = await _executor.Execute(new Command("adb shell su"), createWindow); root = StringLinesRemover.RemoveLine(root, 4); root = StringLinesRemover.ForgetLastLine(root); } catch { root = string.Empty; } }, () => { Thread.Sleep(200); KillAdb(); }); string buildprop = StringLinesRemover.ForgetLastLine(StringLinesRemover.RemoveLine(await BuildProp(createWindow, target), 5)); bool isRoot = false; if (os.Contains("1.5")) { osDetails = "CUPCAKE"; } if (os.Contains("1.6")) { osDetails = "DONUT"; } if (os.Contains("2")) { osDetails = "ECLAIR"; } if (os.Contains("2.2") || os.Contains("2.2.3")) { osDetails = "FROYO"; } if (os.Contains("2.3")) { osDetails = "GINGERBREAD"; } if (os.Contains("3.0") || os.Contains("3.1") || os.Contains("3.2")) { osDetails = "HONEYCOMB"; } if (os.Contains("4.0")) { osDetails = "ICE CREAM SANDWICH"; } if (os.Contains("4.1") || os.Contains("4.2") || os.Contains("4.3")) { osDetails = "JELLY BEAN"; } if (os.Contains("4.4")) { osDetails = "KIT KAT"; } if (root.Contains('#')) { isRoot = true; } return(new DeviceInfo() { Name = name, AndroidVersionCode = os, AndroidVersionName = osDetails, BuildProp = buildprop, Codename = codename, Manufacturer = manufacturer, IsRooted = isRoot }); }