androscalpel/test.py
2023-12-04 14:09:19 +01:00

21 lines
461 B
Python

import logging
FORMAT = "[%(levelname)s] %(name)s %(filename)s:%(lineno)d: %(message)s"
logging.basicConfig(format=FORMAT)
logging.getLogger().setLevel(logging.DEBUG)
import androscalpel as asc
import zipfile as z
from androscalpel import *
APK_NAME = "test.apk"
DEX_NAME = "classes.dex"
with z.ZipFile(APK_NAME) as zipf:
with zipf.open(DEX_NAME, "r") as dex:
dex = dex.read()
apk = asc.Apk()
apk.add_dex_file(dex)
dex_raw = apk.gen_raw_dex()