Skip to content

Commit

Permalink
fix: swap wifi and mobile network in HyperOS (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <[email protected]>
  • Loading branch information
NextAlone authored Oct 31, 2023
1 parent f5a9f9f commit 010c485
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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<String> 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]);
Expand Down

0 comments on commit 010c485

Please sign in to comment.