Skip to content

"IndexError: list index out of range" in calling get_arsc_info #50

@emanuelb

Description

@emanuelb

Running get_arsc_info function from pyaxmlparser.arscutil on resources.arsc from repo at:
https://github.com/appknox/pyaxmlparser/blob/master/tests/test_apk/resources.arsc
will return:

Traceback (most recent call last):
  File "/tmp/arsctest.py", line 12, in <module>
    print(get_arsc_info(rsc))
  File "/usr/lib/python3/dist-packages/pyaxmlparser/arscutil.py", line 636, in get_arsc_info
    tmp_buff = getattr(arscobj, "get_" + ttype + "_resources")(
  File "/usr/lib/python3/dist-packages/pyaxmlparser/arscparser.py", line 439, in get_bool_resources
    buff += '<bool name="%s">%s</bool>\n' % (i[0], i[1])
IndexError: list index out of range

code to reproduce:

from pyaxmlparser.arscparser import ARSCParser
from pyaxmlparser.arscutil   import get_arsc_info
rsc_file = 'resources.arsc'
rsc = ARSCParser(open(rsc_file, 'rb').read())
print('rsc=\n')
print(rsc)
print('rsc.get_strings_resources()=\n')
print(rsc.get_strings_resources())
print('get_arsc_info(rsc)=\n')
print(get_arsc_info(rsc))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions