From 085b6f3e84760dc5d8d71a82b98178e15dcba15f Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Mon, 25 Jul 2022 16:12:30 -0700 Subject: [PATCH] Allow extra_apex_payload_key to take multiple names at once When running tests, we might need to add many extra_payload_keys. Currently we have to add --extra_apex_payload_key for each key pair we pass, resulting in extremely long argument list. Test: th Bug: 239991438 Change-Id: I3e5f9d76c7f45822fb986b603dc089407c35b76b --- tools/releasetools/sign_target_files_apks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 40bd6a775e..dbe79aba09 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -27,7 +27,7 @@ Usage: sign_target_files_apks [flags] input_target_files output_target_files apkcerts.txt file, or the container key for an APEX. Option may be repeated to give multiple extra packages. - --extra_apex_payload_key + --extra_apex_payload_key Add a mapping for APEX package name to payload signing key, which will override the default payload signing key in apexkeys.txt. Note that the container key should be overridden via the `--extra_apks` flag above. @@ -1380,8 +1380,9 @@ def main(argv): for n in names: OPTIONS.extra_apks[n] = key elif o == "--extra_apex_payload_key": - apex_name, key = a.split("=") - OPTIONS.extra_apex_payload_keys[apex_name] = key + apex_names, key = a.split("=") + for name in apex_names: + OPTIONS.extra_apex_payload_keys[name] = key elif o == "--skip_apks_with_path_prefix": # Check the prefix, which must be in all upper case. prefix = a.split('/')[0]