script.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. import gw_file_system
  12. import gw_data_center
  13. import gw_apk_tool
  14. def script_init(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  15. gw_data_center.pack_small = False
  16. gw_apk_tool.__apk_tool__ = 'apktool_2.6.0.jar'
  17. def script_first(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  18. return
  19. def script(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  20. return
  21. def script_last(SDK, decompileDir, channelSdkInfo, new_game_channel_info, gameInfo):
  22. return
  23. def create_mutil_smali(decompileDir):
  24. f_idx = 2
  25. while True:
  26. tmp = gw_file_system.get_full_path(os.path.join(decompileDir, 'smali_classes%d' % f_idx))
  27. tmp = tmp.replace('\\', '/')
  28. tmp = re.sub('/+', '/', tmp)
  29. if os.path.exists(tmp):
  30. f_idx += 1
  31. else:
  32. smali_classes2_dir = tmp
  33. break
  34. # endwhile
  35. os.mkdir(smali_classes2_dir)
  36. return smali_classes2_dir
  37. def move_package(s1, s3, list_package):
  38. for d in list_package:
  39. src = os.path.join(s1, d)
  40. if os.path.exists(src):
  41. dst = os.path.join(s3, d)
  42. distutils.dir_util.copy_tree(src, dst)
  43. distutils.dir_util.remove_tree(src)
  44. if __name__ == '__main__':
  45. ""