Reveal分析IOS界面,plist文件读取

Reveal分析IOS界面,需要得到app的 softwareVersionBundleId上传到iphone中 ,

而IOS8的iTunesMetadata.plist

(设备路径/var/mobile/Containers/Bundle/Application)

提取plist文件使用tar命令

1.cd /var/mobile/Containers/Bundle/Application

2. tar -cvf /tmp/test/plist.tar ./*/iTunesMetadata.plist

3 scp plist.tar 到本地

去Downloads里面查找很费劲 ,所以写了个辅助脚本,一次性全部读取出来

主要使用python,实现遍历文件夹获取文件列表,然后读取字段,输出成文件libReveal.plist格式,然后 scp到 设备

/Library/MobileSubstrate/DynamicLibraries目录

python读取plist文件的库 来自https://github.com/wooster/biplist/ 1 path = '/Users/Documents/work/RevealPlist/'

 2 import os,string
 3 libRevealPlist = '''
 4 {
 5     Filter = {
 6         @ReplaceTag
 7     }
 8 }'''
 9 from biplist import *
10 from datetime import datetime
11 filterListStr = ''
12 def gci (path):
13     global filterListStr
14     parents = os.listdir(path)
15     for parent in parents:
16         child = os.path.join(path,parent)
17         if os.path.isdir(child):
18             gci(child)
19         else:
20             if parent=="iTunesMetadata.plist":
21                 #print(child)
22 metadata = readPlist(child)#readPlist(child).get("metadata") 23 if metadata.get("kind") == "software": 24 bundleId = metadata.get("softwareVersionBundleId") 25 #print bundleId 26 if filterListStr != '': 27 filterListStr += ' ' 28 filterListStr += 'Bundles = ("'+bundleId+'");' 29 gci(path) 30 libRevealPlist = libRevealPlist.replace('@ReplaceTag',filterListStr) 31 print libRevealPlist
原文地址:https://www.cnblogs.com/wyxy2005/p/4523360.html