script.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # coding:utf8
  2. __author__ = '极无双'
  3. import os
  4. import logging
  5. import xml.dom.minidom
  6. import re
  7. import shutil
  8. import glob
  9. def script_second(workspace_sdk_dir, extract_dir, channel_sdk_info, new_game_channel_info, game_info):
  10. logging.info('script_second: ' + str(channel_sdk_info))
  11. # 逆向渠道id
  12. public_xml = os.path.join(extract_dir, "res/values/public.xml")
  13. handle_public_xml(public_xml, "progress_text")
  14. handle_public_xml(public_xml, "lebian_color")
  15. handle_public_xml(public_xml, "progress_max")
  16. handle_public_xml(public_xml, "progress_current")
  17. handle_public_xml(public_xml, "progress_reached")
  18. handle_public_xml(public_xml, "progress_unreached")
  19. return
  20. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  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. if __name__ == '__main__':
  38. replace_life_method("D:\\work\\jws")