From 7785bdaacd8adb935cd7f295730218c33544fa64 Mon Sep 17 00:00:00 2001
From: qdsp6sw <163347875+qdsp6sw@users.noreply.github.com>
Date: Sun, 9 Jun 2024 14:10:34 +0800
Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=85=81=E8=AE=B8=E7=9B=B4?=
=?UTF-8?q?=E6=8E=A5=E6=8B=A8=E6=89=93=E7=B1=BB=E4=BC=BC**21*8#=E7=9A=84MM?=
=?UTF-8?q?I=E7=A0=81=E6=9D=A5=E5=BC=80=E5=90=AF=E5=91=BC=E5=8F=AB?=
=?UTF-8?q?=E8=BD=AC=E7=A7=BB=20(#677)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Audit:喵柒柒🍀
---
.../hyperceiler/module/app/Telecom.java | 31 +++++++++++++++++
.../hook/telecom/ScamReminderBypass.java | 33 +++++++++++++++++++
.../ui/fragment/TelecomFragment.java | 29 ++++++++++++++++
app/src/main/res/values-zh-rCN/strings.xml | 5 +++
app/src/main/res/values/strings.xml | 6 ++++
app/src/main/res/xml/prefs_main.xml | 7 ++++
.../res/xml/prefs_set_homepage_entrance.xml | 8 +++++
app/src/main/res/xml/telecom.xml | 14 ++++++++
8 files changed, 133 insertions(+)
create mode 100644 app/src/main/java/com/sevtinge/hyperceiler/module/app/Telecom.java
create mode 100644 app/src/main/java/com/sevtinge/hyperceiler/module/hook/telecom/ScamReminderBypass.java
create mode 100644 app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/TelecomFragment.java
create mode 100644 app/src/main/res/xml/telecom.xml
diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/Telecom.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Telecom.java
new file mode 100644
index 0000000000..d48541ed8c
--- /dev/null
+++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Telecom.java
@@ -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 .
+
+ * Copyright (C) 2023-2024 HyperCeiler Contributions
+ */
+package com.sevtinge.hyperceiler.module.app;
+
+import com.sevtinge.hyperceiler.module.base.BaseModule;
+import com.sevtinge.hyperceiler.module.base.HookExpand;
+import com.sevtinge.hyperceiler.module.hook.telecom.ScamReminderBypass;
+
+@HookExpand(pkg = "com.android.server.telecom", isPad = false, tarAndroid = 33)
+public class Telecom extends BaseModule {
+ @Override
+ public void handleLoadPackage() {
+ initHook(new ScamReminderBypass(), mPrefsMap.getBoolean("scam_reminder_bypass"));
+ }
+}
diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/telecom/ScamReminderBypass.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/telecom/ScamReminderBypass.java
new file mode 100644
index 0000000000..abeed886f2
--- /dev/null
+++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/telecom/ScamReminderBypass.java
@@ -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 .
+
+ * Copyright (C) 2023-2024 HyperCeiler Contributions
+ */
+package com.sevtinge.hyperceiler.module.hook.telecom;
+
+import com.sevtinge.hyperceiler.module.base.BaseHook;
+
+public class ScamReminderBypass extends BaseHook {
+ @Override
+ public void init() throws NoSuchMethodException {
+ hookAllMethods("com.android.server.telecom.MiuiScamReminder", lpparam.classLoader, "isPotentialInCfummi", new MethodHook() {
+ @Override
+ protected void after(MethodHookParam param) throws Throwable {
+ param.setResult("");
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/TelecomFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/TelecomFragment.java
new file mode 100644
index 0000000000..c8d75cc358
--- /dev/null
+++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/TelecomFragment.java
@@ -0,0 +1,29 @@
+/*
+ * 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 .
+
+ * Copyright (C) 2023-2024 HyperCeiler Contributions
+ */
+package com.sevtinge.hyperceiler.ui.fragment;
+
+import com.sevtinge.hyperceiler.R;
+import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
+
+public class TelecomFragment extends SettingsPreferenceFragment {
+ @Override
+ public int getContentResId() {
+ return R.xml.telecom;
+ }
+}
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index e6304bb305..dd0afce114 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -1772,4 +1772,9 @@
您可以长按或双击后选择文本进行操作,或者复制并反馈给开发者。
今天是 HyperCeiler 的生日!\n感谢与您岁月相伴之恩,愿来年再续前缘,共赴风雨,携手并进!
+
+ 通话管理
+ 允许直接拨打呼叫转移MMI码
+ 允许直接拨打类似**21*8#的MMI码来开启呼叫转移
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ad2d32ba9a..a376fff9ba 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1725,4 +1725,10 @@
Auto Brightness
VoWiFi SIM1
VoWiFi SIM2
+
+
+ Phone Calls
+ Allow Dail call-forwarding MMI code directly
+ Allow Dail MMI Code like **21*8# to enable call-forwarding directly
+
diff --git a/app/src/main/res/xml/prefs_main.xml b/app/src/main/res/xml/prefs_main.xml
index c347104295..43a0fcb121 100644
--- a/app/src/main/res/xml/prefs_main.xml
+++ b/app/src/main/res/xml/prefs_main.xml
@@ -57,6 +57,13 @@
android:summary="com.android.incallui"
android:title="@string/incallui" />
+
+
+
+
+
+
+
+
+
+
+