Skip to content

Commit 59c0066

Browse files
committed
优化项目代码 && 移除部分非必要推荐作用域
Signed-off-by: mu7220 <[email protected]>
1 parent 81bae7c commit 59c0066

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+151
-205
lines changed

README.md

+60-64
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div align="center">
1+
<p style="text-align:center;">
22

3-
<img width="" src="/imgs/icon.png" width=160 height=160 align="center">
3+
<img src="/imgs/icon.png" width="160" height="160" style="display: block; margin: 0 auto;" alt="icon">
44

55
# HyperCeiler
66

77
### Make HyperOS/MIUI Great Again!
88

99
简体中文&nbsp;&nbsp;|&nbsp;&nbsp;[English](/README_en-US.md) |&nbsp;&nbsp;[Português (Brasil)](/README_pt-BR.md)
1010

11-
</div>
11+
</p>
1212

1313
## 支持的版本
1414

@@ -31,67 +31,63 @@ HyperCeiler 已停止维护 Android 11-12 的 MIUI ROM,除系统框架、系
3131
<details>
3232
<summary>点击展开折叠的内容</summary>
3333

34-
| 应用名 | 包名 |
35-
|:------------------------------|:-----------------------------------|
36-
| 系统框架 | system |
37-
| 系统界面 | com.android.systemui |
38-
| 系统桌面 | com.miui.home |
39-
| 系统更新 | com.android.updater |
40-
| Joyose | com.xiaomi.joyose |
41-
| 小米设置 | com.xiaomi.misettings |
42-
| 安全服务 (手机管家、平板管家) | com.miui.securitycenter |
43-
| 笔记 | com.miui.notes |
44-
| 壁纸 | com.miui.miwallpaper |
45-
| 传送门 | com.miui.contentextension |
46-
| 弹幕通知 | com.xiaomi.barrage |
47-
| 百度输入法小米版 | com.baidu.input_mi |
48-
| 电话 | com.android.incallui |
49-
| 电话服务 | com.android.phone |
50-
| 电量与性能 | com.miui.powerkeeper |
51-
| 短信 | com.android.mms |
52-
| 截屏 | com.miui.screenshot |
53-
| 垃圾清理 | com.miui.cleanmaster |
54-
| 浏览器 | com.android.browser |
55-
| 鲁班(MTB) | com.xiaomi.mtb |
56-
| 屏幕录制 | com.miui.screenrecorder |
57-
| 权限管理服务 | com.lbe.security.miui |
58-
| 设置 | com.android.settings |
59-
| 搜狗输入法小米版 | com.sohu.inputmethod.sogou.xiaomi |
60-
| 天气 | com.miui.weather2 |
61-
| 互联互通服务 (投屏) | com.milink.service |
62-
| 外部存储设备 | com.android.externalstorage |
63-
| 息屏与锁屏编辑 (万象息屏) | com.miui.aod |
64-
| 文件管理 | com.android.fileexplorer |
65-
| 系统服务组件 | com.miui.securityadd |
66-
| 下载管理 | com.android.providers.downloads.ui |
67-
| 下载管理程序 | com.android.providers.downloads |
68-
| 相册 | com.miui.gallery |
69-
| 小米创作 | com.miui.creation |
70-
| 小米互传 | com.miui.mishare.connectivity |
71-
| 小米相册 - 编辑 | com.miui.mediaeditor |
72-
| 小米云服务 | com.miui.cloudservice |
73-
| 小米智能卡 | com.miui.tsmclient |
74-
| 讯飞输入法小米版 | com.iflytek.inputmethod.miui |
75-
| 应用包管理组件 | com.miui.packageinstaller |
76-
| 应用商店 | com.xiaomi.market |
77-
| 智能助理 | com.miui.personalassistant |
78-
| 主题商店 (主题壁纸、壁纸与个性化) | com.android.thememanager |
79-
| com.miui.rom | com.miui.rom |
80-
| 系统安全组件 | com.miui.guardprovider |
81-
| 时钟 | com.android.deskclock |
82-
| 相机 | com.android.camera |
83-
| 小爱翻译 | com.xiaomi.aiasst.vision |
84-
| 小爱建议 | com.xiaomi.aireco |
85-
| 小爱视觉 | com.xiaomi.scanner |
86-
| 小爱同学 | com.miui.voiceassist |
87-
| 音乐 | com.miui.player |
88-
| 跨屏协同服务 (MIUI+ Beta 版) | com.xiaomi.mirror |
89-
| NetworkBoost | com.xiaomi.NetworkBoost |
90-
| NFC 服务 | com.android.nfc |
91-
| 音质音效 | com.miui.misound |
92-
| 备份 | com.miui.backup |
93-
| 小米换机 | com.miui.huanji |
94-
| MiTrustService | com.xiaomi.trustservice |
34+
| 应用名 | 包名 |
35+
|:----------------------|:-----------------------------------|
36+
| 系统框架 | system |
37+
| 系统界面 | com.android.systemui |
38+
| 系统桌面 | com.miui.home |
39+
| 系统更新 | com.android.updater |
40+
| Joyose | com.xiaomi.joyose |
41+
| 小米设置 | com.xiaomi.misettings |
42+
| 安全服务 (手机管家、平板管家) | com.miui.securitycenter |
43+
| 笔记 | com.miui.notes |
44+
| 壁纸 | com.miui.miwallpaper |
45+
| 传送门 | com.miui.contentextension |
46+
| 弹幕通知 | com.xiaomi.barrage |
47+
| 百度输入法小米版 | com.baidu.input_mi |
48+
| 电话 | com.android.incallui |
49+
| 电话服务 | com.android.phone |
50+
| 电量与性能 | com.miui.powerkeeper |
51+
| 短信 | com.android.mms |
52+
| 截屏 | com.miui.screenshot |
53+
| 垃圾清理 | com.miui.cleanmaster |
54+
| 浏览器 | com.android.browser |
55+
| 鲁班(MTB) | com.xiaomi.mtb |
56+
| 屏幕录制 | com.miui.screenrecorder |
57+
| 权限管理服务 | com.lbe.security.miui |
58+
| 设置 | com.android.settings |
59+
| 搜狗输入法小米版 | com.sohu.inputmethod.sogou.xiaomi |
60+
| 天气 | com.miui.weather2 |
61+
| 互联互通服务 (投屏) | com.milink.service |
62+
| 外部存储设备 | com.android.externalstorage |
63+
| 息屏与锁屏编辑 (万象息屏) | com.miui.aod |
64+
| 文件管理 | com.android.fileexplorer |
65+
| 系统服务组件 | com.miui.securityadd |
66+
| 下载管理 | com.android.providers.downloads.ui |
67+
| 下载管理程序 | com.android.providers.downloads |
68+
| 相册 | com.miui.gallery |
69+
| 小米创作 | com.miui.creation |
70+
| 小米互传 | com.miui.mishare.connectivity |
71+
| 小米相册 - 编辑 | com.miui.mediaeditor |
72+
| 小米云服务 | com.miui.cloudservice |
73+
| 小米智能卡 | com.miui.tsmclient |
74+
| 讯飞输入法小米版 | com.iflytek.inputmethod.miui |
75+
| 应用包管理组件 | com.miui.packageinstaller |
76+
| 应用商店 | com.xiaomi.market |
77+
| 智能助理 | com.miui.personalassistant |
78+
| 主题商店 (主题壁纸、壁纸与个性化) | com.android.thememanager |
79+
| 系统安全组件 | com.miui.guardprovider |
80+
| 相机 | com.android.camera |
81+
| 小爱翻译 | com.xiaomi.aiasst.vision |
82+
| 小爱建议 | com.xiaomi.aireco |
83+
| 小爱视觉 | com.xiaomi.scanner |
84+
| 小爱同学 | com.miui.voiceassist |
85+
| NetworkBoost | com.xiaomi.NetworkBoost |
86+
| NFC 服务 | com.android.nfc |
87+
| 音质音效 | com.miui.misound |
88+
| 备份 | com.miui.backup |
89+
| 小米换机 | com.miui.huanji |
90+
| MiTrustService | com.xiaomi.trustservice |
9591

9692
</details>
9793

README_en-US.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div align="center">
1+
<p style="text-align:center;">
22

3-
<img width="" src="/imgs/icon.png" width=160 height=160 align="center">
3+
<img src="/imgs/icon.png" width="160" height="160" style="display: block; margin: 0 auto;" alt="icon">
44

55
# HyperCeiler
66

77
### Make HyperOS/MIUI Great Again!
88

99
[简体中文](/README.md)&nbsp;&nbsp;|&nbsp;&nbsp;English |&nbsp;&nbsp;[Português (Brasil)](/README_pt-BR.md)
1010

11-
</div>
11+
</p>
1212

1313
## Supported versions
1414

@@ -76,16 +76,12 @@ HyperCeiler has stopped maintaining the MIUI ROM of Android 11-12, except for th
7676
| GetApps | com.xiaomi.market |
7777
| App vault | com.miui.personalassistant |
7878
| Themes | com.android.thememanager |
79-
| com.miui.rom | com.miui.rom |
8079
| MIUI Security Components | com.miui.guardprovider |
81-
| Clock | com.android.deskclock |
8280
| Camera | com.android.camera |
8381
| Mi AI Translate | com.xiaomi.aiasst.vision |
8482
| Mi AI Suggestions | com.xiaomi.aireco |
8583
| Scanner | com.xiaomi.scanner |
8684
| Mi AI | com.miui.voiceassist |
87-
| Music | com.miui.player |
88-
| MIUI+ | com.xiaomi.mirror |
8985
| NetworkBoost | com.xiaomi.NetworkBoost |
9086
| NFC Service | com.android.nfc |
9187
| Earphones | com.miui.misound |

README_pt-BR.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div align="center">
1+
<p style="text-align:center;">
22

3-
<img width="" src="/imgs/icon.png" width=160 height=160 align="center">
3+
<img src="/imgs/icon.png" width="160" height="160" style="display: block; margin: 0 auto;" alt="icon">
44

55
# HyperCeiler
66

77
### Torne o HyperOS/MIUI ótimo novamente!
88

99
[简体中文](/README.md)&nbsp;&nbsp;|&nbsp;&nbsp;[English](/README_en-US.md) |&nbsp;&nbsp;Português (Brasil)
1010

11-
</div>
11+
</p>
1212

1313
## Versões suportadas
1414

@@ -76,16 +76,12 @@ O HyperCeiler deixou de ser mantido em ROM MIUI para o Android 11-12, exceto par
7676
| GetApps | com.xiaomi.market |
7777
| Assistente | com.miui.personalassistant |
7878
| Temas | com.android.thememanager |
79-
| com.miui.rom | com.miui.rom |
8079
| Componentes de segurança do HyperOS | com.miui.guardprovider |
81-
| Relógio | com.android.deskclock |
8280
| Câmera | com.android.camera |
8381
| Mi AI Translate | com.xiaomi.aiasst.vision |
8482
| AI Reco | com.xiaomi.aireco |
8583
| Scanner | com.xiaomi.scanner |
8684
| Mi AI | com.miui.voiceassist |
87-
| Música | com.miui.player |
88-
| Serviços de interconectividade de dispositivos | com.xiaomi.mirror |
8985
| NetworkBoost | com.xiaomi.NetworkBoost |
9086
| Serviço NFC | com.android.nfc |
9187
| Fones de ouvido | com.miui.misound |

app/build.gradle

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ android {
7474
System.console()?.readLine('\n' + prompt + ': ')
7575
}
7676
def keyStoreFile = getString('storeFile', 'STORE_FILE', 'Store file')?.with(rootProject.&file)
77+
def gitRevision = getGitRevision()
7778

7879
signingConfigs {
7980
hyperceiler {
@@ -113,14 +114,14 @@ android {
113114
minifyEnabled true
114115
shrinkResources true
115116
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
116-
versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + getGitRevision()
117+
versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + gitRevision
117118
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
118119
if (keyStoreFile != null) {
119120
signingConfig signingConfigs.hyperceiler
120121
}
121122
}
122123
debug {
123-
versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + getGitRevision()
124+
versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + gitRevision
124125
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
125126
if (keyStoreFile != null) {
126127
signingConfig signingConfigs.hyperceiler

app/src/main/java/com/sevtinge/hyperceiler/data/adapter/NavigationPagerAdapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import androidx.annotation.NonNull;
2424
import androidx.fragment.app.Fragment;
2525
import androidx.fragment.app.FragmentManager;
26-
import androidx.fragment.app.FragmentPagerAdapter;
2726
import androidx.fragment.app.FragmentStatePagerAdapter;
2827

2928
import java.util.List;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package com.sevtinge.hyperceiler.module.app;
2020

21-
import static com.sevtinge.hyperceiler.utils.api.LinQiqiApisKt.isNewNetworkStyle;
21+
import static com.sevtinge.hyperceiler.utils.api.NekoQiqiApisKt.isNewNetworkStyle;
2222
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion;
2323
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion;
2424
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;

app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseModule.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ public void init(LoadPackageParam lpparam) {
5454
try {
5555
if (!ProjectApi.mAppModulePkg.equals(lpparam.packageName)) {
5656
Handler handler = new Handler();
57-
ContextUtils.getWaitContext(context -> {
58-
handler.post(
59-
() -> {
60-
if (context != null) {
61-
ResourcesTool.loadModuleRes(context);
62-
}
63-
}
64-
);
57+
ContextUtils.getWaitContext(context -> handler.post(
58+
() -> {
59+
if (context != null) {
60+
ResourcesTool.loadModuleRes(context);
61+
}
6562
}
63+
)
6664
, "android".equals(lpparam.packageName));
6765
}
6866
} catch (Throwable e) {

app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import static com.sevtinge.hyperceiler.utils.log.LogManager.logLevelDesc;
2929
import static com.sevtinge.hyperceiler.utils.log.XposedLogUtils.logI;
3030

31+
import android.annotation.SuppressLint;
32+
3133
import com.sevtinge.hyperceiler.module.app.AiAsst;
3234
import com.sevtinge.hyperceiler.module.app.Aod;
3335
import com.sevtinge.hyperceiler.module.app.Backup;
@@ -101,6 +103,7 @@ public abstract class BaseXposedInit implements IXposedHookLoadPackage, IXposedH
101103

102104
public static boolean isSafeModeOn = false;
103105

106+
@SuppressLint("StaticFieldLeak")
104107
public static ResourcesTool mResHook;
105108
public static String mModulePath = null;
106109
public static PrefsMap<String, Object> mPrefsMap = new PrefsMap<>();

app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/XposedTool.java

+6-10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package com.sevtinge.hyperceiler.module.base.tool;
2020

21+
import android.annotation.SuppressLint;
2122
import android.app.Application;
2223
import android.content.Context;
2324
import android.content.res.ColorStateList;
@@ -55,6 +56,7 @@ public class XposedTool extends XposedLogUtils {
5556
public static WeakReference<TextView> mPct;
5657

5758
// public Context mModuleContext = null;
59+
@SuppressLint("StaticFieldLeak")
5860
public static final ResourcesTool mResHook = XposedInit.mResHook;
5961

6062
public static void setTextView(TextView textView) {
@@ -87,12 +89,8 @@ public static Context findContext(@ContextUtils.Duration int flag) {
8789
if ((context = currentApplication()) == null)
8890
context = getSystemContext();
8991
}
90-
case 1 -> {
91-
context = currentApplication();
92-
}
93-
case 2 -> {
94-
context = getSystemContext();
95-
}
92+
case 1 -> context = currentApplication();
93+
case 2 -> context = getSystemContext();
9694
default -> {
9795
}
9896
}
@@ -149,8 +147,7 @@ public static String getPackageVersionName(XC_LoadPackage.LoadPackageParam lppar
149147
Object parser = parserCls.newInstance();
150148
File apkPath = new File(lpparam.appInfo.sourceDir);
151149
Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0);
152-
String versionName = (String) XposedHelpers.getObjectField(pkg, "mVersionName");
153-
return versionName;
150+
return (String) XposedHelpers.getObjectField(pkg, "mVersionName");
154151
} catch (Throwable e) {
155152
return "";
156153
}
@@ -162,8 +159,7 @@ public static int getPackageVersionCode(XC_LoadPackage.LoadPackageParam lpparam)
162159
Object parser = parserCls.newInstance();
163160
File apkPath = new File(lpparam.appInfo.sourceDir);
164161
Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0);
165-
int versionCode = XposedHelpers.getIntField(pkg, "mVersionCode");
166-
return versionCode;
162+
return XposedHelpers.getIntField(pkg, "mVersionCode");
167163
} catch (Throwable e) {
168164
return -1;
169165
}

app/src/main/java/com/sevtinge/hyperceiler/module/hook/camera/CustomWatermark.java

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.luckypray.dexkit.result.MethodDataList;
3232

3333
import java.lang.reflect.Method;
34-
import java.lang.reflect.Modifier;
3534

3635
public class CustomWatermark extends BaseHook {
3736
@Override

0 commit comments

Comments
 (0)