From d2f7c52411e8586f635990374ca061990e563515 Mon Sep 17 00:00:00 2001 From: magaofei Date: Thu, 6 Sep 2018 19:20:40 +0800 Subject: [PATCH] use biplist instead of plistlib (#719) * use biplist instead of plistlib * format * delete classes2-error.zip --- StaticAnalyzer/views/ios/plist_analysis.py | 22 +++++++++++----------- requirements.txt | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/StaticAnalyzer/views/ios/plist_analysis.py b/StaticAnalyzer/views/ios/plist_analysis.py index f24b1c68..577c584d 100755 --- a/StaticAnalyzer/views/ios/plist_analysis.py +++ b/StaticAnalyzer/views/ios/plist_analysis.py @@ -6,20 +6,20 @@ import glob import subprocess import plistlib - -from MobSF.utils import PrintException, isFileExists - +from MobSF.utils import ( + PrintException, + isFileExists +) +from biplist import ( + readPlist, + writePlistToString +) def convert_bin_xml(bin_xml_file): """Convert Binary XML to Readable XML""" - try: - plist_obj = plistlib.readPlist(bin_xml_file) - data = plistlib.writePlistToBytes(plist_obj) - with open(bin_xml_file, 'wb') as flip: - flip.write(data) - return data.decode("utf-8", "ignore") - except: - PrintException("[ERROR] Converting Binary XML to Readable XML") + plist_obj = readPlist(bin_xml_file) + data = writePlistToString(plist_obj) + return data def __check_permissions(p_list): diff --git a/requirements.txt b/requirements.txt index 241e8208..c0bf3a54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ configparser==3.5.0 androguard==3.2.1 lxml==4.2.4 rsa==3.4.2 +biplist==1.0.3 git+https://github.com/MobSF/CapFuzz.git