script.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  14. return
  15. def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  16. return
  17. def script_second(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  18. src = os.path.join(decompileDir, "res/values/public.xml")
  19. if os.path.exists(src):
  20. src = src.replace('\\', '/')
  21. os.remove(src)
  22. return
  23. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  24. return
  25. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  26. return
  27. def handle_public_xml(public_xml_path):
  28. if not os.path.exists(public_xml_path):
  29. logging.info('public_xml is null: ' + public_xml_path)
  30. return
  31. new_lines = []
  32. with open(public_xml_path, 'r+') as f:
  33. for line in f.readlines():
  34. # l = line.strip()
  35. if line.find("wrap_content") > -1:
  36. continue
  37. new_lines.append(line)
  38. f.seek(0)
  39. f.truncate()
  40. f.writelines(new_lines)
  41. return
  42. if __name__ == '__main__':
  43. # script("", "E:\\apk\\youhua\\LYJY360_12412_360逆向_1.23.00", "", "", "")
  44. modify_manifest("G:\\autopack2.0_kuaifa\\tool\\workspace\\mhlskp\\15377\\extract\\")