Marsss
V2EX  ›  Android

Xposed 如何重复调用某个函数?

  •  
  •   Marsss · Sep 19, 2017 · 16160 views
    This topic created in 3183 days ago, the information mentioned may be changed or developed.
    这个神器好像只能当某个方法在被执行的时候,去 hook 它。却不能获取该方法后,再次调用它?

    如上图所示,我已经能成功的 hook 到这个 com.xxxxxx.h.g 里面的"a"方法,也能正确显示 afterhook 之后函数的运行结果,但如果我还想再次让这个函数"a"运行一次呢?我试过 callMethod 方法,但好像不是用来做这个的。。。如何用 xposed 来主动触发应用程序的某个函数呢?

    求指点。。。
    3 replies    2017-09-19 22:52:09 +08:00
    yangff
        1
    yangff  
       Sep 19, 2017
    param.thisObject.a(...)吧
    Marsss
        2
    Marsss  
    OP
       Sep 19, 2017
    @yangff 这样能触发"a"执行吗?我试试。。
    donething
        3
    donething  
       Sep 19, 2017
    可以通过”反射“调用方法。
    不过你还需要考虑一件事:递归会导致这个方法一直调用下去
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5329 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 09:18 · PVG 17:18 · LAX 02:18 · JFK 05:18
    ♥ Do have faith in what you're doing.