def __extractFromPermissions(self):
     """
     Extract package and permissions and store them in self.manifest
     """        
     try:
         args = ['%saapt' % Utils.getAaptPath(self.sdkPath),
                 'd', 'permissions',
                 self.apkFile]
         aapt = subprocess.Popen(args,
                                 stdout=subprocess.PIPE,
                                 stdin=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
     except OSError, osErr:
         raise APKWrapperError('Failed to start aapt \'%s\': %s' % (args, osErr.strerror))
 def __extractApplication(self):
     """
     Extract application information and store them in self.manifest
     """
     # Modes
     level = self.Level.START
     mainLevel = self.Level.START
     subLevel = self.Level.START
     obj = {}
     mainObj = {}
     subObj = {}
     
     # Run aapt
     try:
         args = ['%saapt' % Utils.getAaptPath(self.sdkPath),
                 'd', 'xmltree',
                 self.apkFile,
                 'AndroidManifest.xml']
         aapt = subprocess.Popen(args,
                                 stdout=subprocess.PIPE,
                                 stdin=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
     except OSError, osErr:
         raise APKWrapperError('Failed to start aapt \'%s\': %s' % (args, osErr.strerror))