-
Notifications
You must be signed in to change notification settings - Fork 57
feat: adb list #103
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
base: main
Are you sure you want to change the base?
feat: adb list #103
Conversation
I have tested this with both ADB server USB and direct USB communication. I have not tested it through TCP connection. |
Hi @J05HM0N5TER , thanks for the PR ! Will have a look at it this week :) |
adb_client/src/error.rs
Outdated
#[error("unknown transport: {0}")] | ||
UnknownTransport(String), | ||
/// An unknown file mode was encountered in list | ||
#[error("Unknown file type {0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should rather be "Unknown file mode"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have fixed this.
adb_client/src/adb_device_ext.rs
Outdated
fn push(&mut self, stream: &mut dyn Read, path: &dyn AsRef<str>) -> Result<()>; | ||
|
||
/// List the items in a directory on the device | ||
fn list(&mut self, path: &str) -> Result<Vec<ADBListItem>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rather use dyn AsRef<str>
here to be more flexible on allowed input types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used &str
here because the stat function above also used it, so I thought there was some reason to use it with file paths. Should I update the stat function as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change yours for now, I'll soon release 2.2.0 and I'll add these API breaking changes inside :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it, please have a look when you have time.
connection.read_exact(&mut mode)?; | ||
connection.read_exact(&mut size)?; | ||
connection.read_exact(&mut time)?; | ||
connection.read_exact(&mut name_len)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use connection.read_u32<LittleEndian>()
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't know that function existed. I have fixed it now.
I rebased latest |
Also removed duplicate |
@cocool97 I think I might have messed up your rebase. I happened to be working on it as you did your stuff and I thought I messed up my branch though some local moving of get repos, and did a Can you please re-push your local version to undo my undo of the rebase you did? I have the fixes for some of your comments locally, but I'll just stash them for now to not make the git history more complicated. If it is too much of a mess, we can just squash merge this at the end and remove all the extra stuff. |
Thanks for that. I was a bit confused on how there seemed to be two different places that the commands a defined in. I thought that the definitions of the commands that were against the ADB server were completely disconnected from the ones that interacted directly with the device. |
ADB List (ls) for both direct device communication and for communication though the adb server.
9165bfe
to
d3a886d
Compare
Thanks for you recent changes, I'll review it asap :) Can you fix the failing |
I just pushed the changes to fix the |
ADB List (ls) for both direct device communication and for communication though the ADB server.