Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] frida snippet log should print the renamed function name #1772

Closed
Ran-Naor opened this issue Jan 27, 2023 · 1 comment
Closed

[feature] frida snippet log should print the renamed function name #1772

Ran-Naor opened this issue Jan 27, 2023 · 1 comment

Comments

@Ran-Naor
Copy link
Contributor

When copying a frida snippet of a function the console.log contains the original name, even if you rename the function.
Lets say I rename the function "a" in class "SomeManager" to "startWork".
current frida snippet -

let SomeManager = Java.use("com.example.SomeManager");
SomeManager["a"].overload('android.content.Context').implementation = function (context) {
    console.log('SomeManager.a is called' + ', ' + 'context: ' + context);
    let ret = this["a"](context);
    console.log('SomeManager.a return: ' + ret);
    return ret;
};

new frida snippet would look like this -

let SomeManager = Java.use("com.example.SomeManager");
SomeManager["a"].overload('android.content.Context').implementation = function (context) {
    console.log('SomeManager.startWork is called' + ', ' + 'context: ' + context);
    let ret = this["a"](context);
    console.log('SomeManager.startWork return: ' + ret);
    return ret;
};

I will add the code for this change in a PR :).

skylot pushed a commit that referenced this issue Jan 28, 2023
…)(PR #1773)

* frida snippet log now prints the correct method name if the method was renamed
* fixed spotless check in frida snippet
* get the renamed method name from the alias proprety and changed to format string to fit frida-trace style
* fixed import order to fix gradle spotless warning
@skylot
Copy link
Owner

skylot commented Jan 28, 2023

PR merged. Thanks! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants