import frida, sys

jscode = """
Java.perform(function () {
    var utils = Java.use('com.xiaojianbang.app.Utils');
    utils.getCalc.implementation = function (a, b) {
        console.log("Hook Start...");
        send(arguments[0]);
        send(b);
        send("Success!");
        var num = this._getCalc(100, 200, 300);
        send(num);
        return num;
    }
});
"""
'''

'''
def message(message, data):
    if message["type"] == 'send':
        print("[*] {0}".format(message['payload']))
    else:
        print(message)

#get_remote_device 获取远程设备 (get_usb_device)  attach附加进程
process = frida.get_remote_device().attach('com.xiaojianbang.app')
script= process.create_script(jscode)
script.on("message", message)  #绑定一个事件
script.load()
sys.stdin.read()

frida hook普通方法
frida hook普通方法

frida server下载 https://github.com/frida/frida/releases
先要看构架
adb shell getprop ro.product.cpu.abi