From 77a2e8ae2f97e5d7774a24a31f581a5b790ff008 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Tue, 8 Oct 2019 05:17:06 +0300 Subject: [PATCH] ctcci: Instead of having one pre/post script, allow for separate pre-post scripts uwu --- ctcci/ctcci.py | 19 +++++++++++++------ patches/notrack/{968.sh => 968-post.sh} | 0 2 files changed, 13 insertions(+), 6 deletions(-) rename patches/notrack/{968.sh => 968-post.sh} (100%) diff --git a/ctcci/ctcci.py b/ctcci/ctcci.py index 35e231a..0162f90 100644 --- a/ctcci/ctcci.py +++ b/ctcci/ctcci.py @@ -82,6 +82,13 @@ shutil.copytree(BASE_APK_PATH, WORK_APK_PATH) # Go through patches and apply every single one of them for patch_name in PATCHES: + pre_script = os.path.join(REPO_FOLDER, "patches", + patch_name, f"{VERSION}-pre.sh") + if os.path.exists(pre_script): + subprocess.run(f"bash {pre_script}", + shell=True, + cwd=WORK_APK_PATH) + # Apply custom emoji patches if patch_name in ["mutant", "blobs"]: print(f"Applying {patch_name} emoji patch") @@ -207,12 +214,12 @@ for patch_name in PATCHES: else: patch(patch_file, WORK_APK_PATH, patch_name) - patch_script = os.path.join(REPO_FOLDER, "patches", - patch_name, f"{VERSION}.sh") - if os.path.exists(patch_script): - subprocess.run(f"bash {patch_script}", - shell=True, - cwd=WORK_APK_PATH) + post_script = os.path.join(REPO_FOLDER, "patches", + patch_name, f"{VERSION}-post.sh") + if os.path.exists(post_script): + subprocess.run(f"bash {post_script}", + shell=True, + cwd=WORK_APK_PATH) # Pack the APK subprocess.run(f"{APKTOOL_BIN} b discord", diff --git a/patches/notrack/968.sh b/patches/notrack/968-post.sh similarity index 100% rename from patches/notrack/968.sh rename to patches/notrack/968-post.sh