吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 531|回复: 0
收起左侧

[其他求助] Xposed如何HOOK自定义类型变量?

[复制链接]
908783647 发表于 2024-5-3 17:10
25吾爱币
我想hook queryShareTypes函数中的形参,Xposed如果写,我这样写会报错?

[Java] 纯文本查看 复制代码
                            XposedHelpers.findAndHookMethod(hookclass, "queryShareTypes", t.class,a.class, r.class, new XC_MethodHook() {
                                        @Override
                                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                                            // 获取方法的参数
                                            Object tVar = param.args[0];
                                            Object aVar = param.args[1];
                                            Object rVar = param.args[2];

                                            // 打印参数
                                            if (tVar != null && aVar != null && rVar != null) {
                                                // 做一些日志记录或其他操作
                                                System.out.println("queryShareTypes 入参 tVar: " + tVar.toString());
                                                System.out.println("queryShareTypes 入参 aVar: " + aVar.toString());
                                                System.out.println("queryShareTypes 入参 rVar: " + rVar.toString());
                                            }
                                        }

                                    });


[Java] 纯文本查看 复制代码
    public void queryShareTypes(final t tVar, final a aVar, final r<JSONObject> rVar) {
        if (tVar.f20800a != null && !TextUtils.isEmpty(tVar.f20800a.toString())) {
            HttpCall.Builder builder = new HttpCall.Builder();
            builder.url(com.xunmeng.pinduoduo.aj.b.a(NewBaseApplication.b) + "/api/flow/audience/share/types").header(com.xunmeng.pinduoduo.aj.c.b()).method("POST").params(tVar.f20800a.toString()).callbackOnMain(true).callback(new CommonCallback<JSONObject>() { // from class: com.xunmeng.pinduoduo.share.web.WebShare.3
                [url=home.php?mod=space&uid=1892347]@Override[/url] // com.xunmeng.pinduoduo.basekit.http.callback.CommonCallback
                /* renamed from: e */
                public void onResponseSuccess(int i, JSONObject jSONObject) {
                    Logger.logI(com.pushsdk.a.d, "\u0005\u00074SL\u0005\u0007%s", "0", jSONObject);
                    WebShare.this.handleTypeResponse(aVar.a(), tVar.e("page_sn"), jSONObject, rVar);
                }

                @Override // com.xunmeng.pinduoduo.basekit.http.callback.BaseCallback
                public void onResponseError(int i, HttpError httpError) {
                    Logger.logE(com.pushsdk.a.d, "\u0005\u00074Tg\u0005\u0007%d\u0005\u0007%s", "0", Integer.valueOf(i), httpError);
                    u.a(8);
                    rVar.a(60009, null);
                }

                {
                    WebShare.this = this;
                }

                @Override // com.xunmeng.pinduoduo.basekit.http.callback.BaseCallback
                public void onFailure(Exception exc) {
                    Logger.e("AppShare.WebShare", "types onFailure", exc);
                    u.a(8);
                    rVar.a(60009, null);
                }
            }).build().execute();
            com.xunmeng.pinduoduo.share.c.b.a(tVar.e("page_sn"), tVar.e("scene_id"));
            return;
        }
        Logger.logE(com.pushsdk.a.d, "\u0005\u00074Uh", "0");
        u.a(16);
        rVar.a(60003, null);
    }


[Java] 纯文本查看 复制代码
public class t {

    /* renamed from: a  reason: collision with root package name */
    public final JSONObject f20800a;

    public String e(String str) {
        return d(str, null);
    }

    public int g(String str) {
        return f(str, 0);
    }

    public JSONObject b(String str) {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject == null) {
            return null;
        }
        return jSONObject.optJSONObject(str);
    }

    public JSONArray c(String str) {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject == null) {
            return null;
        }
        return jSONObject.optJSONArray(str);
    }

    public String d(String str, String str2) {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject != null) {
            return jSONObject.optString(str, str2);
        }
        return str2;
    }

    public int f(String str, int i) {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject != null) {
            return jSONObject.optInt(str, i);
        }
        return i;
    }

    public boolean h(String str, boolean z) {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject != null) {
            return jSONObject.optBoolean(str, z);
        }
        return z;
    }

    public String toString() {
        JSONObject jSONObject = this.f20800a;
        if (jSONObject == null) {
            return com.pushsdk.a.d;
        }
        return jSONObject.toString();
    }

    public t(JSONObject jSONObject) {
        this.f20800a = jSONObject;
    }
}


[Asm] 纯文本查看 复制代码
    public interface a {
        Context a();

        String b();

        r<JSONObject> c(String str);

        r<JSONObject> d(JSONObject jSONObject, String str);
    }


[Java] 纯文本查看 复制代码
public interface r<T> {
    void a(int i, T t);
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-11 18:43

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表