diff --git a/README.md b/README.md index 60dae68..e9623e4 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ easiest install ever, just `pip install -U git+https://github.com/asdfzxcvbn/pyz [] refactor: dont prepare, just copy and fix as you go -[1] feat: plist operations (-u, -n, -v, -b, -m, -d, -l, -r) +[2] feat: plist operations (-n, -v, -b, -m, -l, -r) [x] feat: remove watch app -[] feat: fakesign +[x] feat: fakesign [] feat: thin binaries diff --git a/cyan/__main__.py b/cyan/__main__.py index 1f97c2b..9cd2456 100755 --- a/cyan/__main__.py +++ b/cyan/__main__.py @@ -39,6 +39,10 @@ def main() -> None: "-d", "--enable-documents", action="store_true", help="enable documents support" ) + parser.add_argument( + "-s", "--fakesign", action="store_true", + help="fakesign all binaries for use with appsync/trollstore" + ) parser.add_argument( "-c", "--compress", metavar="level", type=int, default=6, diff --git a/cyan/logic.py b/cyan/logic.py index 4d0cedf..782c893 100644 --- a/cyan/logic.py +++ b/cyan/logic.py @@ -47,6 +47,8 @@ def main(parser: ArgumentParser) -> None: app.remove_watch_apps() if args.enable_documents: app.plist.enable_documents() + if args.fakesign: + app.fakesign_all() # create subdirectories if necessary if "/" in args.o: diff --git a/cyan/tbhtypes/app_bundle.py b/cyan/tbhtypes/app_bundle.py index 6cabe96..332859d 100644 --- a/cyan/tbhtypes/app_bundle.py +++ b/cyan/tbhtypes/app_bundle.py @@ -1,5 +1,6 @@ import os import shutil +from glob import glob from .executable import Executable from .plist import Plist @@ -37,3 +38,20 @@ class AppBundle: else: print("[?] watch app not present") + def fakesign_all(self) -> None: + self.executable.fakesign() + count = 1 + + for ts in sum(( + glob(f"{self.path}/**/*.appex", recursive=True), + glob(f"{self.path}/**/*.framework", recursive=True) + ), []): # type: ignore + pl = Plist(f"{ts}/Info.plist") + Executable(f"{ts}/{pl['CFBundleExecutable']}").fakesign() + count += 1 + + for ts in glob(f"{self.path}/**/*.dylib", recursive=True): + Executable(ts).fakesign() + count += 1 + + print(f"[*] fakesigned \033[96m{count}\033[0m items") diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7892fdd..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -lief -