summaryrefslogtreecommitdiff
path: root/plugins/python/androperms/androperms.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-09-15 08:19:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-09-15 08:19:09 (GMT)
commit944fc0a5638bfe77fc65e514fbdd945d8a652635 (patch)
treecaad1d6c5f001dd02380aa2fae0c6dc8d67d9b60 /plugins/python/androperms/androperms.py
parent09d07908465d462101d27ecb1b60df52d63bbe5d (diff)
Shown all Android permissions with links to the code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@262 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/python/androperms/androperms.py')
-rw-r--r--plugins/python/androperms/androperms.py67
1 files changed, 55 insertions, 12 deletions
diff --git a/plugins/python/androperms/androperms.py b/plugins/python/androperms/androperms.py
index 0d70edc..6d65ca4 100644
--- a/plugins/python/androperms/androperms.py
+++ b/plugins/python/androperms/androperms.py
@@ -1,9 +1,10 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-from pychrysalide import Plugin
from manifest import AndroidManifest
from panel import PermsPanel
+from pychrysalide import Plugin
+from pychrysalide.gui.panels import PanelItem
from xml.dom import minidom
import gtk
@@ -45,27 +46,69 @@ class AndroPerms(Plugin):
print
- button = gtk.Button("Hello World")
- button.show()
-
- treestore = gtk.TreeStore(str, str, str)
panel = PermsPanel()
+ self._build_panel_item()
+
+
panel.filter_permissions(plist)
- #self.add_wgt(panel.get_widget())
instrs = binary.get_instructions()
+ buffer = binary.disassembled_buffer
+
+
+
+
for i in instrs:
- # print i, " :: 0x%08lx" % i.address
- line = binary.disassembled_buffer.find_line_by_addr(i.address)
- text = line.get_text()
+ if i.keyword.startswith("invoke"):
+
+ line = buffer.find_line_by_addr(i.address)
+ text = line.get_text()
+
+ panel.check_call(i.address, text)
+
+
+
+
+
+ panel.fill_tree(self._store)
+ self._tree.expand_all()
+
+
+
+ def _build_panel_item(self):
+
+ self._scrolled_window = gtk.ScrolledWindow()
+ self._scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ self._scrolled_window.show()
+
+ self._tree = gtk.TreeView()
+ self._tree.set_headers_visible(False)
+ self._tree.show()
+ self._scrolled_window.add_with_viewport(self._tree)
+
+ locations = gtk.TreeViewColumn()
+ self._tree.append_column(locations)
+
+ cell = gtk.CellRendererText()
+ locations.pack_start(cell, False)
+ locations.add_attribute(cell, "text", 0)
+
+ functions = gtk.TreeViewColumn()
+ self._tree.append_column(functions)
+
+ cell = gtk.CellRendererText()
+ functions.pack_start(cell, True)
+ functions.add_attribute(cell, "text", 1)
+
+ self._store = gtk.TreeStore(str, str)
+ self._tree.set_model(self._store)
- if text.startswith("invoke"):
- #print "[0x%08lx] " % i.address, text
- pass
+ pi = PanelItem(name="Permissions", lname="Permissions", widget=self._scrolled_window, path="S")
+ pi.dock()