Gabriele M | 5b33c6c | 2017-01-22 22:50:02 +0100 | [diff] [blame] | 1 | ui_print("Removing su addon..."); |
| 2 | ifelse(is_mounted("/system"), unmount("/system")); |
| 3 | package_extract_file("mount-system.sh", "/tmp/mount-system.sh"); |
| 4 | set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755); |
| 5 | run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system"); |
| 6 | |
| 7 | if 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"); |
| 12 | else |
| 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"); |
| 17 | endif; |
| 18 | |
| 19 | unmount("/system"); |
| 20 | ui_print("Done"); |
| 21 | set_progress(1.000000); |