Xposed hook 抖音底部tab隐藏

281 阅读1分钟

Xposed hook 抖音底部tab隐藏

以抖音2390为例子

X.Rqb类方法如下:

public final MainTab LIZ(Context context, String str) {
    MainTab s5c;
    ChangeQuickRedirect changeQuickRedirect = LIZ;
    if (PatchProxy.isEnable(changeQuickRedirect)) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{context, str}, this, changeQuickRedirect, false, 2);
        if (proxy.isSupported) {
            return (MainTab) proxy.result;
        }
    }
    C91647ZkD.LIZ(context, str);
    String LIZ2 = C71778RsW.LIZJ.LIZ(str);
    if (Intrinsics.areEqual(LIZ2, "PUBLISH")) {
        s5c = new C72386S5o(context);
    } else {
        s5c = new S5C(context, LIZ2, true);
    }
    LIZ(str, s5c);
    return s5c;
}

LIZ返回值为MainTab ,通过参数tabid来判断是否返回正确的mainTab,如果是需要隐藏的,就返回null.

Class<?> Rqb = XposedHelpers.findClass("X.Rqb", lpparam.classLoader);
XposedHelpers.findAndHookMethod(Rqb, "LIZ", Context.class, String.class, new XC_MethodHook() {
    @Override
    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
        super.beforeHookedMethod(param);
        if (param == null) return;
        Object obj = param.args[1];
        if (obj instanceof String) {
            String tab = (String) obj;
            Log.e(TAG, "X.enc:" + tab);
            //homepage_home  homepage_familiar homepage_publish homepage_notification homepage_profile
            //隐藏底部商城tab ,可替换其他
            if (tab.contains("homepage_mall")) {
                param.setResult((Object) null);
            }
        }
    }
});

本文由博客一文多发平台 OpenWrite 发布!