是否可以使用Adroguard获取由基于Cordova的应用程序生成的config.xml文件?
我在/res文件夹下找不到它,并且它没有列在get_files()方法的输出中。
另一方面,apktool能够从使用它的apk中获取config.xml。
发布于 2018-05-29 17:11:10
因为它在res文件夹下,您需要通过将文件解压缩到一个临时目录来获取它,然后使用Axml解析器解析它。在get_files()中,您必须看到"resources.arsc“文件。res文件就是其中的一部分。你可以这样做:
config_xml_path = os.path.join(<your apk unzipped path>, 'res', 'xml', 'config.xml')
with io.open(config_xml_path, 'rb') as axml_file:
parsed_axml_file = AXMLPrinter(axml_file.read())
axml_content = parsed_axml_file.get_buff().decode('utf-8)
parsed_axml = minidom.parseString(axml_content.encode('utf-8'))如果config.xml的格式不好,您可能会得到一些错误,但我没有包含处理这些情况的解决方案。我希望你能从上面的例子中得到一个概念。
https://stackoverflow.com/questions/49853453
复制相似问题