TeamWin / Team-Win-Recovery-Project

Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/
http://twrp.me
1.96k stars 741 forks source link

(Help needed) root permissions to .sh #665

Open pahapoika opened 8 years ago

pahapoika commented 8 years ago

So how to grant root permissions to bourne script?

(The script already does mount the /data/ to rm) So im making flashable .zip that would delete from /data/system/ but su/xbin/busybox rm -rf /data/system/(filename) doesn't delete the file. So is there any other way to make that zip delete that file from that directory?

Thanks!

that1 commented 8 years ago

TWRP is running as root, so don't use su. And TWRP's busybox is in /sbin. But you should probably simply use "rm".

pahapoika commented 8 years ago

@that1 i ran to another problem. The file is just rw for owner and im not owner of the file. So is there command that you can run on updater-script or in .sh file to change the permissions to rw-rw-rw?

Other way would be replace with empty file. So how would be that possible?

that1 commented 8 years ago

Root should be able to delete any file. But you can also use chmod.

pahapoika commented 8 years ago

@that1 the file can be deleted in terminal emulator by commands su su/xbin/busybox rm /data/system/(nameoffile)

But it does not delete from recovery.

that1 commented 8 years ago

When running the rm command via adb shell while in TWRP (or from TWRP's built-in terminal emulator), what error message are you getting?