mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-11 02:49:40 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5a5d7b5ed | ||
|
|
c3a51e7e03 | ||
|
|
806db413e2 | ||
|
|
927df65b55 | ||
|
|
851eedf629 | ||
|
|
126d17924b |
12
README.md
12
README.md
@@ -6,7 +6,7 @@ cyan supports **linux, macOS, WSL, and jailbroken iOS!** all either x86_64 or ar
|
|||||||
|
|
||||||
## features
|
## features
|
||||||
|
|
||||||
more coming soon! i'm trying to copy pyzule in order to deprecate it in favor of cyan, which is 1000x better
|
you can open an issue to request a feature :D !!
|
||||||
|
|
||||||
- generate and use [shareable .cyan files](https://github.com/asdfzxcvbn/cyan-gen) to configure IPAs!
|
- generate and use [shareable .cyan files](https://github.com/asdfzxcvbn/cyan-gen) to configure IPAs!
|
||||||
- inject deb, dylib, framework, bundle, and appex files/folders
|
- inject deb, dylib, framework, bundle, and appex files/folders
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -151,9 +151,12 @@ class Executable:
|
|||||||
self.inj.write(self.path) # type: ignore
|
self.inj.write(self.path) # type: ignore
|
||||||
|
|
||||||
if has_entitlements:
|
if has_entitlements:
|
||||||
subprocess.run(["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):
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -1,8 +1,10 @@
|
|||||||
|
# type: ignore
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="cyan",
|
name="cyan",
|
||||||
version="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",
|
||||||
|
|||||||
Reference in New Issue
Block a user