From: LuK1337 Date: Tue, 1 Apr 2025 20:23:06 +0000 (+0200) Subject: rules: Make ADB and fastboot work out-of-the-box X-Git-Tag: v258-rc1~787 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edc49209f175c354bc4055281a377a4e9dc21e6c;p=thirdparty%2Fsystemd.git rules: Make ADB and fastboot work out-of-the-box https://android.googlesource.com/platform/packages/modules/adb/+/d0db47dcdf941673f405e1095e6ffb5e565902e5/adb.h#199 https://android.googlesource.com/platform/system/core/+/7199051aaf0ddfa2849650933119307327d8669c/fastboot/fastboot.cpp#244 --- diff --git a/rules.d/70-uaccess.rules.in b/rules.d/70-uaccess.rules.in index 046f169e447..96b61cec32b 100644 --- a/rules.d/70-uaccess.rules.in +++ b/rules.d/70-uaccess.rules.in @@ -77,6 +77,20 @@ ENV{DDC_DEVICE}=="?*", TAG+="uaccess" # media player raw devices (for user-mode drivers, Android SDK, etc.) SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="uaccess" +# Android devices (ADB DbC, ADB, Fastboot) +# Used to interact with devices over Android Debug Bridge and Fastboot protocols, see: +# * https://developer.android.com/tools/adb +# * https://source.android.com/docs/setup/test/running +# * https://source.android.com/docs/setup/test/flash +# +# The bInterfaceClass and bInterfaceSubClass used are documented in source code here: +# * https://android.googlesource.com/platform/packages/modules/adb/+/d0db47dcdf941673f405e1095e6ffb5e565902e5/adb.h#199 +# * https://android.googlesource.com/platform/system/core/+/7199051aaf0ddfa2849650933119307327d8669c/fastboot/fastboot.cpp#244 +# +# Since it's using a generic vendor specific interface class, this can potentially result +# in a rare case where non-ADB/Fastboot device ends up with an ID_DEBUG_APPLIANCE="android". +SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:dc0201:*|*:ff4201:*|*:ff4203:*", ENV{ID_DEBUG_APPLIANCE}="android" + # software-defined radio communication devices ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="uaccess" @@ -111,4 +125,7 @@ SUBSYSTEM=="hidraw", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess" # As defined in https://en.wikipedia.org/wiki/3Dconnexion SUBSYSTEM=="hidraw", ENV{ID_INPUT_3D_MOUSE}=="1", TAG+="uaccess" +# Debug interfaces (e.g. Android Debug Bridge) +ENV{ID_DEBUG_APPLIANCE}=="?*", TAG+="uaccess" + LABEL="uaccess_end"