Skip to content

Commit

Permalink
Merge pull request #22 from douniwan5788/fix_offset
Browse files Browse the repository at this point in the history
fix: 使用header里的偏移查找entries,而非假设数据是连续的
  • Loading branch information
mikusjelly authored Mar 27, 2020
2 parents ffc4e33 + 8809b65 commit 5bbdaab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion apkutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from cigam import Magic
from TextWizard import hash

__VERSION__ = '0.6.6'

# 6E invoke-virtual 110
# 6F invoke-supper
Expand Down
3 changes: 3 additions & 0 deletions apkutils/axml/arscparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def __init__(self, raw_buff):
self.resource_configs[package_name][a_res_type].add(
a_res_type.config)

self.buff.set_idx(header.start+header.header_size)
entries = []
for j in range(0, a_res_type.entryCount):
current_package.mResId = current_package.mResId & 0xffff0000 | j
Expand All @@ -181,6 +182,8 @@ def __init__(self, raw_buff):
break

if entry != -1:
self.buff.set_idx(
header.start+a_res_type.entriesStart+entry)
ate = ARSCResTableEntry(self.buff, res_id, pc)
self.packages[package_name].append(ate)

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os.path

from apkutils import __VERSION__
from setuptools import find_packages, setup


Expand All @@ -11,7 +10,7 @@ def read(fname):
setup(
name="apkutils",

version=__VERSION__,
version='0.6.6',

description=("Utils for parsing apk."),
long_description=read('README.rst'),
Expand All @@ -34,10 +33,11 @@ def read(fname):
packages=find_packages(exclude=['contrib', 'docs', 'tests']),

install_requires=[
"pyelftools",
"cigam",
"xmltodict",
"cigam",
"pyelftools",
"pyopenssl",
"anytree",
"TextWizard"
"TextWizard",
],
)

0 comments on commit 5bbdaab

Please sign in to comment.