diff options
Diffstat (limited to 'plugins/python/androperms/db.py')
-rw-r--r-- | plugins/python/androperms/db.py | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/plugins/python/androperms/db.py b/plugins/python/androperms/db.py deleted file mode 100644 index 7014915..0000000 --- a/plugins/python/androperms/db.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import os - - -class PermsDataBase: - """Display all permissions found in the Manifest.""" - - def __init__(self): - - self._perms = { } - self._used = { } - - self._load_all_definitions() - - - def _load_all_definitions(self): - """Load the database in memory.""" - - with open(os.path.dirname(__file__) + '/androperms.db', 'r') as f: - - for line in f.readlines(): - - perm = line.strip("\n").split("\t") - - for p in perm[1].split(" "): - - if not p.startswith("android.permission."): - continue - - if p not in self._perms: - self._perms[p] = [] - - call = perm[0].split("(")[0] - - if call not in self._perms[p]: - self._perms[p].append(call) - - - def filter_permissions(self, used): - """Forget all permissions which are not used.""" - - keep = {} - - for p in self._perms: - if p in used: - keep[p] = self._perms[p] - - self._perms = keep - - for p in keep: - self._used[p] = [] - - - def check_call(self, addr, line, reladdr): - """Check if a call requires some rights.""" - - found = False - - for p in self._perms: - - if line.find("Wall") > -1: - print "[+]", line, ' ==> ', p - - for c in self._perms[p]: - - #print " - ", c - - #if line.find(c) > -1: - if c.find(line) > -1: - self._used[p].append([reladdr, c + "()", addr]) - found = True - - # if not found: - - # func = line.split('.')[-1] - - # for p in self._perms: - - # for c in self._perms[p]: - - # if c.find(func) > -1: - - # #print ">>> %s found in %s" % (func, c) - - # self._used[p].append([reladdr, line + "()", addr]) - # break - - - def get_used_permissions(self): - """Provide the list of used permissions.""" - - return self._used |