Python support for extract information from android 'apk' package
Project description
# -------------------------------------------------------------------
# AndroidXMLParser was created by Anthony Desnos and is taken from
# the Androguard Project.
# -------------------------------------------------------------------
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------------------------
# Contributors:
# -------------------------------------------------------------------
# Anthony Desnos <anthony [dot] desnos [at] gmail.com>
# Antitree <antitree [at] gmail.com>
# pee <pee@erkkila.org> spam this
# algorythm <algorythm [at] gmail /dot/ com>
# Jiejing Zhang <kzjeef [at] gmail /dot/ com> // for package to pip
# -------------------------------------------------------------------
# version: 0.0.1
# -------------------------------------------------------------------
Example:
1. convert apk binary manifest to string manifest.
import axmlparserpy.axmlprinter as axmlprinter
ap = axmlprinter.AXMLPrinter(open('example/binary/AndroidManifest.xml', 'rb').read())
buff = minidom.parseString(ap.getBuff()).toxml()
print(buff)
2. get apk information
import axmlparserpy.apk as apk
ap = apk.APK('_PATH_TO_APK')
print ap.get_package()
print ap.get_androidversion_name()
# AndroidXMLParser was created by Anthony Desnos and is taken from
# the Androguard Project.
# -------------------------------------------------------------------
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.
# If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------------------------
# Contributors:
# -------------------------------------------------------------------
# Anthony Desnos <anthony [dot] desnos [at] gmail.com>
# Antitree <antitree [at] gmail.com>
# pee <pee@erkkila.org> spam this
# algorythm <algorythm [at] gmail /dot/ com>
# Jiejing Zhang <kzjeef [at] gmail /dot/ com> // for package to pip
# -------------------------------------------------------------------
# version: 0.0.1
# -------------------------------------------------------------------
Example:
1. convert apk binary manifest to string manifest.
import axmlparserpy.axmlprinter as axmlprinter
ap = axmlprinter.AXMLPrinter(open('example/binary/AndroidManifest.xml', 'rb').read())
buff = minidom.parseString(ap.getBuff()).toxml()
print(buff)
2. get apk information
import axmlparserpy.apk as apk
ap = apk.APK('_PATH_TO_APK')
print ap.get_package()
print ap.get_androidversion_name()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
AxmlParserPY-0.01.tar.gz
(8.4 kB
view details)
File details
Details for the file AxmlParserPY-0.01.tar.gz
.
File metadata
- Download URL: AxmlParserPY-0.01.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501821d2eebe6116df98750f1067b773860159f13bbb311f46e6e862eabd7584 |
|
MD5 | 9cb49fbe11107500e7bc46a0f41e1bbd |
|
BLAKE2b-256 | fb5c2e5a89fda7c21b71913ba554c775f9d1a545b14d7343eabbfdb909080171 |