In this guide I will show how to write scripts in Frida. The idea is not to show how Frida works or what can be done with it, there are plenty of those kind of blogs around. While using this amazing tool I find sometimes hard to know how to write a script in order to make the application do what I want to, and as the documentation does not go too deep on that, sometimes I find myself going through different examples till I find how to solve something related to the syntaxis of the Java bridge. So I wrote this guide in order to concentrate that knowledge in one place.
The content is divided in several pages, in order to make it easily searchable. In the content you’ll find how to write Java code in the Frida-bridge syntaxis. So I’ll go through different Java language features and how to write it as a script in Frida. In order to do this, I wrote an application that has many classes that uses different components (like Interfaces, arrays or anonymous classes). Each page will have a brief introduction of the Java feature (not a through one, as it is only intended to make the user understand what is being done in the code), explain how to do the same with Frida and then an example of how it was done in the demo application. The source code and the application can be downloaded from the following github page: https://github.com/CesarMRodriguez/frida-scripting-guide/