Beispiel #1
0
    def test(self):
        dc = DvClass(c, dx)
        dc.process()

        self.assertIsNotNone(dc.get_source())
Beispiel #2
0
        return on_create


# get the main activity
main_act = format_activity_name(apk_obj.get_main_activity())
main_analysis: ClassAnalysis = dx.get_class_analysis(main_act)

on_create: MethodClassAnalysis = find_on_create(main_analysis)
on_create_enc = on_create.method

if on_create:
    main_ast = {}
    for name, cls in sorted(machine.classes.items()):
        if name == on_create.class_name:
            if not isinstance(cls, DvClass):
                cls = DvClass(cls, machine.vma)
            cls.process(doAST=True)
            main_ast[name] = cls.get_ast()

    print("Analyzing callbacks...")
    cbs = get_registered_callbacks(main_act, "onCreate", ast=main_ast)
    cb_methods = get_cb_methods()

    found_methods = list()
    for cb_typ, cb_interface in cbs:
        if cb_interface in cb_methods:
            java_interface: JavaInterface = cb_methods[cb_interface]
        else:
            continue
        interface_method: JavaMethod
def dvclass(c, dx):
    dc = DvClass(c, dx)
    dc.process()

    assert dc.get_source() is not None
def dvclass(c, dx):
    dc = DvClass(c, dx)
    dc.process()

    assert dc.get_source() is not None