-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement adb pull for usb #42
Conversation
Thanks for the PR !
I'll review your PR and use some functions you wrote for the main USB branch |
Hello, I added a subcommand to |
Pull command is implemented, just named |
Okay thank you. I have moved the |
Thanks for your improvement. There are still some things that might be improved :
I've done the rebase on |
Sure thing, I'll make the changes by tomorrow!
|
Hey there, I have made the necessary changes. The user should no longer have to be concerned about the |
I had a look at your code, everything is fine. The Just have a minor issue before merging it, ( First run:
Second run:
|
Behaviour is the same when trying to pull the same file twice without unplugging the device |
The pull and stat commands were leaving ADB on the device hanging but this has been fixed! We had to end a |
Thanks, this works better ! Last point about stat command, output is not as expected for a single file. |
Ah yes, it looks like there is an extra u32 in the beginning of the stat response structure. Since we are not using it, I have made the parser skip it as well. |
Yes, extra u32 is the litteral "STAT". I add a comment to your last commit and merge it right after |
Thanks for the heads up. Let me know if I can help with implementing any other feature.
|
* feat: implement adb pull for usb * feat: add subcommands for pull and shell * feat: add recv method to `ADBDeviceExt` trait, use existing impl for server * feat: merge stat commands for server and usb `impl`s * feat: improve shell; fix: minor rewording * fix: reply with quit usb subcommand at the end of a transaction * fix: adb stat works on a file, not always an apk * fix: ignore extra stat field for now --------- Co-authored-by: LIAUD Corentin <[email protected]>
Changes
USBSubcommand
enum for subcommands like List, Stat, etc.send_and_expect_okay
andrecv_and_reply_okay
method toADBUSBDevice
since the host and the device quite frequently acknowledge each others' messages withOKAY
commands.ADBUSBDeviceExt
traitstat
method to stat a file on the device.pull
function which takes a source file path (string) to read from the device and writes its contents to aWriter
output.pull
to the CLINote
stat
andpull
are implemented for the USB side but they are left astodo!
s forADBServerDevice
To pull a file called
src
from the device and save it asdst
, run