OSDN Git Service

ota_from_target_files: Don't validate data signatures with data wipe
authorBrint E. Kriebel <bekit@cyngn.com>
Tue, 3 Nov 2015 01:26:07 +0000 (17:26 -0800)
committerSteve Kondik <steve@cyngn.com>
Sun, 4 Sep 2016 04:47:36 +0000 (21:47 -0700)
If data is going to be wiped later in the script, there is no reason to
validate signatures. This breaks updates that may be designed to wipe
data and change signatures.

Change-Id: I0b794b43cec2d22996eaa5571688c66582475d55
Ticket: CYNGNOS-1289

tools/releasetools/ota_from_target_files.py

index 3b1b7e5..8ebed98 100755 (executable)
@@ -667,13 +667,14 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
   if HasVendorPartition(input_zip):
     system_progress -= 0.1
 
-  script.AppendExtra("if is_mounted(\"/data\") then")
-  script.ValidateSignatures("data")
-  script.AppendExtra("else")
-  script.Mount("/data")
-  script.ValidateSignatures("data")
-  script.Unmount("/data")
-  script.AppendExtra("endif;")
+  if not OPTIONS.wipe_user_data:
+    script.AppendExtra("if is_mounted(\"/data\") then")
+    script.ValidateSignatures("data")
+    script.AppendExtra("else")
+    script.Mount("/data")
+    script.ValidateSignatures("data")
+    script.Unmount("/data")
+    script.AppendExtra("endif;")
 
   # Place a copy of file_contexts.bin into the OTA package which will be used
   # by the recovery program.