dev commits.

This commit is contained in:
MasOnShi
2022-04-03 20:26:41 +08:00
parent e21922b1f1
commit d84a6b9041

View File

@@ -45,14 +45,17 @@ def extract_file(from_path, to_path):
def patch_file(_key, _iv, to_dir):
patch_file_path = os.path.join(BASE_DIR, "../exports/typora.py")
exports_path = os.path.join(BASE_DIR, "../exports")
save_dir = os.path.join(to_dir, "build")
if not os.path.exists(save_dir):
os.makedirs(save_dir)
subprocess.check_call(["cp", f"{exports_path}/*", save_dir])
patch_file_path = os.path.join(save_dir, "typora.py")
content = open(patch_file_path, "r").read()
content = content.replace("{AES_KEY}", f"b''.fromhex('{_key}')")
content = content.replace("{AES_IV}", f"b''.fromhex('{_iv}')")
save_dir = os.path.join(to_dir, "build")
os.makedirs()
open(os.path.join(to_dir, "typora.py"), "w").write(content)
open(patch_file_path, "w").write(content)
def win_x64_run():