Skip to content
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: autodetect an ADB device when no vendor or product ID is specified #44

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

lavafroth
Copy link
Contributor

Changes

  • Added methods autodetect to autodetect_with_custom_private_key to ADBUSBDevice
  • Added private functions to check if a usb device has the signature of an ADB device
  • Made the vendor_id and product_id USB arguments optional and default to aforementioned methods

### Changes

- Added methods `autodetect` to `autodetect_with_custom_private_key` to
`ADBUSBDevice`
- Added private functions to check if a usb device has the signature of
an ADB device
- Made the `vendor_id` and `product_id` USB arguments optional and
default to aforementioned methods
Copy link
Owner

@cocool97 cocool97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this useful PR :)

Some comments before merging

adb_cli/src/commands/usb.rs Outdated Show resolved Hide resolved
adb_client/src/usb/adb_usb_device.rs Outdated Show resolved Hide resolved
adb_client/src/usb/adb_usb_device.rs Outdated Show resolved Hide resolved
adb_client/src/usb/adb_usb_device.rs Outdated Show resolved Hide resolved
adb_client/src/usb/adb_usb_device.rs Outdated Show resolved Hide resolved
@lavafroth
Copy link
Contributor Author

lavafroth commented Oct 30, 2024 via email

@cocool97
Copy link
Owner

I cleaned the code a bit with functions that could be called either with a custom private key or not.

I also remove the thread(s) spawned to get devices, if no device is find at the time an error is raised

@cocool97 cocool97 merged commit cff0e68 into cocool97:main Oct 31, 2024
4 checks passed
@lavafroth
Copy link
Contributor Author

lavafroth commented Oct 31, 2024 via email

@cocool97
Copy link
Owner

I think we can keep it private for now and see if there are people needing it

@lavafroth
Copy link
Contributor Author

lavafroth commented Oct 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants