diff --git a/cyan/__main__.py b/cyan/__main__.py index 901da36..98aee04 100755 --- a/cyan/__main__.py +++ b/cyan/__main__.py @@ -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 diff --git a/cyan/extras/CydiaSubstrate_tvos.framework/CydiaSubstrate b/cyan/extras/CydiaSubstrate_tvos.framework/CydiaSubstrate new file mode 100644 index 0000000..42540dc Binary files /dev/null and b/cyan/extras/CydiaSubstrate_tvos.framework/CydiaSubstrate differ diff --git a/cyan/extras/CydiaSubstrate_tvos.framework/Info.plist b/cyan/extras/CydiaSubstrate_tvos.framework/Info.plist new file mode 100644 index 0000000..6bc23c5 --- /dev/null +++ b/cyan/extras/CydiaSubstrate_tvos.framework/Info.plist @@ -0,0 +1,25 @@ + + + + + CFBundleExecutable + CydiaSubstrate + + CFBundleIdentifier + ellekit + + CFBundleName + ElleKit + + CFBundleShortVersionString + 1.1.3 + + CFBundleVersion + 1.1.3 + + UIRequiredDeviceCapabilities + + arm64 + + + diff --git a/cyan/extras/CydiaSubstrate_tvos.framework/LICENSE b/cyan/extras/CydiaSubstrate_tvos.framework/LICENSE new file mode 100644 index 0000000..83ac4b7 --- /dev/null +++ b/cyan/extras/CydiaSubstrate_tvos.framework/LICENSE @@ -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. diff --git a/cyan/logic.py b/cyan/logic.py index 8838e15..6433153 100644 --- a/cyan/logic.py +++ b/cyan/logic.py @@ -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: diff --git a/cyan/tbhtypes/main_executable.py b/cyan/tbhtypes/main_executable.py index 01c5af8..60a3c77 100644 --- a/cyan/tbhtypes/main_executable.py +++ b/cyan/tbhtypes/main_executable.py @@ -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 diff --git a/setup.py b/setup.py index d6718dc..8896563 100644 --- a/setup.py +++ b/setup.py @@ -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",