Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file is part of HyperCeiler.

* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.

* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.

* Copyright (C) 2023-2026 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.hooker.systemui

import androidx.preference.Preference
import androidx.preference.SwitchPreference
import com.sevtinge.hyperceiler.core.R
import com.sevtinge.hyperceiler.dashboard.DashboardFragment
import com.sevtinge.hyperceiler.libhook.utils.hookapi.tool.AppsTool
import fan.appcompat.app.AlertDialog

/**
* Navigation settings fragment for SystemUI.
*/
class NavigationSettings : DashboardFragment() {
var navigation: SwitchPreference? = null

override fun getPreferenceScreenResId(): Int {
return R.xml.system_ui_navigation
}

override fun initPrefs() {
navigation = findPreference("prefs_key_system_ui_hide_navigation_bar")
navigation?.setOnPreferenceChangeListener { preference: Preference, newValue: Any? ->
// 询问是否立即重启
val systemUiName = getString(R.string.system_ui)
val homeName = getString(R.string.mihome)
AlertDialog.Builder(requireActivity())
.setTitle(R.string.navigation_restart_confirm_title)
.setMessage(getString(R.string.navigation_restart_confirm_message,
systemUiName,
homeName))
.setPositiveButton(R.string.navigation_restart_confirm_ok) { _, _ ->
// 重启“系统界面”和“系统桌面”
AppsTool.killApps("com.miui.home", "com.android.systemui")
}.setNegativeButton(android.R.string.cancel, null).show()
true
}
}
}
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@
<string name="enable_suggest">تمكين الاقتراحات</string>
<string name="unsupported_func_tips">يبدو أن التطبيق المستهدف هو إصدار معدل. هذه الإضافة غير قادرة على توفير خدمات الربط له. حاول استخدام إصدار مختلف من التطبيق أو تمكين وضع التصحيح وحاول مرة أخرى.</string>
<string name="debug_mode_running">التطبيق المستهدف قيد التصحيح!\nإصدار التطبيق الحالي: %1$s\nالإصدار المستهدف المحدد: %2$s\nتم تطبيق الرابط بنجاح: %3$s</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">إعادة التشغيل</string>
<string name="navigation_restart_confirm_message">هل تريد إعادة تشغيل %1$s و%2$s الآن؟</string>
<string name="navigation_restart_confirm_ok">إعادة التشغيل الآن</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@
<string name="ignore">Ignorieren</string>
<string name="disable_suggest">Vorschlag deaktivieren</string>
<string name="enable_suggest">Vorschlag aktivieren</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Neustart</string>
<string name="navigation_restart_confirm_message">Möchten Sie %1$s und %2$s jetzt neu starten?</string>
<string name="navigation_restart_confirm_ok">Jetzt neu starten</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-es-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@
<string name="ignore">Ignorar</string>
<string name="disable_suggest">Desactivar sugerencias</string>
<string name="enable_suggest">Activar sugerencias</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Reiniciar</string>
<string name="navigation_restart_confirm_message">¿Quieres reiniciar %1$s y %2$s ahora?</string>
<string name="navigation_restart_confirm_ok">Reiniciar ahora</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-in-rID/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@
<string name="app_error_desc">HyperCeiler tiba-tiba tertutup. Untuk membantu kami memperbaiki masalah ini, berikan informasi berikut:\n\nTekan dan tahan pesan apa pun untuk menyalin semuanya.</string>
<string name="safe_mode_cancel">Nonaktifkan mode aman</string>
<string name="safe_mode_ok">Batal</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Mulai ulang</string>
<string name="navigation_restart_confirm_message">Apakah Anda ingin memulai ulang %1$s dan %2$s sekarang?</string>
<string name="navigation_restart_confirm_ok">Mulai ulang sekarang</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@
<string name="ignore">Ignora</string>
<string name="disable_suggest">Disabilita suggerimento</string>
<string name="enable_suggest">Abilita suggerimento</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Riavvia</string>
<string name="navigation_restart_confirm_message">Vuoi riavviare %1$s e %2$s ora?</string>
<string name="navigation_restart_confirm_ok">Riavvia ora</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@
<string name="search_apps_hint">%d 個のアプリを検索</string>
<string name="load_apps_failed">アプリリストの読み込みに失敗しました</string>
<string name="search_result_not_available">この機能は、お使いのデバイスではサポートされていないか、一部の設定の下に隠れている可能性があります</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">再起動</string>
<string name="navigation_restart_confirm_message">%1$sと%2$sを今すぐ再起動しますか?</string>
<string name="navigation_restart_confirm_ok">今すぐ再起動</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-pl-rPL/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@
<string name="experimental_features">Eksperymentalne funkcje</string>
<string name="module_title_1">Podstawowe wiadomości</string>
<string name="app_error_desc">Aplikacja HyperCeiler została nieoczekiwanie zamknięta. Aby pomóc nam to naprawić, podaj poniższe informacje:\n\nNaciśnij i przytrzymaj dowolną wiadomość, aby skopiować całą jej treść.</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Zrestartuj</string>
<string name="navigation_restart_confirm_message">Czy chcesz teraz zrestartować %1$s i %2$s?</string>
<string name="navigation_restart_confirm_ok">Zrestartuj teraz</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@
<string name="enable_suggest">Ativar sugestão</string>
<string name="unsupported_func_tips">O app de destino parece ser uma versão modificada. Esse módulo não consegue fornecer serviços de hook para ele. Tente usar uma versão diferente do app ou ative o Modo de depuração e tente novamente.</string>
<string name="debug_mode_running">O app de destino está sendo depurado!\nVersão atual do app: %1$s\nVersão de destino selecionada: %2$s\nHook aplicado com sucesso: %3$s</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Reiniciar</string>
<string name="navigation_restart_confirm_message">Você quer reiniciar %1$s e %2$s agora?</string>
<string name="navigation_restart_confirm_ok">Reiniciar agora</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@
<string name="debug_mode_switch">Версия отладки</string>
<string name="load_apps_failed">Неудалось загрузить список приложений</string>
<string name="search_apps_hint">Поиск %d приложений</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Перезагрузка</string>
<string name="navigation_restart_confirm_message">Вы хотите перезагрузить %1$s и %2$s сейчас?</string>
<string name="navigation_restart_confirm_ok">Перезагрузить сейчас</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-tr-rTR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@
<string name="ignore">Yoksay</string>
<string name="disable_suggest">Tavsiyeleri devre dışı bırak</string>
<string name="enable_suggest">Tavsiyeleri etkinleştir</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Yeniden başlat</string>
<string name="navigation_restart_confirm_message">%1$s ve %2$s şimdi yeniden başlatmak istiyor musunuz?</string>
<string name="navigation_restart_confirm_ok">Şimdi yeniden başlat</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-uk-rUA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@
<string name="ignore">Ігнорувати</string>
<string name="disable_suggest">Вимкнути пропозиції</string>
<string name="enable_suggest">Увімкнути пропозиції</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Перезавантажити</string>
<string name="navigation_restart_confirm_message">Ви хочете перезапустити %1$s та %2$s зараз?</string>
<string name="navigation_restart_confirm_ok">Перезапустити зараз</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-vi-rVN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@
<string name="search_apps_hint">Tìm kiếm %d ứng dụng</string>
<string name="load_apps_failed">Không tải được danh sách ứng dụng</string>
<string name="search_result_not_available">Tính năng này có thể không được hỗ trợ trên thiết bị này hoặc có thể bị ẩn trong một số tùy chọn</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Khởi động lại</string>
<string name="navigation_restart_confirm_message">Bạn có muốn khởi động lại %1$s và %2$s ngay bây giờ không?</string>
<string name="navigation_restart_confirm_ok">Khởi động lại ngay</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@
<string name="unsupported_func_tips">当前目标作用域来源可能并不是 Xiaomi 官方,出于安全考虑,已停止加载此作用域的所有功能,请尝试更改为 Xiaomi 官方发布的应用包,或前往 \"HyperCeiler 设置-开发者选项-调试模式\" 指定挂载版本后重试。</string>
<string name="debug_mode_running">当前目标作用域正处于调试模式,若无必要开启请前往关闭。\n当前应用版本:%1$s\n选择目标版本:%2$s\n是否成功挂钩:%3$s</string>
<string name="debug_mode_switch">调试版本</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">重启</string>
<string name="navigation_restart_confirm_message">要立即重启%1$s和%2$s吗?</string>
<string name="navigation_restart_confirm_ok">立即重启</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@
<string name="search_apps_hint">搜尋 %d 個應用</string>
<string name="load_apps_failed">加載應用程式列表失敗</string>
<string name="search_result_not_available">此功能可能不支持此裝置或隱藏到部分選項下</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">重新啟動</string>
<string name="navigation_restart_confirm_message">要立即重新啟動%1$s和%2$s嗎?</string>
<string name="navigation_restart_confirm_ok">立即重新啟動</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-zh-rME/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@
<string name="happy_birthday_hyperceiler">今日无事可做?\n 你可以选择为 HyperCeiler 点一支蜡烛并祝 HyperCeiler 生日快乐!</string>
<!--System UI-->
<string name="system_ui">进程\"System UI\"</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">重启</string>
<string name="navigation_restart_confirm_message">要立即重启%1$s和%2$s吗?</string>
<string name="navigation_restart_confirm_ok">立即重启</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,8 @@
<string name="unsupported_func_tips">當前目標作用域來源可能並不是 Xiaomi 官方,出於安全考量,已停止載入此作用域的所有功能,請嘗試更改為 Xiaomi 官方發布的應用包,或前往「HyperCeiler 設定-開發者選項-除錯模式」指定掛載版本後重試。</string>
<string name="debug_mode_running">當前目標作用域正處於除錯模式,若無必要開啟請前往關閉。\n當前應用版本:%1$s\n選擇目標版本:%2$s\n是否成功掛鉤:%3$s</string>
<string name="debug_mode_switch">調試版本</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">重啟</string>
<string name="navigation_restart_confirm_message">要立即重啟%1$s和%2$s嗎?</string>
<string name="navigation_restart_confirm_ok">立即重啟</string>
</resources>
4 changes: 4 additions & 0 deletions library/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,9 @@
<string name="unsupported_func_tips">The current target scope source may not be official Xiaomi. For security reasons, all functions of this scope have been disabled. Please try switching to an app package released by official Xiaomi, or go to "HyperCeiler Settings - Developer options - Debug mode" to specify the mounted version and try again.</string>
<string name="debug_mode_running">The current target scope is in debug mode. If not necessary, please go and turn it off.\nCurrent app version: %1$s\nSelected target version: %2$s\nSuccessfully hooked: %3$s</string>
<string name="debug_mode_switch">Debug version</string>
<!--Dialog-->
<string name="navigation_restart_confirm_title">Restart</string>
<string name="navigation_restart_confirm_message">Do you want to restart %1$s and %2$s now?</string>
<string name="navigation_restart_confirm_ok">Restart now</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import com.sevtinge.hyperceiler.libhook.rules.systemui.lockscreen.LockScreenDoubleTapToSleep;
import com.sevtinge.hyperceiler.libhook.rules.systemui.lockscreen.NotificationShowOnKeyguard;
import com.sevtinge.hyperceiler.libhook.rules.systemui.lockscreen.ScramblePIN;
import com.sevtinge.hyperceiler.libhook.rules.home.navigation.HideNavigationBar;
import com.sevtinge.hyperceiler.libhook.rules.systemui.navigation.RotationButtonB;
import com.sevtinge.hyperceiler.libhook.rules.systemui.other.AutoSEffSwitchForSystemUi;
import com.sevtinge.hyperceiler.libhook.rules.systemui.other.BrightnessPct;
Expand Down Expand Up @@ -168,6 +169,7 @@ public void onPackageLoaded() {
initHook(HideStrongToast.INSTANCE, PrefsBridge.getBoolean("system_ui_status_bar_hide_smart_strong_toast"));

// 导航栏
initHook(new HideNavigationBar(), PrefsBridge.getBoolean("system_ui_hide_navigation_bar"));
initHook(RotationButtonB.INSTANCE, PrefsBridge.getStringAsInt("system_framework_other_rotation_button_int", 0) != 0);

// 控制与通知中心
Expand Down
Loading
Loading