Skip to content

Commit

Permalink
feat: home - others - hide report text
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Jul 2, 2024
1 parent 0287e16 commit 5c6444e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
import com.sevtinge.hyperceiler.module.hook.home.title.FakeNonDefaultIcon;
import com.sevtinge.hyperceiler.module.hook.home.title.FixAnimation;
import com.sevtinge.hyperceiler.module.hook.home.title.HiddenAllTitle;
import com.sevtinge.hyperceiler.module.hook.home.title.HideReportText;
import com.sevtinge.hyperceiler.module.hook.home.title.IconTitleColor;
import com.sevtinge.hyperceiler.module.hook.home.title.IconTitleCustomization;
import com.sevtinge.hyperceiler.module.hook.home.title.LargeIconCornerRadius;
Expand Down Expand Up @@ -286,6 +287,7 @@ public void handleLoadPackage() {
initHook(ShortcutItemCount.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_remove_restrictions"));
initHook(ShowAllHideApp.INSTANCE, true); // 桌面快捷方式管理
initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.sevtinge.hyperceiler.module.hook.home.title;

import android.content.Context;

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

import java.util.ArrayList;
import java.util.List;

public class HideReportText extends BaseHook {
@Override
public void init() throws NoSuchMethodException {
findAndHookMethod("com.miui.home.launcher.uninstall.BaseUninstallDialog", "init", Context.class, List.class, new MethodHook(){
@Override
protected void before(MethodHookParam param) throws Throwable {
findAndHookMethod("com.miui.home.launcher.ShortcutInfo", "getInstallerPackageName", new MethodHook(){
@Override
protected void before(MethodHookParam param) throws Throwable {
param.setResult("com.xiaomi.market");
}
});
}
});
}
}
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 @@ -1236,6 +1236,8 @@
<string name="home_title_custom_anim_param">自定义动画曲线</string>
<string name="home_title_custom_anim_param_damping_title">回弹</string>
<string name="home_title_custom_anim_param_stiffness_title">刚度</string>
<string name="home_title_hide_report_text">隐藏举报入口</string>
<string name="home_title_hide_report_text_desc">隐藏部分应用在卸载对话框的 \"举报该应用\" 入口</string>

<string name="home_recent">最近任务</string>
<string name="home_recent_animation_speed">动画速度</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 @@ -1207,6 +1207,8 @@
<string name="home_title_custom_anim_param">Custom Animation Parameter</string>
<string name="home_title_custom_anim_param_damping_title">Damping</string>
<string name="home_title_custom_anim_param_stiffness_title">Stiffness</string>
<string name="home_title_hide_report_text">Hide report text</string>
<string name="home_title_hide_report_text_desc">Hide report text in uninstall dialog</string>

<string name="home_recent">Recent</string>
<string name="home_recent_animation_speed">Animation speed</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/home_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
android:summary="@string/home_other_mi_pad_enable_more_setting_desc"
android:title="@string/home_other_mi_pad_enable_more_setting_title" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_home_title_hide_report_text"
android:summary="@string/home_title_hide_report_text_desc"
android:title="@string/home_title_hide_report_text" />

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

0 comments on commit 5c6444e

Please sign in to comment.