Skip to content

('getApkPackageInfo Error. ', ValueError('chr() arg not in range(256)',)) #13

@ohyeah521

Description

@ohyeah521

when i run this command

ap = apk.APK(filename)

it show error like this.
('getApkPackageInfo Error. ', ValueError('chr() arg not in range(256)',))

i found the problems.

in this file. stringblock.py

def getRaw(self, idx):
    print("YYYYYYYYYYYYYYYYYYYYYYYYYYYY getRaw %s \n" % idx)
    if idx < 0 or self.m_stringOffsets == [] or idx >= len(self.m_stringOffsets):
        return None

    offset = self.m_stringOffsets[ idx ].get_value()
    length = self.getShort(self.m_strings, offset)

    data = ""
    print "length = ", length
    while length > 0:
        offset += 2
        # Unicode character
        print "self.getShort = ", self.getShort(self.m_strings, offset)
        data += chr(self.getShort(self.m_strings, offset))

        # FIXME
        if data[-1] == "&":
            data = data[:-1]

        length -= 1

    return data

can not resolve unicode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions