diff options
| author | 2020-01-29 11:37:43 -0800 | |
|---|---|---|
| committer | 2020-01-29 11:40:42 -0800 | |
| commit | 83bd55c1db04af6b6ac7c2bbbe55d62b5443d96e (patch) | |
| tree | 470ab1fc2a4fc8acc1af4da74cd9adae9c1d8f49 /tools/releasetools/apex_utils.py | |
| parent | a25d76f2c8ac88b344d26d5e4ae39d50fb9c518f (diff) | |
Assets should be optional in apex repacking
We should only provide the --assets_dir option when the assets directory
is available in the original apex.
Bug: 148452817
Test: unit tests pass
Change-Id: I44308b80a43ff3f441223f0ecc248991d1d83f31
Diffstat (limited to 'tools/releasetools/apex_utils.py')
| -rw-r--r-- | tools/releasetools/apex_utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py index 113f78b191..cf10386ece 100644 --- a/tools/releasetools/apex_utils.py +++ b/tools/releasetools/apex_utils.py @@ -133,7 +133,6 @@ class ApexApkSigner(object): arguments_dict = { 'manifest': os.path.join(apex_dir, 'apex_manifest.pb'), 'build_info': os.path.join(apex_dir, 'apex_build_info.pb'), - 'assets_dir': os.path.join(apex_dir, 'assets'), 'android_jar_path': android_jar_path, 'key': payload_key, 'pubkey': payload_public_key, @@ -156,10 +155,16 @@ class ApexApkSigner(object): for key, val in arguments_dict.items(): repack_cmd.append('--' + key) repack_cmd.append(val) + # optional arguments for apex repacking manifest_json = os.path.join(apex_dir, 'apex_manifest.json') if os.path.exists(manifest_json): repack_cmd.append('--manifest_json') repack_cmd.append(manifest_json) + assets_dir = os.path.join(apex_dir, 'assets') + if os.path.isdir(assets_dir): + repack_cmd.append('--assets_dir') + repack_cmd.append(assets_dir) + repack_cmd.append(payload_dir) repack_cmd.append(repacked_apex) common.RunAndCheckOutput(repack_cmd) |