summaryrefslogtreecommitdiff
path: root/tools/releasetools/apex_utils.py
diff options
context:
space:
mode:
authorBrian Orr <brianorr@google.com>2021-08-11 19:11:22 +0000
committerBrian Orr <brianorr@google.com>2021-08-11 19:11:22 +0000
commit826bccd293d0149052abb08d1af7ff5f142ed169 (patch)
treeeb363b9499c72b60b62a38e6e0c461ee9666f044 /tools/releasetools/apex_utils.py
parenta12391e26819037a52eb7b5e05dcfb223bd136ff (diff)
parentde7ff3d2b04f82d9f924ec1bd8e1069d890f2a54 (diff)
Merge SP1A.210811.001
Change-Id: Ic03dc5d44a2c301b9f2fff7d2a80c17574d6f857
Diffstat (limited to 'tools/releasetools/apex_utils.py')
-rw-r--r--tools/releasetools/apex_utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index 893266f95a..ef4c69cb2e 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -340,6 +340,8 @@ def SignUncompressedApex(avbtool, apex_file, payload_key, container_key,
zip_items = apex_fd.namelist()
payload_info = ParseApexPayloadInfo(avbtool, payload_file)
+ if no_hashtree is None:
+ no_hashtree = payload_info.get("Tree Size", 0) == 0
SignApexPayload(
avbtool,
payload_file,
@@ -385,8 +387,8 @@ def SignUncompressedApex(avbtool, apex_file, payload_key, container_key,
def SignCompressedApex(avbtool, apex_file, payload_key, container_key,
- container_pw, apk_keys, codename_to_api_level_map,
- no_hashtree, signing_args=None):
+ container_pw, apk_keys, codename_to_api_level_map,
+ no_hashtree, signing_args=None):
"""Signs the current compressed APEX with the given payload/container keys.
Args:
@@ -516,6 +518,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw,
raise ApexInfoError(
'Failed to get type for {}:\n{}'.format(apex_file, e))
+
def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True):
"""
Get information about system APEX stored in the input_file zip
@@ -558,7 +561,7 @@ def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True):
for apex_filename in os.listdir(target_dir):
apex_filepath = os.path.join(target_dir, apex_filename)
if not os.path.isfile(apex_filepath) or \
- not zipfile.is_zipfile(apex_filepath):
+ not zipfile.is_zipfile(apex_filepath):
logger.info("Skipping %s because it's not a zipfile", apex_filepath)
continue
apex_info = ota_metadata_pb2.ApexInfo()