Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

允许直接拨打类似**21*8#的MMI码来开启呼叫转移 #677

Merged
merged 1 commit into from
Jun 9, 2024
Merged
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
31 changes: 31 additions & 0 deletions app/src/main/java/com/sevtinge/hyperceiler/module/app/Telecom.java
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.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"));
}
}
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.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("");
}
});
}
}
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.

* 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;
}
}
5 changes: 5 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1772,4 +1772,9 @@
<string name="headtip_tip_long_press_to_copy">您可以长按或双击后选择文本进行操作,或者复制并反馈给开发者。</string>
<string name="happy_birthday_hyperceiler">今天是 HyperCeiler 的生日!\n感谢与您岁月相伴之恩,愿来年再续前缘,共赴风雨,携手并进!</string>

<!--通话管理-->
<string name="telecom">通话管理</string>
<string name="scam_reminder_bypass_caption">允许直接拨打呼叫转移MMI码</string>
<string name="scam_reminder_bypass_description">允许直接拨打类似**21*8#的MMI码来开启呼叫转移</string>

</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1725,4 +1725,10 @@
<string name="ic_qs_title_autobrightness">Auto Brightness</string>
<string name="ic_qs_title_vowifi1">VoWiFi SIM1</string>
<string name="ic_qs_title_vowifi2">VoWiFi SIM2</string>

<!--Telecom-->
<string name="telecom">Phone Calls</string>
<string name="scam_reminder_bypass_caption">Allow Dail call-forwarding MMI code directly</string>
<string name="scam_reminder_bypass_description">Allow Dail MMI Code like **21*8# to enable call-forwarding directly</string>

</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/xml/prefs_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
android:summary="com.android.incallui"
android:title="@string/incallui" />

<com.sevtinge.hyperceiler.prefs.PreferenceHeader
android:fragment="com.sevtinge.hyperceiler.ui.fragment.TelecomFragment"
android:icon="@drawable/ic_call"
android:key="prefs_key_telecom"
android:summary="com.android.server.telecom"
android:title="@string/telecom" />

<com.sevtinge.hyperceiler.prefs.PreferenceHeader
android:fragment="com.sevtinge.hyperceiler.ui.fragment.MmsFragment"
android:icon="@drawable/ic_mms"
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/xml/prefs_set_homepage_entrance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
android:summary="com.android.phone"
android:title="@string/phone" />

<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_phone"
android:key="prefs_key_telecom_state"
android:layout="@layout/preference_header"
android:summary="com.android.server.telecom"
android:title="@string/telecom" />

<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_downloads"
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/xml/telecom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:myLocation="@string/telecom">
<PreferenceCategory>
<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_scam_reminder_bypass"
android:title="@string/scam_reminder_bypass_caption"
android:summary="@string/scam_reminder_bypass_description"/>

</PreferenceCategory>

</PreferenceScreen>