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

时间:2021-12-15 06:20:33

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/'

 import os,string
libRevealPlist = '''
{
Filter = {
@ReplaceTag
}
}'''
from biplist import *
from datetime import datetime
filterListStr = ''
def gci (path):
global filterListStr
parents = os.listdir(path)
for parent in parents:
child = os.path.join(path,parent)
if os.path.isdir(child):
gci(child)
else:
if parent=="iTunesMetadata.plist":
#print(child)
metadata = readPlist(child)#readPlist(child).get("metadata")
if metadata.get("kind") == "software":
bundleId = metadata.get("softwareVersionBundleId")
#print bundleId
if filterListStr != '':
filterListStr += '\n\t\t'
filterListStr += 'Bundles = ("'+bundleId+'");'
gci(path)
libRevealPlist = libRevealPlist.replace('@ReplaceTag',filterListStr)
print libRevealPlist