update-script : I can't delete files in /data/system directory

1.6k Views Asked by At

I want to remove a file from the /data/system folder during the recovery process. I tried the following in my update-script:

ui_print("");
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/data/system");
ui_print("Please wait ...");
delete("/data/system/password.key");
delete("/data/system/gesture.key");
unmount("/data/system");
ui_print("");

It seems to work fine in recovery but with no result when I check my phone, that is no file was removed. I also tried to make a shell script to be executed by my update-script. Here is the script:

#!/sbin/sh

su 
rw /data/system/
rm  /data/system/gesture.key
rm  /data/system/password.key

Here is my update-script for that approach:

ui_print("");
package_extract_file("s.sh", "/tmp/s.sh");
set_perm(0, 0, 0777, "/tmp/s.sh");
run_program("/tmp/s.sh", "");
delete("/tmp/s.sh");

It does not work either. What am I doing wrong?

1

There are 1 best solutions below

0
On

Finaly I found a solution

mount("rfs", "EMMC", "/dev/block/stl11", "/data");