From 253b106f95956e00d0e9873e583bbbded2849397 Mon Sep 17 00:00:00 2001 From: Yong Ma Date: Thu, 18 Aug 2022 09:53:27 +0000 Subject: [PATCH] set up the salt for partitions without build.prop BUG:242954151 Test: make target-files-package, then check the two sha1 are same: 1. sha1 of IMAGES/boot.img 2. expected sha1 of boot in VENDOR/bin/install-recovery.sh Test: make target-files-package; unzip target_files.zip IMAGES/\*`; `zip -d arget_files.zip IMAGES/\*` `add_img_to_target_files -a target_files.zip`. Verify that the rebuilt images are identical to the deleted ones. Change-Id: I5906ac1696b6403674fd8330b1569aed53510945 --- tools/releasetools/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 917e4dc820..5196f6321e 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -861,6 +861,10 @@ def LoadInfoDict(input_file, repacking=False): d["avb_{}_salt".format(partition)] = sha256( fingerprint.encode()).hexdigest() + # Set up the salt for partitions without build.prop + if build_info.fingerprint: + d["avb_salt"] = sha256(build_info.fingerprint.encode()).hexdigest() + # Set the vbmeta digest if exists try: d["vbmeta_digest"] = read_helper("META/vbmeta_digest.txt").rstrip()