Ignore contents.xml with incorrect xml structure

This commit is contained in:
Jakob Lell 2021-09-27 17:04:53 +02:00
parent 7f5eeb8d52
commit d7f902196c
1 changed files with 2 additions and 0 deletions

View File

@ -515,6 +515,8 @@ class RawprogramUnsparseHandler(FileHandler):
root = tree.getroot()
params_tags = root.xpath('//step[@filter="hlos"]/params')
if len(params_tags) == 0:
if len(root.xpath("/contents/product_info/product_name")) > 0:
return CheckFileResult.HANDLER_NO_MATCH # Some firmwares have a completely different file called "contents.xml", which isn't required for extraction.
raise ValueError("Failed to parse contents.xml")
result = CheckFileResult.HANDLER_NO_MATCH
for params_tag in params_tags: