script.py 981 B

123456789101112131415161718192021222324252627282930313233
  1. # coding:utf8
  2. __author__ = 'dong'
  3. from xml.dom.minidom import parse
  4. import os
  5. import logging
  6. import xml.dom.minidom
  7. import re
  8. import shutil
  9. import glob
  10. from xml.etree.ElementTree import ElementTree, Element
  11. import distutils.dir_util
  12. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  13. file_path = os.path.join(decompileDir, "AndroidManifest.xml")
  14. dom = parse(file_path)
  15. # root = dom.documentElement
  16. activities = dom.getElementsByTagName('activity')
  17. for activity in activities:
  18. intent_filters = activity.getElementsByTagName('intent-filter')
  19. for intent_filter in intent_filters:
  20. actions = intent_filter.getElementsByTagName('action')
  21. if len(actions) == 1 and actions[0].getAttribute('android:name') == '':
  22. activity.removeChild(intent_filter)
  23. with open(file_path, 'w') as f:
  24. f.write(dom.toxml())
  25. if __name__ == '__main__':
  26. script_last("",u'',"","","")