Reveal分析IOS界面,需要得到app的 softwareVersionBundleId上传到iphone中 ,
而IOS8的iTunesMetadata.plist 去Downloads里面查找很费劲 ,所以写了个辅助脚本,一次性全部读取出来
主要使用python,实现遍历文件夹获取文件列表,然后读取字段,输出成文件libReveal.plist格式
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).get("metadata") 23 if metadata.get("kind") == "software": 24 bundleId = metadata.get("softwareVersionBundleId") 25 #print bundleId 26 if filterListStr != ‘‘: 27 filterListStr += ‘\n\t\t‘ 28 filterListStr += ‘Bundles = ("‘+bundleId+‘");‘ 29 gci(path) 30 libRevealPlist = libRevealPlist.replace(‘@ReplaceTag‘,filterListStr) 31 print libRevealPlist
时间: 2024-10-13 06:46:06