# -*- coding: utf-8 -*-
import re
import zipfile
from pathlib import Path

APK = Path(__file__).resolve().parent.parent / "apks" / "seabank_ph_base.apk"
with zipfile.ZipFile(str(APK)) as zf:
    for dex_name in zf.namelist():
        if not dex_name.endswith(".dex"):
            continue
        data = zf.read(dex_name)
        if b"CharacterCrypto" not in data and b"SoUtils" not in data:
            continue
        print("===", dex_name, "===")
        for m in re.finditer(rb"L[^;]{0,120};", data):
            s = m.group().decode("latin1", errors="replace")
            if "CharacterCrypto" in s or "SoUtils" in s or "SecurityMain" in s:
                print(s[1:-1].replace("/", "."))
