From 883eecbc4be15d0c35e928284e638fc629ddb0ad Mon Sep 17 00:00:00 2001 From: Hongguang Chen Date: Sat, 23 May 2020 22:20:19 -0700 Subject: [PATCH] Allow more than one '=' in avb_extra_custom_image_extra_args. avb_extra_custom_image_extra_args can be set to 'oem=--signing_helper_with_files=/tmp/avbsigner.sh' on signing server. The second '=' shouldn't be splitted in this case. BUG: 154171021 Test: Manually sign target zip files which has custom images. sign_target_files_apks -d certs --avb_extra_custom_image_key \ oem=oem_rsa4096.pem --avb_extra_custom_image_algorithm \ oem=SHA256_RSA4096 --avb_extra_custom_image_extra_args \ oem="--signing_helper_with_files=/tmp/avbsigner.sh" \ xxxx-target_files.zip signed.zip Change-Id: I815d574f791734d4c6a25a9f8d827b5b4f93d7cc --- tools/releasetools/sign_target_files_apks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 52b7889bd..47360c946 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -1234,7 +1234,10 @@ def main(argv): partition, algorithm = a.split("=") OPTIONS.avb_algorithms[partition] = algorithm elif o == "--avb_extra_custom_image_extra_args": - partition, extra_args = a.split("=") + # Setting the maxsplit parameter to one, which will return a list with + # two elements. e.g., the second '=' should not be splitted for + # 'oem=--signing_helper_with_files=/tmp/avbsigner.sh'. + partition, extra_args = a.split("=", 1) OPTIONS.avb_extra_args[partition] = extra_args else: return False