inject tvOS-compatible CydiaSubstrate instead of iOS

This commit is contained in:
√(noham)²
2026-06-20 17:22:34 +02:00
parent 740d3716dc
commit 1ae265b413
7 changed files with 71 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ class MainExecutable(Executable):
else:
self.inj_func = self.lief_inject
def inject(self, tweaks: dict[str, str], tmpdir: str) -> None:
def inject(self, tweaks: dict[str, str], tmpdir: str, tvos: bool = False) -> None:
ENT_PATH = f"{self.bundle_path}/cyan.entitlements"
PLUGINS_DIR = f"{self.bundle_path}/PlugIns"
FRAMEWORKS_DIR = f"{self.bundle_path}/Frameworks"
@@ -106,10 +106,19 @@ class MainExecutable(Executable):
real = self.common[missing]["name"] # e.g. "Orion.framework"
ip = f"{FRAMEWORKS_DIR}/{real}"
existed = tbhutils.delete_if_exists(ip, real)
shutil.copytree(f"{self.install_dir}/extras/{real}", ip)
if tvos and missing == "substrate.":
src = f"{self.install_dir}/extras/CydiaSubstrate_tvos.framework"
else:
src = f"{self.install_dir}/extras/{real}"
shutil.copytree(src, ip)
if not existed:
print(f"[*] auto-injected {real}")
if not tvos:
print(f"[*] auto-injected {real}")
else:
print(f"[*] auto-injected {real} (tvos)")
# FINALLY !!
if self.inj is not None: # type: ignore