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
strace su shows that the
setuid() calls are failing. I suspect this is because of SELinux contexts.
What should the SELinux contexts be for the binary?