Skip to content

Commit 75d1abf

Browse files
authored
Merge pull request #454 from Memory2314/main
添加 系统桌面-图标与标题-伪装为非默认图标
2 parents 45901f1 + 83d6254 commit 75d1abf

5 files changed

Lines changed: 44 additions & 0 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
import com.sevtinge.hyperceiler.module.hook.home.title.DisableHideTheme;
113113
import com.sevtinge.hyperceiler.module.hook.home.title.DownloadAnimation;
114114
import com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonoChrome;
115+
import com.sevtinge.hyperceiler.module.hook.home.title.FakeNonDefaultIcon;
115116
import com.sevtinge.hyperceiler.module.hook.home.title.FixAnimation;
116117
import com.sevtinge.hyperceiler.module.hook.home.title.HiddenAllTitle;
117118
import com.sevtinge.hyperceiler.module.hook.home.title.IconTitleColor;
@@ -223,6 +224,7 @@ public void handleLoadPackage() {
223224
initHook(DisableHideTheme.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_theme"));
224225
initHook(DisableHideFile.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_file"));
225226
initHook(DisableHideGoogle.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_google"));
227+
initHook(FakeNonDefaultIcon.INSTANCE, mPrefsMap.getBoolean("fake_non_default_icon"));
226228
initHook(new AnimParamCustom(), mPrefsMap.getBoolean("home_title_custom_anim_param_main"));
227229
// initHook(new IconScaleHook()/*, mPrefsMap.getInt("home_title_icon_scale", 100) != 100*/);
228230

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
19+
package com.sevtinge.hyperceiler.module.hook.home.title;
20+
21+
import com.sevtinge.hyperceiler.module.base.BaseHook;
22+
23+
public class FakeNonDefaultIcon extends BaseHook {
24+
@Override
25+
public void init() {
26+
findAndHookMethod("com.miui.home.launcher.DeviceConfig", "isDefaultIcon", new MethodHook() {
27+
@Override
28+
protected void before(MethodHookParam param) throws Throwable {
29+
param.setResult(false);
30+
}
31+
});
32+
}
33+
}

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@
11661166
<string name="home_title_disable_hide_file">禁止隐藏 \"文件\" 图标</string>
11671167
<string name="home_title_disable_hide_theme">禁止隐藏 \"主题壁纸\" 图标</string>
11681168
<string name="home_title_disable_hide_google">禁止隐藏 \"Google\" 图标</string>
1169+
<string name="home_title_fake_non_default_icon">伪装为非默认图标</string>
11691170
<string name="home_title_custom_anim_param">自定义动画曲线</string>
11701171
<string name="home_title_custom_anim_param_damping_title">阻尼</string>
11711172
<string name="home_title_custom_anim_param_stiffness_title">刚度</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@
11441144
<string name="home_title_disable_hide_file">Disable hiding the \"File\" icon</string>
11451145
<string name="home_title_disable_hide_theme">Do not hide \"Theme Manager\" icon</string>
11461146
<string name="home_title_disable_hide_google">Don\'t hide the \"Google\" icon</string>
1147+
<string name="home_title_fake_non_default_icon">Fake non-default icon</string>
11471148
<string name="home_title_custom_anim_param">Custom Animation Parameter</string>
11481149
<string name="home_title_custom_anim_param_damping_title">Damping</string>
11491150
<string name="home_title_custom_anim_param_stiffness_title">Stiffness</string>

app/src/main/res/xml/prefs_about_contributor.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
android:action="android.intent.action.VIEW"
8787
android:data="https://github.com/Henvy-Mango" />
8888
</Preference>
89+
<Preference
90+
android:summary="GitHub@Memory2314"
91+
android:title="Memory">
92+
<intent
93+
android:action="android.intent.action.VIEW"
94+
android:data="https://github.com/Memory2314" />
95+
</Preference>
8996
<Preference
9097
android:summary="CoolApk@MonetCarlos"
9198
android:title="MonetCarlos">

0 commit comments

Comments
 (0)