【发布时间】:2018-04-16 09:05:28
【问题描述】:
是否可以获得由基于 Cordova 的应用程序使用 Adroguard 生成的 config.xml 文件?
我在/res 文件夹下找不到它,并且它没有在get_files() 方法的输出中列出。
另一方面,apktool 能够从正在使用的apk 中获取config.xml开启。
【问题讨论】:
标签: android cordova apk apktool androguard
是否可以获得由基于 Cordova 的应用程序使用 Adroguard 生成的 config.xml 文件?
我在/res 文件夹下找不到它,并且它没有在get_files() 方法的输出中列出。
另一方面,apktool 能够从正在使用的apk 中获取config.xml开启。
【问题讨论】:
标签: android cordova apk apktool androguard
由于它在 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 格式错误,您可能会遇到一些错误,但我不包括处理这些情况的解决方案。我希望你能对上面的例子有所了解。
【讨论】: