Debugging in android chrome as a non-root user

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions of Google Chrome and Chromium. This is the context of the problem, but not the essence of my question.



The desktop chrome is able to communicate with the USB-attached android-chrome when Chrome and DevTools are run as root. I suspect that some character device in /dev is missing read / write access for my non-super-user. Therefore, when I run Chrome as jaroslav, the list of USB devices is empty.



Device detected as root:



superuser can read USB



Device missing for regular user:



non-root-user can not read USB



Strace to the rescue (?)



I want to determine which resources the application (desktop Chrome) is trying to access on my system, but as my knowledge of the platform is limited, I need advice on what to look for. Below is a list of unique system calls that the application uses. Do you know which of these are likely to be communication / negotiation calls to and from the USB device?



access getrandom rename
arch_prctl getresgid rt_sigaction
bind getresuid rt_sigprocmask
brk getsockname rt_sigreturn
clock_getres gettid sched_getparam
clone ioctl sched_getscheduler
close listen sendmsg
connect lseek sendto
creat lstat setpriority
dup mkdir set_robust_list
eventfd2 mmap setsockopt
execve mprotect set_tid_address
fadvise64 mremap shutdown
fallocate msync socket
fcntl munmap socketpair
fstat open stat
fstatfs pipe statfs
ftruncate poll symlink
futex prctl sysinfo
getdents prlimit64 uname
geteuid read unlink
getpeername readlink wait4
getpid recvfrom write
getpriority recvmsg writev


I think chrome could be scanning for USB devices with (about 80 calls):



open("/sys/bus/pci/devices/0000:**:**.*/ 
class,device,irq,resource,vendor", O_RDONLY) = 153


But they are not in /dev, so which devices do I need to open for reading for the regular user?



Here is what I have in /dev:



# ls -l hidraw* bus/usb/*/*
crw-rw-r-- 1 root usb 189, 0 180418 17:53 bus/usb/001/001
crw-rw-r-- 1 root usb 189, 1 180418 17:53 bus/usb/001/002
crw-rw-r-- 1 root usb 189, 128 180418 17:53 bus/usb/002/001
crw-rw-r-- 1 root usb 189, 129 180418 17:53 bus/usb/002/002
crw-rw-r-- 1 root usb 189, 256 180418 17:53 bus/usb/003/001
crw-rw-r-- 1 root usb 189, 257 180418 17:53 bus/usb/003/002
crw-rw-r-- 1 root usb 189, 258 180418 17:53 bus/usb/003/003
crw-rw-r-- 1 root usb 189, 259 180418 17:53 bus/usb/003/004
crw-rw-r-- 1 root usb 189, 260 180418 17:53 bus/usb/003/005
crw-rw---- 1 root plugdev 189, 263 180419 10:47 bus/usb/003/008
crw-rw-r-- 1 root usb 189, 384 180418 17:53 bus/usb/004/001
crw-rw-r-- 1 root usb 189, 385 180418 17:53 bus/usb/004/002
crw------- 1 root root 251, 0 180418 11:32 hidraw0
crw------- 1 root root 251, 1 180418 11:32 hidraw1
crw------- 1 root root 251, 2 180418 11:32 hidraw2


Perhaps all I need to do is to add jaroslav to the plugdev group? This is linux 4.12.12 with udev 236, by the way.



To sum up:



  1. Which system calls are likely to be related to USB communication?

  2. Which /dev nodes do I need to grant my user access to?






share|improve this question



















  • You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
    – ajeh
    Apr 19 at 15:00















up vote
3
down vote

favorite












I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions of Google Chrome and Chromium. This is the context of the problem, but not the essence of my question.



The desktop chrome is able to communicate with the USB-attached android-chrome when Chrome and DevTools are run as root. I suspect that some character device in /dev is missing read / write access for my non-super-user. Therefore, when I run Chrome as jaroslav, the list of USB devices is empty.



Device detected as root:



superuser can read USB



Device missing for regular user:



non-root-user can not read USB



Strace to the rescue (?)



I want to determine which resources the application (desktop Chrome) is trying to access on my system, but as my knowledge of the platform is limited, I need advice on what to look for. Below is a list of unique system calls that the application uses. Do you know which of these are likely to be communication / negotiation calls to and from the USB device?



access getrandom rename
arch_prctl getresgid rt_sigaction
bind getresuid rt_sigprocmask
brk getsockname rt_sigreturn
clock_getres gettid sched_getparam
clone ioctl sched_getscheduler
close listen sendmsg
connect lseek sendto
creat lstat setpriority
dup mkdir set_robust_list
eventfd2 mmap setsockopt
execve mprotect set_tid_address
fadvise64 mremap shutdown
fallocate msync socket
fcntl munmap socketpair
fstat open stat
fstatfs pipe statfs
ftruncate poll symlink
futex prctl sysinfo
getdents prlimit64 uname
geteuid read unlink
getpeername readlink wait4
getpid recvfrom write
getpriority recvmsg writev


I think chrome could be scanning for USB devices with (about 80 calls):



open("/sys/bus/pci/devices/0000:**:**.*/ 
class,device,irq,resource,vendor", O_RDONLY) = 153


But they are not in /dev, so which devices do I need to open for reading for the regular user?



Here is what I have in /dev:



# ls -l hidraw* bus/usb/*/*
crw-rw-r-- 1 root usb 189, 0 180418 17:53 bus/usb/001/001
crw-rw-r-- 1 root usb 189, 1 180418 17:53 bus/usb/001/002
crw-rw-r-- 1 root usb 189, 128 180418 17:53 bus/usb/002/001
crw-rw-r-- 1 root usb 189, 129 180418 17:53 bus/usb/002/002
crw-rw-r-- 1 root usb 189, 256 180418 17:53 bus/usb/003/001
crw-rw-r-- 1 root usb 189, 257 180418 17:53 bus/usb/003/002
crw-rw-r-- 1 root usb 189, 258 180418 17:53 bus/usb/003/003
crw-rw-r-- 1 root usb 189, 259 180418 17:53 bus/usb/003/004
crw-rw-r-- 1 root usb 189, 260 180418 17:53 bus/usb/003/005
crw-rw---- 1 root plugdev 189, 263 180419 10:47 bus/usb/003/008
crw-rw-r-- 1 root usb 189, 384 180418 17:53 bus/usb/004/001
crw-rw-r-- 1 root usb 189, 385 180418 17:53 bus/usb/004/002
crw------- 1 root root 251, 0 180418 11:32 hidraw0
crw------- 1 root root 251, 1 180418 11:32 hidraw1
crw------- 1 root root 251, 2 180418 11:32 hidraw2


Perhaps all I need to do is to add jaroslav to the plugdev group? This is linux 4.12.12 with udev 236, by the way.



To sum up:



  1. Which system calls are likely to be related to USB communication?

  2. Which /dev nodes do I need to grant my user access to?






share|improve this question



















  • You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
    – ajeh
    Apr 19 at 15:00













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions of Google Chrome and Chromium. This is the context of the problem, but not the essence of my question.



The desktop chrome is able to communicate with the USB-attached android-chrome when Chrome and DevTools are run as root. I suspect that some character device in /dev is missing read / write access for my non-super-user. Therefore, when I run Chrome as jaroslav, the list of USB devices is empty.



Device detected as root:



superuser can read USB



Device missing for regular user:



non-root-user can not read USB



Strace to the rescue (?)



I want to determine which resources the application (desktop Chrome) is trying to access on my system, but as my knowledge of the platform is limited, I need advice on what to look for. Below is a list of unique system calls that the application uses. Do you know which of these are likely to be communication / negotiation calls to and from the USB device?



access getrandom rename
arch_prctl getresgid rt_sigaction
bind getresuid rt_sigprocmask
brk getsockname rt_sigreturn
clock_getres gettid sched_getparam
clone ioctl sched_getscheduler
close listen sendmsg
connect lseek sendto
creat lstat setpriority
dup mkdir set_robust_list
eventfd2 mmap setsockopt
execve mprotect set_tid_address
fadvise64 mremap shutdown
fallocate msync socket
fcntl munmap socketpair
fstat open stat
fstatfs pipe statfs
ftruncate poll symlink
futex prctl sysinfo
getdents prlimit64 uname
geteuid read unlink
getpeername readlink wait4
getpid recvfrom write
getpriority recvmsg writev


I think chrome could be scanning for USB devices with (about 80 calls):



open("/sys/bus/pci/devices/0000:**:**.*/ 
class,device,irq,resource,vendor", O_RDONLY) = 153


But they are not in /dev, so which devices do I need to open for reading for the regular user?



Here is what I have in /dev:



# ls -l hidraw* bus/usb/*/*
crw-rw-r-- 1 root usb 189, 0 180418 17:53 bus/usb/001/001
crw-rw-r-- 1 root usb 189, 1 180418 17:53 bus/usb/001/002
crw-rw-r-- 1 root usb 189, 128 180418 17:53 bus/usb/002/001
crw-rw-r-- 1 root usb 189, 129 180418 17:53 bus/usb/002/002
crw-rw-r-- 1 root usb 189, 256 180418 17:53 bus/usb/003/001
crw-rw-r-- 1 root usb 189, 257 180418 17:53 bus/usb/003/002
crw-rw-r-- 1 root usb 189, 258 180418 17:53 bus/usb/003/003
crw-rw-r-- 1 root usb 189, 259 180418 17:53 bus/usb/003/004
crw-rw-r-- 1 root usb 189, 260 180418 17:53 bus/usb/003/005
crw-rw---- 1 root plugdev 189, 263 180419 10:47 bus/usb/003/008
crw-rw-r-- 1 root usb 189, 384 180418 17:53 bus/usb/004/001
crw-rw-r-- 1 root usb 189, 385 180418 17:53 bus/usb/004/002
crw------- 1 root root 251, 0 180418 11:32 hidraw0
crw------- 1 root root 251, 1 180418 11:32 hidraw1
crw------- 1 root root 251, 2 180418 11:32 hidraw2


Perhaps all I need to do is to add jaroslav to the plugdev group? This is linux 4.12.12 with udev 236, by the way.



To sum up:



  1. Which system calls are likely to be related to USB communication?

  2. Which /dev nodes do I need to grant my user access to?






share|improve this question











I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions of Google Chrome and Chromium. This is the context of the problem, but not the essence of my question.



The desktop chrome is able to communicate with the USB-attached android-chrome when Chrome and DevTools are run as root. I suspect that some character device in /dev is missing read / write access for my non-super-user. Therefore, when I run Chrome as jaroslav, the list of USB devices is empty.



Device detected as root:



superuser can read USB



Device missing for regular user:



non-root-user can not read USB



Strace to the rescue (?)



I want to determine which resources the application (desktop Chrome) is trying to access on my system, but as my knowledge of the platform is limited, I need advice on what to look for. Below is a list of unique system calls that the application uses. Do you know which of these are likely to be communication / negotiation calls to and from the USB device?



access getrandom rename
arch_prctl getresgid rt_sigaction
bind getresuid rt_sigprocmask
brk getsockname rt_sigreturn
clock_getres gettid sched_getparam
clone ioctl sched_getscheduler
close listen sendmsg
connect lseek sendto
creat lstat setpriority
dup mkdir set_robust_list
eventfd2 mmap setsockopt
execve mprotect set_tid_address
fadvise64 mremap shutdown
fallocate msync socket
fcntl munmap socketpair
fstat open stat
fstatfs pipe statfs
ftruncate poll symlink
futex prctl sysinfo
getdents prlimit64 uname
geteuid read unlink
getpeername readlink wait4
getpid recvfrom write
getpriority recvmsg writev


I think chrome could be scanning for USB devices with (about 80 calls):



open("/sys/bus/pci/devices/0000:**:**.*/ 
class,device,irq,resource,vendor", O_RDONLY) = 153


But they are not in /dev, so which devices do I need to open for reading for the regular user?



Here is what I have in /dev:



# ls -l hidraw* bus/usb/*/*
crw-rw-r-- 1 root usb 189, 0 180418 17:53 bus/usb/001/001
crw-rw-r-- 1 root usb 189, 1 180418 17:53 bus/usb/001/002
crw-rw-r-- 1 root usb 189, 128 180418 17:53 bus/usb/002/001
crw-rw-r-- 1 root usb 189, 129 180418 17:53 bus/usb/002/002
crw-rw-r-- 1 root usb 189, 256 180418 17:53 bus/usb/003/001
crw-rw-r-- 1 root usb 189, 257 180418 17:53 bus/usb/003/002
crw-rw-r-- 1 root usb 189, 258 180418 17:53 bus/usb/003/003
crw-rw-r-- 1 root usb 189, 259 180418 17:53 bus/usb/003/004
crw-rw-r-- 1 root usb 189, 260 180418 17:53 bus/usb/003/005
crw-rw---- 1 root plugdev 189, 263 180419 10:47 bus/usb/003/008
crw-rw-r-- 1 root usb 189, 384 180418 17:53 bus/usb/004/001
crw-rw-r-- 1 root usb 189, 385 180418 17:53 bus/usb/004/002
crw------- 1 root root 251, 0 180418 11:32 hidraw0
crw------- 1 root root 251, 1 180418 11:32 hidraw1
crw------- 1 root root 251, 2 180418 11:32 hidraw2


Perhaps all I need to do is to add jaroslav to the plugdev group? This is linux 4.12.12 with udev 236, by the way.



To sum up:



  1. Which system calls are likely to be related to USB communication?

  2. Which /dev nodes do I need to grant my user access to?








share|improve this question










share|improve this question




share|improve this question









asked Apr 19 at 9:26









Ярослав Рахматуллин

494311




494311











  • You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
    – ajeh
    Apr 19 at 15:00

















  • You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
    – ajeh
    Apr 19 at 15:00
















You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
– ajeh
Apr 19 at 15:00





You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
– ajeh
Apr 19 at 15:00
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438676%2fdebugging-in-android-chrome-as-a-non-root-user%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438676%2fdebugging-in-android-chrome-as-a-non-root-user%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?