3 Commits

Author SHA1 Message Date
zx
f5a5d7b5ed fix: sub-bundle detection 2024-09-10 17:23:30 -04:00
zx
c3a51e7e03 docs: update install instructions 2024-09-10 16:30:51 -04:00
zx
806db413e2 fix: crashing when jailbroken
i realized azule actually removes the signature (instead of fakesigning) before specific operations, maybe this is the fix?
2024-09-10 07:11:15 -04:00
5 changed files with 22 additions and 11 deletions

View File

@@ -26,11 +26,13 @@ first, make sure you have [ar](https://command-not-found.com/ar) and [tar](https
also obviously install python, version 3.9 or greater is required (the version available on the procursus repo for iOS) also obviously install python, version 3.9 or greater is required (the version available on the procursus repo for iOS)
**if you want to inject dylibs AND ARE NOT ON iOS,** make sure you install lief (you only have to do this once): `pip install -U lief` 1. install [pipx](https://github.com/pypa/pipx?tab=readme-ov-file#install-pipx)
2. install cyan: `pipx install https://github.com/asdfzxcvbn/pyzule-rw/archive/main.zip`
3. follow any instructions `pipx` may have given you, like `pipx ensurepath`
4. **if you want to inject dylibs and ARE NOT ON iOS**: `pipx inject cyan lief`
5. **if you want to change app icons (iOS NOT supported)**: `pipx inject cyan Pillow`
**if you want to change app icons (iOS NOT supported),** also make sure you install pillow: `pip install Pillow` to *update*, just run step 2 again !
then finally, to install or update cyan, just `pip install --force-reinstall git+https://github.com/asdfzxcvbn/pyzule-rw.git#egg=cyan`
## acknowledgements ## acknowledgements

View File

@@ -95,7 +95,7 @@ def main() -> None:
) )
parser.add_argument( parser.add_argument(
"--version", action="version", version="cyan v1.0" "--version", action="version", version="cyan v1.1.2"
) )
from cyan import logic from cyan import logic

View File

@@ -76,7 +76,7 @@ class Executable:
has_entitlements = True has_entitlements = True
# iirc, injecting doesnt work (sometimes) if the file isn't signed # iirc, injecting doesnt work (sometimes) if the file isn't signed
self.fakesign(False) self.remove_signature()
if any(t.endswith(".appex") for t in tweaks): if any(t.endswith(".appex") for t in tweaks):
os.makedirs(PLUGINS_DIR, exist_ok=True) os.makedirs(PLUGINS_DIR, exist_ok=True)
@@ -154,6 +154,9 @@ class Executable:
subprocess.run([self.ldid, f"-S{ENT_PATH}", self.path]) subprocess.run([self.ldid, f"-S{ENT_PATH}", self.path])
print("[*] restored entitlements") print("[*] restored entitlements")
def remove_signature(self) -> None:
subprocess.run([self.ldid, "-R", self.path], stderr=subprocess.DEVNULL)
def fakesign(self, keep_entitlements: bool = True) -> bool: def fakesign(self, keep_entitlements: bool = True) -> bool:
cmd = [self.ldid, "-S"] cmd = [self.ldid, "-S"]
if keep_entitlements: if keep_entitlements:
@@ -195,7 +198,7 @@ class Executable:
) )
def fix_dependencies(self, tweaks: dict[str, str], need: set[str]) -> None: def fix_dependencies(self, tweaks: dict[str, str], need: set[str]) -> None:
self.fakesign() # sometimes it doesnt work if we dont do this self.remove_signature()
for dep in self.get_dependencies(): for dep in self.get_dependencies():
for cname in (tweaks | self.common): for cname in (tweaks | self.common):

View File

@@ -153,12 +153,16 @@ def extract_deb(deb: str, tweaks: dict[str, str], tmpdir: str) -> None:
for hi in sum(( for hi in sum((
glob(f"{t2}/**/*.dylib", recursive=True), glob(f"{t2}/**/*.dylib", recursive=True),
glob(f"{t2}/**/*.bundle", recursive=True),
glob(f"{t2}/**/*.appex", recursive=True), glob(f"{t2}/**/*.appex", recursive=True),
glob(f"{t2}/**/*.bundle", recursive=True),
glob(f"{t2}/**/*.framework", recursive=True) glob(f"{t2}/**/*.framework", recursive=True)
), []): # type: ignore ), []): # type: ignore
if os.path.islink(hi): if (
continue # symlinks are broken iirc os.path.islink(hi) # symlinks are broken iirc
or hi.count(".bundle") > 1 # prevent sub-bundle detection (rip)
or hi.count(".framework") > 1
):
continue
tweaks[os.path.basename(hi)] = hi tweaks[os.path.basename(hi)] = hi

View File

@@ -1,8 +1,10 @@
# type: ignore
from setuptools import setup from setuptools import setup
setup( setup(
name="cyan", name="cyan",
version="1.1.1", version="1.1.2",
description="finally, pyzule doesn't suck", description="finally, pyzule doesn't suck",
author="zx", author="zx",
author_email="zx@hrzn.email", author_email="zx@hrzn.email",