视频讲解:https://www.bilibili.com/video/BV1Tr4y187g1?p=2&spm_id_from=333.999.header_right.history_list.click
我没测试,直接copy视频作者的 hhhh
function main() {
Java.perform(function () {
var database_addr = Java.use('com.tencent.wcdb.database.SQLiteDatabase');
console.log(database_addr);
database_addr.insertWithOnConflict.implementation = function (arg0, arg1, arg2, arg3) {
console.log(arg0);
console.log(arg1);
var content = arg2.toString();
console.log(content);
console.log(arg3);
if ((arg0 == "message") && content.indexOf("isSend=0") >= 0) {
var wxid = content.match('talker=(.*?) content')[1];
console.log("可以回复消息",wxid);
// send("你好吗");
//主动调用发消息函数
Java.choose("com.tencent.mm.ui.chatting.s",{
onMatch:function(instance){
instance.aLe("你好吗");
},onComplete:function(){}
});
}
return this.insertWithOnConflict(arg0, arg1, arg2, arg3);
}
Java.use("com.tencent.mm.ui.chatting.d.a").getTalkerUserName.implementation = function(){
var result = this.getTalkerUserName();
console.log("返回的微信ID",result);
return result;
}
});
}
// function send(text){
// Java.use("com.tencent.mm.ui.chatting.s").aLe.implementation = function(args){
// // console.log("发送消息内容",args);
// var result = this.aLe(text);
// console.log("发送是否成功",result);
// return result;
// }
// }
setImmediate(main)