frida read file from android device report error

45 Views Asked by At

I would like to use frida 16.2.1 read a file from android13 device. I try below code but it reports the following error:

[*] [type]: error

[*] [description]: Error: expected an unsigned integer
   var String = Java.use("java.lang.String")
    var Files = Java.use("java.nio.file.Files")
    var Paths = Java.use("java.nio.file.Paths")
    var URI = Java.use("java.net.URI")
    
    var path = Paths.get(URI.create("file://" + pathName))
    var fileBytes = Files.readAllBytes(path) // crash at this line
    var content = String.$new(fileBytes)
    return content
             
}

The crashed line is using a Path object, not sure why frida report expect unsigned int.

0

There are 0 best solutions below