# coding:utf8 __author__ = 'dong' from xml.dom.minidom import parse import os import logging import xml.dom.minidom import re import shutil import glob from xml.etree.ElementTree import ElementTree, Element import distutils.dir_util def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo): file_path = os.path.join(decompileDir, "AndroidManifest.xml") dom = parse(file_path) # root = dom.documentElement activities = dom.getElementsByTagName('activity') for activity in activities: intent_filters = activity.getElementsByTagName('intent-filter') for intent_filter in intent_filters: actions = intent_filter.getElementsByTagName('action') if len(actions) == 1 and actions[0].getAttribute('android:name') == '': activity.removeChild(intent_filter) with open(file_path, 'w') as f: f.write(dom.toxml()) if __name__ == '__main__': script_last("",u'',"","","")