Merge "Only add apex_info for compressed apexes"
This commit is contained in:
@@ -539,6 +539,15 @@ def GetApexInfoFromTargetFiles(input_file):
|
|||||||
target_dir = os.path.join(tmp_dir, "SYSTEM/apex/")
|
target_dir = os.path.join(tmp_dir, "SYSTEM/apex/")
|
||||||
|
|
||||||
apex_infos = []
|
apex_infos = []
|
||||||
|
|
||||||
|
debugfs_path = "debugfs"
|
||||||
|
if OPTIONS.search_path:
|
||||||
|
debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static")
|
||||||
|
deapexer = 'deapexer'
|
||||||
|
if OPTIONS.search_path:
|
||||||
|
deapexer_path = os.path.join(OPTIONS.search_path, "deapexer")
|
||||||
|
if os.path.isfile(deapexer_path):
|
||||||
|
deapexer = deapexer_path
|
||||||
for apex_filename in os.listdir(target_dir):
|
for apex_filename in os.listdir(target_dir):
|
||||||
apex_filepath = os.path.join(target_dir, apex_filename)
|
apex_filepath = os.path.join(target_dir, apex_filename)
|
||||||
if not os.path.isfile(apex_filepath) or \
|
if not os.path.isfile(apex_filepath) or \
|
||||||
@@ -551,14 +560,6 @@ def GetApexInfoFromTargetFiles(input_file):
|
|||||||
apex_info.package_name = manifest.name
|
apex_info.package_name = manifest.name
|
||||||
apex_info.version = manifest.version
|
apex_info.version = manifest.version
|
||||||
# Check if the file is compressed or not
|
# Check if the file is compressed or not
|
||||||
debugfs_path = "debugfs"
|
|
||||||
if OPTIONS.search_path:
|
|
||||||
debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static")
|
|
||||||
deapexer = 'deapexer'
|
|
||||||
if OPTIONS.search_path:
|
|
||||||
deapexer_path = os.path.join(OPTIONS.search_path, "deapexer")
|
|
||||||
if os.path.isfile(deapexer_path):
|
|
||||||
deapexer = deapexer_path
|
|
||||||
apex_type = RunAndCheckOutput([
|
apex_type = RunAndCheckOutput([
|
||||||
deapexer, "--debugfs_path", debugfs_path,
|
deapexer, "--debugfs_path", debugfs_path,
|
||||||
'info', '--print-type', apex_filepath]).rstrip()
|
'info', '--print-type', apex_filepath]).rstrip()
|
||||||
@@ -579,6 +580,6 @@ def GetApexInfoFromTargetFiles(input_file):
|
|||||||
'--output', decompressed_file_path])
|
'--output', decompressed_file_path])
|
||||||
apex_info.decompressed_size = os.path.getsize(decompressed_file_path)
|
apex_info.decompressed_size = os.path.getsize(decompressed_file_path)
|
||||||
|
|
||||||
apex_infos.append(apex_info)
|
apex_infos.append(apex_info)
|
||||||
|
|
||||||
return apex_infos
|
return apex_infos
|
||||||
|
Reference in New Issue
Block a user