Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
remove element from list while overload function with Frida

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;
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

First you have to cast the variable s to java.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:

let s = this.c(); 
let list = Java.cast(s, Java.use("java.util.List"));
list.remove(0);
return list;

If the returned List is immutable you need to create a new mutable array and the delete then first element:

let s = this.c(); 
let list = Java.cast(s, Java.use("java.util.List"));
let newList = Java.use("java.util.ArrayList").$new(list);
newList.remove(0);
return newList;

Mutable Lists are e.g. ArrayList, LinkedList. Immutable are e.g. created by List.of(...) Arrays.asList(...), by wraping a list with Collections.unmodifiableList() or usually by stream/lambda expressions.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!