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

@@ -102,9 +102,13 @@ def main() -> None:
"--overwrite", action="store_true",
help="overwrite existing files without confirming"
)
parser.add_argument(
"--tv", action="store_true",
help="inject tvOS-compatible CydiaSubstrate instead of iOS"
)
parser.add_argument(
"--version", action="version", version="cyan v1.4.4"
"--version", action="version", version="cyan v1.4.5"
)
from cyan import logic

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>CydiaSubstrate</string>
<key>CFBundleIdentifier</key>
<string>ellekit</string>
<key>CFBundleName</key>
<string>ElleKit</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<key>CFBundleVersion</key>
<string>1.1.3</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,27 @@
Copyright (c) 2022 Évelyne Bélanger All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither ElleKit nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -55,7 +55,7 @@ def main(parser: ArgumentParser) -> None:
app.remove_encrypted_extensions()
if args.f is not None:
app.executable.inject(args.f, tmpdir)
app.executable.inject(args.f, tmpdir, tvos=args.tv)
if args.n is not None:
app.plist.change_name(args.n)
if args.v is not None:

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

View File

@@ -4,7 +4,7 @@ from setuptools import setup
setup(
name="cyan",
version="1.4.4",
version="1.4.5",
description="finally, pyzule doesn't suck",
author="zx",
author_email="z@zxcvbn.fyi",