mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-11 02:49:40 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5a5d7b5ed | ||
|
|
c3a51e7e03 | ||
|
|
806db413e2 |
10
README.md
10
README.md
@@ -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)
|
||||
|
||||
**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`
|
||||
|
||||
then finally, to install or update cyan, just `pip install --force-reinstall git+https://github.com/asdfzxcvbn/pyzule-rw.git#egg=cyan`
|
||||
to *update*, just run step 2 again !
|
||||
|
||||
## acknowledgements
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ def main() -> None:
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--version", action="version", version="cyan v1.0"
|
||||
"--version", action="version", version="cyan v1.1.2"
|
||||
)
|
||||
|
||||
from cyan import logic
|
||||
|
||||
@@ -76,7 +76,7 @@ class Executable:
|
||||
has_entitlements = True
|
||||
|
||||
# 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):
|
||||
os.makedirs(PLUGINS_DIR, exist_ok=True)
|
||||
@@ -154,6 +154,9 @@ class Executable:
|
||||
subprocess.run([self.ldid, f"-S{ENT_PATH}", self.path])
|
||||
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:
|
||||
cmd = [self.ldid, "-S"]
|
||||
if keep_entitlements:
|
||||
@@ -195,7 +198,7 @@ class Executable:
|
||||
)
|
||||
|
||||
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 cname in (tweaks | self.common):
|
||||
|
||||
@@ -153,12 +153,16 @@ def extract_deb(deb: str, tweaks: dict[str, str], tmpdir: str) -> None:
|
||||
|
||||
for hi in sum((
|
||||
glob(f"{t2}/**/*.dylib", recursive=True),
|
||||
glob(f"{t2}/**/*.bundle", recursive=True),
|
||||
glob(f"{t2}/**/*.appex", recursive=True),
|
||||
glob(f"{t2}/**/*.bundle", recursive=True),
|
||||
glob(f"{t2}/**/*.framework", recursive=True)
|
||||
), []): # type: ignore
|
||||
if os.path.islink(hi):
|
||||
continue # symlinks are broken iirc
|
||||
if (
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user