1. 新增对dom、sax、dom4j、 jdom等xml解析组件的支持

2. 优化后缀名获取方式
v1.0.5
kelvin_ben 4 years ago
parent 307e756e23
commit f278863803
  1. 16
      config.py
  2. 10
      libs/task/android_task.py
  3. 6
      libs/task/ios_task.py
  4. 4
      libs/task/web_task.py

@ -3,12 +3,24 @@
# Github: https://github.com/kelvinBen/AppInfoScanner
# 此处用于搜索组件信息,如fastjson、gson等
# 此处用于搜索组件信息
# com.alibaba.fastjson -> fastjson
# com.google.gson -> gson
# com.fasterxml.jackson -> jackson
# net.sf.json ->
# javax.xml.parsers.DocumentBuilder -> dom方式
# javax.xml.parsers.SAXParser -> sax方式
# org.jdom.input.SAXBuilder -> jdom
# org.dom4j.io.SAXReader -> dom4j
filter_components = [
'com.alibaba.fastjson',
'com.google.gson',
'com.fasterxml.jackson',
'net.sf.json'
'net.sf.json',
'javax.xml.parsers.DocumentBuilder',
'javax.xml.parsers.SAXParser',
'org.jdom.input.SAXBuilder',
'org.dom4j.io.SAXReader'
]
# 此处目前支持过滤

@ -105,7 +105,7 @@ class AndroidTask(object):
if "." not in dir_file:
continue
if len(dir_file.split("."))>1:
if dir_file.split(".")[1] in file_suffix:
if dir_file.split(".")[-1] in file_suffix:
self.file_queue.put(dir_file_path)
for component in config.filter_components:
comp = component.replace(".","/")
@ -120,10 +120,12 @@ class AndroidTask(object):
dir_file_path = os.path.join(root_path,dir_file)
if os.path.isdir(dir_file_path):
self.__get_file_type__(dir_file_path)
else:
if dir_file.split(".")[1] == "apk":
else:
suffix_name = dir_file.split(".")[-1]
if suffix_name == "apk":
self.__decode_apk__(dir_file)
elif dir_file.split(".")[1] == "dex":
elif suffix_name == "dex":
self.__decode_dex__(dir_file)
else:
continue

@ -30,7 +30,7 @@ class iOSTask(object):
def start(self):
# ipa 文件
if self.path.split(".")[1] == 'ipa':
if self.path.split(".")[-1] == 'ipa':
# 对ipa进行解包
self.__decode_ipa__(cores.output_path)
@ -56,7 +56,7 @@ class iOSTask(object):
dir_file_path = os.path.join(scanner_dir,dir_file)
if os.path.isdir(dir_file_path):
if dir_file.endswith(".app"):
self.elf_file_name = dir_file.split(".")[0]
self.elf_file_name = dir_file.replace(".app","")
self.__get_scanner_file__(dir_file_path,file_suffix)
else:
if self.elf_file_name == dir_file:
@ -65,7 +65,7 @@ class iOSTask(object):
if self.no_resource:
dir_file_suffix = dir_file.split(".")
if len(dir_file_suffix) > 1:
if dir_file_suffix[1] in file_suffix:
if dir_file_suffix[-1] in file_suffix:
self.file_queue.put(dir_file_path)
def __decode_ipa__(self,output_path):

@ -38,7 +38,7 @@ class WebTask(object):
self.__get_scanner_file__(self.path,scanner_file_suffix)
else:
if not (self.path.split(".")[1] in scanner_file_suffix): # 内容包含进行下步处理
if not (self.path.split(".")[-1] in scanner_file_suffix): # 内容包含进行下步处理
err_info = ("Retrieval of this file type is not supported. Select a file or directory with a suffix of %s" % ",".join(scanner_file_suffix))
raise Exception(err_info)
self.file_queue.put(self.path)
@ -58,7 +58,7 @@ class WebTask(object):
self.__get_scanner_file__(dir_file_path,file_suffix)
else:
if len(dir_file.split("."))>1:
if dir_file.split(".")[1] in file_suffix:
if dir_file.split(".")[-1] in file_suffix:
self.file_queue.put(dir_file_path)
def __print__(self):

Loading…
Cancel
Save