Fix SELinux contexts for a SU binary
1
vote
2
answers
2232
views
I am trying to root my android 6.0.1 phone using the following method:
I first booted into a TWRP image using
fastboot boot
, then using the TWRP terminal I copied the su
binary from the SuperSU kit to /system/xbin/ and ran chmod 6755 ./su
, chown root:root ./su
and chcon u:object_r:system_file:s0 ./su
. Now I booted into Android and opened a terminal emulator and goto /system/xbin/ and see that the SUID bit is set for su
. But when I run su
, nothing happens and the binary exits with a 0
value.
Running strace su
shows that the setresuid()
and setuid()
calls are failing. I suspect this is because of SELinux contexts.
What should the SELinux contexts be for the binary?
Asked by nom
(111 rep)
May 22, 2017, 02:00 PM
Last activity: Nov 24, 2020, 07:04 AM
Last activity: Nov 24, 2020, 07:04 AM