#!/usr/bin/env python3
# find_openurl.py - liet ke moi binary co selector openURL trong bundle
import os

ROOT = r"vn.gsm.md_6473405044_3.15.0_DecryptIPA_by_TTJB\Payload\Driver.app"
PATS = [b"openURL:options:completionHandler:", b"openURL:", b"openURL"]

for dirpath, _, files in os.walk(ROOT):
    for fn in files:
        p = os.path.join(dirpath, fn)
        try:
            if os.path.getsize(p) > 200 * 1024 * 1024:
                continue
            d = open(p, "rb").read()
        except Exception:
            continue
        hits = []
        for pat in PATS[:1]:
            if pat in d:
                hits.append(pat.decode())
        if b"openURL:" in d and "openURL:options:completionHandler:" not in hits:
            hits.append("openURL:")
        if hits:
            print(f"{os.path.relpath(p, ROOT)}  -> {hits}")
