Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple Frida script to log (console output) targeted methods when called
Java.perform(function() {
const targetClass = Java.use('com.example.TargetClass');
targetClass.targetMethod.implementation = function() {
const argumentsJson = JSON.stringify(arguments, null, 2);
const returnValue = targetClass.targetMethod.apply(this, arguments);
console.log('TARGETED_METHOD_CALLED');
console.log('ARGUMENTS:', argumentsJson);
console.log('RETURN_VALUE:', returnValue);
return returnValue;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment