function hook() { Java.perform(function () { var JSON = Java.use("com.alibaba.fastjson.JSON") var Index_indexActModel = Java.use("com.fanwe.live.model.Index_indexActModel"); var gson = Java.use("com.google.gson.Gson").$new(); var LiveRoomModel = Java.use("com.fanwe.live.model.LiveRoomModel"); Java.use("com.fanwe.live.appview.main.LiveTabHotView$4").onSuccess.implementation = function (resp) { console.log("Entering Room List Parser => ", resp) var result = resp.getDecryptedResult(); // 转成json对象 var resultModel = JSON.parseObject(result, Index_indexActModel.class); // json转成java对象,并调用getList方法 var roomList = Java.cast(resultModel, Index_indexActModel).getList(); console.log("size : ", roomList.size(), roomList.get(0)) for (var i = 0; i < roomList.size(); i++) { var LiveRoomModelInfo = Java.cast(roomList.get(i), LiveRoomModel); console.log("roominfo: ", i, " ", gson.toJson(LiveRoomModelInfo)); }
return this.onSuccess(resp) } }) }
// 主动调用 function invoke(){ Java.perform(function(){ Java.choose("com.fanwe.live.appview.main.LiveTabHotView",{ onMatch:function(ins){ console.log("found ins => ",ins) ins.requestData(); },onComplete:function(){ console.log("Search completed!") } }) })
// 遍历类所有的域 function inspectObject(obj) { Java.perform(function () { const Class = Java.use("java.lang.Class"); const obj_class = Java.cast(obj.getClass(), Class); const fields = obj_class.getDeclaredFields(); const methods = obj_class.getMethods(); console.log("Inspecting " + obj.getClass().toString()); console.log("\tFields:"); for (var i in fields){ // console.log("\t\t" + fields[i].toString()); var className = obj_class.toString().trim().split(" ")[1] ; // console.log("className is => ",className); var fieldName = fields[i].toString().split(className.concat(".")).pop() ; console.log(fieldName + " => ",obj[fieldName].value); } // console.log("\tMethods:"); // for (var i in methods) // console.log("\t\t" + methods[i].toString()); }) }
// 打印调用结果的域及信息,类似wallbreaker function hookROOMinfo() { Java.perform(function () { var JSON = Java.use("com.alibaba.fastjson.JSON") var gson = Java.use("com.google.gson.Gson").$new(); var App_get_videoActModel = Java.use("com.fanwe.live.model.App_get_videoActModel");
Java.use("com.fanwe.live.business.LiveBusiness$2").onSuccess.implementation = function (resp) { console.log("Enter LiveBusiness$2 ... ", resp) var result = resp.getDecryptedResult(); var resultVideoModel = JSON.parseObject(result, App_get_videoActModel.class); var roomDetail = Java.cast(resultVideoModel, App_get_videoActModel); console.log("room id is => ", roomDetail.getRoom_id()); inspectObject(roomDetail); return this.onSuccess(resp); } })
var result = Java.use("com.fanwe.live.business.LiveBusiness").$new(ILiveActivityImpl.$new()); console.log("result is => ",result.requestRoomInfo("123454")) }) }
var LiveBusiness = null ; console.log("LiveBusiness is => ", LiveBusiness) function hook3(){ Java.perform(function(){ Java.use("com.fanwe.live.business.LiveBusiness").getLiveQualityData.implementation = function(){ LiveBusiness = this; console.log("now LiveBusiness is => ", LiveBusiness) LiveBusiness.requestRoomInfo("12343"); var result = this.getLiveQualityData() return result; } }) }
function invoke3(){ Java.perform(function(){ var result = LiveBusiness.requestRoomInfo("12343"); console.log("result is => ",result) }) }
function invoke4(){ Java.perform(function(){
// com.fanwe.live.business.LiveBusiness(ILiveActivity); var ILiveActivity = Java.use("com.fanwe.live.activity.room.ILiveActivity");
function hookROOMinfo() { Java.perform(function () { var JSON = Java.use("com.alibaba.fastjson.JSON") var gson = Java.use("com.google.gson.Gson").$new(); var App_get_videoActModel = Java.use("com.fanwe.live.model.App_get_videoActModel");
Java.use("com.fanwe.live.business.LiveBusiness$2").onSuccess.implementation = function (resp) { console.log("Enter LiveBusiness$2 ... ", resp) var result = resp.getDecryptedResult(); var resultVideoModel = JSON.parseObject(result, App_get_videoActModel.class); var roomDetail = Java.cast(resultVideoModel, App_get_videoActModel); console.log("room id is => ", roomDetail.getRoom_id()); inspectObject(roomDetail); return this.onSuccess(resp); } // 直接主动调用,设置房间号 // Java.use("com.fanwe.live.common.CommonInterface").requestRoomInfo.implementation = function (roomid, vod, key, ins) { // console.log("Calling common.CommonInterface.requestRoomInfo...") // return this.requestRoomInfo(1379212, vod, key, ins); // }