Skip to content

Commit

Permalink
feat: Add a option to remove simlock success dialog (ReChronoRain#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepChirp authored and lingqiqi5211 committed Oct 13, 2024
1 parent 875a5e8 commit 3e3abc2
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import com.sevtinge.hyperceiler.module.hook.securitycenter.other.FuckRiskPkg;
import com.sevtinge.hyperceiler.module.hook.securitycenter.other.LockOneHundredPoints;
import com.sevtinge.hyperceiler.module.hook.securitycenter.other.NoLowBatteryWarning;
import com.sevtinge.hyperceiler.module.hook.securitycenter.other.RemoveSIMLockSuccessDialog;
import com.sevtinge.hyperceiler.module.hook.securitycenter.other.SkipCountDownLimit;
import com.sevtinge.hyperceiler.module.hook.securitycenter.sidebar.AddSideBarExpandReceiver;
import com.sevtinge.hyperceiler.module.hook.securitycenter.sidebar.BlurSecurity;
Expand Down Expand Up @@ -123,6 +124,7 @@ public void handleLoadPackage() {
initHook(DisableRootCheck.INSTANCE, mPrefsMap.getBoolean("security_center_disable_root_check"));
initHook(FuckRiskPkg.INSTANCE, mPrefsMap.getBoolean("security_center_disable_send_malicious_app_notification"));
initHook(NoLowBatteryWarning.INSTANCE, mPrefsMap.getBoolean("security_center_remove_low_battery_reminder"));
initHook(RemoveSIMLockSuccessDialog.INSTANCE, mPrefsMap.getBoolean("security_center_remove_simlock_success_dialog"));
initHook(new UnlockFbo(), mPrefsMap.getBoolean("security_center_unlock_fbo"));
initHook(BypassSimLockMiAccountAuth.INSTANCE, mPrefsMap.getBoolean("security_center_bypass_simlock_miaccount_auth"));
initHook(new BypassAdbInstallVerify(), mPrefsMap.getBoolean("security_center_adb_install_verify"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void handleLoadPackage() {
initHook(new DisableMiuiWatermark(), mPrefsMap.getBoolean("system_framework_disable_miui_watermark"));
initHook(new AntiQues(), mPrefsMap.getBoolean("system_settings_anti_ques"));
// 小窗
initHook(new AllowAutoStart(), mPrefsMap.getBoolean("system_framework_auto_start_apps_enable"));
initHook(new AllowAutoStart(), mPrefsMap.getBoolean("system_framework_auto_start_apps_menu"));
initHook(new FreeFormCount(), mPrefsMap.getBoolean("system_framework_freeform_count"));
initHook(new FreeformBubble(), mPrefsMap.getBoolean("system_framework_freeform_bubble"));
initHook(new DisableFreeformBlackList(), mPrefsMap.getBoolean("system_framework_disable_freeform_blacklist"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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.securitycenter.other;

import android.app.Activity;
import android.os.Bundle;

import com.sevtinge.hyperceiler.module.base.BaseHook;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;

object RemoveSIMLockSuccessDialog : BaseHook() {
@Throws(NoSuchMethodException::class)
override fun init() {
XposedHelpers.findAndHookMethod(
"com.miui.simlock.activity.SuccessDialogActivity",
lpparam.classLoader,
"onCreate",
Bundle::class.java,
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
(param.thisObject as Activity).finish()
}
}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void initPrefs() {
mNotifrowmenu = findPreference("prefs_key_system_ui_control_center_notifrowmenu");
mProgressMode = findPreference("prefs_key_system_ui_control_center_media_control_progress_mode");
mProgressModeThickness = findPreference("prefs_key_system_ui_control_center_media_control_progress_thickness");
mProgressModeCornerRadius = findPreference("prefs_key_system_ui_control_center_media_control_progress_thickness");
mProgressModeCornerRadius = findPreference("prefs_key_system_ui_control_center_media_control_progress_corner_radius");
mSliderColor = findPreference("prefs_key_system_ui_control_center_media_control_seekbar_thumb_color");
mProgressBarColor = findPreference("prefs_key_system_ui_control_center_media_control_seekbar_color");
handler = new Handler();
Expand Down Expand Up @@ -218,6 +218,7 @@ private void setCanBeVisibleRoundedRect(boolean mode) {

private void setCanBeVisibleProgressMode(int mode) {
mProgressModeThickness.setVisible(mode == 2);
mProgressModeCornerRadius.setVisible(mode == 2);
mSliderColor.setVisible(mode != 2);
mProgressBarColor.setVisible(mode != 2);
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,8 @@
<string name="security_center_game_speed_desc">在启动游戏时倍速通过开屏动画,仅部分游戏支持</string>
<string name="security_center_bypass_simlock_miaccount_auth">SIM 卡安全保护跳过登录验证</string>
<string name="security_center_bypass_simlock_miaccount_auth_desc">开启 SIM 卡安全保护功能时无需登录小米账号</string>
<string name="security_center_remove_simlock_success_dialog">移除 SIM 卡安全保护验证成功的弹窗</string>
<string name="security_center_remove_simlock_success_dialog_desc">开机后不再弹窗提示 SIM 卡安全保护验证成功</string>
<string name="security_center_aosp_app_info">添加 \"原生应用信息\" 入口</string>
<string name="security_center_aosp_app_info_label">原生应用信息</string>
<string name="security_center_aosp_app_manager">添加 \"原生应用管理\" 入口</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,8 @@
<string name="security_center_game_speed_desc">When launching the game, it passes the opening screen animation at 3x speed, which is only supported by some games.</string>
<string name="security_center_bypass_simlock_miaccount_auth">Bypass Xiaomi Account SIM security</string>
<string name="security_center_bypass_simlock_miaccount_auth_desc">You can use this function even without logging into your Xiaomi Account.</string>
<string name="security_center_remove_simlock_success_dialog">Remove the dialog for successful SIM card security verification</string>
<string name="security_center_remove_simlock_success_dialog_desc">No more dialog after powering on the phone to indicate that the SIM card security protection has been successfully verified.</string>
<string name="security_center_aosp_app_info_label">AOSP app info</string>
<string name="security_center_aosp_app_info">Add AOSP app info entry</string>
<string name="security_center_aosp_app_manager_label">AOSP app manager</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/security_center_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,11 @@
android:summary="@string/security_center_bypass_simlock_miaccount_auth_desc"
android:title="@string/security_center_bypass_simlock_miaccount_auth" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_security_center_remove_simlock_success_dialog"
android:summary="@string/security_center_remove_simlock_success_dialog_desc"
android:title="@string/security_center_remove_simlock_success_dialog" />

</PreferenceCategory>
</PreferenceScreen>

0 comments on commit 3e3abc2

Please sign in to comment.