main_ad_pkg.py 859 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # -*- coding:utf-8 -*-
  2. import sys
  3. import os
  4. import traceback
  5. import json
  6. from V1 import merge_ad_pkg
  7. def package():
  8. if len(sys.argv) < 2:
  9. print("参数数量不正确")
  10. exit(1)
  11. config = sys.argv[1]
  12. if not os.path.exists(config):
  13. print("配置文件不存在")
  14. exit(1)
  15. try:
  16. ret = merge_ad_pkg.startMerge(config)
  17. except:
  18. ret = False
  19. print(traceback.format_exc())
  20. if not ret:
  21. print("切包失败,请联系开发人员")
  22. exit(1)
  23. print("成功")
  24. exit(0)
  25. pass
  26. def read_config_use_new_script(json_file_path):
  27. with open(json_file_path, 'r') as f:
  28. params = json.load(f)
  29. if not 'useAapt2' in params['meta_config']:
  30. return None
  31. return params['meta_config']['useAapt2']
  32. if __name__ == "__main__":
  33. package()