Skip to content

Commit

Permalink
Fix themed title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
shatyuka committed Mar 13, 2023
1 parent afaacda commit e971f11
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/com/shatyuka/zhiliao/hooks/NavRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public class NavRes implements IHook {
static Class<?> BottomNav;
static Class<?> BottomNavBgViewExploreA;
static Class<?> FeedConfigManager;

static Field BottomNavBgViewExploreA_right;
static Field BottomNavBgViewExploreA_center;
Expand Down Expand Up @@ -41,12 +42,16 @@ public void init(ClassLoader classLoader) throws Throwable {
BottomNavBgViewExploreA_center.setAccessible(true);
} catch (Throwable ignored) {
}
FeedConfigManager = Helper.findClass(classLoader, "com.zhihu.android.", (Class<?> FeedConfigManager) -> FeedConfigManager.getMethod("a").getReturnType().getDeclaredField("a").getType().equals(String.class));
}

@Override
public void hook() throws Throwable {
if (Helper.prefs.getBoolean("switch_mainswitch", false) && Helper.prefs.getBoolean("switch_navres", false)) {
XposedHelpers.findAndHookMethod(BottomNav, "b", XC_MethodReplacement.returnConstant(null));
if (FeedConfigManager != null) {
XposedHelpers.findAndHookMethod(FeedConfigManager, "a", XC_MethodReplacement.returnConstant(null));
}
}

if (Helper.prefs.getBoolean("switch_mainswitch", false) && Helper.prefs.getBoolean("switch_nipple", false)) {
Expand Down

0 comments on commit e971f11

Please sign in to comment.