como depurar adb caso de permissão insuficiente

1

há muito tempo atrás, escrevi uma regra do udev para adb com meu telefone (dispositivo) definindo um grupo. Tudo estava bem até que algumas coisas mudaram recentemente:

  1. dispositivo rom
  2. pacote udev
  3. pacote adb

agora fico com o usuário:

$ adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: insufficient permissions for device: verify udev rules.
See [http://developer.android.com/tools/device.html] for more information.

$ adb devices -l
List of devices attached xxxxxxx no permissions (verify udev rules); see 
[http://developer.android.com/tools/device.html] usb:2-1

$ lsusb
// here we have the mentioned device
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

// udev rules newly added after i received an error (did'd change anything - still error i can open adb only using root)  
SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", MODE="0666", GROUP="adbusers"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", GROUP="adbusers"

// this rule was added very long time ago was working perfect till now 
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="adbusers"

listed now as Bus 002 Device 007: ID 18d1:4ee7 Google Inc. 

// o usuário está no grupo adbuser

PS. Eu verifiquei uma permissão no dispositivo e recebo:

 $ ls -l /dev/bus/usb/002/001
 crw-rw-r-- 1 root root 189, 128 kwi 22 13:26 /dev/bus/usb/002/001

As regras do udev não são aplicadas?

ps2. 1) habilitado udev deug 2) regras modificadas + adição de links simbólicos para rastrear mudanças pelo udev

SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", MODE="0666", GROUP="adbusers", SYMLINK+="android%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", GROUP="adbusers", SYMLINK+="x-android%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="adbusers", SYMLINK+="s-android%n"

após o plug do dispositivo

Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2437 queued, 'add' 'usb'
Apr 22 18:50:04 et27 systemd-udevd[304]: Validate module index
Apr 22 18:50:04 et27 systemd-udevd[304]: Check if link configuration needs reloading.
Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2437 forked new worker [1143]
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2437 running
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2438 queued, 'add' 'usb'
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
Apr 22 18:50:04 et27 systemd-udevd[1143]: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
Apr 22 18:50:04 et27 systemd-udevd[1143]: GROUP 1008 /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: MODE 0666 /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: LINK 's-android1' /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: RUN '/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}' /etc/udev/rules.d/60-vboxdrv.rules:5
Apr 22 18:50:04 et27 systemd-udevd[1143]: PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5' /lib/udev/rules.d/69-libmtp.rules:2283
Apr 22 18:50:04 et27 systemd-udevd[1144]: starting 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5'
Apr 22 18:50:04 et27 systemd-udevd[1144]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5': No such file or directory
Apr 22 18:50:04 et27 systemd-udevd[1143]: Process 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5' failed with exit code 2.
Apr 22 18:50:04 et27 systemd-udevd[1143]: handling device node '/dev/bus/usb/002/005', devnum=c189:132, mode=0666, uid=0, gid=1008
Apr 22 18:50:04 et27 systemd-udevd[1143]: set permissions /dev/bus/usb/002/005, 020666, uid=0, gid=1008
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating symlink '/dev/char/189:132' to '../bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating link '/dev/s-android1' to '/dev/bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating symlink '/dev/s-android1' to 'bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: created db file '/run/udev/data/c189:132' for '/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1'
Apr 22 18:50:04 et27 systemd-udevd[1145]: starting '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 132 00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: Process '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 132 00' succeeded.
Apr 22 18:50:04 et27 systemd-udevd[1143]: passed device to netlink monitor 0x562b37096e00
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2437 processed
Apr 22 18:50:04 et27 systemd-udevd[304]: passed 308 byte device to netlink monitor 0x562b37076610
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2438 running
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:15
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
Apr 22 18:50:04 et27 systemd-udevd[1143]: unable to access usb_interface device of '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1/2-1:1.0'
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' returned non-zero
Apr 22 18:50:04 et27 systemd-udevd[1143]: RUN 'kmod load $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:5
Apr 22 18:50:04 et27 systemd-udevd[1143]: created db file '/run/udev/data/+usb:2-1:1.0' for '/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1/2-1:1.0'
Apr 22 18:50:04 et27 systemd-udevd[1143]: Execute 'load' 'usb:v18D1p4EE7d0232dc00dsc00dp00icFFisc42ip01in00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: No module matches 'usb:v18D1p4EE7d0232dc00dsc00dp00icFFisc42ip01in00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: passed device to netlink monitor 0x562b37096e00
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2438 processed
Apr 22 18:50:04 et27 systemd-udevd[304]: cleanup idle workers
Apr 22 18:50:04 et27 systemd-udevd[1143]: Unload module index
Apr 22 18:50:04 et27 systemd-udevd[1143]: Unloaded link configuration context.
Apr 22 18:50:04 et27 systemd-udevd[304]: worker [1143] exited

O grupo não é aplicado no dispositivo que recebo

$ ls -al /dev/android1
lrwxrwxrwx 1 root root 15 kwi 22 18:42 /dev/android1 -> bus/usb/001/001
$ ls -al /dev/s-android1
lrwxrwxrwx 1 root root 15 kwi 22 18:50 /dev/s-android1 -> bus/usb/002/005

poderia ser um problema em valores de grupo numéricos em vez de string? ou GROUP="" em vez GROUP:=""? em caso afirmativo porque udev não rende sobre isso?

  1. notation no como o symlink funciona com a notação antiga, então ...
  2. string em vez de numérico no como resolvido nos logs para - > 1008

a permissão ok está definida como esperado - como links simbólicos que não mostram permissões

$ ls -al /dev/bus/usb/002/001 
crw-rw-rw- 1 root adbusers 189, 128 kwi 22 19:04 /dev/bus/usb/002/001

mas ainda assim fico insuficiente

    
por ceph3us 22.04.2017 / 18:20

2 respostas

2

ok encontrou o que estava em questão:

arquivo ~ / android contém alguns arquivos, provavelmente, armazenar chaves de depuração que são diferentes após o flash / wipe do dispositivo - basta removê-los

para ser exatamente:

~/.android/adbkey
    
por 24.04.2017 / 16:07
2

Eu tive o mesmo problema, (o usuário era membro do grupo plugdev) minha parte faltante era:

Eu tive que ativar o USB para troca de dados no dispositivo depois de conectado (usando o Android 7.1.2)

    
por 02.01.2018 / 23:22

Tags