From 77e2f324e773d9ce71decb1a551e059438bcdddf Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Sun, 22 Jan 2017 22:50:11 +0100 Subject: Update su binary added with addonsu zip Generate zips that include the su binary out of the system image when WITH_SU is not true. This allows to update the binary that was installed with the addonsu zip. Note: this requires backuptool to work and user builds are excluded. Change-Id: Idc905e3397816b7d3701c43bbb809878f0d22b9b --- tools/releasetools/edify_generator.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/releasetools/edify_generator.py') diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 8025235..ca06c8a 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -411,3 +411,10 @@ class EdifyGenerator(object): data = open(input_path, "rb").read() common.ZipWriteStr(output_zip, "META-INF/com/google/android/update-binary", data, perms=0o755) + + def AppenSuUpdater(self): + self.AppendExtra('if (run_program("test", "-f", "/system/addon.d/51-addonsu.sh") == "0" && run_program("test", "-f", "/system/xbin/su") == "0") then') + self.AppendExtra('package_extract_file("extra/su", "/system/xbin/su");') + self.SetPermissions("/system/xbin/su", 0, 2000, 0o755, "u:object_r:su_exec:s0", None) + self.MakeSymlinks([("/system/xbin/su", "/system/bin/su")]) + self.AppendExtra('endif;') -- cgit v1.1