- if os.path.exists(system_zip) and not helpers.images.validate(args, "system_ota", system_zip):
- logging.warning("Not upgrading because system.img comes from an unverified source")
- return
- if os.path.exists(vendor_zip) and not helpers.images.validate(args, "vendor_ota", vendor_zip):
- logging.warning("Not upgrading because vendor.img comes from an unverified source")
- return
+ if os.path.exists(system_zip):
+ if not helpers.images.validate(args, "system_ota", system_zip):
+ logging.warning("Not upgrading because system.img comes from an unverified source")
+ return
+ else:
+ system_zip = "" # Race prevention
+ if os.path.exists(vendor_zip):
+ if not helpers.images.validate(args, "vendor_ota", vendor_zip):
+ logging.warning("Not upgrading because vendor.img comes from an unverified source")
+ return
+ else:
+ vendor_zip = "" # Race prevention