// Read-only hook: log LiteApp (Mini Program) generic CGI transfer calls. // Does NOT modify parameters or block the call — pure observation. // // This plain-source version is for `frida -l script.js` (CLI), which // auto-bundles frida-java-bridge so a bare `Java` global just works. // `multi_spawn_hook.py` (raw Python bindings, no auto-bundling, and no // `require()` either) needs the pre-compiled `hook_lite_transfer_bundled.js` // instead — see that file's header for how it was built. Java.perform(function () { function hookClass(clsName) { try { var cls = Java.use(clsName); cls.a.overload('java.lang.String', 'org.json.JSONObject', 'boolean').implementation = function (p1, p2, p3) { try { console.log("\n[hook] " + clsName + ".a() called at " + new Date().toISOString()); console.log(" arg1 (appid/auth?): " + p1); console.log(" arg2 (json params): " + (p2 !== null ? p2.toString() : "null")); console.log(" arg3 (flag): " + p3); } catch (e) { console.log("[hook] logging error: " + e); } return this.a(p1, p2, p3); }; console.log("[hook] hooked " + clsName + ".a(String, JSONObject, boolean)"); } catch (e) { console.log("[hook] FAILED to hook " + clsName + ": " + e); } } hookClass("com.tencent.mm.plugin.lite.jsapi.comms.k2"); hookClass("com.tencent.mm.plugin.lite.jsapi.comms.y7"); });