From d5d2ea552051ff92b919ceee9e29fb46aaa4f373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=83=E6=9F=92=E6=9F=92?= Date: Sun, 24 Nov 2024 00:21:43 +0800 Subject: [PATCH] opt: codes (skip post -> skp) --- .github/workflows/ci_build.yml | 2 +- .github/workflows/release_build.yml | 4 +-- .../module/app/SystemUI/Pad/SystemUiV.java | 36 ------------------- .../module/app/SystemUI/Phone/SystemUiV.java | 19 ---------- .../statusbar/model/MobileTypeSingle2Hook.kt | 3 +- 5 files changed, 5 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index 5c5fad5135..944a7274c0 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -99,7 +99,7 @@ jobs: compression-level: 9 push_to_canary_channel: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.ref_type != 'tag' && !contains(github.event.head_commit.message, '[skip post]') && !contains(github.event.head_commit.message, 's#') + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.ref_type != 'tag' && !contains(github.event.head_commit.message, '[skp]') && !contains(github.event.head_commit.message, 's#') runs-on: ubuntu-latest name: Push to Canary Channel needs: build_app diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index a8649be536..5f66bfcf4e 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -63,14 +63,14 @@ jobs: echo "|Canary|$canary" >> $GITHUB_STEP_SUMMARY - name: Upload Canary APK - if: ${{ contains(github.event.head_commit.message, '[unupload]') == false && contains(github.event.head_commit.message, '[skip post]') == false }} + if: ${{ contains(github.event.head_commit.message, '[unupload]') == false && contains(github.event.head_commit.message, '[skp]') == false }} uses: actions/upload-artifact@v4 with: name: HyperCeiler Canary path: ${{ env.APK_FILE_CANARY }} - name: Post to Canary Channel - if: ${{ github.ref == 'refs/heads/main' && github.ref_type != 'tag' && contains(github.event.head_commit.message, '[skip post]') == false && contains(github.event.head_commit.message, 's#') == false }} + if: ${{ github.ref == 'refs/heads/main' && github.ref_type != 'tag' && contains(github.event.head_commit.message, '[skp]') == false && contains(github.event.head_commit.message, 's#') == false }} shell: bash env: CHANNEL_ID: ${{ secrets.CHANNEL_ID }} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Pad/SystemUiV.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Pad/SystemUiV.java index a50b6f412b..d6210d7f64 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Pad/SystemUiV.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Pad/SystemUiV.java @@ -166,23 +166,6 @@ public void handleLoadPackage() { initHook(HideVoWiFiIcon.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_icon_vowifi") || mPrefsMap.getBoolean("system_ui_status_bar_icon_volte")); initHook(new StickyFloatingWindowsForSystemUI(), mPrefsMap.getBoolean("system_framework_freeform_sticky")); - // 移动网络图标 - boolean isEnableMobilePublic = mPrefsMap.getBoolean("system_ui_status_bar_icon_mobile_network_hide_card_1") || - mPrefsMap.getBoolean("system_ui_status_bar_icon_mobile_network_hide_card_2") || - mPrefsMap.getStringAsInt("system_ui_status_bar_icon_show_mobile_network_type", 0) != 0 || - mPrefsMap.getBoolean("system_ui_status_bar_mobile_hide_roaming_icon") || - mPrefsMap.getBoolean("system_ui_statusbar_mobile_type_enable") || - mPrefsMap.getBoolean("system_ui_status_bar_mobile_indicator"); - boolean isEnableMobileNetwork = mPrefsMap.getStringAsInt("system_ui_status_bar_icon_small_hd", 0) != 0 || - mPrefsMap.getStringAsInt("system_ui_status_bar_icon_big_hd", 0) != 0 || - mPrefsMap.getStringAsInt("system_ui_status_bar_icon_new_hd", 0) != 0; - - initHook(MobilePublicHook.INSTANCE, isEnableMobilePublic); - initHook(new MobileNetwork(), isEnableMobileNetwork); - initHook(new DualRowSignalHook(), mPrefsMap.getBoolean("system_ui_statusbar_network_icon_enable")); - initHook(MobileTypeSingleHook.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_mobile_type_enable")); - initHook(MobileTypeTextCustom.INSTANCE, !Objects.equals(mPrefsMap.getString("system_ui_status_bar_mobile_type_custom", ""), "")); - // 电池相关 boolean isHideBatteryIcon = mPrefsMap.getBoolean("system_ui_status_bar_battery_icon") || mPrefsMap.getBoolean("system_ui_status_bar_battery_percent") || @@ -217,30 +200,11 @@ public void handleLoadPackage() { // 灵动舞台 initHook(HideStrongToast.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_hide_smart_strong_toast")); - // 居右显示 - boolean isWiFiAtLeft = mPrefsMap.getBoolean("system_ui_status_bar_wifi_at_left"); - boolean isMobileNetworkAtLeft = mPrefsMap.getBoolean("system_ui_status_bar_mobile_network_at_left"); - - boolean isNetworkSpeedAtRight = mPrefsMap.getBoolean("system_ui_status_bar_network_speed_at_right"); - boolean isAlarmClockAtRight = mPrefsMap.getBoolean("system_ui_status_bar_alarm_clock_at_right"); - boolean isNFCAtRight = mPrefsMap.getBoolean("system_ui_status_bar_nfc_at_right"); - boolean isVolumeAtRight = mPrefsMap.getBoolean("system_ui_status_bar_volume_at_right"); - boolean isZenAtRight = mPrefsMap.getBoolean("system_ui_status_bar_zen_at_right"); - - boolean isSwapWiFiAndMobileNetwork = mPrefsMap.getBoolean("system_ui_status_bar_swap_wifi_and_mobile_network"); - - boolean isStatusBarIconAtRightEnable = isWiFiAtLeft || isMobileNetworkAtLeft || isSwapWiFiAndMobileNetwork || isNetworkSpeedAtRight || isAlarmClockAtRight || isNFCAtRight || isVolumeAtRight || isZenAtRight; - - initHook(new StatusBarIconPositionAdjust(), isStatusBarIconAtRightEnable); - // 导航栏 initHook(new HandleLineCustom(), mPrefsMap.getBoolean("system_ui_navigation_handle_custom")); initHook(new NavigationCustom(), mPrefsMap.getBoolean("system_ui_navigation_custom")); initHook(new HideNavigationBar(), mPrefsMap.getBoolean("system_ui_hide_navigation_bar")); initHook(new RotationButton(), mPrefsMap.getStringAsInt("system_framework_other_rotation_button_int", 0) != 0); - // 状态栏布局 - initHook(StatusBarLayout.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_layout_compatibility_mode") || - mPrefsMap.getStringAsInt("system_ui_statusbar_layout_mode", 0) != 0); // 实验性功能 // initHook(new SwitchControlPanel(), false); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java index b91fd5aa5d..d60cda2d01 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java @@ -212,30 +212,11 @@ public void handleLoadPackage() { // 灵动舞台 initHook(HideStrongToast.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_hide_smart_strong_toast")); - // 居右显示 - boolean isWiFiAtLeft = mPrefsMap.getBoolean("system_ui_status_bar_wifi_at_left"); - boolean isMobileNetworkAtLeft = mPrefsMap.getBoolean("system_ui_status_bar_mobile_network_at_left"); - - boolean isNetworkSpeedAtRight = mPrefsMap.getBoolean("system_ui_status_bar_network_speed_at_right"); - boolean isAlarmClockAtRight = mPrefsMap.getBoolean("system_ui_status_bar_alarm_clock_at_right"); - boolean isNFCAtRight = mPrefsMap.getBoolean("system_ui_status_bar_nfc_at_right"); - boolean isVolumeAtRight = mPrefsMap.getBoolean("system_ui_status_bar_volume_at_right"); - boolean isZenAtRight = mPrefsMap.getBoolean("system_ui_status_bar_zen_at_right"); - - boolean isSwapWiFiAndMobileNetwork = mPrefsMap.getBoolean("system_ui_status_bar_swap_wifi_and_mobile_network"); - - boolean isStatusBarIconAtRightEnable = isWiFiAtLeft || isMobileNetworkAtLeft || isSwapWiFiAndMobileNetwork || isNetworkSpeedAtRight || isAlarmClockAtRight || isNFCAtRight || isVolumeAtRight || isZenAtRight; - - initHook(new StatusBarIconPositionAdjust(), isStatusBarIconAtRightEnable); - // 导航栏 initHook(new HandleLineCustom(), mPrefsMap.getBoolean("system_ui_navigation_handle_custom")); initHook(new NavigationCustom(), mPrefsMap.getBoolean("system_ui_navigation_custom")); initHook(new HideNavigationBar(), mPrefsMap.getBoolean("system_ui_hide_navigation_bar")); initHook(new RotationButton(), mPrefsMap.getStringAsInt("system_framework_other_rotation_button_int", 0) != 0); - // 状态栏布局 - initHook(StatusBarLayout.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_layout_compatibility_mode") || - mPrefsMap.getStringAsInt("system_ui_statusbar_layout_mode", 0) != 0); // 实验性功能 // initHook(new SwitchControlPanel(), false); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/model/MobileTypeSingle2Hook.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/model/MobileTypeSingle2Hook.kt index 3da7f25acf..e769dbf4e0 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/model/MobileTypeSingle2Hook.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/model/MobileTypeSingle2Hook.kt @@ -38,6 +38,7 @@ import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.Mobi import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.getLocation import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.hideIndicator import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.hideRoaming +import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.isEnableDouble import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.leftMargin import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.rightMargin import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public.MobilePrefs.showMobileType @@ -87,7 +88,7 @@ object MobileTypeSingle2Hook : BaseHook() { } ) // 隐藏 SIM 卡图标 - if (card1 || card2) hideSimIcon() + if ((card1 || card2) && !isEnableDouble) hideSimIcon() if (!showMobileType) return miuiMobileIconBinder.methodFinder().filterByName("bind").single()