diff options
| author | 2020-01-31 12:11:12 -0800 | |
|---|---|---|
| committer | 2020-01-31 20:19:18 +0000 | |
| commit | 0e38d64e49c20aeef6f4ecd917a7bd90f82fca67 (patch) | |
| tree | ba7ebe06e9a435d6de44f8d71a5dd4cd8043c672 | |
| parent | 0a6022e7815043d508fcd2f93c9dd22af0225d30 (diff) | |
Add quote to the signing arguments when passing to apexer
We should add quote when passing the signing arguments to apexer. So
the final argument whould look like
apexer ... --signing_args "--signing_helper_with_files=%path"
And the argument parser in avbtool will eventually parse the
"--signing_helper_with_files" correctly.
Bug: 148627666
Test: unittest pass, run a smoke sign_target_files_apk with signing arguments
Change-Id: Ie203d26a508cb98ca94e6c364a2640b681ad79f2
| -rw-r--r-- | tools/releasetools/apex_utils.py | 4 | ||||
| -rw-r--r-- | tools/releasetools/test_apex_utils.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index 4ca091700c..4fac6f3e60 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -157,8 +157,10 @@ class ApexApkSigner(object): os.getenv('PATH')] for key, val in arguments_dict.items(): repack_cmd.extend(['--' + key, val]) + # Add quote to the signing_args as we will pass + # --signing_args "--signing_helper_with_files=%path" to apexer if signing_args: - repack_cmd.extend(['--signing_args', signing_args]) + repack_cmd.extend(['--signing_args', '"{}"'.format(signing_args)]) # optional arguments for apex repacking manifest_json = os.path.join(apex_dir, 'apex_manifest.json') if os.path.exists(manifest_json): diff --git a/tools/releasetools/test_apex_utils.py b/tools/releasetools/test_apex_utils.py index b9f2de5574..07284ade8c 100644 --- a/tools/releasetools/test_apex_utils.py +++ b/tools/releasetools/test_apex_utils.py @@ -189,7 +189,7 @@ class ApexUtilsTest(test_utils.ReleaseToolsTestCase): signing_helper = os.path.join(self.testdata_dir, 'signing_helper.sh') os.chmod(signing_helper, 0o700) - payload_signer_args = '--signing_helper_with_files {}'.format( + payload_signer_args = '--signing_helper_with_files={}'.format( signing_helper) signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey, payload_signer_args) |