[Android Q&A, Help & Troubleshooting] wenyendev:
Hi there,

The device is rooted.

But

adb shell ls -l /dev/block/bootdevice/by-name

It returned

/dev/block/bootdevice/by-name: Permission denied

However,

adb shell su -c 'ls -l /dev/block/bootdevice/by-name'

It returned

lrwxrwxrwx root root 1970-01-21 16:08 DDR -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1970-01-21 16:08 DRIVER -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1970-01-21 16:08 LOGO -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1970-01-21 16:08 aboot -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1970-01-21 16:08 abootbak -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1970-01-21 16:08 apdp -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-01-21 16:08 bluetooth -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1970-01-21 16:08 boot -> /dev/block/mmcblk0p35
lrwxrwxrwx root root 1970-01-21 16:08 cache -> /dev/block/mmcblk0p41
lrwxrwxrwx root root 1970-01-21 16:08 config -> /dev/block/mmcblk0p40
lrwxrwxrwx root root 1970-01-21 16:08 devinfo -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1970-01-21 16:08 dpo -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1970-01-21 16:08 fsc -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-21 16:08 fsg -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1970-01-21 16:08 hyp -> /dev/block/mmcblk0p33
lrwxrwxrwx root root 1970-01-21 16:08 hypbak -> /dev/block/mmcblk0p34
lrwxrwxrwx root root 1970-01-21 16:08 keystore -> /dev/block/mmcblk0p39
lrwxrwxrwx root root 1970-01-21 16:08 limits -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1970-01-21 16:08 misc -> /dev/block/mmcblk0p38
lrwxrwxrwx root root 1970-01-21 16:08 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1970-01-21 16:08 modemst1 -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-21 16:08 modemst2 -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1970-01-21 16:08 msadp -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-01-21 16:08 oem_dycnvbk -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1970-01-21 16:08 oem_stanvbk -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1970-01-21 16:08 param -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1970-01-21 16:08 persist -> /dev/block/mmcblk0p37
lrwxrwxrwx root root 1970-01-21 16:08 pmic -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1970-01-21 16:08 pmicbak -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1970-01-21 16:08 recovery -> /dev/block/mmcblk0p36
lrwxrwxrwx root root 1970-01-21 16:08 reserve1 -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1970-01-21 16:08 reserve2 -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1970-01-21 16:08 rpm -> /dev/block/mmcblk0p31
lrwxrwxrwx root root 1970-01-21 16:08 rpmbak -> /dev/block/mmcblk0p32
lrwxrwxrwx root root 1970-01-21 16:08 sbl1 -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1970-01-21 16:08 sbl1bak -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1970-01-21 16:08 sdi -> /dev/block/mmcblk0p28
lrwxrwxrwx root root 1970-01-21 16:08 sec -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1970-01-21 16:08 ssd -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1970-01-21 16:08 system -> /dev/block/mmcblk0p42
lrwxrwxrwx root root 1970-01-21 16:08 tz -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1970-01-21 16:08 tzbak -> /dev/block/mmcblk0p30
lrwxrwxrwx root root 1970-01-21 16:08 userdata -> /dev/block/mmcblk0p43

In addition,

adb pull /dev/block/mmcblk0p43 43.img

It returned

adb: error: remote object '/dev/block/mmcblk0p43' does not exist

How to resolve the issue of "permission denied"?

Why are there differences in terms of results between adb shell ls -l /dev/block/bootdevice/by-name and adb shell su -c 'ls -l /dev/block/bootdevice/by-name'?

Why adb pull failed to create a disk image?

Is mmcblk0p43 recognized as a file so adb pull could copy it out of /dev/block/?

Thanks in advance.

--- Solution ---

Install adbd insecure and check "Enable insecure adbd" and"Enable as boot", these two boxes;

However, it ensued another problem that the device is no more recognised by adb. And this issue is solved by

- installing SELinux Switch and choosing "Permissive".

And both

adb shell ls -l /dev/block/bootdevice/by-name

and

adb pull /dev/block/mmcblk0p43 43.img

worked.

But how come that adbd insecure could enable the 2 commands above

?

Apparently the device's bootloader is locked.

fastboot oem device-info

(bootloader) Device tampered: false
(bootloader) Device unlocked: false
(bootloader) Device is_verified: false
(bootloader) Charger screen enabled: false
(bootloader) Display panel:
(bootloader) console_locked: 1
(bootloader) exec_console_unconsole: 0
OKAY [ 0.072s]