OSDN Git Service

ota_from_target_files: Validate signatures after possible data wipe
authorBrint E. Kriebel <bekit@cyngn.com>
Mon, 18 Aug 2014 21:28:42 +0000 (14:28 -0700)
committerMichael Bestas <mikeioannina@gmail.com>
Sat, 31 Dec 2016 18:25:13 +0000 (20:25 +0200)
If the data is being wiped, we want to validate the signature after
this step. This is also a good check that the data wipe succeeded.

Change-Id: Iaecfddfb2010944de0c97e7bb21d8e581f20deec

tools/releasetools/ota_from_target_files.py

index 4173b20..eaffe05 100755 (executable)
@@ -641,13 +641,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
 
   device_specific.FullOTA_InstallBegin()
 
-  if block_based:
-    common.ZipWriteStr(output_zip, "system/bin/otasigcheck.sh",
-                   ""+input_zip.read("SYSTEM/bin/otasigcheck.sh"))
-  script.Mount("/data")
-  script.ValidateSignatures("data")
-  script.Unmount("/data")
-
   if OPTIONS.backuptool:
     if block_based:
       common.ZipWriteStr(output_zip, "system/bin/backuptool.sh",
@@ -663,6 +656,13 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
   if HasVendorPartition(input_zip):
     system_progress -= 0.1
 
+  if block_based:
+    common.ZipWriteStr(output_zip, "system/bin/otasigcheck.sh",
+                   ""+input_zip.read("SYSTEM/bin/otasigcheck.sh"))
+  script.Mount("/data")
+  script.ValidateSignatures("data")
+  script.Unmount("/data")
+
   # Place a copy of file_contexts.bin into the OTA package which will be used
   # by the recovery program.
   if "selinux_fc" in OPTIONS.info_dict: