我可以帮您翻译。以下是翻译结果:
这个公共对象没有getter,所以我必须使用另一个对象(我们称之为“Bye”)的方法(byeMethodB)来监视这个值。
这是我的Frida脚本的样子:
我一直在尝试使用Frida钩取安卓应用程序时打印列表内容,但没有成功。
我想要在Java中钩取的对象如下所示:
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
public final class Hello extends HelloParent{
@JsonIgnore
public final List sampleList;
}
这个公共对象没有getter,所以我必须使用另一个对象(我们称之为“Bye”)的方法(byeMethodB)来监视这个值。
这是我的Frida脚本的样子:
setTimeout(function() {
Java.perform(function(){
Java.use("Bye").byeMethodA.implementation = function(){
try{
//Returns a Hello object
var helloObject = Java.cast(this.byeMethodB(),Java.use("Hello"))
printListContent(Java.cast(helloObject.sampleList,Java.use("java.util.List"))))
}catch(err){
console.log(err)
}
}
})
},1000)
function printListContent(list){
var listIter = list.iterator()
while(listIter.hasNext()){
console.log(listIter.next())
}
}
如果不将“helloObject.sampleList”对象转换为列表,输出结果如下:
[object Object]
所以我确定它不是null
如果我使用Java.cast(helloObject.sampleList,Java.use("java.util.List"))
进行转换,
我会得到以下错误:
我也尝试过:
Java.cast(helloObject.sampleList,Java.use("java.util.List<>"))
我非常确定它是一个字符串
Java.cast(helloObject.sampleList,Java.use("java.util.List<String>"))
(我认为这是一个字符串)
Java.cast(helloObject.sampleList,Java.use("java.util.List<java.lang.String>"))
Java.cast(helloObject.sampleList,Java.use("[String"))
Java.cast(helloObject.sampleList,Java.use("[Ljava.lang.String"))
进展非常不顺利。希望能得到一些帮助。