From 3c311a6982c73963e7ee5070f71535291d349923 Mon Sep 17 00:00:00 2001 From: zx Date: Sat, 7 Sep 2024 17:55:47 -0400 Subject: [PATCH] WHY IS THIS SO FUCKING STUPID --- cyan/tbhtypes/executable.py | 2 ++ cyan/tbhutils.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cyan/tbhtypes/executable.py b/cyan/tbhtypes/executable.py index 4b37a3e..a20fba4 100644 --- a/cyan/tbhtypes/executable.py +++ b/cyan/tbhtypes/executable.py @@ -95,10 +95,12 @@ class Executable: ) # `extract_deb()` will modify `tweaks`, which is why we make a copy + cwd = os.getcwd() for bn, path in dict(tweaks).items(): if bn.endswith(".deb"): tbhutils.extract_deb(path, tweaks, tmpdir) continue + os.chdir(cwd) # i fucking hate jailbroken iOS utils. needed: set[str] = set() for bn, path in tweaks.items(): diff --git a/cyan/tbhutils.py b/cyan/tbhutils.py index 36be7c2..b94a792 100644 --- a/cyan/tbhutils.py +++ b/cyan/tbhutils.py @@ -121,11 +121,11 @@ def extract_deb(deb: str, tweaks: dict[str, str], tmpdir: str) -> None: t2 = f"{tmpdir}/{uuid4()}" os.mkdir(t2) - if platform.system() == "Linux" or ( - "iPhone" in platform.machine() - or "iPad" in platform.machine() - ): + if platform.system() == "Linux": tool = ["ar", "-x", deb, f"--output={t2}"] + elif "iPhone" in platform.machine() or "iPad" in platform.machine(): + os.chdir(t2) # BAHAHAHAHHAHA. + tool = ["ar", "-x", deb] else: tool = ["tar", "-xf", deb, f"--directory={t2}"]