From 010c48547d5d1d75c9deb8b5b40fdb9952361515 Mon Sep 17 00:00:00 2001 From: NextAlone <12210746+NextAlone@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:17:16 +0800 Subject: [PATCH] fix: swap wifi and mobile network in HyperOS (#7) Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com> --- .../statusbar/icon/all/StatusBarIconPositionAdjust.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/StatusBarIconPositionAdjust.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/StatusBarIconPositionAdjust.java index a3ad3ebca6..fc378636e7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/StatusBarIconPositionAdjust.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/StatusBarIconPositionAdjust.java @@ -145,15 +145,15 @@ protected void after(MethodHookParam param) { findAndHookConstructor(mStatusBarIconList, String[].class, new MethodHook() { @Override protected void before(MethodHookParam param) { - boolean isRightController = "StatusBarIconControllerImpl".equals(param.thisObject.getClass().getSimpleName()); + boolean isRightController = "StatusBarIconList".equals(param.thisObject.getClass().getSimpleName()); ArrayList allStatusIcons = new ArrayList<>(Arrays.asList((String[]) param.args[0])); if (isRightController) { - int startIndex = allStatusIcons.indexOf("no_sim"); + int startIndex = allStatusIcons.indexOf("mobile"); int endIndex = allStatusIcons.indexOf("demo_wifi") + 1; List removedIcons = allStatusIcons.subList(startIndex, endIndex); removedIcons.clear(); if (!isMoveLeft) { - startIndex = allStatusIcons.indexOf("ethernet"); + startIndex = allStatusIcons.indexOf("hd"); allStatusIcons.addAll(startIndex + 1, mSignalRelatedIcons); } param.args[0] = allStatusIcons.toArray(new String[0]);