[Android Software/Hacking General [Developers Only]] k1ll3r8e:
Heyho,

THX for the feedback and sorry for the late reply!

The problem i see so far, depends really on the changes I introduced! First of all, i removed the "default" instance, which causes this problem. To avoid this, you simply need to call "ADB.Devices()" and select the returned device like "ADB.Select(Your_Device_Info)" or you need to request the instance like "ADB.Instance(Your_Device_Info)".

Also, there are now lots of REAL async overloads, so you can do like:

List<String> getdevicecodename = (List<string>)await ADB.Instance().ShellCmdAsync("/system/bin/getprop ro.product.device").ConfigureAwait(false);
List<String> getcarrier = (List<string>)await ADB.Instance().ShellCmdAsync("/system/bin/getprop ro.carrier").ConfigureAwait(false);

Edit:

About the DeviceState, you could also use:

(DeviceState) Tools.ToolBox.CheckDeviceState(string deviceID);
(DeviceState) Tools.ToolBox.CheckDeviceState(IDeviceInfo device);

Edit 1:

Here are a few async overloads you should use instead of Task.Run() or Task.Factory.StartNew():

Task<IEnumerable<string>> ShellCmdAsync(string cmd, int timeout = 0);
Task<IEnumerable<string>> ShellCmdAsync(string cmd, CancellationToken cancellationToken, int timeout = 0);
Task<IEnumerable<string>> ShellCmdAsync(string cmd, ShellDataEventHandler shellDataEventHandler, int timeout = 0);
Task<IEnumerable<string>> ShellCmdAsync(string cmd, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0);

Task<int> ShellCmdHResAsync(string cmd, int timeout = 0);
Task<int> ShellCmdHResAsync(string cmd, CancellationToken cancellationToken, int timeout = 0);
Task<int> ShellCmdHResAsync(string cmd, ShellDataEventHandler shellDataEventHandler, int timeout = 0);
Task<int> ShellCmdHResAsync(string cmd, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0);

Task<IEnumerable<string>> ShellCmdStackAsync(IEnumerable<string> cmdStack, int timeout = 0);
Task<IEnumerable<string>> ShellCmdStackAsync(IEnumerable<string> cmdStack, CancellationToken cancellationToken, int timeout = 0);
Task<IEnumerable<string>> ShellCmdStackAsync(IEnumerable<string> cmdStack, ShellDataEventHandler shellDataEventHandler, int timeout = 0);
Task<IEnumerable<string>> ShellCmdStackAsync(IEnumerable<string> cmdStack, ShellDataEventHandler shellDataEventHandler, CancellationToken cancellationToken, int timeout = 0);

These are available under (IADBClient)ADB.Instance(), (Su)ADB.Instance().Device.Su and (BusyBox)ADB.Instance().Device.BusyBox

These are also available via the IADBClient:

Task<bool> InstallAsync(string localPath);
Task<bool> InstallAsync(string localPath, PackageInstallArgs args);
Task<bool> InstallAsync(IEnumerable<string> localPaths);
Task<bool> InstallAsync(IEnumerable<string> localPaths, PackageInstallArgs args);

Task<bool> UninstallAsync(string package, bool keepData = false);

Task<bool> PullAsync(string remotePath, string localPath);
Task<bool> PullAsync(string remotePath, string localPath, FileTransferEventHandler transferEventHandler);
Task<bool> PullAsync(string remotePath, string localPath, FileTransferEventHandler transferEventHandler, CancellationToken cancellationToken);

Task<bool> PushAsync(string localPath, string remotePath);
Task<bool> PushAsync(string localPath, string remotePath, FileTransferEventHandler transferEventHandler);
Task<bool> PushAsync(string localPath, string remotePath, FileTransferEventHandler transferEventHandler, CancellationToken cancellationToken);

Hope i could help you ;)

Regards,

Sebastian