2

When I run lsusb in Termux, the output is permission denied. I don't have root access.

Perhaps the Android system allows me to get specific access in root?

2
  • @Irfan Latif is it possible to get a specific root access in an unrooted device? Temporary root access with a password ,for example,would be amazing for customers! Android might be more flexible ...
    – J-Mello
    Mar 14, 2019 at 21:07
  • No (un)fortunately that's not possible. Android by-design doesn't allow that. Mar 14, 2019 at 21:21

1 Answer 1

1

lsusb command lists entries in /sys/bus/usb/devices which is world-readable but SELinux would be denying access because u:r:untrusted_app:s0 context isn't allowed to access u:object_r:sysfs:s0.

However you can try adb shell lsusb because sepolicy allows u:r:shell:s0 to read the directory as defined here:

allow shell sysfs:dir r_dir_perms

And here:

define(`r_dir_perms', `{ open getattr read search ioctl lock }')
5
  • So,I tried 'adb shell lsusb' and this is the following output: $ adb shell lsusb No command 'adb' found, did you mean: Command 'ab' from package 'apache2' Command 'gdb' from package
    – J-Mello
    Mar 15, 2019 at 20:54
  • adb is to be run from PC. Follow this simple guideline. Mar 15, 2019 at 21:17
  • Using adb in an Android device, plugged in windows pc for example,have a way to run commands that wasn't allowed before in termux , whatever it will be,not only lsusb?(desmg,lsusb and some commands doesn't works too)
    – J-Mello
    Mar 18, 2019 at 18:57
  • @J-Mello sorry can't understand what you mean. Mar 18, 2019 at 19:22
  • I need to use a USB on a PC to make lsusb permissions be able.I've been wondering about,if I use termux(either on pc or in an Android device) in this scenario I would be able to use termux like my android device were rooted.
    – J-Mello
    Mar 18, 2019 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .