quamotion/madb

System.ArgumentOutOfRangeException: ""

TheAirBlow opened this issue · 0 comments

Ok my previout dumb issue was easy fix (#211), but NOT THIS TIME.

I get System.ArgumentOutOfRangeException with no description provided.
This time my path is /data/app/net.airblowprod.ubox-xq9tbYgsYqN_cFVlCoeX3A==/base.apk

For some background, I am coding an app for backuping an Android smartphone.

My code:

private static void PullPackage(string package, SyncService service, string path)
{
    string cmd = $"pm path {package} | awk -F':' '{{print $2}}'";
    var receiver = new ConsoleOutputReceiver();
    client.ExecuteRemoteCommand(cmd, device, receiver);
    string data = receiver.ToString().Substring(0, receiver.ToString().Length - 2);
    using (Stream stream = File.OpenWrite(path))
        service.Pull(data, stream, null, CancellationToken.None);
}