Skip to content

Commit

Permalink
Merge branch 'ReChronoRain:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
igormiguell authored Dec 8, 2024
2 parents ebdf470 + 693d825 commit bdb63cd
Show file tree
Hide file tree
Showing 165 changed files with 1,964 additions and 1,771 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Android 13-15 的 MIUI 和 HyperOS

本模块<b>不支持</b> `修改较多的第三方 MIUI/Xiaomi HyperOS ROM``修改较多的系统软件`,以及`部分国际 MIUI/Xiaomi HyperOS ROM`

目前 HyperCeiler 是基于 Android 14-15 的 Xiaomi HyperOS 1.0-1.1 的手机端设备进行适配,覆盖不是很完整,需要不断测试和改进
目前 HyperCeiler 是基于 Android 14-15 的 Xiaomi HyperOS 1.0-2.0 的手机端设备进行适配,覆盖不是很完整,需要不断测试和改进

提交反馈前请注意是否已有相同反馈,避免给开发者造成困扰。花相同精力看相同反馈是一件很浪费时间的事情

Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ dependencies {
// compileOnly(libs.androidx.preference)

implementation(libs.dexkit)
implementation(libs.mmkv)
implementation(libs.ezxhelper)
implementation(libs.hiddenapibypass)
implementation(libs.gson)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/sevtinge/hyperceiler/XposedInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void initZygote(StartupParam startupParam) throws Throwable {

@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
if (isInSafeMode(lpparam.packageName)) return;
EzXHelper.initHandleLoadPackage(lpparam);
EzXHelper.setLogTag(TAG);
EzXHelper.setToastTag(TAG);
Expand Down Expand Up @@ -160,7 +161,6 @@ private void setXSharedPrefs() {
}

private void init(XC_LoadPackage.LoadPackageParam lpparam) {
if (isSafeModeOn) return;
String packageName = lpparam.packageName;
if (Objects.equals(packageName, "android"))
logI(packageName, "androidVersion = " + getAndroidVersion() + ", miuiVersion = " + getMiuiVersion() + ", hyperosVersion = " + getHyperOSVersion());
Expand All @@ -180,7 +180,7 @@ private void invokeInit(XC_LoadPackage.LoadPackageParam lpparam) {
return;
}

if (isInSafeMode(mPkgName) || isOtherRestrictions(mPkgName)) return;
if (isOtherRestrictions(mPkgName)) return;

HashMap<String, DataBase> dataMap = DataBase.get();
if (dataMap.values().stream().noneMatch(dataBase -> dataBase.mTargetPackage.equals(mPkgName))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.callback;

import android.content.Context;

import com.hchen.hooktool.tool.ParamTool;

public interface IAttachBaseContext {
default void onAttachBaseContextCreateBefore(ParamTool param, Context context) {
}

default void onAttachBaseContextCreateAfter(ParamTool param, Context context) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -293,6 +294,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -293,6 +294,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -292,6 +293,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -284,6 +285,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -287,6 +288,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -286,6 +287,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.hook.mms.DisableAd;
import com.sevtinge.hyperceiler.module.hook.mms.DisableRiskTip;
import com.sevtinge.hyperceiler.module.hook.mms.ImOldDevice;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookBase(targetPackage = "com.android.mms", isPad = false)
Expand All @@ -31,5 +32,6 @@ public void handleLoadPackage() {
initHook(new DisableRiskTip(), mPrefsMap.getBoolean("mms_disable_fraud_risk_tip") || mPrefsMap.getBoolean("mms_disable_overseas_risk_tip"));
initHook(new DisableAd(), mPrefsMap.getBoolean("mms_disable_ad"));
initHook(UnlockSuperClipboard.INSTANCE, mPrefsMap.getStringAsInt("various_super_clipboard_e", 0) != 0);
initHook(new ImOldDevice(), mPrefsMap.getBoolean("mms_im_old_device"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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-2024 HyperCeiler Contributions
*/

package com.sevtinge.hyperceiler.module.app;

import com.hchen.database.HookBase;
import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.hook.soundrecorder.DisableAiWatermark;

@HookBase(targetPackage = "com.android.soundrecorder", isPad = false)
public class SoundRecorder extends BaseModule {

@Override
public void handleLoadPackage() {
initHook(new DisableAiWatermark(), mPrefsMap.getBoolean("sound_recorder_disable_ai_watermark"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.AllowManageAllNotifications;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AntiQues;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AppsFreezerEnable;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ControlCenterStyle;
import com.sevtinge.hyperceiler.module.hook.systemsettings.DisableInstallUnknownVerify;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnableFoldArea;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnablePadArea;
Expand Down Expand Up @@ -98,6 +99,8 @@ public void handleLoadPackage() {
initHook(new EnablePadArea(), mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(), mPrefsMap.getBoolean("system_settings_enable_fold_area"));

initHook(new ControlCenterStyle(), mPrefsMap.getBoolean("system_control_center_unlock_old"));

initHook(new ModifySystemVersion(), mPrefsMap.getBoolean("updater_enable_miui_version") && mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1);

initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.AllowManageAllNotifications;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AntiQues;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AppsFreezerEnable;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ControlCenterStyle;
import com.sevtinge.hyperceiler.module.hook.systemsettings.DisableInstallUnknownVerify;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnableFoldArea;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnablePadArea;
Expand Down Expand Up @@ -98,6 +99,8 @@ public void handleLoadPackage() {
initHook(new EnablePadArea(), mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(), mPrefsMap.getBoolean("system_settings_enable_fold_area"));

initHook(new ControlCenterStyle(), mPrefsMap.getBoolean("system_control_center_unlock_old"));

initHook(new ModifySystemVersion(), mPrefsMap.getBoolean("updater_enable_miui_version") && mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1);

initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.AllowManageAllNotifications;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AntiQues;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AppsFreezerEnable;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ControlCenterStyle;
import com.sevtinge.hyperceiler.module.hook.systemsettings.DisableInstallUnknownVerify;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnableFoldArea;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnablePadArea;
Expand Down Expand Up @@ -98,6 +99,8 @@ public void handleLoadPackage() {
initHook(new EnablePadArea(), mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(), mPrefsMap.getBoolean("system_settings_enable_fold_area"));

initHook(new ControlCenterStyle(), mPrefsMap.getBoolean("system_control_center_unlock_old"));

initHook(new ModifySystemVersion(), mPrefsMap.getBoolean("updater_enable_miui_version") && mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1);

initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.AllowManageAllNotifications;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AntiQues;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AppsFreezerEnable;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ControlCenterStyle;
import com.sevtinge.hyperceiler.module.hook.systemsettings.DisableInstallUnknownVerify;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnableFoldArea;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnablePadArea;
Expand Down Expand Up @@ -100,6 +101,8 @@ public void handleLoadPackage() {
initHook(new EnablePadArea(), mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(), mPrefsMap.getBoolean("system_settings_enable_fold_area"));

initHook(new ControlCenterStyle(), mPrefsMap.getBoolean("system_control_center_unlock_old"));

initHook(new ModifySystemVersion(), mPrefsMap.getBoolean("updater_enable_miui_version") && mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1);

initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.HideNavigationBar;
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.NavigationCustom;
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.RotationButton;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.FocusNotifLyricPluginHelper;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.NewPluginHelper;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.NewPluginHelperKt;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.BlurEnable;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.DoubleTapToSleep;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.HideStatusBarBeforeScreenshot;
Expand Down Expand Up @@ -147,7 +149,9 @@ public class SystemUiU extends BaseModule {
@Override
public void handleLoadPackage() {
// PluginHelper
initHook(NewPluginHelper.INSTANCE);
initHook(NewPluginHelperKt.INSTANCE);
/*initHook(new NewPluginHelper());
initHook(FocusNotifLyricPluginHelper.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_music_switch"));*/
// initHook(Island.INSTANCE, true); // 灵动岛
initHook(new ChargeAnimationStyle(), mPrefsMap.getStringAsInt("system_ui_charge_animation_style", 0) > 0);
// initHook(DisableChargeAnimation.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.HideNavigationBar;
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.NavigationCustom;
import com.sevtinge.hyperceiler.module.hook.systemui.navigation.RotationButton;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.FocusNotifLyricPluginHelper;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.NewPluginHelper;
import com.sevtinge.hyperceiler.module.hook.systemui.plugin.NewPluginHelperKt;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.BlurEnable;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.DoubleTapToSleep;
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.HideStatusBarBeforeScreenshot;
Expand Down Expand Up @@ -127,7 +129,9 @@ public class SystemUiV extends BaseModule {
@Override
public void handleLoadPackage() {
// PluginHelper
initHook(NewPluginHelper.INSTANCE);
initHook(NewPluginHelperKt.INSTANCE);
/*initHook(new NewPluginHelper());
initHook(FocusNotifLyricPluginHelper.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_music_switch"));*/
// initHook(Island.INSTANCE, true); // 灵动岛
initHook(new ChargeAnimationStyle(), mPrefsMap.getStringAsInt("system_ui_charge_animation_style", 0) > 0);
// initHook(DisableChargeAnimation.INSTANCE);
Expand Down
Loading

0 comments on commit bdb63cd

Please sign in to comment.