""" % bcb_dev)
script.SetProgress(1)
- script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+ # For downgrade OTAs, we prefer to use the update-binary in the source
+ # build that is actually newer than the one in the target build.
+ if OPTIONS.downgrade:
+ script.AddToZip(source_zip, output_zip, input_path=OPTIONS.updater_binary)
+ else:
+ script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+ metadata["ota-required-cache"] = str(script.required_cache)
WriteMetadata(metadata, output_zip)
if OPTIONS.verify and vendor_diff:
script.Print("Remounting and verifying vendor partition files...")
script.Unmount("/vendor")
- script.Mount("/vendor")
+ script.Mount("/vendor", recovery_mount_options)
vendor_diff.EmitExplicitTargetVerification(script)
- script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+
+ # For downgrade OTAs, we prefer to use the update-binary in the source
+ # build that is actually newer than the one in the target build.
+ if OPTIONS.downgrade:
+ script.AddToZip(source_zip, output_zip, input_path=OPTIONS.updater_binary)
+ else:
+ script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+ metadata["ota-required-cache"] = str(script.required_cache)
WriteMetadata(metadata, output_zip)