【Python开发】检测app使用了多少个xib和js的脚本(python)
2016-08-14 00:04
766 查看
#!/usr/bin/env python # coding=utf-8 import os, sys def countTargetFile(targetDir): resultStr = '' targetTypes = ['.nib', '.m', '.js'] for targetType in targetTypes: targetCount = 0 for root, dirs, files in os.walk(targetDir): for file in files: if file.endswith(targetType): print os.path.join(root, file) targetCount += 1 oneResult = 'type = ' + targetType + ', target count = ' + str(targetCount) print oneResult resultStr += oneResult + '\n' return resultStr def deal(baseDir, filename): print 'process file:' + baseDir + filename tmpDir = os.getcwd() + '/unzip_folders/' + filename.replace(' ', '_') print tmpDir try: os.mkdir(tmpDir) zipFile = tmpDir + '/' + 'tmp.zip' command = 'cp ' + baseDir + filename.replace(' ', '\ ') + ' ' + zipFile os.system(command) command = 'unzip ' + zipFile + ' -d ' + tmpDir print command os.system(command) except OSError: print 'file exist, ignore' resultStr = countTargetFile(tmpDir + '/Payload') file = open(tmpDir.replace('.ipa','') + '_result.txt', 'w') file.write(filename + ':\n') file.write(resultStr) file.write('\n') file.close() def process(): baseDir = os.getcwd() targetFiles = os.listdir('./ipa_folders') print targetFiles for oneFile in targetFiles: if oneFile.endswith('.ipa'): deal(baseDir + '/ipa_folders/', oneFile) if __name__ == '__main__': process() print 'over'
转载地址:脚本
相关文章推荐
- 使用python检测手机QQ在线状态的脚本代码
- 使用backbone.js、zepto.js和trigger.io开发HTML5 App
- 使用Python脚本实现批量网站存活检测遇到问题及解决方法
- iOS与H5交互 H5与App原生交互,一般会是前端页面中的JavaScript与App使用的原生开发语言的交互。技术方案应能达到以下要求: 在js与原生进行交互的时候能保证正常的正向调用逻辑返回
- mitmproxy使用python脚本定制开发(三)
- Android入门之旅5—使用Python脚本开发Android应用
- 使用Python来开发Markdown脚本扩展的实例分享
- iOS开发:使用大图+脚本,生成各种size的app icon和图片素材
- 使用LoadRunner完成移动APP的脚本开发
- 如何在Windows下开发Python:在cmd下运行Python脚本+如何使用Python Shell(command line模式和GUI模式)+如何使用Python IDE
- 使用backbone.js、zepto.js和trigger.io开发HTML5 App
- 使用Python脚本和ADB命令实现卸载App
- 使用python为Java项目开发一个预编译脚本
- 如何在Windows下开发Python:在cmd下运行Python脚本+如何使用Python Shell(command line模式和GUI模式)+如何使用Python IDE
- 在IE中使用Python作为开发脚本
- Atitit.使用引擎加脚本架构的设计 使用php,js来开发桌面程序。。
- 使用LoadRunner完成移动APP的脚本开发
- Python脚本在安卓开发中的使用