feat, refactor: entitlement merging, MainExecutable

This commit is contained in:
zx
2024-09-18 21:39:02 -04:00
parent 2d16015c78
commit c1c0b2294e
7 changed files with 153 additions and 104 deletions

View File

@@ -9,6 +9,7 @@ from uuid import uuid4
from glob import glob, iglob
from argparse import Namespace
from typing import Optional, Any
from plistlib import load as pload
HAS_ZIP = shutil.which("zip") is not None
HAS_UNZIP = shutil.which("unzip") is not None
@@ -68,6 +69,16 @@ def validate_inputs(args: Namespace) -> Optional[str]:
if args.cyan is not None and not os.path.isfile(args.cyan):
sys.exit(f"[!] {args.cyan} does not exist")
if args.x is not None:
if not os.path.isfile(args.x):
sys.exit(f"[!] {args.x} does not exist")
try:
with open(args.x, "rb") as f:
args.x = pload(f)
except Exception:
sys.exit("[!] couldn't parse given entitlements file")
def get_app(path: str, tmpdir: str, is_ipa: bool) -> str:
payload = f"{tmpdir}/Payload"