Fix test case

This commit is contained in:
MadSquirrel 2024-04-08 21:39:38 +02:00
parent db87703967
commit 293d85b29e

View File

@ -380,6 +380,7 @@ class AXMLParser:
self.axml_tampered = False
self.buff = io.BufferedReader(io.BytesIO(raw_buff))
self.buff_size = self.buff.raw.getbuffer().nbytes
self.packerwarning = False
# Minimum is a single ARSCHeader, which would be a strange edge case...
if self.buff_size < 8:
@ -824,7 +825,10 @@ class AXMLParser:
if name <= len(self.m_resourceIDs):
attr = self.m_resourceIDs[name]
if attr in public.SYSTEM_RESOURCES['attributes']['inverse']:
res = 'android:' + public.SYSTEM_RESOURCES['attributes']['inverse'][attr]
res = public.SYSTEM_RESOURCES['attributes']['inverse'][attr].replace("_",
":")
if res != self.sb[name]:
self.packerwarning = True
if not res or res == ":":
# Attach the HEX Number, so for multiple missing attributes we do not run
@ -1047,7 +1051,7 @@ class AXMLPrinter:
:returns: True if packer detected, False otherwise
"""
return self.packerwarning
return self.packerwarning or self.axml.packerwarning
def _get_attribute_value(self, index):
"""