def __init__(self, manObj, apk):
     self.jadx = pyjadx.Jadx()
     self.m = manObj
     self.apk = apk
     self.package = self.m.getPackageName()
     self.potentialLogs = list()
     self.potentialWebView = list()
     self.hardcodedUrl = list()
     self.ipaddr = list()
     self.mitd = list()
     try:
         self.app = self.jadx.load(self.apk)
     except Exception as e:
         print(e)
Ejemplo n.º 2
0
def load_apk(apk, i):
    print(apk, i)
    jadx = pyjadx.Jadx()
    jadx.load(args.apk)
Ejemplo n.º 3
0
import pyjadx
import sys
import argparse
import pygments
import pathlib

jadx = pyjadx.Jadx()


def pretty_print(apk, classes):
    apk_path = pathlib.Path(apk).resolve().absolute()
    decompiler = jadx.load(apk_path.as_posix())
    if classes:
        for cls in classes:
            try:
                cls_decompiled = decompiler.get_class(cls)
                print(cls_decompiled.code_highlight)
            except Exception as e:
                print(f"Error while dealing with '{cls}': '{e}'!",
                      file=sys.stderr)
    else:
        for c in decompiler.classes:
            print(c.code_highlight)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Example of pyjadx associated with pygments")
    parser.add_argument("apk", help="Target apk")
    parser.add_argument("--classes",
                        type=str,