Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX committed Jan 23, 2024
2 parents ec2bfb7 + 1be17bd commit c3d186b
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ HyperCeiler 已停止维护 Android 11-12 的 MIUI ROM,除系统框架、系
- [「FuckNFC」 by xiaowine](https://github.com/xiaowine/FuckNFC)
- [「ForegroundPin」 by 焕晨HChen](https://github.com/HChenX/ForegroundPin)
- [「Gson」 by Android Open Source Project, Google Inc.](https://github.com/google/gson)
- [「Hyper Helper」 by HowieHChen](https://github.com/HowieHChen/XiaomiHelper)
- [「HideMiuiClipboardDialog」 by zerorooot](https://github.com/zerorooot/HideMiuiClipboardDialog)
- [「HyperSmartCharge」 by buffcow](https://github.com/buffcow/HyperSmartCharge)
- [「Kotlin」 by JetBrains](https://github.com/JetBrains/kotlin)
Expand Down
1 change: 1 addition & 0 deletions README_en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ You can provide translations for the HyperCeiler project [here](https://crwd.in/
- [「FuckNFC」 by xiaowine](https://github.com/xiaowine/FuckNFC)
- [「ForegroundPin」 by 焕晨HChen](https://github.com/HChenX/ForegroundPin)
- [「Gson」 by Android Open Source Project, Google Inc.](https://github.com/google/gson)
- [「Hyper Helper」 by HowieHChen](https://github.com/HowieHChen/XiaomiHelper)
- [「HideMiuiClipboardDialog」 by zerorooot](https://github.com/zerorooot/HideMiuiClipboardDialog)
- [「HyperSmartCharge」 by buffcow](https://github.com/buffcow/HyperSmartCharge)
- [「Kotlin」 by JetBrains](https://github.com/JetBrains/kotlin)
Expand Down
1 change: 1 addition & 0 deletions README_pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Você pode fornecer traduções para o projeto [aqui](https://crwd.in/cemiuiler)
- [「FuckNFC」 por xiaowine](https://github.com/xiaowine/FuckNFC)
- [「ForegroundPin」 por 焕晨HChen](https://github.com/HChenX/ForegroundPin)
- [「Gson」 por Android Open Source Project, Google Inc.](https://github.com/google/gson)
- [「Hyper Helper」 by HowieHChen](https://github.com/HowieHChen/XiaomiHelper)
- [「HideMiuiClipboardDialog」 por zerorooot](https://github.com/zerorooot/HideMiuiClipboardDialog)
- [「HyperSmartCharge」 por buffcow](https://github.com/buffcow/HyperSmartCharge)
- [「Kotlin」 por JetBrains](https://github.com/JetBrains/kotlin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.sevtinge.hyperceiler.module.hook.systemui.BluetoothRestrict;
import com.sevtinge.hyperceiler.module.hook.systemui.BrightnessPct;
import com.sevtinge.hyperceiler.module.hook.systemui.ChargeAnimationStyle;
import com.sevtinge.hyperceiler.module.hook.systemui.DisableBottomBar;
import com.sevtinge.hyperceiler.module.hook.systemui.DisableMiuiMultiWinSwitch;
import com.sevtinge.hyperceiler.module.hook.systemui.HideNavigationBar;
import com.sevtinge.hyperceiler.module.hook.systemui.MonetThemeOverlay;
Expand Down Expand Up @@ -259,6 +260,7 @@ public void handleLoadPackage() {
initHook(new NotificationFix(), mPrefsMap.getBoolean("system_ui_other_notification_fix") && isMoreHyperOSVersion(1f));
initHook(new BrightnessPct(), mPrefsMap.getBoolean("system_showpct_title"));
initHook(DisableMiuiMultiWinSwitch.INSTANCE, mPrefsMap.getBoolean("system_ui_disable_miui_multi_win_switch"));
initHook(DisableBottomBar.INSTANCE, mPrefsMap.getBoolean("system_ui_disable_bottombar"));

// 锁屏
initHook(new ScramblePIN(), mPrefsMap.getBoolean("system_ui_lock_screen_scramble_pin"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.sevtinge.hyperceiler.module.hook.systemui

import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.BaseHook

object DisableBottomBar : BaseHook() {
override fun init() {
val clazzMiuiBaseWindowDecoration =
loadClass("com.android.wm.shell.miuimultiwinswitch.miuiwindowdecor.MiuiBaseWindowDecoration", lpparam.classLoader)

clazzMiuiBaseWindowDecoration.methodFinder().filterByName("createBottomCaption").first()
.createHook {
returnConstant(null)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,28 @@ import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.BaseHook
import com.sevtinge.hyperceiler.utils.devicesdk.isMoreHyperOSVersion
import com.sevtinge.hyperceiler.utils.setObjectField

object HideLockscreenZenMode : BaseHook() {
override fun init() {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "shouldBeVisible"
}.createHook {
returnConstant(false)
}
// hyperOS fix by hyper helper
if (isMoreHyperOSVersion(1f)) {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "updateVisibility"
}.createHook {
before {
it.thisObject.setObjectField("manuallyDismissed", true)
}
}
} else {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "shouldBeVisible"
}.createHook {
returnConstant(false)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public int getContentResId() {

@Override
public View.OnClickListener addRestartListener() {
return view -> ((BaseSettingsActivity)getActivity()).showRestartDialog(
return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog(
getResources().getString(R.string.system_ui),
"com.android.systemui"
);
Expand All @@ -38,10 +38,10 @@ public View.OnClickListener addRestartListener() {
public void initPrefs() {
mMonetOverlay = findPreference("prefs_key_system_ui_monet");
mDisableBluetoothRestrict = findPreference("prefs_key_system_ui_disable_bluetooth_restrict");
mMiuiMultiWinSwitch = findPreference("prefs_key_system_ui_disable_miui_multi_win_switch");
mMiuiMultiWinSwitch = findPreference("prefs_key_system_ui_disable_miui_multi_win_switch");

mMonetOverlay.setVisible(!isAndroidVersion(30));
mDisableBluetoothRestrict.setVisible(isMiuiVersion(14f) && isMoreAndroidVersion(31));
mMiuiMultiWinSwitch.setVisible(isMoreHyperOSVersion(1f) && isPad());
mMiuiMultiWinSwitch.setVisible(isMoreHyperOSVersion(1f));
}
}
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,8 @@
<string name="system_ui_another_title">其他</string>
<string name="system_ui_disable_bluetooth_restrict">禁用蓝牙临时关闭</string>
<string name="system_ui_disable_miui_multi_win_switch">隐藏快捷窗口按钮</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">隐藏 HyperOS for Pad 横屏下顶部居中的快捷窗口按钮 (即常驻的三个小点)</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">隐藏常驻的三个小点,包括小窗顶部和 HyperOS for Pad 横屏顶部中间的按钮 (不影响功能使用)</string>
<string name="system_ui_disable_bottombar">隐藏小窗的小白条</string>
<string name="system_ui_notification_freeform">更多应用通知栏下拉打开小窗</string>
<string name="system_ui_others_pct_title">数据显示</string>
<string name="system_showpct_title">显示亮度百分比</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@
<string name="system_ui_another_title">Other</string>
<string name="system_ui_disable_bluetooth_restrict">Prevent bluetooth from being turned off temporarily</string>
<string name="system_ui_disable_miui_multi_win_switch">Hide the Convenience Window button</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">Hide the convenient window button centered at the top of the HyperOS for Pad landscape screen</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">Hide the three permanent dots, including the top of the small window and the button in the middle of the top of the HyperOS for Pad horizontal screen (does not affect the use of functions)</string>
<string name="system_ui_disable_bottombar">Hide the bottom gesture of the small window</string>
<string name="system_ui_others_pct_title">Data display</string>
<string name="system_showpct_title">Displays the brightness percentage</string>
<string name="system_cc_volume_showpct_title">Displays the percentage of sound</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/system_ui_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
android:summary="@string/system_ui_disable_miui_multi_win_switch_desc"
android:title="@string/system_ui_disable_miui_multi_win_switch" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_disable_bottombar"
android:title="@string/system_ui_disable_bottombar" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_disable_bluetooth_restrict"
Expand Down

0 comments on commit c3d186b

Please sign in to comment.