script.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # coding:utf8
  2. __author__ = 'dong'
  3. import os
  4. import logging
  5. import xml.dom.minidom
  6. import re
  7. import shutil
  8. import glob
  9. from xml.etree.ElementTree import ElementTree, Element
  10. import distutils.dir_util
  11. from xml.etree import ElementTree as ET
  12. ANDROID_NS = 'http://schemas.android.com/apk/res/android'
  13. def script_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
  14. public_xml = os.path.join(extract_dir, "res/values/public.xml")
  15. handle_public_xml(public_xml, "debugger")
  16. handle_public_xml(public_xml, "mms_cfg")
  17. handle_public_xml(public_xml, "ss_cfg")
  18. handle_public_xml(public_xml, "ss_sgn")
  19. raws_xml = os.path.join(extract_dir, "res/values/raws.xml")
  20. os.remove(raws_xml)
  21. return
  22. def handle_public_xml(public_xml_path, remove_node):
  23. if not os.path.exists(public_xml_path):
  24. logging.info('public_xml is null: ' + public_xml_path)
  25. return
  26. new_lines = []
  27. with open(public_xml_path, 'r+') as f:
  28. for line in f.readlines():
  29. # l = line.strip()
  30. if line.find(remove_node) > -1:
  31. continue
  32. new_lines.append(line)
  33. f.seek(0)
  34. f.truncate()
  35. f.writelines(new_lines)
  36. return
  37. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  38. logging.info("-----debug-----")
  39. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  40. return
  41. if __name__ == '__main__':
  42. # replace_super_application("D:\work\wzdq")
  43. ""