script.py 1.8 KB

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