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

APK = Path(__file__).resolve().parent.parent / "apks" / "maribank_sg_base.apk"
with zipfile.ZipFile(str(APK)) as zf:
    d = b"".join(zf.read(n) for n in zf.namelist() if n.endswith(".dex"))

for m in re.finditer(rb"CharacterCrypto[\w$]{0,40}", d):
    print(m.group().decode())

for m in re.finditer(rb"getDfp[\w$]{0,20}", d):
    s = m.group().decode()
    if s not in ("getDfp",):
        print("method:", s)

# utils.d wrapper
for m in re.finditer(rb"Lcom/shopee/bke/lib/jni/utils/[\w$]{1,20};", d):
    print(m.group().decode()[1:-1].replace("/", "."))
