script.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. if os.path.exists(raws_xml):
  21. os.remove(raws_xml)
  22. return
  23. def handle_public_xml(public_xml_path, remove_node):
  24. if not os.path.exists(public_xml_path):
  25. logging.info('public_xml is null: ' + public_xml_path)
  26. return
  27. new_lines = []
  28. with open(public_xml_path, 'r+') as f:
  29. for line in f.readlines():
  30. # l = line.strip()
  31. if line.find(remove_node) > -1:
  32. continue
  33. new_lines.append(line)
  34. f.seek(0)
  35. f.truncate()
  36. f.writelines(new_lines)
  37. return
  38. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  39. logging.info("-----debug-----")
  40. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  41. return
  42. if __name__ == '__main__':
  43. # replace_super_application("D:\work\wzdq")
  44. ""