One comment on “Xposed: Hook and Read okhttp3.Response Body Without Failures

  1. Hello, I’m trying to do same thing in Android 6.0 API 23 which uses package as “” , here is my edited code based on your approach. But it always returns an empty response body.

    XposedHelpers.findAndHookConstructor(“”, lpparam.classLoader, “$Builder”, new XC_MethodHook() {
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
    Object responseBody = XposedHelpers.getObjectField(param.args[0], “body”);
    if (responseBody != null) {
    if (responseBody.getClass().getCanonicalName().equals(“”)) {
    Object source = XposedHelpers.getObjectField(responseBody, “source”);
    Object buffer = XposedHelpers.callMethod(source, “buffer”);
    Object copy = XposedHelpers.callMethod(buffer, “clone”);
    Object body = XposedHelpers.callMethod(copy, “readUtf8”);
    new MyLogger().log(TAG, “okhttp3.Response constructor body : ” + body);



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s