summaryrefslogtreecommitdiff
path: root/plugins/python/apkfiles
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-08-03 13:03:26 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-08-03 13:03:26 (GMT)
commitb7c83221f2a60be8ee5d44a7599dbe6869af005f (patch)
tree814e294533920d18f8734baa9aaef47c676e520a /plugins/python/apkfiles
parent7d2b7ca95966c2d687526cd75a96d1ea67d3f503 (diff)
Loaded the permissions used by an APK file.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@255 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/python/apkfiles')
-rw-r--r--plugins/python/apkfiles/apkfiles.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/python/apkfiles/apkfiles.py b/plugins/python/apkfiles/apkfiles.py
index 38d0e59..7c05ca9 100644
--- a/plugins/python/apkfiles/apkfiles.py
+++ b/plugins/python/apkfiles/apkfiles.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-from pychrysa import Plugin
+from pychrysalide import Plugin
import zipfile
@@ -9,11 +9,13 @@ import zipfile
class ApkFiles(Plugin):
"""Open and process APK files."""
+
def get_action(self):
"""Register the plugin for given actions."""
return Plugin.PGA_FORMAT_MATCHER
+
def is_matching(self, filename, data):
"""Define if the given file can be handled."""
@@ -22,7 +24,8 @@ class ApkFiles(Plugin):
zf = zipfile.ZipFile(filename)
- if zf.namelist().count('classes.dex') > 0:
+ if zf.namelist().count('classes.dex') > 0 \
+ and zf.namelist().count('AndroidManifest.xml') > 0:
f = zf.open('classes.dex', 'r')
data = f.read()