当前位置: 首页>>代码示例>>Python>>正文


Python biplist.readPlist方法代码示例

本文整理汇总了Python中biplist.readPlist方法的典型用法代码示例。如果您正苦于以下问题:Python biplist.readPlist方法的具体用法?Python biplist.readPlist怎么用?Python biplist.readPlist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在biplist的用法示例。


在下文中一共展示了biplist.readPlist方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: icon_from_app

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def icon_from_app(app_path):
    plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
    plist = biplist.readPlist(plist_path)
    icon_name = plist['CFBundleIconFile']
    icon_root,icon_ext = os.path.splitext(icon_name)
    if not icon_ext:
        icon_ext = '.icns'
    icon_name = icon_root + icon_ext
    return os.path.join(app_path, 'Contents', 'Resources', icon_name)

# .. Basics ....................................................................

# Uncomment to override the output filename
# filename = 'test.dmg'

# Uncomment to override the output volume name
# volume_name = 'Test'

# Volume format (see hdiutil create -help) 
开发者ID:ActivityWatch,项目名称:activitywatch,代码行数:21,代码来源:dmgbuild-settings.py

示例2: _parse_plist

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def _parse_plist(self):
        try:
            if self.plist_temp_file == None:
                self._get_plist_temp_file()
                
            if self.plist_temp_file == '':
                self.plist_info_list = {}
                return False
            
            self.plist_info_list = readPlist(self.plist_temp_file)
            os.remove(self.plist_temp_file)
            return self.plist_info_list
        except Exception, e:
            print "Not a plist:", e
            self.plist_info_list = {}
            return False 
开发者ID:NetEaseGame,项目名称:iOS-private-api-checker,代码行数:18,代码来源:IpaParse.py

示例3: getRootElementNames

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def getRootElementNames(f):
    ''' The top element is usually called "root", but sometimes it is not!
        Hence we retrieve the correct name here. In some plists, there is
        more than one top element, this function will retrieve them all.
    '''
    roots = []
    try:
        plist = biplist.readPlist(f)
        top_element = plist.get('$top', None)
        if top_element:
            roots = [ x for x in top_element.keys() ]
        else:
            print('$top element not found! Not an NSKeyedArchive?')
    except Exception as ex:
        print('Had an exception (error) trying to read plist using biplist')
        traceback.print_exc()
    return roots 
开发者ID:jfarley248,项目名称:iTunes_Backup_Reader,代码行数:19,代码来源:deserializer.py

示例4: GetTopLevel

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def GetTopLevel(self, file_object):
    """Returns the deserialized content of a plist as a dictionary object.

    Args:
      file_object (dfvfs.FileIO): a file-like object to parse.

    Returns:
      dict[str, object]: contents of the plist.

    Raises:
      UnableToParseFile: when the file cannot be parsed.
    """
    try:
      top_level_object = biplist.readPlist(file_object)

    except (biplist.InvalidPlistException,
            biplist.NotBinaryPlistException) as exception:
      raise errors.UnableToParseFile(
          'Unable to parse plist with error: {0!s}'.format(exception))

    return top_level_object 
开发者ID:log2timeline,项目名称:plaso,代码行数:23,代码来源:plist.py

示例5: Read

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def Read(self, file_object):
    """Reads a plist from a file-like object.

    Args:
      file_object (dfvfs.FileIO): a file-like object containing plist data.

    Raises:
      IOError: if the plist file-like object cannot be read.
      OSError: if the plist file-like object cannot be read.
    """
    try:
      self.root_key = biplist.readPlist(file_object)

    except (
        biplist.NotBinaryPlistException,
        biplist.InvalidPlistException) as exception:
      raise IOError(exception) 
开发者ID:log2timeline,项目名称:plaso,代码行数:19,代码来源:plist.py

示例6: restore

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def restore(self, options = {"RestoreSystemFiles": True,
                                "RestoreShouldReboot": True,
                                "RestorePreserveCameraRoll": True,
                                "RemoveItemsNotRestored": False,
                                "RestoreDontCopyBackup": True,
                                "RestorePreserveSettings": True},
                                password=None):

        self.logger.info("Starting restoration...")
        m = os.path.join(self.backupPath,self.udid,"Manifest.plist")
        try:
            manifest = readPlist(m)
        except IOError:
            self.logger.error("not a valid backup folder")
            return -1
        if manifest.get("IsEncrypted"):
            print("Backup is encrypted, enter password : ")
            if password:
                self.password = password
            else:
                self.password = raw_input()
            options["Password"] = self.password
        self.mobilebackup2_send_request("Restore", self.udid, self.udid, options)
        self.work_loop() 
开发者ID:iOSForensics,项目名称:pymobiledevice,代码行数:26,代码来源:mobilebackup2.py

示例7: _GetSystemInfo

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def _GetSystemInfo(self):
        ''' Gets system version information'''
        try:
            log.debug("Trying to get system version from /System/Library/CoreServices/SystemVersion.plist")
            f = self.Open('/System/Library/CoreServices/SystemVersion.plist')
            if f != None:
                try:
                    plist = biplist.readPlist(f)
                    self.os_version = plist.get('ProductVersion', '')
                    self.os_build = plist.get('ProductBuildVersion', '')
                    self.os_friendly_name = plist.get('ProductName', '')
                    log.info ('iOS version detected is: {} ({}) Build={}'.format(self.os_friendly_name, self.os_version, self.os_build))
                    f.close()
                    return True
                except (biplist.InvalidPlistException, biplist.NotBinaryPlistException) as ex:
                    log.error ("Could not get ProductVersion from plist. Is it a valid xml plist? Error=" + str(ex))
                f.close()
            else:
                log.error("Could not open plist to get system version info!")
        except:
            log.exception("Unknown error from _GetSystemInfo()")
        return False 
开发者ID:ydkhatri,项目名称:mac_apt,代码行数:24,代码来源:macinfo.py

示例8: getRootElementNames

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def getRootElementNames(f):
    ''' The top element is usually called "root", but sometimes it is not!
        Hence we retrieve the correct name here. In some plists, there is
        more than one top element, this function will retrieve them all.
    '''
    roots = []
    try:
        plist = biplist.readPlist(f)
        top_element = plist.get('$top', None)
        if top_element:
            roots = [ x for x in top_element.keys() ]
        else:
            print('$top element not found! Not an NSKeyedArchive?')
    except biplist.InvalidPlistException:
        print('Had an exception (error) trying to read plist using biplist')
        traceback.print_exc()
    return roots 
开发者ID:abrignoni,项目名称:iLEAPP,代码行数:19,代码来源:deserializer.py

示例9: icon_from_app

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def icon_from_app(app_path):
    plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
    plist = biplist.readPlist(plist_path)
    icon_name = plist['CFBundleIconFile']
    icon_root,icon_ext = os.path.splitext(icon_name)
    if not icon_ext:
        icon_ext = '.icns'
    icon_name = icon_root + icon_ext
    return os.path.join(app_path, 'Contents', 'Resources', icon_name)

# .. Basics ....................................................................

# Uncomment to override the output filename
# filename = 'test.dmg'

# Uncomment to override the output volume name
# volume_name = 'Test'

# Volume format (see hdiutil create -help) 
开发者ID:gridsync,项目名称:gridsync,代码行数:21,代码来源:dmgbuild_settings.py

示例10: icon_from_app

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def icon_from_app(app_path):
    plist_path = os.path.join(app_path, "Contents", "Info.plist")
    plist = biplist.readPlist(plist_path)
    icon_name = plist["CFBundleIconFile"]
    icon_root, icon_ext = os.path.splitext(icon_name)
    if not icon_ext:
        icon_ext = ".icns"
    icon_name = icon_root + icon_ext
    return os.path.join(app_path, "Contents", "Resources", icon_name)


# .. Basics ...................................................................

# Uncomment to override the output filename
# filename = 'mu-editor.dmg'

# Uncomment to override the output volume name
# volume_name = 'Mu Editor'


# Volume format (see hdiutil create -help) 
开发者ID:mu-editor,项目名称:mu,代码行数:23,代码来源:dmg_settings.py

示例11: main

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def main(plist):
    print("[+] Opening {} file".format(plist))
    try:
        plist_data = biplist.readPlist(plist)
    except (biplist.InvalidPlistException,
            biplist.NotBinaryPlistException) as e:
        print("[-] Invalid PLIST file - unable to be opened by biplist")
        sys.exit(2)

    print("[+] Printing Info.plist Device "
          "and User Information to Console\n")
    for k in plist_data:
        if k != 'Applications' and k != 'iTunes Files':
            print("{:<25s} - {}".format(k, plist_data[k])) 
开发者ID:PacktPublishing,项目名称:Python-Digital-Forensics-Cookbook,代码行数:16,代码来源:plist_parser.py

示例12: _read_and_unlock_keybag

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def _read_and_unlock_keybag(self):
        if self._unlocked:
            return self._unlocked
        # Open the Manifest.plist file to access the Keybag:
        with open(self._manifest_plist_path, 'rb') as infile:
            self._manifest_plist = biplist.readPlist(infile)
        self._keybag = google_iphone_dataprotection.Keybag(self._manifest_plist['BackupKeyBag'])
        # Attempt to unlock the Keybag:
        self._unlocked = self._keybag.unlockWithPassphrase(self._passphrase)
        if not self._unlocked:
            raise ValueError("Failed to decrypt keys: incorrect passphrase?")
        # No need to keep the passphrase any more:
        self._passphrase = None
        return True 
开发者ID:jfarley248,项目名称:iTunes_Backup_Reader,代码行数:16,代码来源:iphone_backup.py

示例13: handler_bplist

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def handler_bplist(filename, filepath, info, out=None, settings=None ):
    if out != None:
        out.put("\t[PLIST] Extractiong: " + filepath)
    else:
        print "\t[PLIST] Extractiong: " + filepath
    
    try:
        plist = biplist.readPlist(filepath)
        content = biplist.writePlistToString(plist,False)
        fobj = ExtractStore.ApplicationFile(filename,ExtractStore.TYPE_XML)
        fobj.add_content(content)
        return fobj
    except:
        return handle_data(filename,filepath,info,out) 
开发者ID:georgenicolaou,项目名称:nfi,代码行数:16,代码来源:FileHandlers.py

示例14: plist

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def plist(local_file):
    """
    Reads and returns a plist file in dict form

    :param str local_file: the plist list file to read
    :return: a dict with the plist content
    """
    import biplist
    return biplist.readPlist(local_file) 
开发者ID:nettitude,项目名称:scrounger,代码行数:11,代码来源:ios.py

示例15: run

# 需要导入模块: import biplist [as 别名]
# 或者: from biplist import readPlist [as 别名]
def run(self):
        try:
            d = biplist.readPlist('/Library/Preferences/com.apple.alf.plist')
            enabled = (d['globalstate'] >= 1)
        except:
            return (False, "failed to read firewall config plist")

        return (enabled, "{}".format("enabled" if enabled else "disabled")) 
开发者ID:snare,项目名称:idiot,代码行数:10,代码来源:firewall.py


注:本文中的biplist.readPlist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。