diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2014-11-30 15:09:43 +0000 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 17:51:29 -0700 |
commit | f0f601f977c0bd5a97fa6292b659d28dbdf1b0de (patch) | |
tree | 0d7821012d0e36eb4fc8177e50d7686b25969548 /tools/releasetools/edify_generator.py | |
parent | 19f72f01ccd0a3317728ff3f3af029fcdcaceef6 (diff) | |
download | build-f0f601f977c0bd5a97fa6292b659d28dbdf1b0de.zip build-f0f601f977c0bd5a97fa6292b659d28dbdf1b0de.tar.gz build-f0f601f977c0bd5a97fa6292b659d28dbdf1b0de.tar.bz2 |
otasigcheck: Go back to the key-rewrite check.
Using an intermediate file had the at-the-time unintended but good
side-effect of making execution failures (absent script, no
busybox in recovery, bad selinux setup) pass gracefully. Since this
check is intended as a blacklist, blocking the update when only
sure that breakage will ensue, that was a nice thing to get.
Checking the return code, while cleaner, is making non-key-related
failures like those mentioned above abort execution of the script.
The key itself isn't even checked, yet we're aborting because of it.
So go back to the original behavior: In case we're not sure... pass.
To do:
This can be cleaned up differently, and to the same effect, by returning
an explicit error code from the script and aborting when that error
comes up. Change the script to do that and come back here. :)
Change-Id: Ic9d7c3128047c25f31e2ef416c9df4d21ca0a1a8
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r-- | tools/releasetools/edify_generator.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 61af160..6ebf11d 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -168,7 +168,9 @@ class EdifyGenerator(object): self.script.append('package_extract_file("system/bin/otasigcheck.sh", "/tmp/otasigcheck.sh");') self.script.append('package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");') self.script.append('set_metadata("/tmp/otasigcheck.sh", "uid", 0, "gid", 0, "mode", 0755);') - self.script.append('run_program("/tmp/otasigcheck.sh") == "0" || abort("Can\'t install this package on top of incompatible data. Please try another package or run a factory reset");') + self.script.append('run_program("/tmp/otasigcheck.sh");') + ## The script changes the key value when it fails, check for "INVALID" + self.script.append('sha1_check(read_file("/tmp/releasekey"),"7241e92725436afc79389d4fc2333a2aa8c20230") && abort("Can\'t install this package on top of incompatible data. Please try another package or run a factory reset");') def ShowProgress(self, frac, dur): """Update the progress bar, advancing it over 'frac' over the next |