I am developing an embedded application and I need allow the device owner to root and unroot the device on demand.
I am able to root the device by running the following shell commands through a special version of SU which is stored in the rom:
chown 0.0 /system/xbin/su
chmod 06755 /system/xbin/su
chown 0.0 /system/xbin/busybox
chmod 0755 /system/xbin/busybox
I now need to be able to reverse the rooting process. I therefore need to revert the owner and permissions on the two files. The problem is I'm not sure what the default permissions and owners are on an unrooted android device.
Can anybody help?!