diff --git a/README.md b/README.md index 834af5510d..2e21090193 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -
+

- +icon # HyperCeiler @@ -8,7 +8,7 @@ 简体中文  |  [English](/README_en-US.md) |  [Português (Brasil)](/README_pt-BR.md) -

+

## 支持的版本 @@ -31,67 +31,63 @@ HyperCeiler 已停止维护 Android 11-12 的 MIUI ROM,除系统框架、系
点击展开折叠的内容 -| 应用名 | 包名 | -|:------------------------------|:-----------------------------------| -| 系统框架 | system | -| 系统界面 | com.android.systemui | -| 系统桌面 | com.miui.home | -| 系统更新 | com.android.updater | -| Joyose | com.xiaomi.joyose | -| 小米设置 | com.xiaomi.misettings | -| 安全服务 (手机管家、平板管家) | com.miui.securitycenter | -| 笔记 | com.miui.notes | -| 壁纸 | com.miui.miwallpaper | -| 传送门 | com.miui.contentextension | -| 弹幕通知 | com.xiaomi.barrage | -| 百度输入法小米版 | com.baidu.input_mi | -| 电话 | com.android.incallui | -| 电话服务 | com.android.phone | -| 电量与性能 | com.miui.powerkeeper | -| 短信 | com.android.mms | -| 截屏 | com.miui.screenshot | -| 垃圾清理 | com.miui.cleanmaster | -| 浏览器 | com.android.browser | -| 鲁班(MTB) | com.xiaomi.mtb | -| 屏幕录制 | com.miui.screenrecorder | -| 权限管理服务 | com.lbe.security.miui | -| 设置 | com.android.settings | -| 搜狗输入法小米版 | com.sohu.inputmethod.sogou.xiaomi | -| 天气 | com.miui.weather2 | -| 互联互通服务 (投屏) | com.milink.service | -| 外部存储设备 | com.android.externalstorage | -| 息屏与锁屏编辑 (万象息屏) | com.miui.aod | -| 文件管理 | com.android.fileexplorer | -| 系统服务组件 | com.miui.securityadd | -| 下载管理 | com.android.providers.downloads.ui | -| 下载管理程序 | com.android.providers.downloads | -| 相册 | com.miui.gallery | -| 小米创作 | com.miui.creation | -| 小米互传 | com.miui.mishare.connectivity | -| 小米相册 - 编辑 | com.miui.mediaeditor | -| 小米云服务 | com.miui.cloudservice | -| 小米智能卡 | com.miui.tsmclient | -| 讯飞输入法小米版 | com.iflytek.inputmethod.miui | -| 应用包管理组件 | com.miui.packageinstaller | -| 应用商店 | com.xiaomi.market | -| 智能助理 | com.miui.personalassistant | -| 主题商店 (主题壁纸、壁纸与个性化) | com.android.thememanager | -| com.miui.rom | com.miui.rom | -| 系统安全组件 | com.miui.guardprovider | -| 时钟 | com.android.deskclock | -| 相机 | com.android.camera | -| 小爱翻译 | com.xiaomi.aiasst.vision | -| 小爱建议 | com.xiaomi.aireco | -| 小爱视觉 | com.xiaomi.scanner | -| 小爱同学 | com.miui.voiceassist | -| 音乐 | com.miui.player | -| 跨屏协同服务 (MIUI+ Beta 版) | com.xiaomi.mirror | -| NetworkBoost | com.xiaomi.NetworkBoost | -| NFC 服务 | com.android.nfc | -| 音质音效 | com.miui.misound | -| 备份 | com.miui.backup | -| 小米换机 | com.miui.huanji | -| MiTrustService | com.xiaomi.trustservice | +| 应用名 | 包名 | +|:----------------------|:-----------------------------------| +| 系统框架 | system | +| 系统界面 | com.android.systemui | +| 系统桌面 | com.miui.home | +| 系统更新 | com.android.updater | +| Joyose | com.xiaomi.joyose | +| 小米设置 | com.xiaomi.misettings | +| 安全服务 (手机管家、平板管家) | com.miui.securitycenter | +| 笔记 | com.miui.notes | +| 壁纸 | com.miui.miwallpaper | +| 传送门 | com.miui.contentextension | +| 弹幕通知 | com.xiaomi.barrage | +| 百度输入法小米版 | com.baidu.input_mi | +| 电话 | com.android.incallui | +| 电话服务 | com.android.phone | +| 电量与性能 | com.miui.powerkeeper | +| 短信 | com.android.mms | +| 截屏 | com.miui.screenshot | +| 垃圾清理 | com.miui.cleanmaster | +| 浏览器 | com.android.browser | +| 鲁班(MTB) | com.xiaomi.mtb | +| 屏幕录制 | com.miui.screenrecorder | +| 权限管理服务 | com.lbe.security.miui | +| 设置 | com.android.settings | +| 搜狗输入法小米版 | com.sohu.inputmethod.sogou.xiaomi | +| 天气 | com.miui.weather2 | +| 互联互通服务 (投屏) | com.milink.service | +| 外部存储设备 | com.android.externalstorage | +| 息屏与锁屏编辑 (万象息屏) | com.miui.aod | +| 文件管理 | com.android.fileexplorer | +| 系统服务组件 | com.miui.securityadd | +| 下载管理 | com.android.providers.downloads.ui | +| 下载管理程序 | com.android.providers.downloads | +| 相册 | com.miui.gallery | +| 小米创作 | com.miui.creation | +| 小米互传 | com.miui.mishare.connectivity | +| 小米相册 - 编辑 | com.miui.mediaeditor | +| 小米云服务 | com.miui.cloudservice | +| 小米智能卡 | com.miui.tsmclient | +| 讯飞输入法小米版 | com.iflytek.inputmethod.miui | +| 应用包管理组件 | com.miui.packageinstaller | +| 应用商店 | com.xiaomi.market | +| 智能助理 | com.miui.personalassistant | +| 主题商店 (主题壁纸、壁纸与个性化) | com.android.thememanager | +| 系统安全组件 | com.miui.guardprovider | +| 相机 | com.android.camera | +| 小爱翻译 | com.xiaomi.aiasst.vision | +| 小爱建议 | com.xiaomi.aireco | +| 小爱视觉 | com.xiaomi.scanner | +| 小爱同学 | com.miui.voiceassist | +| NetworkBoost | com.xiaomi.NetworkBoost | +| NFC 服务 | com.android.nfc | +| 音质音效 | com.miui.misound | +| 备份 | com.miui.backup | +| 小米换机 | com.miui.huanji | +| MiTrustService | com.xiaomi.trustservice |
diff --git a/README_en-US.md b/README_en-US.md index c69b09456f..99c9df249e 100644 --- a/README_en-US.md +++ b/README_en-US.md @@ -1,6 +1,6 @@ -
+

- +icon # HyperCeiler @@ -8,7 +8,7 @@ [简体中文](/README.md)  |  English |  [Português (Brasil)](/README_pt-BR.md) -

+

## Supported versions @@ -76,16 +76,12 @@ HyperCeiler has stopped maintaining the MIUI ROM of Android 11-12, except for th | GetApps | com.xiaomi.market | | App vault | com.miui.personalassistant | | Themes | com.android.thememanager | -| com.miui.rom | com.miui.rom | | MIUI Security Components | com.miui.guardprovider | -| Clock | com.android.deskclock | | Camera | com.android.camera | | Mi AI Translate | com.xiaomi.aiasst.vision | | Mi AI Suggestions | com.xiaomi.aireco | | Scanner | com.xiaomi.scanner | | Mi AI | com.miui.voiceassist | -| Music | com.miui.player | -| MIUI+ | com.xiaomi.mirror | | NetworkBoost | com.xiaomi.NetworkBoost | | NFC Service | com.android.nfc | | Earphones | com.miui.misound | diff --git a/README_pt-BR.md b/README_pt-BR.md index f5bc83bdfb..79fd69a2aa 100644 --- a/README_pt-BR.md +++ b/README_pt-BR.md @@ -1,6 +1,6 @@ -
+

- +icon # HyperCeiler @@ -8,7 +8,7 @@ [简体中文](/README.md)  |  [English](/README_en-US.md) |  Português (Brasil) -

+

## Versões suportadas @@ -76,16 +76,12 @@ O HyperCeiler deixou de ser mantido em ROM MIUI para o Android 11-12, exceto par | GetApps | com.xiaomi.market | | Assistente | com.miui.personalassistant | | Temas | com.android.thememanager | -| com.miui.rom | com.miui.rom | | Componentes de segurança do HyperOS | com.miui.guardprovider | -| Relógio | com.android.deskclock | | Câmera | com.android.camera | | Mi AI Translate | com.xiaomi.aiasst.vision | | AI Reco | com.xiaomi.aireco | | Scanner | com.xiaomi.scanner | | Mi AI | com.miui.voiceassist | -| Música | com.miui.player | -| Serviços de interconectividade de dispositivos | com.xiaomi.mirror | | NetworkBoost | com.xiaomi.NetworkBoost | | Serviço NFC | com.android.nfc | | Fones de ouvido | com.miui.misound | diff --git a/app/build.gradle b/app/build.gradle index 9db34b0b54..cac2f7adcd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -74,6 +74,7 @@ android { System.console()?.readLine('\n' + prompt + ': ') } def keyStoreFile = getString('storeFile', 'STORE_FILE', 'Store file')?.with(rootProject.&file) + def gitRevision = getGitRevision() signingConfigs { hyperceiler { @@ -113,14 +114,14 @@ android { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + getGitRevision() + versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + gitRevision buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\"" if (keyStoreFile != null) { signingConfig signingConfigs.hyperceiler } } debug { - versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + getGitRevision() + versionNameSuffix "_" + DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDateTime.now()) + "_" + gitRevision buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\"" if (keyStoreFile != null) { signingConfig signingConfigs.hyperceiler diff --git a/app/src/main/java/com/sevtinge/hyperceiler/data/adapter/NavigationPagerAdapter.java b/app/src/main/java/com/sevtinge/hyperceiler/data/adapter/NavigationPagerAdapter.java index 84fbf98c44..46d17790ed 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/data/adapter/NavigationPagerAdapter.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/data/adapter/NavigationPagerAdapter.java @@ -23,7 +23,6 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentStatePagerAdapter; import java.util.List; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java index b08d5977ef..58ea54720b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.app; -import static com.sevtinge.hyperceiler.utils.api.LinQiqiApisKt.isNewNetworkStyle; +import static com.sevtinge.hyperceiler.utils.api.NekoQiqiApisKt.isNewNetworkStyle; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseModule.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseModule.java index 93b6971fd1..e3de75d54d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseModule.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseModule.java @@ -54,15 +54,13 @@ public void init(LoadPackageParam lpparam) { try { if (!ProjectApi.mAppModulePkg.equals(lpparam.packageName)) { Handler handler = new Handler(); - ContextUtils.getWaitContext(context -> { - handler.post( - () -> { - if (context != null) { - ResourcesTool.loadModuleRes(context); - } - } - ); + ContextUtils.getWaitContext(context -> handler.post( + () -> { + if (context != null) { + ResourcesTool.loadModuleRes(context); + } } + ) , "android".equals(lpparam.packageName)); } } catch (Throwable e) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java index 1a53d859fe..65342e2a96 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java @@ -28,6 +28,8 @@ import static com.sevtinge.hyperceiler.utils.log.LogManager.logLevelDesc; import static com.sevtinge.hyperceiler.utils.log.XposedLogUtils.logI; +import android.annotation.SuppressLint; + import com.sevtinge.hyperceiler.module.app.AiAsst; import com.sevtinge.hyperceiler.module.app.Aod; import com.sevtinge.hyperceiler.module.app.Backup; @@ -101,6 +103,7 @@ public abstract class BaseXposedInit implements IXposedHookLoadPackage, IXposedH public static boolean isSafeModeOn = false; + @SuppressLint("StaticFieldLeak") public static ResourcesTool mResHook; public static String mModulePath = null; public static PrefsMap mPrefsMap = new PrefsMap<>(); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/XposedTool.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/XposedTool.java index 67ea50dc3e..f37e006157 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/XposedTool.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/XposedTool.java @@ -18,6 +18,7 @@ */ package com.sevtinge.hyperceiler.module.base.tool; +import android.annotation.SuppressLint; import android.app.Application; import android.content.Context; import android.content.res.ColorStateList; @@ -55,6 +56,7 @@ public class XposedTool extends XposedLogUtils { public static WeakReference mPct; // public Context mModuleContext = null; + @SuppressLint("StaticFieldLeak") public static final ResourcesTool mResHook = XposedInit.mResHook; public static void setTextView(TextView textView) { @@ -87,12 +89,8 @@ public static Context findContext(@ContextUtils.Duration int flag) { if ((context = currentApplication()) == null) context = getSystemContext(); } - case 1 -> { - context = currentApplication(); - } - case 2 -> { - context = getSystemContext(); - } + case 1 -> context = currentApplication(); + case 2 -> context = getSystemContext(); default -> { } } @@ -149,8 +147,7 @@ public static String getPackageVersionName(XC_LoadPackage.LoadPackageParam lppar Object parser = parserCls.newInstance(); File apkPath = new File(lpparam.appInfo.sourceDir); Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0); - String versionName = (String) XposedHelpers.getObjectField(pkg, "mVersionName"); - return versionName; + return (String) XposedHelpers.getObjectField(pkg, "mVersionName"); } catch (Throwable e) { return ""; } @@ -162,8 +159,7 @@ public static int getPackageVersionCode(XC_LoadPackage.LoadPackageParam lpparam) Object parser = parserCls.newInstance(); File apkPath = new File(lpparam.appInfo.sourceDir); Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0); - int versionCode = XposedHelpers.getIntField(pkg, "mVersionCode"); - return versionCode; + return XposedHelpers.getIntField(pkg, "mVersionCode"); } catch (Throwable e) { return -1; } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/camera/CustomWatermark.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/camera/CustomWatermark.java index a0f54ea318..7ab8e82148 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/camera/CustomWatermark.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/camera/CustomWatermark.java @@ -31,7 +31,6 @@ import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; public class CustomWatermark extends BaseHook { @Override diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/AnimDurationRatio.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/AnimDurationRatio.kt index 49e7b35d28..575b8a6c2d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/AnimDurationRatio.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/AnimDurationRatio.kt @@ -28,7 +28,7 @@ object AnimDurationRatio : BaseHook() { var value1 = mPrefsMap.getInt("home_title_animation_speed", 100).toFloat() var value2 = mPrefsMap.getInt("home_recent_animation_speed", 100).toFloat() if (value1 != 100f) { - value1 = value1 / 100f + value1 /= 100f loadClass("com.miui.home.recents.util.RectFSpringAnim").methodFinder().first { name == "getModifyResponse" }.createHook { @@ -38,7 +38,7 @@ object AnimDurationRatio : BaseHook() { } } if (value2 != 100f) { - value2 = value2 / 100f + value2 /= 100f loadClass("com.miui.home.launcher.common.DeviceLevelUtils").methodFinder().first { name == "getDeviceLevelTransitionAnimRatio" }.createHook { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/drawer/PinyinArrangement.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/drawer/PinyinArrangement.java index 5d8ff2b92a..923149025a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/drawer/PinyinArrangement.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/drawer/PinyinArrangement.java @@ -19,6 +19,8 @@ package com.sevtinge.hyperceiler.module.hook.home.drawer; import android.app.Activity; +import android.content.res.Configuration; +import android.os.LocaleList; import com.github.promeg.pinyinhelper.Pinyin; import com.sevtinge.hyperceiler.module.base.BaseHook; @@ -28,7 +30,7 @@ import de.robv.android.xposed.XposedHelpers; public class PinyinArrangement extends BaseHook { - Locale locale; + LocaleList locale; Activity activity; @Override @@ -64,13 +66,14 @@ protected void before(MethodHookParam param) { @Override protected void before(MethodHookParam param) { activity = (Activity) XposedHelpers.getObjectField(param.thisObject, "mLauncher"); - locale = activity.getResources().getConfiguration().locale; + locale = activity.getResources().getConfiguration().getLocales(); activity.getResources().getConfiguration().setLocale(Locale.SIMPLIFIED_CHINESE); } @Override protected void after(MethodHookParam param) { - activity.getResources().getConfiguration().setLocale(locale); + Configuration configuration = activity.getResources().getConfiguration(); + configuration.setLocales(locale); } } ); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt index c21b45a58a..d4b43f2944 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt @@ -23,7 +23,6 @@ import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.BaseHook import com.sevtinge.hyperceiler.utils.api.IS_TABLET -import com.sevtinge.hyperceiler.utils.api.isPad object AlwaysShowCleanUp: BaseHook() { override fun init() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt index c9a20fbd04..ea69d53ff0 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt @@ -29,7 +29,6 @@ import com.github.kyuubiran.ezxhelper.finders.ConstructorFinder.`-Static`.constr import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.BaseHook import com.sevtinge.hyperceiler.utils.api.IS_TABLET -import com.sevtinge.hyperceiler.utils.api.isPad import com.sevtinge.hyperceiler.utils.getObjectField // @SuppressLint("StaticFieldLeak") diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/title/DisableHideFile.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/title/DisableHideFile.kt index 7aa069dde7..f909f14ed7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/title/DisableHideFile.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/title/DisableHideFile.kt @@ -19,9 +19,6 @@ package com.sevtinge.hyperceiler.module.hook.home.title import android.content.ComponentName -import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass -import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook -import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.BaseHook import com.sevtinge.hyperceiler.utils.api.IS_INTERNATIONAL_BUILD import de.robv.android.xposed.XC_MethodHook diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/other/DisableRootCheck.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/other/DisableRootCheck.kt index 5d7e184267..0cb2709590 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/other/DisableRootCheck.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/other/DisableRootCheck.kt @@ -30,7 +30,7 @@ object DisableRootCheck : BaseHook() { addUsingStringsEquals("key_check_item_root") returnType = "boolean" } - }.single().getMethodInstance(lpparam.classLoader)?.createHook { + }.single().getMethodInstance(lpparam.classLoader).createHook { returnConstant(false) } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/AllowUntrustedTouchForU.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/AllowUntrustedTouchForU.java index 22e55010ed..292bba0d27 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/AllowUntrustedTouchForU.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/AllowUntrustedTouchForU.java @@ -20,8 +20,6 @@ import com.sevtinge.hyperceiler.module.base.BaseHook; -import de.robv.android.xposed.XposedHelpers; - public class AllowUntrustedTouchForU extends BaseHook { //Class mInputManager; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/EnableFoldArea.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/EnableFoldArea.kt index 476b400ddc..28e2c332a9 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/EnableFoldArea.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/EnableFoldArea.kt @@ -32,7 +32,7 @@ class EnableFoldArea : BaseHook() { true ) - SettingsFeaturesClass.methodFinder().first(){ + SettingsFeaturesClass.methodFinder().first { name == "isSupportFoldScreenSettings" }.createHook { before{ diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageOverlayPermission.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageOverlayPermission.kt index aef4ab5ffd..ffba46e570 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageOverlayPermission.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageOverlayPermission.kt @@ -32,7 +32,7 @@ class QuickManageOverlayPermission : BaseHook() { object : MethodHook() { override fun before(param: MethodHookParam) { val intent = (param.thisObject as Activity).intent - if (intent.action != Settings.ACTION_MANAGE_OVERLAY_PERMISSION || intent.data == null || intent.data!!.scheme != "package") return@before + if (intent.action != Settings.ACTION_MANAGE_OVERLAY_PERMISSION || intent.data == null || intent.data!!.scheme != "package") return param.thisObject.objectHelper().setObjectUntilSuperclass( "initialFragmentName", "com.android.settings.applications.appinfo.DrawOverlayDetails" diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageUnknownAppSources.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageUnknownAppSources.kt index 345bbd8b7b..a7c18e5175 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageUnknownAppSources.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/QuickManageUnknownAppSources.kt @@ -32,7 +32,7 @@ class QuickManageUnknownAppSources : BaseHook() { object : MethodHook() { override fun before(param: MethodHookParam) { val intent = (param.thisObject as Activity).intent - if (intent.action != Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES || intent.data == null || intent.data!!.scheme != "package") return@before + if (intent.action != Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES || intent.data == null || intent.data!!.scheme != "package") return param.thisObject.objectHelper().setObjectUntilSuperclass( "initialFragmentName", "com.android.settings.applications.appinfo.ExternalSourcesDetails" diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SwitchControlPanel.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SwitchControlPanel.java index be265c5723..410a833aa1 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SwitchControlPanel.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SwitchControlPanel.java @@ -18,7 +18,6 @@ */ package com.sevtinge.hyperceiler.module.hook.systemui; -import static com.sevtinge.hyperceiler.utils.log.AndroidLogUtils.LogD; import static com.sevtinge.hyperceiler.utils.log.AndroidLogUtils.LogI; import android.view.MotionEvent; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGrid.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGrid.kt index b3bd58af11..ac08357388 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGrid.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGrid.kt @@ -29,8 +29,8 @@ import com.sevtinge.hyperceiler.module.base.BaseHook class QQSGrid : BaseHook() { override fun init() { - val cols = mPrefsMap.getInt("system_control_center_old_qs_grid_columns", 5); - val colsHorizontal = mPrefsMap.getInt("system_control_center_old_qs_grid_columns_horizontal", 6); + val cols = mPrefsMap.getInt("system_control_center_old_qs_grid_columns", 5) + val colsHorizontal = mPrefsMap.getInt("system_control_center_old_qs_grid_columns_horizontal", 6) loadClass("com.android.systemui.qs.MiuiQuickQSPanel").methodFinder().first { name == "setMaxTiles" && parameterCount == 1 diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGridOld.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGridOld.java index 0a81d1d46b..082ee078d7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGridOld.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QQSGridOld.java @@ -28,7 +28,6 @@ public void init() { int colsResId = switch (cols) { case 3 -> R.integer.quick_quick_settings_num_rows_3; case 4 -> R.integer.quick_quick_settings_num_rows_4; - case 5 -> R.integer.quick_quick_settings_num_rows_5; case 6 -> R.integer.quick_quick_settings_num_rows_6; case 7 -> R.integer.quick_quick_settings_num_rows_7; default -> R.integer.quick_quick_settings_num_rows_5; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QSGrid.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QSGrid.kt index fbd97a830a..72f1e7cd51 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QSGrid.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/QSGrid.kt @@ -19,15 +19,11 @@ package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter import android.content.res.Configuration -import android.view.View import android.view.ViewGroup - import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder - import com.sevtinge.hyperceiler.module.base.BaseHook - import de.robv.android.xposed.XposedHelpers class QSGrid : BaseHook() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ChargingCVP.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ChargingCVP.kt index 2ce33f0526..e31c2dc6a7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ChargingCVP.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ChargingCVP.kt @@ -206,6 +206,7 @@ object ChargingCVP : BaseHook() { } + @SuppressLint("DefaultLocale") private fun getCVP(): String { // 获取电流信息 val batteryManager = diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ClockDisplaySeconds.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ClockDisplaySeconds.kt index 3fdeac0cc6..d75ccbcf04 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ClockDisplaySeconds.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/ClockDisplaySeconds.kt @@ -35,7 +35,10 @@ import com.sevtinge.hyperceiler.utils.getObjectFieldAs import de.robv.android.xposed.XC_MethodHook import java.lang.reflect.Method import java.text.SimpleDateFormat -import java.util.* +import java.util.Calendar +import java.util.Date +import java.util.Timer +import java.util.TimerTask object ClockDisplaySeconds : BaseHook() { private var nowTime: Date = Calendar.getInstance().time @@ -58,7 +61,7 @@ object ClockDisplaySeconds : BaseHook() { Handler(viewGroup.context.mainLooper).post(r) } } - Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000) + Timer().schedule(T(), 1000 - System.currentTimeMillis() % 1000, 1000) } catch (_: Exception) { } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/RemoveCamera.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/RemoveCamera.kt index 00fa61ae54..e23f573b08 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/RemoveCamera.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/RemoveCamera.kt @@ -54,7 +54,7 @@ object RemoveCamera : BaseHook() { } } } else if (isMiuiVersion(14f) && isAndroidVersion(34)) { - newClass!!.methodFinder().first() { + newClass!!.methodFinder().first { name == "onFinishInflate" }.createHook { after { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/DisplayHardwareDetail.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/DisplayHardwareDetail.java index de4dbdf0f6..d187052447 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/DisplayHardwareDetail.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/DisplayHardwareDetail.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.systemui.statusbar; -import static com.sevtinge.hyperceiler.utils.api.LinQiqiApisKt.isNewNetworkStyle; +import static com.sevtinge.hyperceiler.utils.api.NekoQiqiApisKt.isNewNetworkStyle; import static com.sevtinge.hyperceiler.utils.devicesdk.AppUtilsKt.dp2px; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static de.robv.android.xposed.XposedHelpers.callMethod; @@ -86,8 +86,8 @@ private String getSlotNameByType(int mIconType) { } static class TextIcon { - public boolean atRight; - public int iconType; + public final boolean atRight; + public final int iconType; public TextIcon(boolean mAtRight, int mIconType) { atRight = mAtRight; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/NotificationIconColumns.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/NotificationIconColumns.java index 0946fb7670..70ea155195 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/NotificationIconColumns.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/NotificationIconColumns.java @@ -33,7 +33,6 @@ import com.sevtinge.hyperceiler.module.base.BaseHook; -import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; public class NotificationIconColumns extends BaseHook { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt index 71cd9dd928..b819fba8d8 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt @@ -111,7 +111,7 @@ object TimeCustomization : BaseHook() { Handler(textV.context.mainLooper).post(r) } } - Timer().scheduleAtFixedRate( + Timer().schedule( T(), 1000 - System.currentTimeMillis() % 1000, 1000 ) } catch (_: Exception) { @@ -187,7 +187,7 @@ object TimeCustomization : BaseHook() { Handler(textV.context.mainLooper).post(r) } } - Timer().scheduleAtFixedRate( + Timer().schedule( T(), 1000 - System.currentTimeMillis() % 1000, 1000 ) } catch (_: Exception) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeed.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeed.kt index 98c092fc4b..68a5b6fbfc 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeed.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeed.kt @@ -18,6 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.network.news +import android.annotation.SuppressLint import android.content.Context import android.net.ConnectivityManager import android.net.NetworkCapabilities @@ -96,6 +97,7 @@ object NewNetworkSpeed : BaseHook() { } // 网速计算与隐藏相关 + @SuppressLint("DefaultLocale") private fun humanReadableByteCount(ctx: Context, bytes: Long): String { return try { val modRes = getModuleRes(ctx) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/old/NetworkSpeed.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/old/NetworkSpeed.kt index 77e75ddd13..d1f0bd1323 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/old/NetworkSpeed.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/old/NetworkSpeed.kt @@ -18,6 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.network.old +import android.annotation.SuppressLint import android.content.Context import android.net.ConnectivityManager import android.net.NetworkCapabilities @@ -92,6 +93,7 @@ object NetworkSpeed : BaseHook() { } // 网速计算与隐藏相关 + @SuppressLint("DefaultLocale") private fun humanReadableByteCount(ctx: Context, bytes: Long): String { return try { val modRes = getModuleRes(ctx) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogBlur.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogBlur.java index e6fe30caa5..7a31e10ef5 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogBlur.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogBlur.java @@ -18,6 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.various; +import android.os.Build; import android.view.View; import com.sevtinge.hyperceiler.module.base.BaseHook; @@ -27,7 +28,7 @@ public class DialogBlur extends BaseHook { - Class mDialogCls = findClassIfExists("miuix.appcompat.app.AlertController"); + final Class mDialogCls = findClassIfExists("miuix.appcompat.app.AlertController"); @Override public void init() { @@ -39,7 +40,9 @@ protected void after(MethodHookParam param) throws Throwable { if (mParentPanel != null) { /*new BlurUtils(mParentPanel);*/ - new BlurUtils(mParentPanel, "default"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + new BlurUtils(mParentPanel, "default"); + } } } }); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogGravity.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogGravity.java index 60447f5837..35007cbd41 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogGravity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/various/DialogGravity.java @@ -42,13 +42,13 @@ public class DialogGravity extends BaseHook { - public static Context mContext; - public static View mParentPanel = null; + public Context mContext; + public View mParentPanel = null; - Class mDialogCls = XposedHelpers.findClassIfExists("miuix.appcompat.app.AlertController", lpparam.classLoader); - Class mDialogParentPanelCls = XposedHelpers.findClassIfExists("miuix.internal.widget.DialogParentPanel", lpparam.classLoader); + final Class mDialogCls = XposedHelpers.findClassIfExists("miuix.appcompat.app.AlertController", lpparam.classLoader); + final Class mDialogParentPanelCls = XposedHelpers.findClassIfExists("miuix.internal.widget.DialogParentPanel", lpparam.classLoader); - List methodList = new LinkedList<>(); + final List methodList = new LinkedList<>(); @Override public void init() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/SubPickerActivity.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/SubPickerActivity.java index aeadc3eba3..b9c7950e72 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/SubPickerActivity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/SubPickerActivity.java @@ -19,7 +19,6 @@ package com.sevtinge.hyperceiler.ui; import android.content.Intent; -import android.os.Bundle; import com.sevtinge.hyperceiler.callback.IAppSelectCallback; import com.sevtinge.hyperceiler.ui.base.SettingsActivity; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/customhook/CustomHookConfigActivity.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/customhook/CustomHookConfigActivity.java index 997143aa80..daf5551776 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/customhook/CustomHookConfigActivity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/customhook/CustomHookConfigActivity.java @@ -18,8 +18,6 @@ */ package com.sevtinge.hyperceiler.ui.customhook; -import android.os.Bundle; - import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.SettingsActivity; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/AboutFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/AboutFragment.java index 36c79dc737..d5bc0a6cd1 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/AboutFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/AboutFragment.java @@ -18,21 +18,21 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; - import android.content.Intent; import android.net.Uri; + import com.sevtinge.hyperceiler.BuildConfig; import com.sevtinge.hyperceiler.R; -import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.expansionpacks.utils.ClickCountsUtils; +import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; + import moralnorm.preference.Preference; import moralnorm.preference.SwitchPreference; public class AboutFragment extends SettingsPreferenceFragment { private int lIIlIll = 100 >>> 7; - private int lIIlIlI = 100 >>> 6; + private final int lIIlIlI = 100 >>> 6; @Override public int getContentResId() { @@ -49,8 +49,7 @@ public void initPrefs() { lIIllII.setTitle(BuildConfig.VERSION_NAME + " | " + BuildConfig.BUILD_TYPE); //if (isMoreHyperOSVersion(1f)) lIIllII.setSummary(R.string.description_hyperos); else lIIllII.setSummary(R.string.description_miui); lIIllII.setOnPreferenceClickListener(lIIllll -> { - if (lIIllll instanceof SwitchPreference) { - SwitchPreference switchPreference = (SwitchPreference) lIIllll; + if (lIIllll instanceof SwitchPreference switchPreference) { switchPreference.setChecked(!switchPreference.isChecked()); lIIlIll++; @@ -80,18 +79,15 @@ public void initPrefs() { * 调用 joinQQGroup() 即可发起手Q客户端申请加群 * * @param key 由官网生成的key - * @return 返回true表示呼起手Q成功,返回false表示呼起失败 */ - private boolean joinQQGroup(String key) { + private void joinQQGroup(String key) { Intent intent = new Intent(); intent.setData(Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26jump_from%3Dwebapi%26k%3D" + key)); try { startActivity(intent); - return true; } catch (Exception e) { // 未安装手Q或安装的版本不支持 - return false; } } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java index 97ab0f02b6..40ad0083c6 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java @@ -30,7 +30,6 @@ import com.sevtinge.hyperceiler.utils.devicesdk.DeviceSDKKt; import com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt; -import java.util.ArrayList; import java.util.Objects; import moralnorm.preference.Preference; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MiLinkFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MiLinkFragment.java index a5bb8bf68e..bc99350f82 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MiLinkFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MiLinkFragment.java @@ -18,15 +18,11 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad; -import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; -import android.content.Intent; import android.view.View; import com.sevtinge.hyperceiler.R; -import com.sevtinge.hyperceiler.ui.SubPickerActivity; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java index ec1b1a75e9..7273326075 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java @@ -33,7 +33,6 @@ import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; -import moralnorm.preference.PreferenceCategory; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/framework/OtherSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/framework/OtherSettings.java index 6afd3f593f..eaf4601842 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/framework/OtherSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/framework/OtherSettings.java @@ -116,16 +116,8 @@ public void initPrefs() { } public void initApp(ExecutorService executorService, Runnable runnable) { - executorService.submit(new Runnable() { - @Override - public void run() { - handler.post(new Runnable() { - @Override - public void run() { - runnable.run(); - } - }); - } + executorService.submit(() -> { + handler.post(runnable); }); } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/LockScreenSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/LockScreenSettings.java index 17f05d78be..646de25491 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/LockScreenSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/LockScreenSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.systemui; -import static com.sevtinge.hyperceiler.utils.api.LinQiqiApisKt.isDeviceEncrypted; +import static com.sevtinge.hyperceiler.utils.api.NekoQiqiApisKt.isDeviceEncrypted; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isHyperOSVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/various/AOSPSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/various/AOSPSettings.java index a7b2d48c7a..425a2d59fe 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/various/AOSPSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/various/AOSPSettings.java @@ -18,8 +18,6 @@ */ package com.sevtinge.hyperceiler.ui.fragment.various; -import android.view.View; - import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/various/LocationSimulationActivity.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/various/LocationSimulationActivity.java index 4eac9d01af..37222f7c17 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/various/LocationSimulationActivity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/various/LocationSimulationActivity.java @@ -24,7 +24,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.SettingsActivity; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/CtaUtils.java b/app/src/main/java/com/sevtinge/hyperceiler/utils/CtaUtils.java index 05550241c9..4c23e364e6 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/CtaUtils.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/CtaUtils.java @@ -18,7 +18,6 @@ */ package com.sevtinge.hyperceiler.utils; -import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/LogcatHelper.java b/app/src/main/java/com/sevtinge/hyperceiler/utils/LogcatHelper.java index dce32fb169..d8b951f21b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/LogcatHelper.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/LogcatHelper.java @@ -84,7 +84,7 @@ private static class LogDumper extends Thread { private Process logcatProc; private BufferedReader mReader = null; private boolean mRunning = true; - String cmds = null; + String cmds; private final String mPID; private FileOutputStream out = null; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/api/LinQiqiApis.kt b/app/src/main/java/com/sevtinge/hyperceiler/utils/api/NekoQiqiApis.kt similarity index 99% rename from app/src/main/java/com/sevtinge/hyperceiler/utils/api/LinQiqiApis.kt rename to app/src/main/java/com/sevtinge/hyperceiler/utils/api/NekoQiqiApis.kt index 61fb67ecf4..e09600f648 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/api/LinQiqiApis.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/api/NekoQiqiApis.kt @@ -152,7 +152,7 @@ fun isNewNetworkStyle(): Boolean { "com.android.systemui.statusbar.views.NetworkSpeedView", EzXHelper.classLoader ) return if (networkSpeedViewCls != null) { - LinearLayout::class.java.isAssignableFrom(networkSpeedViewCls); + LinearLayout::class.java.isAssignableFrom(networkSpeedViewCls) } else { false } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/AppUtils.kt b/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/AppUtils.kt index c9c3b10265..9c67346cb3 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/AppUtils.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/AppUtils.kt @@ -32,7 +32,7 @@ import com.github.kyuubiran.ezxhelper.EzXHelper import com.sevtinge.hyperceiler.utils.PropUtils import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.getSharedPrefs import moralnorm.internal.utils.DeviceHelper -import java.util.* +import java.util.Locale fun dp2px(dpValue: Float): Int = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, dpValue, EzXHelper.appContext.resources.displayMetrics @@ -63,7 +63,7 @@ fun checkVersionName(): String = getPackageInfoCompat(EzXHelper.appContext.packa fun isAlpha(): Boolean = getPackageInfoCompat(EzXHelper.appContext.packageName).versionName.contains("ALPHA", ignoreCase = true) -fun isTablet(): Boolean = Resources.getSystem().getConfiguration().smallestScreenWidthDp >= 600 +fun isTablet(): Boolean = Resources.getSystem().configuration.smallestScreenWidthDp >= 600 fun isPadDevice(): Boolean = isTablet() || DeviceHelper.isFoldDevice() diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/SystemSDK.kt b/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/SystemSDK.kt index 54903a8d05..cc9b748de0 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/SystemSDK.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/devicesdk/SystemSDK.kt @@ -45,7 +45,7 @@ fun isAndroidVersion(versioncode: Int): Boolean{ 33 -> (getAndroidVersion() == Build.VERSION_CODES.TIRAMISU) 34 -> (getAndroidVersion() == Build.VERSION_CODES.UPSIDE_DOWN_CAKE) else -> false - }; + } return result } @@ -76,7 +76,7 @@ fun isMiuiVersion(versioncode: Float): Boolean{ 14f -> (getProp("ro.miui.ui.version.name") == "V140") 15f -> (getProp("ro.miui.ui.version.name") == "V150") else -> false - }; + } return result } @@ -95,7 +95,7 @@ fun isHyperOSVersion(versioncode: Float): Boolean{ val result: Boolean = when (versioncode) { 1f -> (getProp("ro.mi.os.version.name") == "OS1.0") else -> false - }; + } return result } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/log/LogManager.java b/app/src/main/java/com/sevtinge/hyperceiler/utils/log/LogManager.java index 65bc6ff766..4e2699c0c2 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/log/LogManager.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/log/LogManager.java @@ -23,21 +23,14 @@ import com.sevtinge.hyperceiler.BuildConfig; public class LogManager { - public static int logLevel = getLogLevel(); + public static final int logLevel = getLogLevel(); public static int getLogLevel() { int level = mPrefsMap.getStringAsInt("log_level", 2); - switch (BuildConfig.BUILD_TYPE) { - case "canary" -> { - return level == 0 ? 3 : 4; - } - /*case "debug" -> { - return 4; - }*/ - default -> { - return level; - } + if (BuildConfig.BUILD_TYPE.equals("canary")) { + return level == 0 ? 3 : 4; } + return level; } public static String logLevelDesc() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/view/WeatherView.kt b/app/src/main/java/com/sevtinge/hyperceiler/view/WeatherView.kt index e540923214..5f52b314f3 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/view/WeatherView.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/view/WeatherView.kt @@ -33,18 +33,16 @@ class WeatherView(context: Context?, private val showCity: Boolean) : TextView(c private val mContext: Context private val weatherUri = Uri.parse("content://weather/weather") - private val mHandler: Handler + private val mHandler: Handler = object : Handler(Looper.getMainLooper()) { + override fun handleMessage(message: Message) { + val str = message.obj as String + this@WeatherView.text = if (TextUtils.isEmpty(str)) " " else str + } + } private val mWeatherObserver: ContentObserver? private val mWeatherRunnable: WeatherRunnable init { - mHandler = - object : Handler(Looper.getMainLooper()) { - override fun handleMessage(message: Message) { - val str = message.obj as String - this@WeatherView.text = if (TextUtils.isEmpty(str)) " " else str - } - } mWeatherObserver = WeatherContentObserver(mHandler) mContext = context!! mWeatherRunnable = WeatherRunnable() diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 41686cec54..eb50d03d39 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -5,7 +5,6 @@ android com.android.browser com.android.camera - com.android.deskclock com.android.externalstorage com.android.fileexplorer com.android.incallui @@ -39,9 +38,7 @@ com.miui.notes com.miui.packageinstaller com.miui.personalassistant - com.miui.player com.miui.powerkeeper - com.miui.rom com.miui.screenrecorder com.miui.screenshot com.miui.securityadd @@ -54,7 +51,6 @@ com.xiaomi.barrage com.xiaomi.joyose com.xiaomi.market - com.xiaomi.mirror com.xiaomi.misettings com.xiaomi.mtb com.xiaomi.NetworkBoost diff --git a/imgs/icon.png b/imgs/icon.png index a26b61b66b..e2b8175c27 100644 Binary files a/imgs/icon.png and b/imgs/icon.png differ