From eda7e563b50fb8bf203fef3d08efbd37be57329c Mon Sep 17 00:00:00 2001 From: mkx173 Date: Wed, 3 Apr 2024 20:40:42 -0700 Subject: [PATCH] fix: removing top_level_navi causes various visual issues --- .../tieba/tabswitch/hooker/TSPreference.java | 2 +- .../tabswitch/hooker/eliminate/Purge.java | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/gm/tieba/tabswitch/hooker/TSPreference.java b/app/src/main/java/gm/tieba/tabswitch/hooker/TSPreference.java index f8910465..94539eb3 100644 --- a/app/src/main/java/gm/tieba/tabswitch/hooker/TSPreference.java +++ b/app/src/main/java/gm/tieba/tabswitch/hooker/TSPreference.java @@ -189,7 +189,7 @@ private LinearLayout createRootPreference(final Activity activity) { } preferenceLayout.addView(new SwitchButtonHolder(activity, "净化进吧", "purge_enter", SwitchButtonHolder.TYPE_SWITCH)); preferenceLayout.addView(new SwitchButtonHolder(activity, "净化我的", "purge_my", SwitchButtonHolder.TYPE_SWITCH)); - preferenceLayout.addView(new SwitchButtonHolder(activity, "净化置顶帖", "fold_top_card_view", SwitchButtonHolder.TYPE_SWITCH)); + preferenceLayout.addView(new SwitchButtonHolder(activity, "默认折叠置顶帖", "fold_top_card_view", SwitchButtonHolder.TYPE_SWITCH)); preferenceLayout.addView(new SwitchButtonHolder(activity, "只推荐已关注的吧", "follow_filter", SwitchButtonHolder.TYPE_SWITCH)); preferenceLayout.addView(new SwitchButtonHolder(activity, "屏蔽首页视频贴", "purge_video", SwitchButtonHolder.TYPE_SWITCH)); preferenceLayout.addView(new SwitchButtonHolder(activity, "过滤首页推荐", "personalized_filter", SwitchButtonHolder.TYPE_DIALOG)); diff --git a/app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/Purge.java b/app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/Purge.java index 78cff176..639be42e 100644 --- a/app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/Purge.java +++ b/app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/Purge.java @@ -51,7 +51,7 @@ public List matchers() { new StringMatcher("准备展示精灵动画提示控件"), new StringMatcher("TbChannelJsInterfaceNew"), new StringMatcher("bottom_bubble_config"), - new StringMatcher("top_level_navi"), +// new StringMatcher("top_level_navi"), new StringMatcher("index_tab_info"), new SmaliMatcher("Lcom/baidu/tbadk/coreExtra/floatCardView/AlaLiveTipView;->(Landroid/content/Context;)V"), new SmaliMatcher("Lcom/baidu/tbadk/editortools/meme/pan/SpriteMemePan;->(Landroid/content/Context;)V"), @@ -100,17 +100,17 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { }); } break; - case "top_level_navi": // 首页活动背景 - if (method.equals("invoke")) { - XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() { - @Override - protected void beforeHookedMethod(MethodHookParam param) throws Throwable { - JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class); - syncData.put("top_level_navi", null); - } - }); - } - break; +// case "top_level_navi": // 首页活动背景 +// if (method.equals("invoke")) { +// XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() { +// @Override +// protected void beforeHookedMethod(MethodHookParam param) throws Throwable { +// JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class); +// syncData.put("top_level_navi", null); +// } +// }); +// } +// break; case "index_tab_info": // 首页活动Tab (202), 直播Tab (6) if (method.equals("invoke")) { XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() {