与Frida的过载功能时,将元素从列表中删除
我用Frida和I Overload函数调试Android应用程序,该功能返回java.util.list< someObject>
我想从列表中删除第一个元素,该元素已返回该函数。
我该怎么做?
Java.perform(function x() {
var my_class = Java.use("a.b");
my_class.c.overload().implementation = function () {
var s= this.c(); // THE FUNCTION RETURN java.util.List<SomeObject>
//HERE I WANT TO REMOVE THE FIRST ELEMENT IN S
return s;
};
});
这是c
函数:
public List<SomeObject> c() {
return this.c;
}
I debug an android application with Frida and I overload function that return java.util.List<SomeObject>
I want to remove the first element from List that the function is return.
How can I do that please?
Java.perform(function x() {
var my_class = Java.use("a.b");
my_class.c.overload().implementation = function () {
var s= this.c(); // THE FUNCTION RETURN java.util.List<SomeObject>
//HERE I WANT TO REMOVE THE FIRST ELEMENT IN S
return s;
};
});
Here is c
function:
public List<SomeObject> c() {
return this.c;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您必须将变量
s
施加到java.util.list
,然后可以调用它上的方法或将其用作参数,例如创建新列表。如果列表
c()
返回是可变的:如果返回的列表是不可变的,则可以创建一个新的可变阵列,然后删除,则第一个元素:
可变列表为EG
arraylist
,linkedlist
。 EG是由list.of(...)
arrays.aslist(...)
创建的,通过用collections.unmodifiableist()< /code>,或通常通过stream/lambda表达式。
First you have to cast the variable
s
tojava.util.List
, then you can call methods on it or use it as argument, e.g. to create a new List.The following code works if the List
c()
returns is mutable:If the returned List is immutable you need to create a new mutable array and the delete then first element:
Mutable Lists are e.g.
ArrayList
,LinkedList
. Immutable are e.g. created byList.of(...)
Arrays.asList(...)
, by wraping a list withCollections.unmodifiableList()
or usually by stream/lambda expressions.