Skip to content

Commit

Permalink
新增: 安全服务-其他-禁止自启模糊预览图
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX committed Jun 24, 2024
1 parent bde2065 commit 43a3b1e
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ HyperCeiler 已停止维护 Android 11-12 的 MIUI ROM,如需使用请停留[
- [「Android」 by Android Open Source Project, Google Inc.](https://source.android.google.cn/license)
- [「AndroidHiddenApiBypass」 by LSPosed](https://github.com/LSPosed/AndroidHiddenApiBypass)
- [「AndroidX」 by Android Open Source Project, Google Inc.](https://github.com/androidx/androidx)
- [「AutoSEffSwitch」 by 焕晨 HChen](https://github.com/HChenX/AutoSEffSwitch)
- [「AntiAntiDefraud」 by MinaMichita](https://github.com/MinaMichita/AntiAntiDefraud)
- [「Auto NFC」 by GSWXXN](https://github.com/GSWXXN/AutoNFC)
- [「BypassSignCheck」 by Weverses](https://github.com/Weverses/BypassSignCheck)
Expand Down
1 change: 1 addition & 0 deletions README_en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Note: When the translation progress of the new language is greater than or equal
- [「Android」 by Android Open Source Project, Google Inc.](https://source.android.google.cn/license)
- [「AndroidHiddenApiBypass」 by LSPosed](https://github.com/LSPosed/AndroidHiddenApiBypass)
- [「AndroidX」 by Android Open Source Project, Google Inc.](https://github.com/androidx/androidx)
- [「AutoSEffSwitch」 by 焕晨 HChen](https://github.com/HChenX/AutoSEffSwitch)
- [「AntiAntiDefraud」 by MinaMichita](https://github.com/MinaMichita/AntiAntiDefraud)
- [「Auto NFC」 by GSWXXN](https://github.com/GSWXXN/AutoNFC)
- [「BypassSignCheck」 by Weverses](https://github.com/Weverses/BypassSignCheck)
Expand Down
1 change: 1 addition & 0 deletions README_pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Observação: Quando o progresso da tradução do novo idioma for maior ou igual
- [「Android」 por Android Open Source Project, Google Inc.](https://source.android.google.cn/license)
- [「AndroidHiddenApiBypass」 por LSPosed](https://github.com/LSPosed/AndroidHiddenApiBypass)
- [「AndroidX」 por Android Open Source Project, Google Inc.](https://github.com/androidx/androidx)
- [「AutoSEffSwitch」 by 焕晨 HChen](https://github.com/HChenX/AutoSEffSwitch)
- [「AntiAntiDefraud」 por MinaMichita](https://github.com/MinaMichita/AntiAntiDefraud)
- [「Auto NFC」 por GSWXXN](https://github.com/GSWXXN/AutoNFC)
- [「BypassSignCheck」 por Weverses](https://github.com/Weverses/BypassSignCheck)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.sevtinge.hyperceiler.module.hook.securitycenter.IsSbnBelongToActiveBubbleApp;
import com.sevtinge.hyperceiler.module.hook.securitycenter.NewBoxBlur;
import com.sevtinge.hyperceiler.module.hook.securitycenter.PowerSaver;
import com.sevtinge.hyperceiler.module.hook.securitycenter.PrivacyThumbnailBlur;
import com.sevtinge.hyperceiler.module.hook.securitycenter.RemoveConversationBubbleSettingsRestriction;
import com.sevtinge.hyperceiler.module.hook.securitycenter.RemoveOpenAppConfirmationPopup;
import com.sevtinge.hyperceiler.module.hook.securitycenter.ScLockApp;
Expand Down Expand Up @@ -129,6 +130,7 @@ public void handleLoadPackage() {
mPrefsMap.getBoolean("security_center_unlock_s_resolution") ||
mPrefsMap.getBoolean("security_center_unlock_enhance_contours");

initHook(new PrivacyThumbnailBlur(), mPrefsMap.getBoolean("security_center_privacy_thumbnail_blur"));
initHook(new PowerSaver(), mPrefsMap.getBoolean("security_center_power_saver"));
initHook(new NewBoxBlur(), mPrefsMap.getBoolean("security_center_newbox_custom_enable"));
initHook(BlurSecurity.INSTANCE, mPrefsMap.getBoolean("se_enable"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.sevtinge.hyperceiler.module.hook.securitycenter;

import android.content.Context;

import com.sevtinge.hyperceiler.module.base.BaseTool;
import com.sevtinge.hyperceiler.module.base.dexkit.DexKit;
import com.sevtinge.hyperceiler.module.base.dexkit.IDexKit;

import org.luckypray.dexkit.DexKitBridge;
import org.luckypray.dexkit.query.FindMethod;
import org.luckypray.dexkit.query.matchers.ClassMatcher;
import org.luckypray.dexkit.query.matchers.MethodMatcher;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.Arrays;

public class PrivacyThumbnailBlur extends BaseTool {
@Override
public void doHook() {
Method method = (Method) DexKit.getDexKitBridge("ptb", new IDexKit() {
@Override
public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationException {
return bridge.findMethod(FindMethod.create()
.matcher(MethodMatcher.create()
.declaredClass(ClassMatcher.create()
.usingStrings("miui_recents_privacy_thumbnail_blur")
)
.paramTypes(Context.class, String.class, boolean.class)
)
).singleOrNull().getMethodInstance(lpparam.classLoader);
}
});

hookMethod(method, new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
if (Arrays.stream(stackTraceElements).noneMatch(stackTraceElement ->
stackTraceElement.getClassName().equals("PrivacyThumbnailBlurSettings")
)) {
param.setResult(null);
}
}
});
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,7 @@
<string name="security_center_get_number">管理应用获取手机号并一键登录</string>
<string name="security_center_applock_pin_scramble">应用锁乱序 PIN</string>
<string name="security_center_power_saver">禁止妙享省电</string>
<string name="security_center_privacy_thumbnail_blur">禁止自启模糊预览图</string>
<string name="security_center_power_saver_desc">禁止在通过小米妙享镜像流转屏幕时开启省电模式</string>
<string name="security_center_applock_pin_scramble_desc">随机更改应用锁 PIN 键盘顺序</string>
<string name="security_center_beauty_light_auto">解锁智能调节补光灯亮度</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@
<string name="security_center_get_number">Manage the application to obtain the mobile phone number and log in with one click</string>
<string name="security_center_applock_pin_scramble">Applock out of order PIN</string>
<string name="security_center_power_saver">Magic Share doesn\'t save power</string>
<string name="security_center_privacy_thumbnail_blur">Disable self-starting blurred preview images</string>
<string name="security_center_power_saver_desc">Disable power saving mode when screen mirroring via Mi Smart Hub</string>
<string name="security_center_applock_pin_scramble_desc">Randomly change app lock PIN keypad sequence</string>
<string name="security_center_beauty_light_auto">Unlock Adjust fill light brightness automatically</string>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/xml/prefs_about_use.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
android:action="android.intent.action.VIEW"
android:data="https://github.com/androidx/androidx" />
</Preference>
<Preference
android:summary="焕晨 HChen | GPL-3.0"
android:title="AutoSEffSwitch">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/HChenX/AutoSEffSwitch" />
</Preference>
<Preference
android:summary="MinaMichita | No License"
android:title="AntiAntiDefraud">
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/security_center_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
android:summary="@string/security_center_power_saver_desc"
android:title="@string/security_center_power_saver" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_security_center_privacy_thumbnail_blur"
android:title="@string/security_center_privacy_thumbnail_blur" />

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

0 comments on commit 43a3b1e

Please sign in to comment.