码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2015-05-22 22:33:41      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

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

 

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

标签:

原文地址:http://www.cnblogs.com/wyxy2005/p/4523360.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!