From: Brint E. Kriebel Date: Tue, 3 Nov 2015 01:26:07 +0000 (-0800) Subject: ota_from_target_files: Don't validate data signatures with data wipe X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fbuild.git;a=commitdiff_plain;h=ad8feb246916f41d8a731ac401081d6e56695db3 ota_from_target_files: Don't validate data signatures with data wipe 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 --- diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 3b1b7e54d..8ebed9860 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -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.