congzheng avatar congzheng committed 15c2b03

07.07 the latest version before the medium evaluation.

Comments (0)

Files changed (54)

 import androguard, analysis, androlyze
 import bytecode
 
+class APK:
+    filename = None
+    apk = None
+    
+    def __init__(self, filename):
+        self.filename = filename
+        self.apk = androlyze.APK(filename)
+    
+    def isVaildAPK(self):
+        return self.apk.is_valid_APK()
+    
+    def getFilename(self):
+        return str(self.apk.get_filename())
+        
+    def getVersionCode(self):
+        return str(self.apk.get_androidversion_code())
+    
+    def getVersionName(self):
+        return str(self.apk.get_androidversion_name())
+        
+    def getPackage(self):
+        return str(self.apk.get_package())
+    
+    def getReceivers(self):
+        retStr = ""
+        receivers = self.apk.get_receivers()
+        for i in receivers:
+            retStr += i +"\n"
+        if retStr != "":
+            retStr = retStr[:-1]
+        return (retStr, len(receivers))
+    
+    def getServices(self):
+        retStr = ""
+        services = self.apk.get_services()
+        for i in services:
+            retStr += i +"\n"
+        if retStr != "":
+            retStr = retStr[:-1]
+        return (retStr, len(services))        
 
-def androlyzeAPK(filename):
-    a = androlyze.APK(filename)
-    return a
-
-def is_valid_APK(a):
-    return a.is_valid_APK()
-
-def get_filename(a):
-    return str(a.get_filename())
+    def getPermissions(self):
+        retStr = ""
+        permissions = self.apk.get_permissions()
+        for i in permissions:
+            retStr += i +"\n"
+        if retStr != "":
+            retStr = retStr[:-1]
+        return (retStr, len(permissions))
+        
+    def getDex(self):
+        return self.apk.get_dex()
     
-def get_versionCode(a):
-    return str(a.get_androidversion_code())
     
-def get_versionName(a):
-    return str(a.get_androidversion_name())
-
-def get_package(a):
-    return str(a.get_package())
-
-def get_receivers(a):
-    retStr = ""
-    receivers = a.get_receivers()
-    for i in receivers:
-        retStr += i +"\n"
-    if retStr != "":
-        retStr = retStr[:-1]
-    return (retStr, len(receivers))
-    
-def get_services(a):
-    retStr = ""
-    services = a.get_services()
-    for i in services:
-        retStr += i +"\n"
-    if retStr != "":
-        retStr = retStr[:-1]
-    return (retStr, len(services))
-
-def get_permissions(a):
-    retStr = ""
-    permissions = a.get_permissions()
-    for i in permissions:
-        retStr += i +"\n"
-    if retStr != "":
-        retStr = retStr[:-1]
-    return (retStr, len(permissions))

Binary file modified.

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Project SYSTEM "Project-4.6.dtd">
 <!-- eric4 project file for project AndroidGui -->
-<!-- Saved: 2011-06-25, 11:08:21 -->
+<!-- Saved: 2011-07-07, 00:00:13 -->
 <!-- Copyright (C) 2011 ,  -->
 <Project version="4.6">
   <Language></Language>
     <Source>startQT.py</Source>
     <Source>APKInfo.py</Source>
     <Source>GetMethods.py</Source>
+    <Source>Graph.py</Source>
+    <Source>xdotParser.py</Source>
+    <Source>InputDialog.py</Source>
+    <Source>jad.py</Source>
+    <Source>Ui_InputDialog.py</Source>
+    <Source>newMessageBox.py</Source>
   </Sources>
   <Forms>
     <Form>MainWindow.ui</Form>
+    <Form>InputDialog.ui</Form>
   </Forms>
   <Translations>
   </Translations>
 
 from dvm import *
 
-
-
 class CLASS:
+    apk = None
+    vm = None
     def __init__(self, apk):
         self.apk = apk
-        self.vm = DalvikVMFormat(apk.get_dex())
+        self.vm = DalvikVMFormat(apk.getDex())
     
     def get_class(self):
         return self.vm.get_classes()
                 
         return maxdepth
         
-
         
-        
+   

Binary file modified.

+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+import sys
+from Ui_MainWindow import Ui_mainWindow
+
+
+
+from  InputDialog import *
+from Ui_InputDialog import Ui_inputDialog_smali
+
+
+
+class GraphicsView(QGraphicsView):
+    scene = None
+    view = None
+    pageSize = [100, 100]
+    
+    def __init__(self):
+        super(GraphicsView, self).__init__()
+
+        # set the drag mode
+        self.setDragMode(QGraphicsView.ScrollHandDrag)
+        
+        
+    def wheelEvent(self, event):
+        factor = 1.41 ** (event.delta()/240.0)
+        self.scale(factor, factor)
+    
+    def setPageSize(self, pagesize):
+        self.pageSize[0] = pagesize[0]
+        self.pageSize[1] = pagesize[1]
+    
+    
+    
+    def initShow(self, tab_cfg,  gridLayout):
+        self.view = GraphicsView()
+        self.scene = QGraphicsScene()
+        self.scene.setSceneRect(0, 0, self.pageSize[0], self.pageSize[1])
+        self.view.setScene(self.scene)
+        gridLayout.addWidget(self.view)
+
+    
+    def show(self, nodeList, linkList):
+                
+        self.scene.clear()
+        self.scene.setSceneRect(0, 0, self.pageSize[0], self.pageSize[1])
+        
+        for node in nodeList:
+            self.scene.addItem(node)
+        
+        for link in linkList:
+            self.scene.addItem(link)
+        
+
+
+class Link(QGraphicsLineItem):
+    myFromNode = None
+    myToNode = None
+    painterPath = None
+    color = None
+    
+    def __init__(self, fromNode = None, toNode = None):
+        QGraphicsLineItem.__init__(self)        
+        self.myFromNode = fromNode
+        self.myToNode = toNode
+        self.painterPath = QPainterPath()
+        self.myColor = Qt.black
+        self.setFlags(QGraphicsLineItem.ItemIsMovable | QGraphicsLineItem.ItemIsSelectable)
+
+    
+    def drawLine(self, path):
+        for i in range(0, len(path), 2):
+            x = path[i]
+            y = path[i+1]
+            if i == 0:
+                self.painterPath.moveTo(x, y)
+            else:
+                self.painterPath.lineTo(x, y)
+
+
+    def drawArrow(self, points):
+        point1_x = points[0]
+        point1_y = points[1]
+        point2_x = points[2]
+        point2_y = points[3]
+        point3_x = points[4]
+        point3_y = points[5]
+        self.painterPath.moveTo(point1_x, point1_y)
+        self.painterPath.lineTo(point2_x, point2_y)
+        self.painterPath.lineTo(point3_x, point3_y)
+        self.painterPath.lineTo(point1_x, point1_y)
+
+
+    def color(self):
+        return self.myColor
+
+    def setColor(self, color):
+        colorDir = {"red":Qt.red, "blue":Qt.blue, "green":Qt.green}
+        self.myColor = colorDir[color]
+
+    def paint(self, painter, option, widget = None):
+        pen = QPen(self.myColor)  
+        painter.setPen(pen)
+        painter.drawPath(self.painterPath)
+        
+    def boundingRect(self):
+        rect = QRectF(0, 0, 99999999, 99999999)
+        return rect         
+        
+        
+ 
+        
+class Node(QGraphicsItem):
+    myText = None
+    myTextColor = None
+    myBackgroundColor = None
+    myOutlineColor = None
+    myLinks = []
+    left = 0.0
+    top = 0.0
+    width = 0.0
+    height = 0.0
+    font = None
+    
+    
+    def __init__(self, aleft = 0.0, atop = 0.0, awidth = 0.0, aheight = 0.0):
+        QGraphicsItem.__init__(self)
+        self.myTextColor = QColor(Qt.darkGreen)
+        self.myOutlineColor = QColor(Qt.darkGray)
+        self.myBackgroundColor = QColor(Qt.white)
+#        self.setFlags(QGraphicsItem.ItemIsMovable | QGraphicsItem.ItemIsSelectable)
+        self.setFlags(QGraphicsItem.ItemIsSelectable)
+        self.left = aleft
+        self.top = atop
+        self.width = awidth
+        self.height = aheight
+        
+        self.font = QFont("Courier", 5, -1, 0)
+
+
+    
+    def setText(self, text):
+        self.prepareGeometryChange()
+        self.myText = text
+        self.update()
+    
+    def text(self):
+        return text
+    
+    def setTextColor(self, color):
+        self.myTextColor = color
+        self.update()
+    
+    def textColor(self):
+        return self.myTextColor
+    
+    def setOutlineColor(self, color):
+        self.myOutlineColor = color
+        self.update()
+        
+    def outlineColor(self):
+        return self.myOutlineColor
+    
+    def setBackgroundColor(self, color):
+        self.myBackgroundColor = color
+        self.update()
+    
+    def backgroundColor(self):
+        return self.myBackgroundColor
+        
+    def addLink(self, link):
+        self.myLinks.append(link)
+        
+    def removeLink(self, link):
+        self.myLinks.remove(link)    
+        
+    def outlineRect(self):
+        rect = QRectF(self.left, self.top, self.width, self.height)
+        return rect 
+    
+    def updateOutlineRect(self):
+        Padding = 8
+        metrics = QFontMetrics(self.font)
+        rect = metrics.boundingRect(self.myText)
+        rect.adjust(-Padding, -Padding, +Padding, +Padding)
+        rect.translate(-rect.center())
+        return rect
+        
+    
+    def boundingRect(self):
+        Margin = 1
+        return self.outlineRect().adjusted(-Margin, -Margin, +Margin, +Margin)
+    
+    def paint(self, painter, option, widget = None):
+        pen = QPen(self.myOutlineColor)
+        if option.state & QStyle.State_Selected:
+            pen.setStyle(Qt.DotLine)
+            pen.setWidth(2)
+            
+        painter.setPen(pen)
+        painter.setBrush(self.myBackgroundColor)
+        rect = self.outlineRect()
+        painter.drawRect(rect)
+        painter.setPen(self.myTextColor)
+        
+        painter.setFont(self.font)
+        painter.drawText(rect, Qt.AlignLeft | Qt.AlignVCenter, self.myText)
+    
+    def mouseDoubleClickEvent(self, event):
+        
+#        inputDialog = QInputDialog()
+#        ok = None
+#        text = QString
+#        (text, ok) = inputDialog.getText(event.widget(), str("Edit Text"), str("Edit new Text:"), QLineEdit.Normal, self.myText)
+
+#        if ok and not text.isEmpty():
+#            self.setText(text)
+
+        inputDialog_smali = inputDialog(self, self.myText)
+        inputDialog_smali.exec_()
+
+
+
+    
+  
+
+    
+    

Binary file added.

+# -*- coding: utf-8 -*-
+
+"""
+Module implementing inputDialog.
+"""
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import QDialog
+from PyQt4.QtCore import pyqtSignature
+
+from Ui_InputDialog import Ui_inputDialog_smali
+
+class inputDialog(QDialog, Ui_inputDialog_smali):
+    """
+    Class documentation goes here.
+    """
+    node = None
+    
+    def __init__(self, node, myText):
+        """
+        Constructor
+        """
+        QDialog.__init__(self)
+        self.setupUi(self)
+        self.plainTextEdit_smali.setPlainText(myText)
+        self.node = node
+
+    
+    @pyqtSignature("")
+    def on_pushButton_ok_smali_clicked(self):
+        """
+        Slot documentation goes here.
+        """
+
+        newText = self.plainTextEdit_smali.toPlainText()
+        self.node.setText(newText)
+        
+        

Binary file added.

+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>inputDialog_smali</class>
+ <widget class="QDialog" name="inputDialog_smali">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>612</width>
+    <height>538</height>
+   </rect>
+  </property>
+  <property name="contextMenuPolicy">
+   <enum>Qt::NoContextMenu</enum>
+  </property>
+  <property name="windowTitle">
+   <string>Modify the smali code</string>
+  </property>
+  <property name="sizeGripEnabled">
+   <bool>false</bool>
+  </property>
+  <property name="modal">
+   <bool>false</bool>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QPlainTextEdit" name="plainTextEdit_smali">
+       <property name="lineWrapMode">
+        <enum>QPlainTextEdit::NoWrap</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <layout class="QHBoxLayout" name="horizontalLayout_smali">
+       <item>
+        <widget class="QPushButton" name="pushButton_ok_smali">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>OK</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_cancel_smali">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>Cancel</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>pushButton_ok_smali</sender>
+   <signal>clicked()</signal>
+   <receiver>inputDialog_smali</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>188</x>
+     <y>514</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>98</x>
+     <y>514</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>pushButton_cancel_smali</sender>
+   <signal>clicked()</signal>
+   <receiver>inputDialog_smali</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>455</x>
+     <y>513</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>520</x>
+     <y>509</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
      <widget class="QMdiArea" name="mdiArea">
       <widget class="QWidget" name="win1">
        <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
         <item row="0" column="0">
          <widget class="QTabWidget" name="tabWidget">
           <property name="currentIndex">
-           <number>1</number>
+           <number>0</number>
           </property>
           <property name="documentMode">
            <bool>false</bool>
            <layout class="QGridLayout" name="gridLayout_11"/>
           </widget>
           <widget class="QWidget" name="tab_smali">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <attribute name="title">
             <string>Smali</string>
            </attribute>
            <layout class="QGridLayout" name="gridLayout_12">
             <item row="0" column="0">
-             <widget class="QPlainTextEdit" name="plainTextEdit_smali"/>
+             <widget class="QPlainTextEdit" name="plainTextEdit_smali">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="verticalScrollBarPolicy">
+               <enum>Qt::ScrollBarAsNeeded</enum>
+              </property>
+              <property name="horizontalScrollBarPolicy">
+               <enum>Qt::ScrollBarAsNeeded</enum>
+              </property>
+              <property name="lineWrapMode">
+               <enum>QPlainTextEdit::NoWrap</enum>
+              </property>
+              <property name="centerOnScroll">
+               <bool>false</bool>
+              </property>
+             </widget>
             </item>
            </layout>
           </widget>
            <attribute name="title">
             <string>Java</string>
            </attribute>
-           <layout class="QGridLayout" name="gridLayout_13"/>
+           <layout class="QGridLayout" name="gridLayout_13">
+            <item row="0" column="0">
+             <widget class="QPlainTextEdit" name="plainTextEdit_java"/>
+            </item>
+           </layout>
           </widget>
           <widget class="QWidget" name="tab_bytecode">
            <attribute name="title">
             <string>ByteCode</string>
            </attribute>
-           <layout class="QGridLayout" name="gridLayout_14"/>
+           <layout class="QGridLayout" name="gridLayout_14">
+            <item row="0" column="0">
+             <widget class="QPlainTextEdit" name="plainTextEdit_bytecode"/>
+            </item>
+           </layout>
           </widget>
          </widget>
         </item>
              </size>
             </property>
             <property name="currentIndex">
-             <number>3</number>
+             <number>4</number>
             </property>
             <widget class="QWidget" name="tab_file">
              <attribute name="title">
              <layout class="QGridLayout" name="gridLayout_2121">
               <item row="0" column="1">
                <widget class="QTreeWidget" name="treeWidget_files">
+                <attribute name="headerVisible">
+                 <bool>false</bool>
+                </attribute>
                 <column>
                  <property name="text">
                   <string notr="true">1</string>
              </attribute>
              <layout class="QGridLayout" name="gridLayout_2122">
               <item row="0" column="0">
-               <widget class="QListWidget" name="listWidget_strings"/>
+               <widget class="QListWidget" name="listWidget_strings">
+                <property name="editTriggers">
+                 <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
+                </property>
+                <property name="movement">
+                 <enum>QListView::Static</enum>
+                </property>
+                <property name="isWrapping" stdset="0">
+                 <bool>false</bool>
+                </property>
+                <property name="resizeMode">
+                 <enum>QListView::Adjust</enum>
+                </property>
+                <property name="layoutMode">
+                 <enum>QListView::Batched</enum>
+                </property>
+               </widget>
               </item>
              </layout>
             </widget>
              </attribute>
              <layout class="QGridLayout" name="gridLayout_2123">
               <item row="0" column="0">
-               <widget class="QTreeWidget" name="treeWidget_classes">
-                <column>
-                 <property name="text">
-                  <string notr="true">1</string>
-                 </property>
-                </column>
-               </widget>
+               <widget class="QListWidget" name="listWidget_classes"/>
               </item>
              </layout>
             </widget>
     <property name="title">
      <string>Help(&amp;H)</string>
     </property>
+    <addaction name="About"/>
    </widget>
    <addaction name="menuFile"/>
    <addaction name="menuEdit_E"/>
     <string>Find(&amp;F)</string>
    </property>
   </action>
+  <action name="About">
+   <property name="text">
+    <string>About</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="src/images/mainwindow.qrc"/>

Ui_InputDialog.py

+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/administrator/gsoc-AndroidGui/InputDialog.ui'
+#
+# Created: Tue Jul  5 02:56:54 2011
+#      by: PyQt4 UI code generator 4.8.4
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+try:
+    _fromUtf8 = QtCore.QString.fromUtf8
+except AttributeError:
+    _fromUtf8 = lambda s: s
+
+class Ui_inputDialog_smali(object):
+    def setupUi(self, inputDialog_smali):
+        inputDialog_smali.setObjectName(_fromUtf8("inputDialog_smali"))
+        inputDialog_smali.resize(612, 538)
+        inputDialog_smali.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
+        inputDialog_smali.setSizeGripEnabled(False)
+        inputDialog_smali.setModal(False)
+        self.gridLayout_2 = QtGui.QGridLayout(inputDialog_smali)
+        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
+        self.gridLayout = QtGui.QGridLayout()
+        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
+        self.plainTextEdit_smali = QtGui.QPlainTextEdit(inputDialog_smali)
+        self.plainTextEdit_smali.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
+        self.plainTextEdit_smali.setObjectName(_fromUtf8("plainTextEdit_smali"))
+        self.gridLayout.addWidget(self.plainTextEdit_smali, 0, 0, 1, 1)
+        self.horizontalLayout_smali = QtGui.QHBoxLayout()
+        self.horizontalLayout_smali.setObjectName(_fromUtf8("horizontalLayout_smali"))
+        self.pushButton_ok_smali = QtGui.QPushButton(inputDialog_smali)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.pushButton_ok_smali.sizePolicy().hasHeightForWidth())
+        self.pushButton_ok_smali.setSizePolicy(sizePolicy)
+        self.pushButton_ok_smali.setObjectName(_fromUtf8("pushButton_ok_smali"))
+        self.horizontalLayout_smali.addWidget(self.pushButton_ok_smali)
+        self.pushButton_cancel_smali = QtGui.QPushButton(inputDialog_smali)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.pushButton_cancel_smali.sizePolicy().hasHeightForWidth())
+        self.pushButton_cancel_smali.setSizePolicy(sizePolicy)
+        self.pushButton_cancel_smali.setObjectName(_fromUtf8("pushButton_cancel_smali"))
+        self.horizontalLayout_smali.addWidget(self.pushButton_cancel_smali)
+        self.gridLayout.addLayout(self.horizontalLayout_smali, 1, 0, 1, 1)
+        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
+
+        self.retranslateUi(inputDialog_smali)
+        QtCore.QObject.connect(self.pushButton_ok_smali, QtCore.SIGNAL(_fromUtf8("clicked()")), inputDialog_smali.close)
+        QtCore.QObject.connect(self.pushButton_cancel_smali, QtCore.SIGNAL(_fromUtf8("clicked()")), inputDialog_smali.close)
+        QtCore.QMetaObject.connectSlotsByName(inputDialog_smali)
+
+    def retranslateUi(self, inputDialog_smali):
+        inputDialog_smali.setWindowTitle(QtGui.QApplication.translate("inputDialog_smali", "Modify the smali code", None, QtGui.QApplication.UnicodeUTF8))
+        self.pushButton_ok_smali.setText(QtGui.QApplication.translate("inputDialog_smali", "OK", None, QtGui.QApplication.UnicodeUTF8))
+        self.pushButton_cancel_smali.setText(QtGui.QApplication.translate("inputDialog_smali", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+    import sys
+    app = QtGui.QApplication(sys.argv)
+    inputDialog_smali = QtGui.QDialog()
+    ui = Ui_inputDialog_smali()
+    ui.setupUi(inputDialog_smali)
+    inputDialog_smali.show()
+    sys.exit(app.exec_())
+

Binary file added.

 
 # Form implementation generated from reading ui file '/home/administrator/gsoc-AndroidGui/MainWindow.ui'
 #
-# Created: Fri Jun 24 16:48:15 2011
+# Created: Wed Jul  6 22:57:59 2011
 #      by: PyQt4 UI code generator 4.8.4
 #
 # WARNING! All changes made in this file will be lost!
         self.mdiArea = QtGui.QMdiArea(self.centralWidget)
         self.mdiArea.setObjectName(_fromUtf8("mdiArea"))
         self.win1 = QtGui.QWidget()
-        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding)
         sizePolicy.setHorizontalStretch(0)
         sizePolicy.setVerticalStretch(0)
         sizePolicy.setHeightForWidth(self.win1.sizePolicy().hasHeightForWidth())
         self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11"))
         self.tabWidget.addTab(self.tab_cfg, _fromUtf8(""))
         self.tab_smali = QtGui.QWidget()
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.tab_smali.sizePolicy().hasHeightForWidth())
+        self.tab_smali.setSizePolicy(sizePolicy)
         self.tab_smali.setObjectName(_fromUtf8("tab_smali"))
         self.gridLayout_12 = QtGui.QGridLayout(self.tab_smali)
         self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12"))
         self.plainTextEdit_smali = QtGui.QPlainTextEdit(self.tab_smali)
+        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
+        sizePolicy.setHorizontalStretch(0)
+        sizePolicy.setVerticalStretch(0)
+        sizePolicy.setHeightForWidth(self.plainTextEdit_smali.sizePolicy().hasHeightForWidth())
+        self.plainTextEdit_smali.setSizePolicy(sizePolicy)
+        self.plainTextEdit_smali.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
+        self.plainTextEdit_smali.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
+        self.plainTextEdit_smali.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
+        self.plainTextEdit_smali.setCenterOnScroll(False)
         self.plainTextEdit_smali.setObjectName(_fromUtf8("plainTextEdit_smali"))
         self.gridLayout_12.addWidget(self.plainTextEdit_smali, 0, 0, 1, 1)
         self.tabWidget.addTab(self.tab_smali, _fromUtf8(""))
         self.tab_java.setObjectName(_fromUtf8("tab_java"))
         self.gridLayout_13 = QtGui.QGridLayout(self.tab_java)
         self.gridLayout_13.setObjectName(_fromUtf8("gridLayout_13"))
+        self.plainTextEdit_java = QtGui.QPlainTextEdit(self.tab_java)
+        self.plainTextEdit_java.setObjectName(_fromUtf8("plainTextEdit_java"))
+        self.gridLayout_13.addWidget(self.plainTextEdit_java, 0, 0, 1, 1)
         self.tabWidget.addTab(self.tab_java, _fromUtf8(""))
         self.tab_bytecode = QtGui.QWidget()
         self.tab_bytecode.setObjectName(_fromUtf8("tab_bytecode"))
         self.gridLayout_14 = QtGui.QGridLayout(self.tab_bytecode)
         self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14"))
+        self.plainTextEdit_bytecode = QtGui.QPlainTextEdit(self.tab_bytecode)
+        self.plainTextEdit_bytecode.setObjectName(_fromUtf8("plainTextEdit_bytecode"))
+        self.gridLayout_14.addWidget(self.plainTextEdit_bytecode, 0, 0, 1, 1)
         self.tabWidget.addTab(self.tab_bytecode, _fromUtf8(""))
         self.gridLayout_1.addWidget(self.tabWidget, 0, 0, 1, 1)
         self.win2 = QtGui.QWidget()
         self.treeWidget_files = QtGui.QTreeWidget(self.tab_file)
         self.treeWidget_files.setObjectName(_fromUtf8("treeWidget_files"))
         self.treeWidget_files.headerItem().setText(0, _fromUtf8("1"))
+        self.treeWidget_files.header().setVisible(False)
         self.gridLayout_2121.addWidget(self.treeWidget_files, 0, 1, 1, 1)
         self.tabWidget_2.addTab(self.tab_file, _fromUtf8(""))
         self.tab_strings = QtGui.QWidget()
         self.gridLayout_2122 = QtGui.QGridLayout(self.tab_strings)
         self.gridLayout_2122.setObjectName(_fromUtf8("gridLayout_2122"))
         self.listWidget_strings = QtGui.QListWidget(self.tab_strings)
+        self.listWidget_strings.setEditTriggers(QtGui.QAbstractItemView.DoubleClicked|QtGui.QAbstractItemView.EditKeyPressed)
+        self.listWidget_strings.setMovement(QtGui.QListView.Static)
+        self.listWidget_strings.setProperty(_fromUtf8("isWrapping"), False)
+        self.listWidget_strings.setResizeMode(QtGui.QListView.Adjust)
+        self.listWidget_strings.setLayoutMode(QtGui.QListView.Batched)
         self.listWidget_strings.setObjectName(_fromUtf8("listWidget_strings"))
         self.gridLayout_2122.addWidget(self.listWidget_strings, 0, 0, 1, 1)
         self.tabWidget_2.addTab(self.tab_strings, _fromUtf8(""))
         self.tab_classes.setObjectName(_fromUtf8("tab_classes"))
         self.gridLayout_2123 = QtGui.QGridLayout(self.tab_classes)
         self.gridLayout_2123.setObjectName(_fromUtf8("gridLayout_2123"))
-        self.treeWidget_classes = QtGui.QTreeWidget(self.tab_classes)
-        self.treeWidget_classes.setObjectName(_fromUtf8("treeWidget_classes"))
-        self.treeWidget_classes.headerItem().setText(0, _fromUtf8("1"))
-        self.gridLayout_2123.addWidget(self.treeWidget_classes, 0, 0, 1, 1)
+        self.listWidget_classes = QtGui.QListWidget(self.tab_classes)
+        self.listWidget_classes.setObjectName(_fromUtf8("listWidget_classes"))
+        self.gridLayout_2123.addWidget(self.listWidget_classes, 0, 0, 1, 1)
         self.tabWidget_2.addTab(self.tab_classes, _fromUtf8(""))
         self.tab_methods = QtGui.QWidget()
         self.tab_methods.setObjectName(_fromUtf8("tab_methods"))
         self.actAll.setObjectName(_fromUtf8("actAll"))
         self.actFind = QtGui.QAction(mainWindow)
         self.actFind.setObjectName(_fromUtf8("actFind"))
+        self.About = QtGui.QAction(mainWindow)
+        self.About.setObjectName(_fromUtf8("About"))
         self.menuFile.addAction(self.actNew)
         self.menuFile.addAction(self.actOpen)
         self.menuFile.addAction(self.actClose)
         self.menuEdit_E.addAction(self.actPast)
         self.menuEdit_E.addAction(self.actAll)
         self.menuTool_T.addAction(self.actFind)
+        self.menuHelp_H.addAction(self.About)
         self.menuBar.addAction(self.menuFile.menuAction())
         self.menuBar.addAction(self.menuEdit_E.menuAction())
         self.menuBar.addAction(self.menuTool_T.menuAction())
         self.toolBar.addAction(self.actSave)
 
         self.retranslateUi(mainWindow)
-        self.tabWidget.setCurrentIndex(1)
-        self.tabWidget_2.setCurrentIndex(3)
+        self.tabWidget.setCurrentIndex(0)
+        self.tabWidget_2.setCurrentIndex(4)
         QtCore.QMetaObject.connectSlotsByName(mainWindow)
 
     def retranslateUi(self, mainWindow):
         self.actPast.setText(QtGui.QApplication.translate("mainWindow", "Past(&P)", None, QtGui.QApplication.UnicodeUTF8))
         self.actAll.setText(QtGui.QApplication.translate("mainWindow", "All(&A)", None, QtGui.QApplication.UnicodeUTF8))
         self.actFind.setText(QtGui.QApplication.translate("mainWindow", "Find(&F)", None, QtGui.QApplication.UnicodeUTF8))
+        self.About.setText(QtGui.QApplication.translate("mainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
 
 import mainwindow_rc
 

Binary file modified.

dex2jar/.svn/all-wcprops

+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar
+END
+setclasspath.bat
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/setclasspath.bat
+END
+dex2jar.bat
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/dex2jar.bat
+END
+dex2jar-dump.bat
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/dex2jar-dump.bat
+END
+dex2jar.sh
+K 25
+svn:wc:ra_dav:version-url
+V 67
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/dex2jar.sh
+END
+dex2jar-dump.sh
+K 25
+svn:wc:ra_dav:version-url
+V 72
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/dex2jar-dump.sh
+END

dex2jar/.svn/entries

+10
+
+dir
+25
+http://172.31.1.121/svn/ndrc10/trunk/appanalyzer/static/dex2jar
+http://172.31.1.121/svn/ndrc10
+
+
+
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4aad8c4b-fa92-0410-9038-9dd700e5c94e
+
+setclasspath.bat
+file
+
+
+
+
+2011-03-03T02:13:30.721372Z
+a2e5690faa9d09553417331f435c3471
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+200
+
+dex2jar.bat
+file
+
+
+
+
+2011-03-03T02:13:30.721372Z
+df4907dbbbf10c4a448d2f4edcb1c9ce
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+150
+
+lib
+dir
+
+dex2jar-dump.bat
+file
+
+
+
+
+2011-03-03T02:13:30.721372Z
+f8b1136ec1f3703e433344d17db498f0
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+154
+
+dex2jar.sh
+file
+
+
+
+
+2011-03-03T02:13:30.721372Z
+bbaa39989f221eaed2779ffd13344e39
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+496
+
+dex2jar-dump.sh
+file
+
+
+
+
+2011-03-03T02:13:30.721372Z
+e6fd877980a21c60d62a6e7beeb6299e
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+480
+

dex2jar/.svn/text-base/dex2jar-dump.bat.svn-base

+@echo off
+set CLASSPATH=
+
+FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i
+
+java -cp "%CLASSPATH%" pxb.android.dex2jar.dump.Dump %*

dex2jar/.svn/text-base/dex2jar-dump.sh.svn-base

+#!/bin/sh
+
+# copy from $Tomcat/bin/startup.sh
+# resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+PRGDIR=`dirname "$PRG"`
+#
+
+_classpath="."
+for k in $PRGDIR/lib/*.jar
+do
+ _classpath="${_classpath}:${k}"
+done
+java  -classpath "${_classpath}" "pxb.android.dex2jar.dump.Dump" $1 $2 $3 $4 $5 $6

dex2jar/.svn/text-base/dex2jar.bat.svn-base

+@echo off
+set CLASSPATH=
+FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i
+
+java -cp "%CLASSPATH%" pxb.android.dex2jar.v3.Main %*

dex2jar/.svn/text-base/dex2jar.sh.svn-base

+#!/bin/sh
+
+# copy from $Tomcat/bin/startup.sh
+# resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+PRGDIR=`dirname "$PRG"`
+#
+
+_classpath="."
+for k in $PRGDIR/lib/*.jar
+do
+ _classpath="${_classpath}:${k}"
+done
+java -Xms512m -Xmx1024m -classpath "${_classpath}" "pxb.android.dex2jar.v3.Main" $1 $2 $3 $4 $5 $6

dex2jar/.svn/text-base/setclasspath.bat.svn-base

+SET _CLASSPATHCOMPONENT=%1
+:argCheck
+IF %2a==a GOTO gotAllArgs
+SHIFT
+SET _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+GOTO argCheck
+:gotAllArgs
+SET CLASSPATH=%_CLASSPATHCOMPONENT%;%CLASSPATH%

dex2jar/dex2jar-dump.bat

+@echo off
+set CLASSPATH=
+
+FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i
+
+java -cp "%CLASSPATH%" pxb.android.dex2jar.dump.Dump %*

dex2jar/dex2jar-dump.sh

+#!/bin/sh
+
+# copy from $Tomcat/bin/startup.sh
+# resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+PRGDIR=`dirname "$PRG"`
+#
+
+_classpath="."
+for k in $PRGDIR/lib/*.jar
+do
+ _classpath="${_classpath}:${k}"
+done
+java  -classpath "${_classpath}" "pxb.android.dex2jar.dump.Dump" $1 $2 $3 $4 $5 $6

dex2jar/dex2jar.bat

+@echo off
+set CLASSPATH=
+FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i
+
+java -cp "%CLASSPATH%" pxb.android.dex2jar.v3.Main %*

dex2jar/dex2jar.sh

+#!/bin/sh
+
+# copy from $Tomcat/bin/startup.sh
+# resolve links - $0 may be a softlink
+PRG="$0"
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+PRGDIR=`dirname "$PRG"`
+#
+
+_classpath="."
+for k in $PRGDIR/lib/*.jar
+do
+ _classpath="${_classpath}:${k}"
+done
+java -Xms512m -Xmx1024m -classpath "${_classpath}" "pxb.android.dex2jar.v3.Main" $1 $2 $3 $4 $5 $6

dex2jar/lib/.svn/all-wcprops

+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib
+END
+asm-debug-all-3.2.jar
+K 25
+svn:wc:ra_dav:version-url
+V 82
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib/asm-debug-all-3.2.jar
+END
+commons-io-2.0.jar
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib/commons-io-2.0.jar
+END
+slf4j-api-1.5.6.jar
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib/slf4j-api-1.5.6.jar
+END
+slf4j-simple-1.5.6.jar
+K 25
+svn:wc:ra_dav:version-url
+V 83
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib/slf4j-simple-1.5.6.jar
+END
+dex2jar-0.0.7.8-SNAPSHOT.jar
+K 25
+svn:wc:ra_dav:version-url
+V 89
+/svn/ndrc10/!svn/ver/17/trunk/appanalyzer/static/dex2jar/lib/dex2jar-0.0.7.8-SNAPSHOT.jar
+END

dex2jar/lib/.svn/entries

+10
+
+dir
+25
+http://172.31.1.121/svn/ndrc10/trunk/appanalyzer/static/dex2jar/lib
+http://172.31.1.121/svn/ndrc10
+
+
+
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4aad8c4b-fa92-0410-9038-9dd700e5c94e
+
+asm-debug-all-3.2.jar
+file
+
+
+
+
+2011-03-03T02:13:30.705373Z
+cc4045cb1d39e5046446c96b060bd96c
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+298080
+
+commons-io-2.0.jar
+file
+
+
+
+
+2011-03-03T02:13:30.709373Z
+89eb4fafe1a174a75713949496421fb1
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+159235
+
+slf4j-api-1.5.6.jar
+file
+
+
+
+
+2011-03-03T02:13:30.709373Z
+ca55c6dae5d0f9a8a829720408918586
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+22338
+
+slf4j-simple-1.5.6.jar
+file
+
+
+
+
+2011-03-03T02:13:30.709373Z
+fccd9ee5901196313dcc6c4f366f4cbf
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7583
+
+dex2jar-0.0.7.8-SNAPSHOT.jar
+file
+
+
+
+
+2011-03-03T02:13:30.709373Z
+e6eb06b4b61f84a82f305c352344cc41
+2011-03-01T05:16:24.133767Z
+17
+zhushixiong
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+152732
+

dex2jar/lib/.svn/prop-base/asm-debug-all-3.2.jar.svn-base

+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END

dex2jar/lib/.svn/prop-base/commons-io-2.0.jar.svn-base

+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END

dex2jar/lib/.svn/prop-base/dex2jar-0.0.7.8-SNAPSHOT.jar.svn-base

+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END

dex2jar/lib/.svn/prop-base/slf4j-api-1.5.6.jar.svn-base

+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END

dex2jar/lib/.svn/prop-base/slf4j-simple-1.5.6.jar.svn-base

+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
Add a comment to this file

dex2jar/lib/.svn/text-base/asm-debug-all-3.2.jar.svn-base

Binary file added.

Add a comment to this file

dex2jar/lib/.svn/text-base/commons-io-2.0.jar.svn-base

Binary file added.

Add a comment to this file

dex2jar/lib/.svn/text-base/dex2jar-0.0.7.8-SNAPSHOT.jar.svn-base

Binary file added.

Add a comment to this file

dex2jar/lib/.svn/text-base/slf4j-api-1.5.6.jar.svn-base

Binary file added.

Add a comment to this file

dex2jar/lib/.svn/text-base/slf4j-simple-1.5.6.jar.svn-base

Binary file added.

Add a comment to this file

dex2jar/lib/asm-debug-all-3.2.jar

Binary file added.

Add a comment to this file

dex2jar/lib/commons-io-2.0.jar

Binary file added.

Add a comment to this file

dex2jar/lib/dex2jar-0.0.7.8-SNAPSHOT.jar

Binary file added.

Add a comment to this file

dex2jar/lib/slf4j-api-1.5.6.jar

Binary file added.

Add a comment to this file

dex2jar/lib/slf4j-simple-1.5.6.jar

Binary file added.

dex2jar/setclasspath.bat

+SET _CLASSPATHCOMPONENT=%1
+:argCheck
+IF %2a==a GOTO gotAllArgs
+SHIFT
+SET _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+GOTO argCheck
+:gotAllArgs
+SET CLASSPATH=%_CLASSPATHCOMPONENT%;%CLASSPATH%
+import os
+import sys
+import zipfile
+
+from startQT import SYSPATH
+
+# delete all files and dirs in the "./temp/" dictionary
+# return 0: success;
+def clear():
+    cmd = "rm -rf " + SYSPATH + "/temp/*"
+    return os.system(cmd)
+
+
+
+# use the dex2jar to generate the .jar file.
+# Then move .jar file to the "./temp/" dictionary
+# At last, unzip the .jar file to "./temp/" dictionary
+# return 1: success ; return 0: fail
+def dex2jar(filename):
+    cmd1 = SYSPATH +"/dex2jar/dex2jar.sh " + filename
+    if os.system(cmd1) !=0:
+        return 0
+    
+    newfilename = os.path.split(filename)[-1] + ".dex2jar.jar"
+    cmd2 = "mv " + os.path.dirname(filename) + "/" + newfilename + " " + SYSPATH + "/temp/"
+    if os.system(cmd2) !=0:
+        return 0
+        
+    if unzip(SYSPATH + "/temp/" + newfilename) != 0:
+        return 0
+    
+    return 1
+    
+
+
+# unzip the .jar file
+# return 0: success;
+def unzip(filename):
+    cmd = "unzip -o " + filename + " -d" + SYSPATH + "/temp/unzip"
+    return os.system(cmd)
+
+
+
+# decompile the apk to the Javacodes
+# parameter:
+#       filename: the full absolute path of the apk file
+# return 1: success; return 0:fail
+def decompile(filename):
+    if clear() != 0:
+        return 0
+        
+    if dex2jar(filename) != 1:
+        return 0
+    
+    cmd = SYSPATH + "/jad158e.linux.static/jad -o -r -sjava -d" + SYSPATH + "/temp/java " + SYSPATH + "/temp/unzip/**/*.class"
+    if os.system(cmd) != 0:
+        return 0
+ 
+    return 1
+
+
+
+    
+    
+    

Binary file added.

jad158e.linux.static/Readme.txt

+This is README file for Jad - the fast Java Decompiler.
+Jad home page: http://www.geocities.com/kpdus/jad.html
+Copyright 2001 Pavel Kouznetsov (kpdus@yahoo.com).
+
+0. Please read the disclaimer on the Jad home page.
+
+1. Installation.
+
+Unzip jad.zip file into any appropriate directory on your hard drive.
+This will create two files:
+
+    - an executable file named 'jad.exe' (Windows *)
+      or 'jad' (*n*x)
+
+    - this README file
+
+No other setup is required.
+
+2. How to use Jad
+
+To decompile a single JAVA class file 'example1.class' 
+type the following:
+
+     jad example1.class
+
+This command creates file 'example1.jad' in the current directory.
+If such file already exists Jad asks whether you want to overwrite it or not.
+Option -o permits overwriting without a confirmation.
+
+You can omit .class extension and/or use wildcards in the names of
+input files.
+
+Option -s <ext> allows to change output file extension:
+
+     jad -sjava example1.class
+
+This command creates file 'example1.java'. Be careful when using
+options -o and -sjava together, because Jad can accidentally overwrite
+your own source files.
+
+Jad uses JAVA class name as an output file name. For example, if class
+file 'example1.class' contains JAVA class 'test1' then Jad will create
+file 'test1.jad' rather than 'example1.jad'. If you want to specify
+your own output file name use the output redirection:
+
+   jad -p example1.class > myexm1.java
+
+Option -d allows you to specify another directory for output files,
+which are created, by default, in the current directory. For example:
+
+   jad -o -dtest -sjava *.class
+
+   (or jad -o -d test -s java *.class, which has the same effect)
+
+This command decompiles all .class files in the current directory 
+and places all output files with extension .java into directory 'test'.
+
+
+If you want to decompile the whole tree of JAVA classes,
+use the following command:
+
+   jad -o -r -sjava -dsrc tree/**/*.class
+
+This command decompiles all .class files located in all 
+subdirectories of 'tree' and creates output files in subdirectories
+of 'src' according to package names of classes. For example, if file 
+'tree/a/b/c.class' contains class 'c' from package 'a.b', then 
+output file will have a name 'src/a/b/c.java'.
+
+Note the use of the "two stars" wildcard ('**') in the previous
+command. It is handled by Jad rather than the command shell, so on
+UNIX the last argument should be single-quoted:
+
+   jad -o -r -sjava -dsrc 'tree/**/*.class'
+
+
+In a case you want to check the accuracy of the decompilation or just
+curious, there is an option -a which tells Jad to annotate the output
+with JAVA Virtual Machine bytecodes.
+
+Jad supports the inner and anonymous classes. 
+When Jad expands wildcards in the input file names, 
+it automatically skips matching inner classes. 
+On UNIX Jad skips inner classes if there is more than 
+one class specified in the command line.
+Jad looks for inner classes in the directory of their top-level
+container class.
+
+3. List of the command-line options.
+
+Jad accepts the following options:
+
+   -a       - annotate the output with JVM bytecodes (default: off)
+   -af      - same as -a, but output fully qualified names when annotating
+   -clear   - clear all prefixes, including the default ones (can be abbreviated as -cl)
+   -b       - output redundant braces (e.g., if(a) { b(); }, default: off)
+   -d <dir> - directory for output files (will be created when necessary)
+   -dead    - try to decompile dead parts of code (if any) (default: off)
+   -disass  - disassemble method bytecodes (no JAVA source generated)
+   -f       - output fully qualified names for classes/fields/methods (default: off)
+   -ff      - output class fields before methods (default: after methods)
+   -i       - output default initializers for all non-final fields
+   -l<num>  - split strings into pieces of maximum <num> chars (default: off)
+   -lnc     - annotate the output with line numbers (default: off)
+   -lradix<num> - display long integers using the specified radix (8, 10 or 16)
+   -nl      - split strings on newline character (default: off)
+   -nocast  - don't generate auxiliary casts
+   -nocode  - don't generate the source code for methods
+   -noconv  - don't convert Java identifiers (default: convert)
+   -noctor  - suppress the empty constructors
+   -nodos   - do not check for class files written in DOS mode (CR before NL, default: check)
+   -nofd    - don't disambiguate fields with the same names by adding signatures to their names (default: do)
+   -noinner - turn off the support of inner classes (default: on)
+   -nolvt   - ignore Local Variable Table information
+   -nonlb   - don't output a newline before opening brace (default: do)
+   -o       - overwrite output files without confirmation (default: off)
+   -p       - send decompiled code to STDOUT (e.g., for piping)
+   -pi<num> - pack imports into one line after <num> imports (default: 3)
+   -pv<num> - pack fields with identical types into one line (default: off)
+   -pa <pfx>- prefix for all packages in generated source files
+   -pc <pfx>- prefix for classes with numerical names (default: _cls)
+   -pf <pfx>- prefix for fields with numerical names (default: _fld)
+   -pe <pfx>- prefix for unused exception names (default: _ex)
+   -pl <pfx>- prefix for locals with numerical names (default: _lcl)
+   -pm <pfx>- prefix for methods with numerical names (default: _mth)
+   -pp <pfx>- prefix for method parms with numerical names (default: _prm)
+   -r       - restore package directory structrure
+   -radix<num> - display integers using the specified radix (8, 10 or 16)
+   -s <ext> - output file extension (by default '.jad')
+   -safe    - generate additional casts to disambiguate methods/fields (default: off)
+   -space   - output space between keyword (if/for/while/etc) and expression (default: off)
+   -stat    - display the total number of processed classes/methods/fields
+   -t       - use tabs instead of spaces for indentation
+   -t<num>  - use <num> spaces for indentation (default: 4)
+   -v       - display method names being decompiled
+   -8       - convert UNICODE strings into 8-bit strings
+              using the current ANSI code page (Win32 only)
+   -&       - redirect STDERR to STDOUT (Win32 only)
+
+All single-word options have three formats:
+
+  -o    - 'reverses' value of an option
+  -o+   - set value to 'true' or 'on'
+  -o-   - set value to 'false' or 'off'
+
+You can specify the options you want to be set by default in the environment variable
+JAD_OPTIONS. For example:
+
+JAD_OPTIONS=-ff+ -nonlb+ -t+ -space+
Add a comment to this file

jad158e.linux.static/jad

Binary file added.

+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+
+class newMessageBox(QMessageBox):
+
+    
+    def __init__(self, parent = None):
+        QMessageBox.__init__(self, parent)
+        
+    def resizeEvent(self, resizeEvent):
+        self.setFixedSize(400, 120)
+

Binary file added.

 import sys
 sys.path.append("./src/images")
 
-from PyQt4.QtGui import QMainWindow
-from PyQt4.QtCore import pyqtSignature
+if sys.path[0] =="":
+    SYSPATH = sys.path[1]
+else:
+    SYSPATH = sys.path[0]
+    
+
+#from PyQt4.QtGui import QMainWindow
+#from PyQt4.QtCore import pyqtSignature
 
 from Ui_MainWindow import Ui_mainWindow
 
 
 
-import APKInfo
+from APKInfo import *
 import zipfile
 import GetMethods
 
+from Graph import *
+from xdotParser import *
+from jad import *
+from newMessageBox import *
 
-path2method = {}
 
 
 
     """
     Class documentation goes here.
     """
+    path2method = {}
+    CL = None
+    Graph = None
+
     def __init__(self, parent = None):
         """
         Constructor
         self.setupUi(self)
         self.mdiArea.addSubWindow(self.win1)
         self.mdiArea.addSubWindow(self.win2)
+        
+        # init the CFG Tab's Graph scene
+        self.Graph = GraphicsView()
+        self.Graph.initShow(self.tab_cfg, self.gridLayout_11)
     
     @pyqtSignature("")
     def on_actNew_triggered(self):
         Slot documentation goes here.
         """
         dlg = QFileDialog(self)
-        self.filename = dlg.getOpenFileName(self, self.tr("Open APK File"), QString(),  self.tr("APK Files(*.apk)"))
-        if not zipfile.is_zipfile(self.filename):
+        filename = dlg.getOpenFileName(self, self.tr("Open APK File"), QString(),  self.tr("APK Files(*.apk)"))
+        if not zipfile.is_zipfile(filename):
             self.msgbox = QMessageBox()
             self.msgbox.setText("Please select the APK file correctly!")
             self.msgbox.setWindowTitle("Warning!")
             self.msgbox.show()
         else:
-            a = APKInfo.androlyzeAPK(self.filename)
+            apk = APK(filename)
             
             # judge this APK is valid or invalid
-            if not APKInfo.is_valid_APK(a):
+            if not apk.isVaildAPK():
                 self.msgbox = QMessageBox()
                 self.msgbox.setText("This APK is invalid!")
                 self.msgbox.setWindowTitle("Error!")
                 self.msgbox.show()
                 return
                 
-            self.Tab_APKInfo(a)
-            self.Tab_Methods(a)
+            
+            # clear all the last info
+            self.listWidget_strings.clear()
+            self.listWidget_classes.clear()
+                
+            self.Graph.scene.clear()
+            self.plainTextEdit_smali.setPlainText("")
+            self.plainTextEdit_java.setPlainText("")
+            self.plainTextEdit_bytecode.setPlainText("")
+            
+            self.Tab_APKInfo(apk)
+            self.Tab_Methods(apk)
+            self.Tab_Strings()
+            self.Tab_Classes()
+            self.Tab_Files(str(filename))
+            
+            self.tabWidget_2.setCurrentIndex(4)
+            self.tabWidget.setCurrentIndex(0)
+
+
+
+    @pyqtSignature("")
+    def on_About_triggered(self):
+        self.msgbox = newMessageBox()
+        self.msgbox.setText("Author:  CongZheng(CN)\nMentor: Ryan W Smith(US), Anthony Desnos(FR)\nSupported by the Honeynet Project and Gsoc2011")
+        self.msgbox.setWindowTitle("About")
+        self.msgbox.show()
 
 ##################################################
 #Tab_APKInfo:
 #    build the APKInfo Tab  
 ##################################################
-    def Tab_APKInfo(self, a):
+    def Tab_APKInfo(self, apk):        
         self.textEdit_receivers = QTextEdit()
-        self.textEdit_receivers.setText(APKInfo.get_receivers(a)[0])
+        self.textEdit_receivers.setText(apk.getReceivers()[0])
         self.textEdit_services = QTextEdit()
-        self.textEdit_services.setText(APKInfo.get_services(a)[0])
+        self.textEdit_services.setText(apk.getServices()[0])
         self.textEdit_permissions = QTextEdit()
-        self.textEdit_permissions.setText(APKInfo.get_permissions(a)[0])
+        self.textEdit_permissions.setText(apk.getPermissions()[0])
 
         # get the number of lines
-        num_receivers = APKInfo.get_receivers(a)[1]
-        num_services = APKInfo.get_services(a)[1]
-        num_permissions = APKInfo.get_permissions(a)[1]
+        num_receivers = apk.getReceivers()[1]
+        num_services = apk.getServices()[1]
+        num_permissions = apk.getPermissions()[1]
         
         # set the default height of textedit widget
         self.textEdit_receivers.setFixedHeight(25*num_receivers)
         self.textEdit_permissions.setFixedHeight(25*num_permissions)
         
         # add these items to the tableWidget. the last three items is the textEdits as cell widgets 
-        self.tableWidget_apkinfo.setItem(0, 0, QTableWidgetItem(APKInfo.get_filename(a)))
-        self.tableWidget_apkinfo.setItem(1, 0, QTableWidgetItem(APKInfo.get_versionCode(a)))
-        self.tableWidget_apkinfo.setItem(2, 0, QTableWidgetItem(APKInfo.get_versionName(a)))
-        self.tableWidget_apkinfo.setItem(3, 0, QTableWidgetItem(APKInfo.get_package(a)))
+        self.tableWidget_apkinfo.setItem(0, 0, QTableWidgetItem(apk.getFilename()))
+        self.tableWidget_apkinfo.setItem(1, 0, QTableWidgetItem(apk.getVersionCode()))
+        self.tableWidget_apkinfo.setItem(2, 0, QTableWidgetItem(apk.getVersionName()))
+        self.tableWidget_apkinfo.setItem(3, 0, QTableWidgetItem(apk.getPackage()))
         self.tableWidget_apkinfo.setCellWidget(4, 0, self.textEdit_receivers)
         self.tableWidget_apkinfo.setCellWidget(5, 0, self.textEdit_services)
         self.tableWidget_apkinfo.setCellWidget(6, 0, self.textEdit_permissions)
         self.tableWidget_apkinfo.resizeRowsToContents()
  
  
- 
+##################################################
+#Tab_Methods:
+#    build the Methods Tab  
+################################################## 
     def Tab_Methods(self, a):
         clsslice = []
         
-        CL = GetMethods.CLASS(a)
-        classes = CL.get_class()
-        maxdepth = CL.get_maxdepth()
+        self.CL = GetMethods.CLASS(a)
+        
+        classes = self.CL.get_class()
+        maxdepth = self.CL.get_maxdepth()
         
         self.treeWidget_methods.clear()
         self.treeWidget_methods.setColumnCount(2)
         
         for c in classes:
             flag = 0
-            classname = CL.get_classname(c)
+            classname = self.CL.get_classname(c)
             slice = classname.split("/")
             
             
                 child.setText(0, slice[-1])
             
             # add the node child items, which are methods.
-            for m in CL.get_methods(c):
+            for m in self.CL.get_methods(c):
                 # build a gloal dir from classname+methodname path to method obj
-                path2method[c._name + m._name] = m
-                methodname = CL.get_methodname(m)
+                self.path2method[c._name + m._name] = m
+                methodname = self.CL.get_methodname(m)
                 childMethod = QTreeWidgetItem(child)
                 childMethod.setText(0, methodname)
         
         
         # create a connect between signal and slot.
-        self.connect(self.treeWidget_methods, SIGNAL("itemDoubleClicked(QTreeWidgetItem *, int)"), self.displaySmali)
+        self.connect(self.treeWidget_methods, SIGNAL("itemDoubleClicked(QTreeWidgetItem *, int)"), self.locateMethod)
 
         pheader = self.treeWidget_methods.header()
         pheader.setResizeMode(3)
         
         self.treeWidget_methods.setStyleSheet("QTreeView::item:hover{background-color:rgb(0,255,0,50)}"
                                              "QTreeView::item:selected{background-color:rgb(255,0,0,100)}")
-        
-        
-    def displaySmali( self, item, index):  
+
+
+##################################################
+#locateMethod:
+#    locate the method, which has been clicked  
+##################################################        
+    def locateMethod( self, item, index):  
       if item.childCount() != 0:
           return
       else:
               else:
                   classname += i + "/"
           
-          smaliContent = ""
           path = classname + methodname
-          code =  path2method[str(path)].get_code()
-          if code == None:
-              self.plainTextEdit_smali.setPlainText("")
-          else:
-              bc = code.get_bc()
-              idx = 0
-              linenum = 0
-              for i in bc.get():
-                  smaliContent +=  str(linenum) + " " + "0x%x" % idx + " " + str(i.get_name()) + " " + str(i.get_operands()) + " " + str(i.get_formatted_operands()) + '\n'
-                  idx += i.get_length()
-                  linenum += 1
-                  
-              self.plainTextEdit_smali.setPlainText(smaliContent)
+          method = self.path2method[str(path)]
+          
+          # after locating the method, get the content for Tab_Smali, Tab_CFG, Tab_Bytecode
+          self.Tab_Smali(method)
+          self.Tab_CFG(method)
+          self.Tab_Bytecode(method)
+          self.tabWidget.setCurrentIndex(0)
 
+
+
+##################################################
+#Tab_Smali:
+#    build the Smali Tab  
+################################################## 
+    def Tab_Smali(self, method):
+        smaliContent = ""
+        code =  method.get_code()
         
+        if code == None:
+            self.plainTextEdit_smali.setPlainText("")
+        else:
+            bc = code.get_bc()
+            idx = 0
+            linenum = 0
+            for i in bc.get():
+                smaliContent += str(linenum) + " " + "0x%x" % idx + " "
+                smaliContent += i.show_buff(idx) + "\n"
+                idx += i.get_length()
+                linenum += 1
+                
+            self.plainTextEdit_smali.setPlainText(smaliContent)
+
+
+
+##################################################
+#Tab_Classes:
+#    build the Classes Tab 
+##################################################         
+    def Tab_Classes(self):
+        Classes = self.CL.vm.get_classes_names()
+        for c in Classes:
+            listItem = QListWidgetItem(c, self.listWidget_classes)
+            listItem.setFlags(Qt.ItemIsEditable | Qt.ItemIsSelectable | Qt.ItemIsEnabled)
+
+
+##################################################
+#Tab_Strings:
+#    build the Strings Tab 
+################################################## 
+    def Tab_Strings(self):
+        Strings = self.CL.vm.get_strings()
+        for s in Strings:
+            listItem = QListWidgetItem(s, self.listWidget_strings)
+            listItem.setFlags(Qt.ItemIsEditable | Qt.ItemIsSelectable | Qt.ItemIsEnabled)
         
+
+
+##################################################
+#Tab_Bytecode:
+#    build the Bytecode Tab 
+################################################## 
+    def Tab_Bytecode(self, method):
+        bytecode = ""
+        code = method.get_code()
         
+        if code == None:
+            self.plainTextEdit_bytecode.setPlainText("")
+        else:
+            bc = code.get_bc()
+            raw = bc.get_raw()
         
+            import binascii
+            c = binascii.hexlify(raw)
+            while c: