Skip to content

Commit

Permalink
Merge pull request #3 from M0Rf30/main
Browse files Browse the repository at this point in the history
[pull] main from M0Rf30:main
  • Loading branch information
KyleGospo authored Jan 15, 2024
2 parents d9dbf06 + ac358ab commit 465754e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
68 changes: 38 additions & 30 deletions 51-android.rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ ATTR{bDeviceClass}=="09", GOTO="android_usb_rules_end"
ENV{ID_MODEL}=="Controller", GOTO="android_usb_rules_end"
ENV{ID_USB_INTERFACES}=="*:0701??:*", GOTO="android_usb_rules_end"

LABEL="android_usb_rules_begin"
# Devices listed here in android_usb_rules_{begin...end} are connected by USB
# Devices listed here are connected by USB

# Acer
ATTR{idVendor}!="0502", GOTO="not_Acer"
Expand Down Expand Up @@ -57,9 +56,14 @@ ATTR{idProduct}=="05e8", GOTO="adb"
ATTR{idProduct}=="2048", GOTO="adbmidi"
# Amazon Fire TV Stick Lite (3rd gen)
ATTR{idProduct}=="03a8", GOTO="adbfast"
# Amazone Fire 7 (mustang)
# Amazon Fire 7 (mustang)
ATTR{idProduct}=="03c8", GOTO="adbfast"
ATTR{idProduct}=="03cb", GOTO="adbfast"
# Amazon Fire HD 8 2018 (karnak)
ATTR{idProduct}=="0338", GOTO="adbfast"
ATTR{idProduct}=="033b", GOTO="adbfast"
# Amazon Fire HD 8 2022 (raphite)
ATTR{idProduct}=="0658", GOTO="adbfast"
GOTO="android_usb_rules_end"
LABEL="not_Amazon"

Expand Down Expand Up @@ -91,6 +95,7 @@ ATTR{idProduct}=="1???", GOTO="android_usb_rules_end"
# Zenphone 2 (ZE500CL) (7770=adb 7773=mtp,adb 7775=rndis,adb,mass_storage 7777=ptp,adb 5F03=mtp,adb,pclink,mass_storage 5F05=rndis,adb,pclink,mass_storage 5F07=ptp,adb,pclink)
# Zenfone GO (ZB500KL) (7772=mtp 7773=mtp,adb 7774=rndis 7775=rndis,adb 7776=ptp 7777=ptp,adb)
ATTR{idProduct}=="7770", GOTO="adb"
ATTR{idProduct}=="7771", GOTO="adbfast"
ATTR{idProduct}=="7773", GOTO="adbmtp"
ATTR{idProduct}=="7775", ENV{adb_adbmass}="yes", GOTO="adbrndis"
ATTR{idProduct}=="7777", GOTO="adbptp"
Expand Down Expand Up @@ -209,6 +214,9 @@ ATTR{idProduct}=="4ee9", GOTO="adbmidi"
# Tensor Pixel phones (Pixel 7/7 pro/6/6A/6 Pro) 4eeb=cdc-ncm; 4eec=cdc-ncm,adb
ATTR{idProduct}=="4eec", GOTO="adbcdc"

# Pixel Watch 2 (4ee0=fastboot 4e11=adb)
ATTR{idProduct}=="4e11", GOTO="adb"

# Pixel C Tablet (5202=mtp 5203=mtp,adb)
ATTR{idProduct}=="5201", GOTO="adbfast"
ATTR{idProduct}=="5203", GOTO="adbmtp"
Expand Down Expand Up @@ -249,6 +257,8 @@ ATTR{idProduct}=="d10a", GOTO="adbmtp"
# Other vendors that also used duplicated Google's idVendor code follows:
# IDEA XDS-1078 (debug=2c11)
ATTR{idProduct}=="2c11", GOTO="adb"
# Hisense U8G Smart TV (MTK MT5895)
ATTR{idProduct}=="0d02", GOTO="adbfast"
GOTO="android_usb_rules_end"
LABEL="not_Google"

Expand Down Expand Up @@ -491,18 +501,14 @@ ATTR{idProduct}=="2d66", SYMLINK+="android_adb"
ATTR{idProduct}=="428c", SYMLINK+="android_adb"
# Droid
ATTR{idProduct}=="41db", SYMLINK+="android_adb"
# Xoom (70a8=mtp 70a9=mtp,adb)
ATTR{idProduct}=="70a8", GOTO="mtp"
ATTR{idProduct}=="70a9", GOTO="adbmtp"
# XT890/907/Razr (710d=mtp 710e=mtp,adb)
ATTR{idProduct}=="710e", GOTO="adbmtp"
# Razr XT912
ATTR{idProduct}=="4362", GOTO="adbfast"
# Droid Turbo 2
ATTR{idProduct}=="2ea4", GOTO="adbfast"
# Atrix/Razr HD (2e32=mtp 2e33=mtp,adb)
# Razr M (2e50=mtp 2e51=mtp,adb)
# Moto G3 (2e76=mtp,adb 2e81=charge,adb 2e82=mtp 2e83=ptp 2e84=ptp,adb 2e24=rndis 2e25=rndis,adb)
# Moto E/G dual sim (2e76=mtp,adb 2e80=fast 2e81=recovery 2e82=mtp 2e83=ptp 2e84=ptp,adb 2e24=rndis 2e25=rndis,adb)
# Moto Z3 Play, beckham, XT1929
# For details see: <https://github.com/M0Rf30/android-udev-rules/issues/264>
# 18d1:4ee8=midi; 18d1:4ee9=midi+adb
Expand All @@ -513,14 +519,20 @@ ATTR{idProduct}=="2e25", GOTO="adbrndis"
ATTR{idProduct}=="2e33", GOTO="adbmtp"
ATTR{idProduct}=="2e51", GOTO="adbmtp"
ATTR{idProduct}=="2e76", GOTO="adbmtp"
ATTR{idProduct}=="2e80", GOTO="fast"
ATTR{idProduct}=="2e80", GOTO="adbfast"
ATTR{idProduct}=="2e81", GOTO="adb"
ATTR{idProduct}=="2e82", GOTO="mtp"
ATTR{idProduct}=="2e83", GOTO="ptp"
ATTR{idProduct}=="2e84", GOTO="adbptp"
ATTR{idProduct}=="2eb7", GOTO="mass"
ENV{adb_user}="yes"
GOTO="android_usb_rule_match"
# Xoom (70a8=mtp 70a9=mtp,adb 70ae=rndis 70af=rndis,adb 70b0=acm 70b1=acm,adb 70b2=acm,rndis 70b3=acm,rndis,adb 70b4=ptp 70b5ptp,adb)
ATTR{idProduct}=="70a9", GOTO="adbmtp"
ATTR{idProduct}=="70ae", GOTO="rndis"
ATTR{idProduct}=="70af", GOTO="adbrndis"
ATTR{idProduct}=="70b1", GOTO="adbcdc"
ATTR{idProduct}=="70b3", GOTO="adbrndis"
ATTR{idProduct}=="70b5", GOTO="adbptp"
# XT890/907/Razr (710d=mtp 710e=mtp,adb 710f=mass)
ATTR{idProduct}=="710e", GOTO="adbmtp"
GOTO="android_usb_rules_end"
LABEL="not_Motorola"

# MTK (MediaTek Inc)
Expand Down Expand Up @@ -577,10 +589,12 @@ ATTR{idVendor}!="2a70", GOTO="not_OnePlus"
ATTR{idProduct}=="4ee2", GOTO="adbmtp"
ATTR{idProduct}=="4ee6", GOTO="adbptp"
ATTR{idProduct}=="4ee7", GOTO="adb"
# OnePlus 6T
ATTR{idProduct}=="d001", GOTO="adb"
# OnePlus Nord N10 4G USB tethering mode
ATTR{idProduct}=="9024", GOTO="adb"
# OnePlus 3T with Oreo MIDI mode 90bb=midi,adb 9011=mtp 904d=ptp 904e=ptp,adb
# OnePlus 7t (9012=mtp,adb)
# OnePlus 7T (9012=mtp,adb)
ATTR{idProduct}=="9011", GOTO="mtp"
ATTR{idProduct}=="9012", GOTO="adbmtp"
ATTR{idProduct}=="904d", GOTO="ptp"
Expand Down Expand Up @@ -818,6 +832,8 @@ ATTR{idProduct}=="0c01", GOTO="adb"
ATTR{idProduct}=="00f2", GOTO="adb"
# Alcatel OT6012A
ATTR{idProduct}=="0167", GOTO="adb"
# Alcatel 5024L
ATTR{idProduct}=="4ee7", GOTO="adb"
ENV{adb_user}="yes"
GOTO="android_usb_rule_match"
LABEL="not_T_A_Mobile"
Expand Down Expand Up @@ -848,23 +864,20 @@ ATTR{idVendor}=="2d95", GOTO="user"

# XiaoMi
ATTR{idVendor}!="2717", GOTO="not_XiaoMi"
# Mi2A
ATTR{idProduct}=="904e", SYMLINK+="android_adb"
ATTR{idProduct}=="9039", SYMLINK+="android_adb"
# Mi3
ATTR{idProduct}=="0368", SYMLINK+="android_adb"
ATTR{idProduct}=="0368", GOTO="adbmtp"
# RedMi 1S WCDMA (MTP+Debug)
ATTR{idProduct}=="1268", GOTO="adbmtp"
# RedMi / RedMi Note WCDMA (MTP+Debug)
ATTR{idProduct}=="1248", GOTO="adbmtp"
# RedMi 1S / RedMi / RedMi Note WCDMA (1218=ptp,adb 1228=usb,adb)
# RedMi 1S / RedMi / RedMi Note WCDMA (1210=ptp 1218=ptp,adb 1220=CDrom 1228=usb,adb 1240=mtp 1248=mtp,adb)
ATTR{idProduct}=="1218", GOTO="adbptp"
ATTR{idProduct}=="1228", GOTO="adb"
ATTR{idProduct}=="1248", GOTO="adbmtp"
# RedMi / RedMi Note 4G WCDMA (1311=ptp,adb 1328=usb,adb 1368=mtp,adb)
ATTR{idProduct}=="1318", GOTO="adbptp"
ATTR{idProduct}=="1328", GOTO="adb"
ATTR{idProduct}=="1368", GOTO="adbmtp"
# Mi2 (f003=mtp,mass_storage 9039=mtp,adb,mass_storage 904d=ptp 904e=ptp,adb f000=mass_storage 9015=mass_storage,adb f00e=ndis 9024=ndis,adb f00f=ndis 803e=ndis,adb)
# Mi2A / Mi2S (9039=mtp,adb, 904e=adb,ptp)
ATTR{idProduct}=="9039", GOTO="adbmtp"
ATTR{idProduct}=="904e", GOTO="adbptp"
ATTR{idProduct}=="9015", GOTO="adbmass"
Expand All @@ -881,8 +894,7 @@ ATTR{idProduct}=="ff48", GOTO="adbmtp"
ATTR{idProduct}=="ff88", GOTO="adbrndis"
# RedMi / RedMi Note 4G CDMA (ff68=usb,adb) / Mi4c / Mi5
ATTR{idProduct}=="ff68", GOTO="adb"
ENV{adb_user}="yes"
GOTO="android_usb_rule_match"
GOTO="android_usb_rules_end"
LABEL="not_XiaoMi"

# Yota
Expand Down Expand Up @@ -958,17 +970,13 @@ GOTO="android_usb_rules_end"
LABEL="adb", ENV{adb_adb}="yes", GOTO="android_usb_rule_match"

# ADB Debug and Audio Source
LABEL="adbaud", ENV{adb_adb}="yes"
LABEL="aud", ENV{adb_user}="yes", GOTO="android_usb_rule_match"
LABEL="adbaud", ENV{adb_adb}="yes", GOTO="android_usb_rule_match"

# ADB Debug and AT-commands CDC Serial
LABEL="adbcdc", ENV{adb_adbcdc}="yes"
# check if exists /dev/ttyACM%n, GROUP=dialout, modeprobe cdc_acm)
LABEL="cdc", ENV{adb_user}="yes", GOTO="android_usb_rule_match"
LABEL="adbcdc", ENV{adb_adbcdc}="yes", GOTO="android_usb_rule_match"

# ADB Debug and Fastboot mode
LABEL="adbfast", ENV{adb_adb}="yes"
LABEL="fast", ENV{adb_fast}="yes", GOTO="android_usb_rule_match"
LABEL="adbfast", ENV{adb_adbfast}="yes", GOTO="android_usb_rule_match"

# ADB Debug and mass storage (note: generally android_ver<4.3; Moto Z3 Play when powered off)
LABEL="adbmass", ENV{adb_adbmass}="yes"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ adb devices
# You should now see your device
```

### Using the automtic install script
### Using the automatic install script

1. Clone this repository
2. Run the `install.sh` as root on your terminal
Expand Down

0 comments on commit 465754e

Please sign in to comment.