blob: b89b572dd68064b99a881c37b1f2c96cf43aa61a [file] [log] [blame]
Gabriele M5b33c6c2017-01-22 22:50:02 +01001ui_print("Removing su addon...");
2ifelse(is_mounted("/system"), unmount("/system"));
3package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
4set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
5run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
6
7if getprop("ro.build.system_root_image") != "true" then
8 delete("/system/addon.d/51-addonsu.sh");
9 delete("/system/bin/su");
10 delete("/system/etc/init/superuser.rc");
11 delete("/system/xbin/su");
12else
13 delete("/system/system/addon.d/51-addonsu.sh");
14 delete("/system/system/bin/su");
15 delete("/system/system/etc/init/superuser.rc");
16 delete("/system/system/xbin/su");
17endif;
18
19unmount("/system");
20ui_print("Done");
21set_progress(1.000000);