axmlparserpy can be used to parse Android binary XML files into plaintext XML.
axmlparserpy was originally created by Anthony Desnos and was extracted from the Androguard project.
GPL
Python AxmlParser
axmlparserpy can be used to parse Android binary XML files into plaintext XML.
axmlparserpy was originally created by Anthony Desnos and was extracted from the Androguard project.
GPL
value = array[int(offset / 4)].get_value() in stringblock.py
Using AxmlParserPY encounters:
exceptions must be old-style classes or derived from BaseException, not str
I tested on python2.7 or python3.5.
I think the error is caused by this statement: raise("ooo")
?
no usage examples for extracting AndroidManifest from APKs
I don't know why, but it crashes when I run it. The version I am using is 0.0.4, the python version is 2.7.
Below is my code
with open(xmlPath, 'rb') as f:
ap = axmlprinter.AXMLPrinter(f.read())
dom = xml.dom.minidom.parseString(ap.getBuff()).toxml()
print dom
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import axmlparserpy.apk as apk
Traceback (most recent call last):
File "", line 1, in
File "E:\Python35\lib\site-packages\axmlparserpy\apk.py", line 21, in
from axmlprinter import AXMLPrinter
ImportError: No module named 'axmlprinter'
Due to how integrated the androidmanifest.xml file is with the rest of the APK, it makes sense to put APK processing back into this project. This is most likely already implemented in androguard's apk.py but will need to be updated.
Steps to complete:
[originally reported by pee]
Right now, resource strings are not resolved to the resource.asc file. AXMLPrinter and other's don't do this either but it would be nice to have this option. aapt and apktool have already implemented simliar functionality.
Example:'<manifest android:versionCode="300" android:versionName="@7F040001"'
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.