Skip to content

Commit

Permalink
Correct attribute name to be the same used by Android
Browse files Browse the repository at this point in the history
  • Loading branch information
MadSquirrel committed Apr 8, 2024
1 parent 30fdb63 commit db87703
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions androguard/core/axml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,14 +821,15 @@ def getAttributeName(self, index):

res = self.sb[name]
# If the result is a (null) string, we need to look it up.
if not res or res == ":":
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]
else:
# Attach the HEX Number, so for multiple missing attributes we do not run
# into problems.
res = 'android:UNKNOWN_SYSTEM_ATTRIBUTE_{:08x}'.format(attr)

if not res or res == ":":
# Attach the HEX Number, so for multiple missing attributes we do not run
# into problems.
res = 'android:UNKNOWN_SYSTEM_ATTRIBUTE_{:08x}'.format(attr)
return res

def getAttributeValueType(self, index):
Expand Down

0 comments on commit db87703

Please sign in to comment.