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

Use interface ID instead of vendor/product IDs #147

Closed
ktnr74 opened this issue Jul 19, 2018 · 2 comments
Closed

Use interface ID instead of vendor/product IDs #147

ktnr74 opened this issue Jul 19, 2018 · 2 comments

Comments

@ktnr74
Copy link

ktnr74 commented Jul 19, 2018

Instead of trying to match all those different devices by different vendors do what adb does itself: look for the interface IDs (class/subclass/protocol), which in case of adb always will be 0xFF4201, and in case of fastboot will be 0xFF4203.

So all those rules can be replaced by a single line:
http://ktnr74.blogspot.com/2014/09/the-most-comprehensive-write-up-on-how.html

Also Google has removed the vendor ID whitelist a few years back, so adb_usb.ini is no longer used - you can remove the README footnote.

@M0Rf30
Copy link
Owner

M0Rf30 commented Jul 19, 2018

I added the universal rule at the beginning of the rules, if the check of interfaces fails, the other rules will follow. Let me know what do you think

@ktnr74
Copy link
Author

ktnr74 commented Jul 19, 2018

the simplified version of the rules file I use on my development system is similar to this
https://gist.github.com/ktnr74/f749a4bc2aa13b190b46a8643d1b465d

The main difference between the approaches is that my rule would only set devices permissions if either adb or fastboot interface is enumerated regardless of the vendor ID. If some users relied on the vendor ID based rules to provide access to PTP/MTP/UMS/etc interfaces - those interfaces would have to be added separately. Or the users could just keep using the vendor based rules.

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

No branches or pull requests

2 participants