Skip to content

Instantly share code, notes, and snippets.

@tiiime
Last active May 6, 2022 06:41
Show Gist options
  • Save tiiime/e8ec790bdf3ab0e71c0f4a96bb940e62 to your computer and use it in GitHub Desktop.
Save tiiime/e8ec790bdf3ab0e71c0f4a96bb940e62 to your computer and use it in GitHub Desktop.
frrida log okhttp request
// frida -U ${package} -l request.js
Java.perform(function () {
var OkHttpClient = Java.use("okhttp3.OkHttpClient");
var RealCall = Java.use("okhttp3.RealCall");
OkHttpClient.newCall.implementation = function (request) {
var result = this.newCall(request)
console.log(request.toString())
return result
};
RealCall.getResponseWithInterceptorChain.implementation = function () {
var response = this.getResponseWithInterceptorChain()
console.log(response.toString())
return response
}
});
@evaleries
Copy link

You forgot the variable declaration "var" in line 8 and 14.
Line 8 should be
var result = this.newCall(request)
and line 14
var response = this.getResponseWithInterceptorChain()

@alt-fox
Copy link

alt-fox commented May 6, 2021

sometimes u need use this ->
Java.use("okhttp3.internal.connection.RealCall");
getResponseWithInterceptorChain$okhttp();
:)

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