diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 1e8e1500d2..fc7ef31afa 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -67,11 +67,6 @@ jobs: name: HyperCeiler Canary path: ${{ env.APK_FILE_CANARY }} - - name: Commit - run: | - text="${{ github.event.sha }} ${{ github.event.head_commit.message }}" - echo "commit=$(echo $text | sed 's/\([][\\`.*^$\/+?{}()=!|:-]\)/\\\1/g')" >> $GITHUB_ENV - - name: Post to Canary Channel if: ${{ github.ref == 'refs/heads/main' && github.ref_type != 'tag' && contains(github.event.head_commit.message, '[skip post]') == false && contains(github.event.head_commit.message, 's#') == false }} shell: bash @@ -80,11 +75,10 @@ jobs: BOT_TOKEN: ${{ secrets.BOT_TOKEN }} CANARY: ${{ env.APK_FILE_CANARY }} COMMIT_MESSAGE: |+ - **New push to github\!** - - `${{ env.commit }}` - - by ${{ github.event.head_commit.author.name }} + New push to GitHub + ``` + ${{ github.event.head_commit.message }} + ```by `${{ github.event.head_commit.author.name }}` See commit detail [here](${{ github.event.head_commit.url }}) run: | ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))') diff --git a/.github/workflows/android_pr.yml b/.github/workflows/android_pr.yml index 281dcdea0a..da91ca9123 100644 --- a/.github/workflows/android_pr.yml +++ b/.github/workflows/android_pr.yml @@ -56,9 +56,10 @@ jobs: GROUP_DEBUG_ID: ${{ secrets.GROUP_DEBUG_ID }} BOT_TOKEN: ${{ secrets.BOT_TOKEN }} DEBUG: ${{ env.APK_FILE_DEBUG }} - COMMIT_MESSAGE: |+ - **New PR to gitHub\!** - by ${{ github.triggering_actor }} + COMMIT_MESSAGE: |+ + New push to GitHub + by `${{ github.triggering_actor }}` + See commit detail [here](${{ github.event.head_commit.url }}) run: | ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))') cd ${{ github.workspace }} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java index 15c7765531..6bb6582541 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java @@ -39,7 +39,9 @@ import com.sevtinge.hyperceiler.module.hook.home.dock.DockCustomNew; import com.sevtinge.hyperceiler.module.hook.home.dock.FoldDeviceDock; import com.sevtinge.hyperceiler.module.hook.home.dock.FoldDock; +import com.sevtinge.hyperceiler.module.hook.home.dock.HideDock; import com.sevtinge.hyperceiler.module.hook.home.dock.ShowDockIconTitle; +import com.sevtinge.hyperceiler.module.hook.home.dock.SlideUpOnlyShowDock; import com.sevtinge.hyperceiler.module.hook.home.drawer.AllAppsContainerViewBlur; import com.sevtinge.hyperceiler.module.hook.home.drawer.AppDrawer; import com.sevtinge.hyperceiler.module.hook.home.drawer.PinyinArrangement; @@ -251,6 +253,8 @@ public void handleLoadPackage() { initHook(ShowDockIconTitle.INSTANCE, mPrefsMap.getBoolean("home_dock_icon_title")); initHook(new HideNavigationBar(), mPrefsMap.getBoolean("system_ui_hide_navigation_bar")); initHook(DisableRecentsIcon.INSTANCE, mPrefsMap.getBoolean("home_dock_disable_recents_icon")); + initHook(SlideUpOnlyShowDock.INSTANCE, mPrefsMap.getBoolean("home_dock_slide_up_only_show_dock") && !mPrefsMap.getBoolean("home_dock_hide_dock")); + initHook(HideDock.INSTANCE, mPrefsMap.getBoolean("home_dock_hide_dock")); // 其他 initHook(new LockApp(), mPrefsMap.getBoolean("system_framework_guided_access")); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework.java index 8d03214058..f3563c50ba 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework.java @@ -156,7 +156,7 @@ public void handleLoadPackage() { // Other initHook(new PackagePermissions()); - initHook(new RotationButton(), mPrefsMap.getBoolean("system_framework_other_rotation_button")); + initHook(new RotationButton(), mPrefsMap.getStringAsInt("system_framework_other_rotation_button_int", 0) == 2); initHook(new GlobalActions(), mLoadPackageParam.processName.equals("android")); initHook(new ThermalBrightness(), mPrefsMap.getBoolean("system_framework_other_thermal_brightness")); initHook(DisableCleaner.INSTANCE, mPrefsMap.getBoolean("system_framework_other_disable_cleaner")); 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 485fcb6757..31ec3314c4 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 @@ -32,13 +32,17 @@ import com.sevtinge.hyperceiler.module.hook.systemui.DisableBottomBar; import com.sevtinge.hyperceiler.module.hook.systemui.DisableMiuiMultiWinSwitch; import com.sevtinge.hyperceiler.module.hook.systemui.DisableTransparent; +import com.sevtinge.hyperceiler.module.hook.systemui.MediaButton; import com.sevtinge.hyperceiler.module.hook.systemui.MonetThemeOverlay; import com.sevtinge.hyperceiler.module.hook.systemui.NotificationFix; import com.sevtinge.hyperceiler.module.hook.systemui.NotificationFreeform; import com.sevtinge.hyperceiler.module.hook.systemui.QSDetailBackGround; +import com.sevtinge.hyperceiler.module.hook.systemui.SquigglyProgress; import com.sevtinge.hyperceiler.module.hook.systemui.StatusBarActions; import com.sevtinge.hyperceiler.module.hook.systemui.UiLockApp; +import com.sevtinge.hyperceiler.module.hook.systemui.UnimportantNotification; import com.sevtinge.hyperceiler.module.hook.systemui.UnlockClipboard; +import com.sevtinge.hyperceiler.module.hook.systemui.UnlockCustomActions; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.AddBlurEffectToNotificationView; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.AllowAllThemesNotificationBlur; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.CCGrid; @@ -52,6 +56,8 @@ import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.GmsTile; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.HideDelimiter; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlPanelBackgroundMix; +import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlPanelTimeViewTextSize; +import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MediaControlSeekbarCustom; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MoreCardTiles; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.MuteVisibleNotifications; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.NotificationImportanceHyperOSFix; @@ -132,7 +138,8 @@ public class SystemUI extends BaseModule { @Override public void handleLoadPackage() { - + // PluginHelper + initHook(new PluginHelper()); // 充电动画 initHook(new ChargeAnimationStyle(), mPrefsMap.getStringAsInt("system_ui_charge_animation_style", 0) > 0); // initHook(DisableChargeAnimation.INSTANCE); @@ -153,6 +160,12 @@ public void handleLoadPackage() { initHook(new StatusBarIcon()); initHook(new IconsFromSystemManager()); + initHook(new UnlockCustomActions(), mPrefsMap.getBoolean("system_ui_control_center_media_control_unlock_custom_actions")); + initHook(new MediaButton(), mPrefsMap.getInt("system_ui_control_center_media_control_media_button", 140) != 140 + || mPrefsMap.getInt("system_ui_control_center_media_control_media_button_custom", 140) != 140); + initHook(new SquigglyProgress(), mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 1); + initHook(new MediaControlSeekbarCustom(), mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2); + initHook(new MediaControlPanelTimeViewTextSize(), mPrefsMap.getInt("system_ui_control_center_media_control_time_view_text_size", 13) != 13); initHook(new BluetoothIcon(), mPrefsMap.getStringAsInt("system_ui_status_bar_icon_bluetooth", 0) != 0 && !isMoreHyperOSVersion(1f)); initHook(new WifiStandard(), mPrefsMap.getStringAsInt("system_ui_status_bar_icon_wifi_standard", 0) > 0); initHook(new SelectiveHideIconForAlarmClock(), mPrefsMap.getStringAsInt("system_ui_status_bar_icon_alarm_clock", 0) == 3 && mPrefsMap.getInt("system_ui_status_bar_icon_alarm_clock_n", 0) > 0); @@ -226,6 +239,8 @@ public void handleLoadPackage() { initHook(new DisplayHardwareDetail(), mPrefsMap.getBoolean("system_ui_statusbar_battery_enable") || mPrefsMap.getBoolean("system_ui_statusbar_temp_enable")); + // initHook(new DisplayHardwareDetailForHyper(), true); + // 灵动提示 initHook(HideStrongToast.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_strong_toast_hide")); @@ -249,7 +264,7 @@ public void handleLoadPackage() { initHook(HandleLineCustom.INSTANCE, mPrefsMap.getBoolean("system_ui_navigation_handle_custom")); initHook(new NavigationCustom(), mPrefsMap.getBoolean("system_ui_navigation_custom")); initHook(new HideNavigationBar(), mPrefsMap.getBoolean("system_ui_hide_navigation_bar")); - initHook(new RotationButton(), true); + initHook(new RotationButton(), mPrefsMap.getStringAsInt("system_framework_other_rotation_button_int", 0) != 0); // 状态栏布局 initHook(StatusBarLayout.INSTANCE, mPrefsMap.getBoolean("system_ui_statusbar_layout_compatibility_mode") || mPrefsMap.getStringAsInt("system_ui_statusbar_layout_mode", 0) != 0); @@ -260,6 +275,7 @@ public void handleLoadPackage() { // 控制中心 // initHook(new SmartHome(), false); + initHook(new UnimportantNotification(), mPrefsMap.getBoolean("system_ui_control_center_unimportant_notification")); initHook(new BlurEnable(), mPrefsMap.getBoolean("system_ui_control_center_statusbar_blur")); initHook(new ExpandNotification(), !mPrefsMap.getStringSet("system_ui_control_center_expand_notification").isEmpty()); initHook(new HideDelimiter(), mPrefsMap.getStringAsInt("system_ui_control_center_hide_operator", 0) != 0); @@ -280,12 +296,16 @@ public void handleLoadPackage() { initHook(NotificationWeatherOld.INSTANCE, mPrefsMap.getBoolean("system_ui_control_center_show_weather")); initHook(NotificationWeatherNew.INSTANCE, mPrefsMap.getBoolean("system_ui_control_center_show_weather")); initHook(CompactNotificationsHook.INSTANCE, mPrefsMap.getBoolean("system_ui_control_center_compact_notice")); - initHook(CCGrid.INSTANCE, mPrefsMap.getInt("system_control_center_cc_rows", 4) > 4 || + /*initHook(CCGridOld.INSTANCE, mPrefsMap.getInt("system_control_center_cc_rows", 4) > 4 || mPrefsMap.getInt("system_control_center_cc_columns", 4) > 4 || (mPrefsMap.getBoolean("system_ui_control_center_rounded_rect") && !isMoreHyperOSVersion(1f)) || - mPrefsMap.getBoolean("system_control_center_qs_tile_label")); - initHook(new QSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable")); - initHook(new QQSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable")); + mPrefsMap.getBoolean("system_control_center_qs_tile_label"));*/ + initHook(new CCGrid(), (mPrefsMap.getInt("system_control_center_cc_rows", 4) > 4 || + mPrefsMap.getInt("system_control_center_cc_columns", 4) > 4 || + mPrefsMap.getBoolean("system_ui_control_center_rounded_rect") || + mPrefsMap.getBoolean("system_control_center_qs_tile_label")) && !isMoreHyperOSVersion(1f)); + initHook(new QSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable")); + initHook(new QQSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable")); initHook(new MoreCardTiles(), mPrefsMap.getStringAsInt("system_ui_control_center_more_card_tiles", 0) != 0); initHook(new AutoCollapse(), mPrefsMap.getBoolean("system_ui_control_auto_close")); initHook(RedirectToNotificationChannelSetting.INSTANCE, mPrefsMap.getBoolean("system_ui_control_center_redirect_notice")); @@ -332,7 +352,5 @@ public void handleLoadPackage() { initHook(DoubleTapToSleep.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_double_tap_to_sleep")); initHook(new AllowManageAllNotifications(), mPrefsMap.getBoolean("system_framework_allow_manage_all_notifications")); - - initHook(new PluginHelper()); } } 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 4227dfe55c..faeca5ec06 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 @@ -20,6 +20,7 @@ import com.github.kyuubiran.ezxhelper.EzXHelper; import com.sevtinge.hyperceiler.XposedInit; +import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import com.sevtinge.hyperceiler.module.base.dexkit.InitDexKit; import com.sevtinge.hyperceiler.utils.ContextUtils; import com.sevtinge.hyperceiler.utils.api.ProjectApi; @@ -32,17 +33,8 @@ public abstract class BaseModule implements IXposedHook { public LoadPackageParam mLoadPackageParam = null; public String TAG = getClass().getSimpleName(); - public static ILoadDexKit loadDexKit; public final PrefsMap mPrefsMap = XposedInit.mPrefsMap; - public interface ILoadDexKit { - void createDexKit(LoadPackageParam lpparam, String TAG); - } - - public static void setLoadDexKit(ILoadDexKit iLoadDexKit) { - loadDexKit = iLoadDexKit; - } - public void init(LoadPackageParam lpparam) { EzXHelper.initHandleLoadPackage(lpparam); EzXHelper.setLogTag(TAG); @@ -53,6 +45,11 @@ public void init(LoadPackageParam lpparam) { ContextUtils.getWaitContext( context -> { if (context != null) { + // try { + // Handler handler = new Handler(context.getMainLooper()); + // BaseXposedInit.mResHook.putHandler(handler); + // } catch (Throwable e) { + // } BaseXposedInit.mResHook.loadModuleRes(context); // mResHook.loadModuleRes(context); } @@ -62,12 +59,11 @@ public void init(LoadPackageParam lpparam) { XposedLogUtils.logE(TAG, "get context failed!" + e); } mLoadPackageParam = lpparam; + InitDexKit kit = new InitDexKit(lpparam, TAG); + DexKit.INSTANCE.setInitDexKit(kit); initZygote(); - DexKitHelper helper = new DexKitHelper(); - InitDexKit kit = new InitDexKit(); - loadDexKit.createDexKit(mLoadPackageParam, TAG); handleLoadPackage(); - if (helper.useDexKit) { + if (kit.isInit) { try { kit.closeHostDir(); // XposedLogUtils.logE(TAG, "close dexkit s: " + lpparam.packageName); @@ -90,17 +86,4 @@ public void initHook(BaseHook baseHook, boolean isInit) { baseHook.onCreate(mLoadPackageParam); } } - - private static class DexKitHelper implements InitDexKit.IUseDexKit { - public boolean useDexKit = false; - - public DexKitHelper() { - InitDexKit.setUseDexKit(this); - } - - @Override - public void useDexKit(boolean use) { - useDexKit = use; - } - } } 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 d3441231f5..df7b0aeab4 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 @@ -162,7 +162,7 @@ public abstract class BaseXposedInit { @CallSuper public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable { setXSharedPrefs(); - mResHook = new ResourcesTool(); + mResHook = new ResourcesTool(startupParam.modulePath); mModulePath = startupParam.modulePath; } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/DexKit.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/DexKit.kt index f0f9f1782b..e98b902a5d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/DexKit.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/DexKit.kt @@ -18,34 +18,18 @@ */ package com.sevtinge.hyperceiler.module.base.dexkit -import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam -import org.luckypray.dexkit.DexKitBridge -import org.luckypray.dexkit.query.enums.StringMatchType -import org.luckypray.dexkit.query.matchers.ClassMatcher -import org.luckypray.dexkit.query.matchers.MethodMatcher +import org.luckypray.dexkit.* +import org.luckypray.dexkit.query.enums.* +import org.luckypray.dexkit.query.matchers.* /** * DexKit 工具 */ object DexKit { - var hostDir: String? = null - var isInitialized = false - val dexKitBridge: DexKitBridge by lazy { - InitDexKit.init() - } + var initDexKit: InitDexKit? = null - /** - * 初始化 DexKit 的 apk 完整路径 - */ - fun initDexKit(loadPackageParam: LoadPackageParam) { - hostDir = loadPackageParam.appInfo.sourceDir - } - - /** - * 关闭 DexKit bridge - */ - fun closeDexKit() { - if (isInitialized) dexKitBridge.close() + val dexKitBridge: DexKitBridge by lazy { + initDexKit!!.init() } /** diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/InitDexKit.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/InitDexKit.java index 716330a61f..3a9e98de39 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/InitDexKit.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/dexkit/InitDexKit.java @@ -1,78 +1,63 @@ /* - * This file is part of HyperCeiler. + * This file is part of HyperCeiler. - * HyperCeiler is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. + * HyperCeiler is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . - * Copyright (C) 2023-2024 HyperCeiler Contributions -*/ + * Copyright (C) 2023-2024 HyperCeiler Contributions + */ package com.sevtinge.hyperceiler.module.base.dexkit; -import com.sevtinge.hyperceiler.module.base.BaseModule; - import org.luckypray.dexkit.DexKitBridge; import de.robv.android.xposed.callbacks.XC_LoadPackage; -public class InitDexKit implements BaseModule.ILoadDexKit { - public static XC_LoadPackage.LoadPackageParam mLpparam; - public static IUseDexKit iUseDexKit; - public static String mTAG; - private static String hostDir = null; - - public InitDexKit() { - BaseModule.setLoadDexKit(this); - } - - public interface IUseDexKit { - void useDexKit(boolean use); - } +public class InitDexKit { + public String mTAG; + public XC_LoadPackage.LoadPackageParam mLpparam; + public DexKitBridge mDexKitBridge = null; + public boolean isInit = false; + private String hostDir = null; - public static void setUseDexKit(IUseDexKit useDexKit) { - iUseDexKit = useDexKit; + public InitDexKit(XC_LoadPackage.LoadPackageParam param, String tag) { + mLpparam = param; + mTAG = tag; } - public static DexKitBridge init() throws Exception { - if (hostDir == null) { - if (mLpparam == null) { - throw new Exception(mTAG != null ? mTAG : "InitDexKit" + ": lpparam is null"); + public DexKitBridge init() throws Exception { + if (mDexKitBridge == null) { + if (hostDir == null) { + if (mLpparam == null) { + throw new Exception(mTAG != null ? mTAG : "InitDexKit" + ": lpparam is null"); + } + hostDir = mLpparam.appInfo.sourceDir; } - hostDir = mLpparam.appInfo.sourceDir; + System.loadLibrary("dexkit"); + // XposedLogUtils.logE(mTAG, "dexkit: " + hostDir); + mDexKitBridge = DexKitBridge.create(hostDir); } - System.loadLibrary("dexkit"); - // XposedLogUtils.logE(mTAG, "dexkit: " + hostDir); - DexKitBridge bridge = DexKitBridge.create(hostDir); - DexKit.INSTANCE.setInitialized(true); - setHostDir(hostDir); - iUseDexKit.useDexKit(true); - return bridge; - } - - public static void setHostDir(String dir) { - DexKit.INSTANCE.setHostDir(dir); + isInit = true; + return mDexKitBridge; } public void closeHostDir() throws Exception { if (mLpparam != null) { - DexKit.INSTANCE.closeDexKit(); + mDexKitBridge.close(); + mDexKitBridge = null; + // DexKit.INSTANCE.setDexKitBridge(null); + isInit = false; } else { throw new Exception(mTAG + ": lpparam is null"); } } - - @Override - public void createDexKit(XC_LoadPackage.LoadPackageParam lpparam, String TAG) { - mLpparam = lpparam; - mTAG = TAG; - } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/HookTool.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/HookTool.java index 5f8e6a6df0..b39912a864 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/HookTool.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/HookTool.java @@ -226,7 +226,7 @@ public void findAndHookConstructor(Class hookClass, Object... parameterTypesA XposedHelpers.findAndHookConstructor(hookClass, parameterTypesAndCallback); } - public void findAndHookConstructor(String className, ClassLoader classLoader, Object... parameterTypesAndCallback) { + public static void findAndHookConstructor(String className, ClassLoader classLoader, Object... parameterTypesAndCallback) { XposedHelpers.findAndHookConstructor(className, classLoader, parameterTypesAndCallback); } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/ResourcesTool.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/ResourcesTool.java index 66af9f29b9..afadfc6c68 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/ResourcesTool.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/tool/ResourcesTool.java @@ -29,12 +29,19 @@ import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; +import android.content.res.loader.ResourcesLoader; +import android.content.res.loader.ResourcesProvider; +import android.os.Build; +import android.os.Handler; +import android.os.ParcelFileDescriptor; import android.util.Pair; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.utils.ContextUtils; import com.sevtinge.hyperceiler.utils.log.XposedLogUtils; +import java.io.File; +import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -53,7 +60,9 @@ public class ResourcesTool { private boolean hooksApplied = false; private boolean isInit = false; private boolean useModuleRes = true; - // private Context mContext = null; + private final String mModulePath; + private Handler mHandler = null; + private ResourcesLoader resourcesLoader = null; private final ConcurrentHashMap resMap = new ConcurrentHashMap<>(); private final ArrayList unhooks = new ArrayList<>(); @@ -65,7 +74,8 @@ protected enum ReplacementType { private final ConcurrentHashMap> replacements = new ConcurrentHashMap<>(); - public ResourcesTool() { + public ResourcesTool(String modulePath) { + mModulePath = modulePath; applyHooks(); isInit = true; } @@ -84,11 +94,11 @@ public static int getFakeResId(String resourceName) { /** * @noinspection JavaReflectionMemberAccess */ - private int loadRes(Context context) { + private boolean loadResBelowApi30(Context context) { // String TAG = "addModuleRes"; try { return (int) XposedHelpers.callMethod(context.getResources().getAssets(), "addAssetPath", - XposedInit.mModulePath); + XposedInit.mModulePath) != 0; } catch (Throwable e) { XposedLogUtils.logE(TAG, "CallMethod addAssetPathInternal failed!" + e); } @@ -96,7 +106,7 @@ private int loadRes(Context context) { @SuppressLint({"SoonBlockedPrivateApi", "DiscouragedPrivateApi"}) Method AssetPath = AssetManager.class.getDeclaredMethod("addAssetPath", String.class); AssetPath.setAccessible(true); - return Integer.parseInt(String.valueOf(AssetPath.invoke(context.getResources().getAssets(), XposedInit.mModulePath))); + return Integer.parseInt(String.valueOf(AssetPath.invoke(context.getResources().getAssets(), XposedInit.mModulePath))) != 0; } catch (NoSuchMethodException e) { XposedLogUtils.logE(TAG, "Method addAssetPath is null: ", e); } catch (InvocationTargetException e) { @@ -106,19 +116,55 @@ private int loadRes(Context context) { } catch (NumberFormatException e) { XposedLogUtils.logE(TAG, "NumberFormatException: ", e); } - return 0; + return false; + } + + /** + * 来自 QA 的方法 + */ + private boolean loadResAboveApi30(Context context) { + if (resourcesLoader == null) { + try (ParcelFileDescriptor pfd = ParcelFileDescriptor.open(new File(mModulePath), + ParcelFileDescriptor.MODE_READ_ONLY)) { + ResourcesProvider provider = ResourcesProvider.loadFromApk(pfd); + ResourcesLoader loader = new ResourcesLoader(); + loader.addProvider(provider); + resourcesLoader = loader; + } catch (IOException e) { + XposedLogUtils.logE(TAG, "Failed to add resource!: " + e); + return false; + } + } + // if (Looper.myLooper() == Looper.getMainLooper()) { + context.getResources().addLoaders(resourcesLoader); + // } else { + // if (mHandler != null) { + // mHandler.post(() -> context.getResources().addLoaders(resourcesLoader)); + // } else { + // return false; + // } + // } + return true; } /** * 获取添加后的 Res. * 一般不需要,除非上面 loadModuleRes 加载后依然无效。 + * + * @noinspection UnusedReturnValue */ public Resources loadModuleRes(Context context) { + boolean load; if (context == null) { XposedLogUtils.logE(TAG, "context can't is null!!"); return null; } - if (loadRes(context) == 0) { + if (Build.VERSION.SDK_INT >= 30) { + load = loadResAboveApi30(context); + } else { + load = loadResBelowApi30(context); + } + if (!load) { XposedLogUtils.logW(TAG, "loadModuleRes return 0, It may have failed. Try the second method ..."); try { Resources resources = getModuleRes(context); @@ -131,6 +177,10 @@ public Resources loadModuleRes(Context context) { return context.getResources(); } + public void putHandler(Handler handler) { + mHandler = handler; + } + public static Context getModuleContext(Context context) throws PackageManager.NameNotFoundException { return getModuleContext(context, null); @@ -221,13 +271,12 @@ protected void before(MethodHookParam param) { } catch (Resources.NotFoundException e) { value = findRes(context, method, param.args); } - if (Boolean.TRUE.equals(resMap.get((int) param.args[0]))) { resMap.remove((int) param.args[0]); } + if (value == null) return; + param.setResult(value); } - if (value == null) return; - param.setResult(value); } } }; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/externalstorage/DisableFolderCantUse.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/externalstorage/DisableFolderCantUse.java index df8d18dc30..854f17f77c 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/externalstorage/DisableFolderCantUse.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/externalstorage/DisableFolderCantUse.java @@ -18,16 +18,33 @@ */ package com.sevtinge.hyperceiler.module.hook.externalstorage; +import static com.sevtinge.hyperceiler.module.base.tool.HookTool.MethodHook.returnConstant; + import com.sevtinge.hyperceiler.module.base.BaseHook; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public class DisableFolderCantUse extends BaseHook { + + private final static List METHOD_NAME_LIST = Arrays.asList("shouldBlockFromTree", "shouldBlockDirectoryFromTree"); + @Override public void init() { - findAndHookMethod("com.android.externalstorage.ExternalStorageProvider", "shouldBlockFromTree", String.class, new MethodHook() { - @Override - protected void before(MethodHookParam param) { - param.setResult(false); - } - }); + Class externalStorageProvider = findClass("com.android.externalstorage.ExternalStorageProvider"); + List methodList = Arrays.stream(externalStorageProvider.getDeclaredMethods()) + .filter(method -> METHOD_NAME_LIST.contains(method.getName())) + .filter(method -> method.getReturnType() == boolean.class).collect(Collectors.toList()); + + if (methodList.isEmpty()) { + logE(TAG, lpparam.packageName, new NoSuchMethodException("shouldBlockFromTree")); + return; + } + + for (Method method : methodList) { + hookMethod(method, returnConstant(false)); + } } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/HideDock.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/HideDock.kt new file mode 100644 index 0000000000..5b56aabda6 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/HideDock.kt @@ -0,0 +1,23 @@ +package com.sevtinge.hyperceiler.module.hook.home.dock + +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.* + + +object HideDock : BaseHook() { + override fun init() { + // 上滑时忽略dock,直接触发最近任务手势 + loadClass("com.miui.home.recents.GestureTouchEventTracker").methodFinder() + .filterByName("isTouchCountAndHotSeatSupport").single().createHook { + returnConstant(false) + } + + // 拦截dock出现动画 + loadClass("com.miui.home.launcher.dock.DockStateMachine").methodFinder() + .filterByName("transitionToAppearingState\$default").single().createHook { + replace { } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/SlideUpOnlyShowDock.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/SlideUpOnlyShowDock.kt new file mode 100644 index 0000000000..9409846483 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/dock/SlideUpOnlyShowDock.kt @@ -0,0 +1,161 @@ +package com.sevtinge.hyperceiler.module.hook.home.dock + +import android.view.* +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.* +import com.sevtinge.hyperceiler.utils.* + + +object SlideUpOnlyShowDock : BaseHook() { + override fun init() { + loadClass("com.miui.home.recents.DockGestureHelper").methodFinder() + .filterByName("dispatchTouchEvent").single().createHook { + replace { + // ================ + // DockController dockController = getDockController(); + // if (dockController == null) { + // Log.e("DockGestureHelper", "onTouchEvent: dockController=" + getDockController()); + // return; + // } + // ================ + val dockController = it.thisObject.callMethod("getDockController") + ?: return@replace null + + // ================ + // int actionMasked = motionEvent.getActionMasked(); + // if (actionMasked == 3 || actionMasked == 1) { + // this.mTransitionYStyle.cancel(); + // this.mIsDockTransitionAnimStart = false; + // } + // ================ + val motionEvent = it.args[0] as MotionEvent + val actionMasked = motionEvent.actionMasked + if (actionMasked == 3 || actionMasked == 1) { + it.thisObject.getObjectField("mTransitionYStyle")?.callMethod("cancel") + it.thisObject.setBooleanField("mIsDockTransitionAnimStart", false) + } + + + // ================ + // if (!dockController.isFloatingDockShowing()) { + // if (motionEvent.getEventTime() - motionEvent.getDownTime() >= 180) { + // if (actionMasked == 3 || actionMasked == 1 || actionMasked == 6 || actionMasked == 5) { + // dockController.dispatchUpEvent(motionEvent, this.mTouchTracker.getUpType()); + // } else { + // animationTransitionDock(motionEvent, dockController); + // dockController.addMovement(motionEvent); + // dockController.updateLeaveSafeAreaStatus(motionEvent.getRawX(), motionEvent.getRawY(), true); + // } + // } else if (actionMasked != 3 && actionMasked != 1) { + // dockController.addMovement(motionEvent); + // dockController.updateLeaveSafeAreaStatus(motionEvent.getRawX(), motionEvent.getRawY(), false); + // } + // ================ + val b = dockController.callMethod("isFloatingDockShowing") as Boolean + if (!b) { + // 将判断时间设置为0 + // if (motionEvent.eventTime - motionEvent.downTime >= 180) { + if (actionMasked == 3 || actionMasked == 1 || actionMasked == 6 || actionMasked == 5) { + // dockController.callMethod("dispatchUpEvent", motionEvent, it.thisObject.getObjectField("mTouchTracker")?.callMethod("getUpType")) + // 设置为10, 表示是慢速上滑,后面就会执行打开dock的逻辑,如果是5则为快速上滑,会执行跳转桌面的逻辑 + dockController.callMethod("dispatchUpEvent", motionEvent, 10) + } else { + it.thisObject.callMethod( + "animationTransitionDock", motionEvent, dockController + ) + dockController.callMethod("addMovement", motionEvent) + dockController.callMethod( + "updateLeaveSafeAreaStatus", + motionEvent.rawX, + motionEvent.rawY, + true + ) + } + // } else if (actionMasked != 3 && actionMasked != 1) { + // dockController.callMethod("addMovement", motionEvent) + // dockController.callMethod( + // "updateLeaveSafeAreaStatus", + // motionEvent.rawX, + // motionEvent.rawY, + // false + // ) + // } + } + + // ================ + // if (!this.isStartedGesture) { + // if (isTargetValue(actionMasked, 2) && (dockController.isLeaveSafeArea() || this.mTouchTracker.isTaskStartMove(motionEvent.getRawY()))) { + // startGestureModeGesture(0); + // } else if (isTargetValue(actionMasked, 1, 3) && this.mTouchTracker.getUpType() == 5) { + // startGestureModeGesture(1); + // } + // } + // ================ + // val isStartedGesture = it.thisObject.getBooleanField("isStartedGesture") + // if (!isStartedGesture) { + // if (it.thisObject.callMethod( + // "isTargetValue", + // actionMasked, + // 2 + // ) as Boolean && (dockController.callMethod("isLeaveSafeArea") as Boolean || it.thisObject.callMethod( + // "mTouchTracker" + // )?.callMethod("isTaskStartMove", motionEvent.rawY) as Boolean) + // ) { + // it.thisObject.callMethod("startGestureModeGesture", 0) + // } else if (it.thisObject.callMethod( + // "isTargetValue", + // actionMasked, + // 1, + // 3 + // ) as Boolean && it.thisObject.callMethod("mTouchTracker") + // ?.callMethod("getUpType") == 5 + // ) { + // it.thisObject.callMethod("startGestureModeGesture", 1) + // } + // } + // 这部分是跳转最近任务或者桌面的逻辑,直接去掉 + + + // ================ + // if (this.isStartedGesture) { + // this.mGestureInputHelper.dispatchGestureModeTouchEvent(motionEvent); + // } else if ((actionMasked == 1 || actionMasked == 6) && (launcher = Application.getLauncher()) != null) { + // launcher.notifyPowerKeeperGesture("gesture_end", !this.mTouchTracker.isKeyboardEventTracker()); + // } + // ================ + + + val isStartedGesture0 = it.thisObject.getBooleanField("isStartedGesture") + if (isStartedGesture0) { + it.thisObject.callMethod("mGestureInputHelper") + ?.callMethod("dispatchGestureModeTouchEvent", motionEvent) + } else if (actionMasked == 1 || actionMasked == 6) { + val launcher = findClassIfExists( + "com.miui.home.launcher.Application", lpparam.classLoader + ).callStaticMethod("getLauncher") + launcher?.javaClass?.getDeclaredMethod( + "notifyPowerKeeperGesture", + String::class.java, + Boolean::class.javaPrimitiveType + )?.invoke( + launcher, + "gesture_end", + !(it.thisObject.getObjectField("mTouchTracker")!! + .callMethod("isKeyboardEventTracker") as Boolean) + ) + } else { + } + } + } + + // 拦截通过dock快速上滑进入桌面的方法 + loadClass("com.miui.home.recents.DockGestureHelper").methodFinder() + .filterByName("startGestureModeGesture").single().createHook { + replace { } + } + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/navigation/HideNavigationBar.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/navigation/HideNavigationBar.java index bde86a26d6..f4c4d62b4d 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/navigation/HideNavigationBar.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/navigation/HideNavigationBar.java @@ -1,21 +1,21 @@ /* - * This file is part of HyperCeiler. + * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . - * Copyright (C) 2023-2024 HyperCeiler Contributions -*/ + * Copyright (C) 2023-2024 HyperCeiler Contributions + */ package com.sevtinge.hyperceiler.module.hook.home.navigation; import android.provider.Settings; @@ -31,58 +31,65 @@ public class HideNavigationBar extends BaseHook { public void init() { /*横屏隐藏*/ findAndHookMethod("com.miui.home.recents.views.RecentsContainer", - "showLandscapeOverviewGestureView", - boolean.class, new MethodHook() { - @Override - protected void before(MethodHookParam param) { - param.args[0] = false; + "showLandscapeOverviewGestureView", + boolean.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + param.args[0] = false; + } } - } ); /*锁定返回*/ findAndHookMethod("com.miui.home.recents.NavStubView", - "isMistakeTouch", new MethodHook() { - @Override - protected void before(MethodHookParam param) { - View navView = (View) param.thisObject; - boolean misTouch = false; - boolean setting = Settings.Global.getInt(navView.getContext().getContentResolver(), "show_mistake_touch_toast", 1) != 0; - if (setting) { - boolean mIsShowStatusBar = XposedHelpers.getBooleanField(param.thisObject, "mIsShowStatusBar"); - if (!mIsShowStatusBar) { - misTouch = (boolean) XposedHelpers.callMethod(param.thisObject, "isLandScapeActually"); + "isMistakeTouch", + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + View navView = (View) param.thisObject; + boolean misTouch; + boolean setting = Settings.Global.getInt(navView.getContext().getContentResolver(), "show_mistake_touch_toast", 1) == 0; + if (setting) { + param.setResult(setting); + return; } + // boolean mIsShowStatusBar = (boolean) XposedHelpers.callMethod(param.thisObject, "isImmersive"); + misTouch = (boolean) XposedHelpers.callMethod(param.thisObject, "isLandScapeActually"); + param.setResult(misTouch); } - param.setResult(misTouch); } - } ); /*横屏设置状态*/ findAndHookMethod("com.miui.home.recents.NavStubView", "onPointerEvent", - MotionEvent.class, new MethodHook() { - @Override - protected void before(MethodHookParam param) { - boolean mIsInFsMode = XposedHelpers.getBooleanField(param.thisObject, "mIsInFsMode"); - if (!mIsInFsMode) { + MotionEvent.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + boolean mIsInFsMode = XposedHelpers.getBooleanField(param.thisObject, "mIsInFsMode"); MotionEvent motionEvent = (MotionEvent) param.args[0]; - if (motionEvent.getAction() == 0) { - XposedHelpers.setObjectField(param.thisObject, "mHideGestureLine", true); + if (!mIsInFsMode) { + if (motionEvent.getAction() == 0) { + XposedHelpers.setObjectField(param.thisObject, "mHideGestureLine", true); + // XposedHelpers.setObjectField(param.thisObject, "mIsShowNavBar", true); + // XposedHelpers.setObjectField(param.thisObject, "mIsShowStatusBar", true); + } } } } - } ); /*恢复状态*/ findAndHookMethod("com.miui.home.recents.NavStubView", "updateScreenSize", - new MethodHook() { - @Override - protected void before(MethodHookParam param) { - XposedHelpers.setObjectField(param.thisObject, "mHideGestureLine", false); + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + XposedHelpers.setObjectField(param.thisObject, "mHideGestureLine", false); + // XposedHelpers.setObjectField(param.thisObject, "mIsShowNavBar", true); + // XposedHelpers.setObjectField(param.thisObject, "mIsShowStatusBar", true); + } } - } ); } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/app/AppDisable.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/app/AppDisable.java index e391bc7666..a07ac5fd06 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/app/AppDisable.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/securitycenter/app/AppDisable.java @@ -44,6 +44,7 @@ public class AppDisable extends BaseHook { public ArrayList mMiuiCoreApps = new ArrayList<>(); + private MenuItem menuItem = null; @Override public void init() { @@ -54,6 +55,8 @@ public void init() { protected void after(MethodHookParam param) throws Throwable { Activity act = (Activity) param.thisObject; Menu menu = (Menu) param.args[0]; + menuItem = menu.findItem(6); + if (menuItem != null) menuItem.setVisible(false); MenuItem dis = menu.add(0, 666, 1, act.getResources().getIdentifier("app_manager_disable_text", "string", lpparam.packageName)); dis.setIcon(act.getResources().getIdentifier("action_button_stop_svg", "drawable", lpparam.packageName)); @@ -66,7 +69,8 @@ protected void after(MethodHookParam param) throws Throwable { ApplicationInfo appInfo = pm.getApplicationInfo(mPackageInfo.packageName, PackageManager.GET_META_DATA); boolean isSystem = (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0; boolean isUpdatedSystem = (appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; - dis.setTitle(act.getResources().getIdentifier(appInfo.enabled ? "app_manager_disable_text" : "app_manager_enable_text", "string", lpparam.packageName)); + dis.setTitle(act.getResources().getIdentifier(appInfo.enabled ? "app_manager_disable_text" : "app_manager_enable_text", + "string", lpparam.packageName)); getModuleRes(act); mMiuiCoreApps = new ArrayList<>(Arrays.asList(act.getResources().getStringArray(R.array.miui_core_app_package_name))); if (mMiuiCoreApps.contains(mPackageInfo.packageName)) { @@ -80,6 +84,26 @@ protected void after(MethodHookParam param) throws Throwable { } ); + findAndHookMethod("com.miui.appmanager.ApplicationsDetailsActivity", + "onPrepareOptionsMenu", Menu.class, + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + if (menuItem != null) menuItem.setVisible(false); + } + } + ); + + findAndHookMethod("com.miui.appmanager.ApplicationsDetailsActivity", + "onResume", + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + if (menuItem != null) menuItem.setVisible(false); + } + } + ); + findAndHookMethod("com.miui.appmanager.ApplicationsDetailsActivity", "onOptionsItemSelected", MenuItem.class, new MethodHook() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/RotationButton.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/RotationButton.java index 657b5e95c5..7ce8070079 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/RotationButton.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/RotationButton.java @@ -19,24 +19,30 @@ package com.sevtinge.hyperceiler.module.hook.systemframework; import android.content.Context; -import android.os.Handler; import android.provider.Settings; import com.sevtinge.hyperceiler.module.base.BaseHook; +import com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt; import de.robv.android.xposed.XposedHelpers; public class RotationButton extends BaseHook { Context context; + boolean isHyper = false; + @Override public void init() throws NoSuchMethodException { - findAndHookConstructor("com.android.server.wm.DisplayRotation$OrientationListener", - "com.android.server.wm.DisplayRotation", Context.class, Handler.class, + isHyper = SystemSDKKt.isMoreHyperOSVersion(1f); + if (isHyper) return; + hookAllConstructors("com.android.server.wm.DisplayRotation$OrientationListener", new MethodHook() { @Override protected void after(MethodHookParam param) { - context = (Context) param.args[1]; + Object arg = param.args[1]; + if (arg instanceof Context) { + context = (Context) param.args[1]; + } } } ); @@ -67,7 +73,7 @@ protected void before(MethodHookParam param) { ); - findAndHookMethod("com.android.server.wm.DisplayRotation", + /*findAndHookMethod("com.android.server.wm.DisplayRotation", "isRotationChoicePossible", int.class, new MethodHook() { @Override @@ -80,7 +86,7 @@ protected void after(MethodHookParam param) throws Throwable { // } } } - ); + );*/ } private void setData(Context context, String value) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/MediaButton.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/MediaButton.java new file mode 100644 index 0000000000..22f152ba72 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/MediaButton.java @@ -0,0 +1,78 @@ +package com.sevtinge.hyperceiler.module.hook.systemui; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.Icon; +import android.media.session.MediaController; +import android.media.session.PlaybackState; +import android.os.UserHandle; + +import com.sevtinge.hyperceiler.module.base.BaseHook; + +import java.lang.reflect.Method; + +import de.robv.android.xposed.XposedHelpers; + +public class MediaButton extends BaseHook { + private String pkg = null; + private final int type = mPrefsMap.getInt("system_ui_control_center_media_control_media_button", 140); + private final int typeCustom = mPrefsMap.getInt("system_ui_control_center_media_control_media_button_custom", 140); + + @Override + public void init() throws NoSuchMethodException { + findAndHookMethod("com.android.systemui.media.controls.pipeline.MediaDataManager", + "createActionsFromState", String.class, MediaController.class, UserHandle.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + pkg = (String) param.args[0]; + } + } + ); + + findAndHookMethod("com.android.systemui.media.controls.pipeline.MediaDataManager$createActionsFromState$customActions$1", + "invoke", Object.class, new MethodHook() { + + @Override + protected void after(MethodHookParam param) throws Throwable { + if (typeCustom != 140) { + PlaybackState.CustomAction customAction = (PlaybackState.CustomAction) param.args[0]; + Object MediaAction = param.getResult(); + Object mediaDataManager = XposedHelpers.getObjectField(param.thisObject, "this$0"); + Context context = (Context) XposedHelpers.getObjectField(mediaDataManager, "context"); + Icon createWithResource = Icon.createWithResource(pkg, customAction.getIcon()); + Drawable loadDrawable = createWithResource.loadDrawable(context); + Class DrawableUtils = findClassIfExists("com.miui.utils.DrawableUtils", lpparam.classLoader); + Method method = DrawableUtils.getDeclaredMethod("drawable2Bitmap", Drawable.class); + Bitmap bitmap = (Bitmap) method.invoke(null, loadDrawable); + loadDrawable = new BitmapDrawable(context.getResources(), Bitmap.createScaledBitmap(bitmap, + typeCustom, typeCustom, true)); + XposedHelpers.setObjectField(MediaAction, "icon", loadDrawable); + } + } + } + ); + + findAndHookMethod("com.android.systemui.media.controls.pipeline.MediaDataManager", + "getStandardAction", MediaController.class, long.class, long.class, + new MethodHook() { + @Override + protected void after(MethodHookParam param) throws Throwable { + if (type != 140) { + Object MediaAction = param.getResult(); + Context context = (Context) XposedHelpers.getObjectField(param.thisObject, "context"); + Drawable drawable = (Drawable) XposedHelpers.getObjectField(MediaAction, "icon"); + Class DrawableUtils = findClassIfExists("com.miui.utils.DrawableUtils", lpparam.classLoader); + Method method = DrawableUtils.getDeclaredMethod("drawable2Bitmap", Drawable.class); + Bitmap bitmap = (Bitmap) method.invoke(null, drawable); + drawable = new BitmapDrawable(context.getResources(), Bitmap.createScaledBitmap(bitmap, + type, type, true)); + XposedHelpers.setObjectField(MediaAction, "icon", drawable); + } + } + } + ); + } +} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SquigglyProgress.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SquigglyProgress.java new file mode 100644 index 0000000000..d63466d2ad --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/SquigglyProgress.java @@ -0,0 +1,25 @@ +package com.sevtinge.hyperceiler.module.hook.systemui; + +import android.graphics.drawable.Drawable; +import android.widget.SeekBar; + +import com.sevtinge.hyperceiler.module.base.BaseHook; + +import de.robv.android.xposed.XposedHelpers; + +public class SquigglyProgress extends BaseHook { + @Override + public void init() throws NoSuchMethodException { + findAndHookConstructor("com.android.systemui.media.controls.models.player.MediaViewHolder", + android.view.View.class, new MethodHook() { + @Override + protected void after(MethodHookParam param) { + SeekBar seekBar = (SeekBar) XposedHelpers.getObjectField(param.thisObject, "seekBar"); + Object squigglyProgress = XposedHelpers.newInstance( + findClassIfExists("com.android.systemui.media.controls.ui.SquigglyProgress")); + seekBar.setProgressDrawable((Drawable) squigglyProgress); + } + } + ); + } +} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnimportantNotification.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnimportantNotification.java new file mode 100644 index 0000000000..be2380615e --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnimportantNotification.java @@ -0,0 +1,56 @@ +/* + * This file is part of HyperCeiler. + + * HyperCeiler is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + + * Copyright (C) 2023-2024 HyperCeiler Contributions + */ +package com.sevtinge.hyperceiler.module.hook.systemui; + +import com.sevtinge.hyperceiler.module.base.BaseHook; + +import java.util.ArrayList; + +import de.robv.android.xposed.XposedHelpers; + +public class UnimportantNotification extends BaseHook { + @Override + public void init() throws NoSuchMethodException { + findAndHookMethod("com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator$shadeExpansionListener$1", + "onPanelExpansionChanged", "com.android.systemui.shade.ShadeExpansionChangeEvent", + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + Object FoldCoordinator = XposedHelpers.getObjectField(param.thisObject, "this$0"); + XposedHelpers.setObjectField(FoldCoordinator, "mPendingNotifications", new ArrayList<>()); + } + } + ); + + findAndHookMethod("com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator", + "access$shouldIgnoreEntry", + "com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator", + "com.android.systemui.statusbar.notification.collection.NotificationEntry", + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + // Object mSbn = XposedHelpers.getObjectField(param.args[1], "mSbn"); + // String getPackageName = (String) XposedHelpers.callMethod(mSbn, "getPackageName"); + // logE(TAG, "after: " + param.getResult() + " pkg: " + getPackageName); + param.setResult(true); + } + } + ); + } +} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnlockCustomActions.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnlockCustomActions.java new file mode 100644 index 0000000000..78402e9e77 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnlockCustomActions.java @@ -0,0 +1,27 @@ +package com.sevtinge.hyperceiler.module.hook.systemui; + +import com.sevtinge.hyperceiler.module.base.BaseHook; + +import java.util.ArrayList; + +import de.robv.android.xposed.XposedHelpers; + +public class UnlockCustomActions extends BaseHook { + + @Override + public void init() throws NoSuchMethodException { + findAndHookMethod("com.android.systemui.media.controls.pipeline.MediaDataManager$createActionsFromState$customActions$1", + "invoke", Object.class + , new MethodHook() { + @Override + protected void before(MethodHookParam param) { + Object INSTANCE = XposedHelpers.getStaticObjectField( + findClassIfExists("com.android.systemui.statusbar.notification.NotificationSettingsManager$Holder"), + "INSTANCE"); + XposedHelpers.setObjectField(INSTANCE, "mHiddenCustomActionsList", new ArrayList<>()); + } + + } + ); + } +} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.java new file mode 100644 index 0000000000..3d63ee2712 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.java @@ -0,0 +1,241 @@ +package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.text.TextUtils; +import android.util.AttributeSet; +import android.view.View; +import android.widget.TextView; + +import com.sevtinge.hyperceiler.R; +import com.sevtinge.hyperceiler.module.base.BaseHook; + +import java.util.ArrayList; +import java.util.Iterator; + +import de.robv.android.xposed.XposedHelpers; + +public class CCGrid extends BaseHook { + private static final int cols = mPrefsMap.getInt("system_control_center_cc_columns", 4); // 列数 + private static final int rows = mPrefsMap.getInt("system_control_center_cc_rows", 4); // 行数 + private static final boolean label = mPrefsMap.getBoolean("system_control_center_qs_tile_label"); // 移除标题 + private static float scaledTileWidthDim = -1f; + + @Override + public void init() throws NoSuchMethodException { + final String pkg = lpparam.packageName; + if (cols > 4) { + mResHook.setObjectReplacement(pkg, "dimen", "qs_control_tiles_columns", cols); + } + + findAndHookMethod("com.android.systemui.SystemUIApplication", + "onCreate", + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + Context mContext = (Context) XposedHelpers.callMethod(param.thisObject, + "getApplicationContext"); + Resources resources = mContext.getResources(); + float density = resources.getDisplayMetrics().density; + int tileWidthResId = resources.getIdentifier("qs_control_center_tile_width", "dimen", "com.android.systemui"); + float tileWidthDim = resources.getDimension(tileWidthResId); + if (cols > 4) { + tileWidthDim /= density; + scaledTileWidthDim = tileWidthDim * 4 / cols; + mResHook.setDensityReplacement(pkg, "dimen", "qs_control_center_tile_width", + scaledTileWidthDim); + mResHook.setDensityReplacement("miui.systemui.plugin", "dimen", "qs_control_center_tile_width", + scaledTileWidthDim); + mResHook.setDensityReplacement(pkg, "dimen", "qs_control_tile_icon_bg_size", + scaledTileWidthDim); + mResHook.setDensityReplacement("miui.systemui.plugin", "dimen", "qs_control_tile_icon_bg_size", + scaledTileWidthDim); + mResHook.setDensityReplacement("miui.systemui.plugin", "dimen", "qs_cell_height", 85f); + } + } + + } + ); + } + + public static void loadCCGrid(ClassLoader pluginLoader) { + if (cols > 4) { + findAndHookConstructor("miui.systemui.controlcenter.qs.QSPager", + pluginLoader, Context.class, AttributeSet.class, + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + XposedHelpers.setObjectField(param.thisObject, "columns", cols); + } + } + ); + } + if (!label) { + findAndHookMethod("miui.systemui.controlcenter.qs.tileview.StandardTileView", pluginLoader, + "createLabel", boolean.class, + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + Object label = XposedHelpers.getObjectField(param.thisObject, "label"); + if (label != null) { + TextView lb = (TextView) label; + lb.setMaxLines(1); + lb.setSingleLine(true); + lb.setEllipsize(TextUtils.TruncateAt.MARQUEE); + lb.setMarqueeRepeatLimit(0); + View labelContainer = (View) XposedHelpers.getObjectField(param.thisObject, "labelContainer"); + labelContainer.setPadding(4, 0, 4, 0); + + } + } + } + ); + } + if (rows != 4) { + findAndHookMethod("miui.systemui.controlcenter.qs.QSPager", pluginLoader, + "distributeTiles", + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + boolean collapse = XposedHelpers.getBooleanField(param.thisObject, "collapse"); + if (collapse) { + ArrayList pages = (ArrayList) XposedHelpers.getObjectField(param.thisObject, "pages"); + for (Object tileLayoutImpl : pages) { + XposedHelpers.callMethod(tileLayoutImpl, "removeTiles"); + } + ArrayList pageTiles = new ArrayList<>(); + int currentRow = 2; + ArrayList records = (ArrayList) XposedHelpers.getObjectField(param.thisObject, "records"); + Iterator it2 = records.iterator(); + int i3 = 0; + int pageNow = 0; + Object bigHeader = XposedHelpers.getObjectField(param.thisObject, "header"); + while (it2.hasNext()) { + pageTiles.add(it2.next()); + i3++; + if (i3 >= cols) { + currentRow++; + i3 = 0; + } + if (currentRow >= rows || !it2.hasNext()) { + XposedHelpers.callMethod(pages.get(pageNow), "setTiles", pageTiles, + pageNow == 0 ? bigHeader : null); + pageTiles.clear(); + int totalRows = XposedHelpers.getIntField(param.thisObject, "rows"); + if (currentRow > totalRows) { + XposedHelpers.setObjectField(param.thisObject, "rows", currentRow); + } + if (it2.hasNext()) { + pageNow++; + currentRow = 0; + } + } + } + Iterator it3 = pages.iterator(); + while (it3.hasNext()) { + boolean isEmpty = (boolean) XposedHelpers.callMethod(it3.next(), "isEmpty"); + if (isEmpty) { + it3.remove(); + } + } + Object pageIndicator = XposedHelpers.getObjectField(param.thisObject, "pageIndicator"); + if (pageIndicator != null) { + XposedHelpers.callMethod(pageIndicator, "setNumPages", pages.size()); + } + Object adapter = XposedHelpers.getObjectField(param.thisObject, "adapter"); + XposedHelpers.callMethod(param.thisObject, "setAdapter", adapter); + } + } + } + ); + } + // 移除磁贴标题相关 + if (mPrefsMap.getBoolean("system_control_center_qs_tile_label")) { + mHideCCLabels(pluginLoader); + } + + // 新控制中心矩形圆角 + if (mPrefsMap.getBoolean("system_ui_control_center_rounded_rect")) { + mResHook.setResReplacement("miui.systemui.plugin", "drawable", "qs_background_restricted", + R.drawable.ic_qs_tile_bg_temporary_closure); + mResHook.setResReplacement("miui.systemui.plugin", "drawable", "qs_background_unavailable", + R.drawable.ic_qs_tile_bg_disabled); + mResHook.setResReplacement("miui.systemui.plugin", "drawable", "qs_background_disabled", + R.drawable.ic_qs_tile_bg_disabled); + mResHook.setResReplacement("miui.systemui.plugin", "drawable", "qs_background_warning", + R.drawable.ic_qs_tile_bg_warning); + mCCTileCornerHook(pluginLoader); + } + } + + private static void mHideCCLabels(ClassLoader pluginLoader) { + mResHook.setDensityReplacement("miui.systemui.plugin", "dimen", "qs_cell_height", 85f); + Class mQSController = XposedHelpers.findClassIfExists( + "miui.systemui.controlcenter.qs.tileview.StandardTileView", + pluginLoader + ); + hookAllMethods(mQSController, "init", + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + if (param.args.length != 1) return; + View mLabelContainer = (View) XposedHelpers.getObjectField(param.thisObject, "labelContainer"); + mLabelContainer.setVisibility(View.GONE); + } + } + ); + } + + private static void mCCTileCornerHook(ClassLoader pluginLoader) { + findAndHookMethod("miui.systemui.controlcenter.qs.tileview.ExpandableIconView", pluginLoader, + "setCornerRadius", float.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + Context mContext = (Context) XposedHelpers.callMethod(param.thisObject, "getPluginContext"); + var radius = 18f; + if (scaledTileWidthDim > 0) { + radius *= scaledTileWidthDim / 65; + } + param.args[0] = mContext.getResources().getDisplayMetrics().density * radius; + } + } + ); + findAndHookMethod("miui.systemui.dagger.PluginComponentFactory", pluginLoader, + "create", Context.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + Context mContext = (Context) param.args[0]; + Resources res = mContext.getResources(); + int enabledTileBackgroundResId = res.getIdentifier("qs_background_enabled", "drawable", "miui.systemui.plugin"); + int enabledTileColorResId = res.getIdentifier("qs_enabled_color", "color", "miui.systemui.plugin"); + int tintColor = res.getColor(enabledTileColorResId, null); + MethodHook imgHook = new MethodHook() { + @Override + protected void before(MethodHookParam param) { + int resInt = (int) param.args[0]; + if (resInt == enabledTileBackgroundResId && resInt != 0) { + try { + Drawable enableTile = getModuleRes(mContext) + .getDrawable(R.drawable.ic_qs_tile_bg_enabled, null); + enableTile.setTint(tintColor); + param.setResult(enableTile); + } catch (PackageManager.NameNotFoundException e) { + logE("CCGrid", e); + } + } + } + }; + + findAndHookMethod("android.content.res.Resources", pluginLoader, + "getDrawable", int.class, imgHook); + findAndHookMethod("android.content.res.Resources.Theme", pluginLoader, + "getDrawable", int.class, imgHook); + } + } + ); + } +} diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridForHyperOS.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridForHyperOS.java index 88d44c1597..336b9b6713 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridForHyperOS.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridForHyperOS.java @@ -1,38 +1,105 @@ /* - * This file is part of HyperCeiler. + * This file is part of HyperCeiler. - * HyperCeiler is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. + * HyperCeiler is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . - * Copyright (C) 2023-2024 HyperCeiler Contributions -*/ + * Copyright (C) 2023-2024 HyperCeiler Contributions + */ package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter; import static com.sevtinge.hyperceiler.module.base.BaseXposedInit.mPrefsMap; +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.GradientDrawable; + import com.sevtinge.hyperceiler.module.base.tool.HookTool; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedHelpers; public class CCGridForHyperOS { + private static final float radius = (float) mPrefsMap.getInt("system_ui_control_center_rounded_rect_radius", 72); + public static void initCCGridForHyperOS(ClassLoader classLoader) { Class clazz = XposedHelpers.findClass("miui.systemui.controlcenter.qs.tileview.QSTileItemIconView", classLoader); - XposedHelpers.findAndHookMethod(clazz, "getCornerRadius", new HookTool.MethodHook() { - @Override - protected void before(XC_MethodHook.MethodHookParam param) { - param.setResult((float) mPrefsMap.getInt("system_ui_control_center_rounded_rect_radius", 72)); - } - }); + XposedHelpers.findAndHookMethod(clazz, "getCornerRadius", + new HookTool.MethodHook() { + @Override + protected void before(XC_MethodHook.MethodHookParam param) { + param.setResult((float) mPrefsMap.getInt("system_ui_control_center_rounded_rect_radius", 72)); + } + } + ); + XposedHelpers.findAndHookMethod("miui.systemui.controlcenter.qs.tileview.QSTileItemIconView", classLoader, "updateIcon", + "com.android.systemui.plugins.qs.QSTile$State", boolean.class, boolean.class, + new HookTool.MethodHook() { + @Override + protected void before(MethodHookParam param) { + XposedHelpers.callMethod(param.thisObject, "updateResources"); + } + } + ); + + XposedHelpers.findAndHookMethod("miui.systemui.controlcenter.qs.tileview.QSTileItemIconView", classLoader, + "updateResources", + new HookTool.MethodHook() { + @Override + protected void before(MethodHookParam param) { + Context pluginContext = (Context) XposedHelpers.getObjectField(param.thisObject, "pluginContext"); + int warning = pluginContext.getResources().getIdentifier("qs_background_warning", "drawable", "miui.systemui.plugin"); + int enabled = pluginContext.getResources().getIdentifier("qs_background_enabled", "drawable", "miui.systemui.plugin"); + int restricted = pluginContext.getResources().getIdentifier("qs_background_restricted", "drawable", "miui.systemui.plugin"); + int disabled = pluginContext.getResources().getIdentifier("qs_background_disabled", "drawable", "miui.systemui.plugin"); + int unavailable = pluginContext.getResources().getIdentifier("qs_background_unavailable", "drawable", "miui.systemui.plugin"); + Drawable warningD = pluginContext.getTheme().getDrawable(warning); + Drawable enabledD = pluginContext.getTheme().getDrawable(enabled); + Drawable restrictedD = pluginContext.getTheme().getDrawable(restricted); + Drawable disabledD = pluginContext.getTheme().getDrawable(disabled); + Drawable unavailableD = pluginContext.getTheme().getDrawable(unavailable); + if (warningD != null) { + GradientDrawable warningG = (GradientDrawable) warningD; + warningG.setCornerRadius(radius); + } + if (enabledD != null) { + GradientDrawable enabledG = (GradientDrawable) enabledD; + enabledG.setCornerRadius(radius); + } + if (restrictedD != null) { + GradientDrawable restrictedG = (GradientDrawable) restrictedD; + restrictedG.setCornerRadius(radius); + } + if (disabledD != null) { + GradientDrawable disabledG = (GradientDrawable) disabledD; + disabledG.setCornerRadius(radius); + } + if (unavailableD != null) { + GradientDrawable unavailableG = (GradientDrawable) unavailableD; + unavailableG.setCornerRadius(radius); + } + } + } + ); + + XposedHelpers.findAndHookMethod("miui.systemui.controlcenter.qs.tileview.QSTileItemIconView", classLoader, + "setCornerRadius", float.class, + new HookTool.MethodHook() { + @Override + protected void before(MethodHookParam param) { + param.setResult(null); + } + } + ); } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridOld.kt similarity index 96% rename from app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.kt rename to app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridOld.kt index a3347fd543..7e0ed0df7c 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGrid.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/CCGridOld.kt @@ -18,33 +18,31 @@ */ package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter -import android.annotation.SuppressLint -import android.content.Context -import android.content.pm.ApplicationInfo -import android.text.TextUtils -import android.util.AttributeSet -import android.view.View -import android.widget.TextView +import android.annotation.* +import android.content.* +import android.content.pm.* +import android.text.* +import android.util.* +import android.view.* +import android.widget.* +import com.github.kyuubiran.ezxhelper.* import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook -import com.github.kyuubiran.ezxhelper.ObjectUtils import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder -import com.sevtinge.hyperceiler.R -import com.sevtinge.hyperceiler.module.base.BaseHook -import com.sevtinge.hyperceiler.utils.devicesdk.isAndroidVersion -import com.sevtinge.hyperceiler.utils.devicesdk.isHyperOSVersion -import com.sevtinge.hyperceiler.utils.devicesdk.isMoreHyperOSVersion -import de.robv.android.xposed.XposedHelpers +import com.sevtinge.hyperceiler.* +import com.sevtinge.hyperceiler.module.base.* +import com.sevtinge.hyperceiler.utils.devicesdk.* +import de.robv.android.xposed.* -object CCGrid : BaseHook() { +object CCGridOld : BaseHook() { private val cols by lazy { - mPrefsMap.getInt("system_control_center_cc_columns", 4) + mPrefsMap.getInt("system_control_center_cc_columns", 4) // 列数 } private val rows by lazy { - mPrefsMap.getInt("system_control_center_cc_rows", 4) + mPrefsMap.getInt("system_control_center_cc_rows", 4) // 行数 } private val label by lazy { - mPrefsMap.getBoolean("system_control_center_qs_tile_label") + mPrefsMap.getBoolean("system_control_center_qs_tile_label") // 移除标题 } private var scaledTileWidthDim = -1f diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelBackugroundMix.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelBackugroundMix.kt index 226ead3656..79083669f9 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelBackugroundMix.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelBackugroundMix.kt @@ -26,6 +26,7 @@ import android.graphics.drawable.* import android.hardware.* import android.media.* import android.os.* +import android.util.* import android.view.* import android.widget.* import androidx.annotation.* @@ -34,6 +35,7 @@ import com.github.kyuubiran.ezxhelper.ClassUtils.loadClassOrNull import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createBeforeHook import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook +import com.github.kyuubiran.ezxhelper.Log import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.* @@ -50,6 +52,12 @@ private var artwork: Icon? = null //from https://github.com/YuKongA/MediaControl-BlurBg/blob/752de17a31d940683648cee7b957d4ff48d381a3/app/src/main/kotlin/top/yukonga/mediaControlBlur/MainHook.kt class MediaControlPanelBackgroundMix : BaseHook() { + private val radius by lazy { + mPrefsMap.getInt("system_ui_control_center_media_control_panel_background_mix_blur_radius", 40) + } + private val overlay by lazy { + mPrefsMap.getInt("system_ui_control_center_media_control_panel_background_mix_overlay", 20) + } @RequiresApi(Build.VERSION_CODES.S) override fun init() { EzXHelper.initHandleLoadPackage(lpparam) @@ -76,27 +84,22 @@ class MediaControlPanelBackgroundMix : BaseHook() { playerTwoCircleView: Class<*>? ) { try { - mediaControlPanel?.methodFinder()?.filterByName("attachPlayer")?.first() - ?.createAfterHook { - val context = AndroidAppHelper.currentApplication().applicationContext + mediaControlPanel?.methodFinder()?.filterByName("attachPlayer")?.first()?.createAfterHook { + val context = AndroidAppHelper.currentApplication().applicationContext - val isBackgroundBlurOpened = - XposedHelpers.callStaticMethod(notificationUtil, "isBackgroundBlurOpened", context) as Boolean - if (!isBackgroundBlurOpened) return@createAfterHook + val isBackgroundBlurOpened = XposedHelpers.callStaticMethod(notificationUtil, "isBackgroundBlurOpened", context) as Boolean + if (!isBackgroundBlurOpened) return@createAfterHook - val mMediaViewHolder = - it.thisObject.objectHelper().getObjectOrNullUntilSuperclass("mMediaViewHolder") ?: return@createAfterHook - val mediaBg = - mMediaViewHolder.objectHelper().getObjectOrNullAs("mediaBg") ?: return@createAfterHook - val radius = mPrefsMap.getInt("system_ui_control_center_media_control_panel_background_mix_blur_radius", 40) + val mMediaViewHolder = it.thisObject.objectHelper().getObjectOrNullUntilSuperclass("mMediaViewHolder") ?: return@createAfterHook + val mediaBg = mMediaViewHolder.objectHelper().getObjectOrNullAs("mediaBg") ?: return@createAfterHook - mediaBg.apply { - setMiViewBlurMode(1) - setMiBackgroundBlurRadius(radius) - setBlurRoundRect(getNotificationElementRoundRect(context)) - setMiBackgroundBlendColors(getNotificationElementBlendColors(context), 1f) - } + mediaBg.apply { + setMiViewBlurMode(1) + setMiBackgroundBlurRadius(radius) + setBlurRoundRect(getNotificationElementRoundRect(context)) + setMiBackgroundBlendColors(getNotificationElementBlendColors(context), 1f) } + } miuiMediaControlPanel?.methodFinder()?.filterByName("bindPlayer")?.first() ?.createAfterHook { @@ -160,8 +163,8 @@ class MediaControlPanelBackgroundMix : BaseHook() { action2?.setColorFilter(Color.BLACK) action3?.setColorFilter(Color.BLACK) action4?.setColorFilter(Color.BLACK) - seekBar?.progressDrawable?.colorFilter = colorFilter(Color.BLACK) - seekBar?.thumb?.colorFilter = colorFilter(Color.BLACK) + seekBar?.progressDrawable?.colorFilter = colorFilter(Color.argb(165, 0, 0, 0)) + seekBar?.thumb?.colorFilter = colorFilter(if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.argb(165, 0, 0, 0)) elapsedTimeView?.setTextColor(grey) totalTimeView?.setTextColor(grey) } else { @@ -173,8 +176,8 @@ class MediaControlPanelBackgroundMix : BaseHook() { action2?.setColorFilter(Color.WHITE) action3?.setColorFilter(Color.WHITE) action4?.setColorFilter(Color.WHITE) - seekBar?.progressDrawable?.colorFilter = colorFilter(Color.WHITE) - seekBar?.thumb?.colorFilter = colorFilter(Color.WHITE) + seekBar?.progressDrawable?.colorFilter = colorFilter(Color.argb(165, 255, 255, 255)) + seekBar?.thumb?.colorFilter = colorFilter((if (mPrefsMap.getStringAsInt("system_ui_control_center_media_control_progress_mode", 0) == 2) Color.TRANSPARENT else Color.argb(165, 255, 255, 255))) elapsedTimeView?.setTextColor(grey) totalTimeView?.setTextColor(grey) } @@ -216,7 +219,7 @@ class MediaControlPanelBackgroundMix : BaseHook() { albumView?.setImageDrawable(BitmapDrawable(context.resources, newBitmap)) if (appIcon?.parent != null) { - (appIcon.parent as ViewGroup).removeView(appIcon) + (appIcon?.parent as ViewGroup?)?.removeView(appIcon) } } } @@ -389,10 +392,7 @@ class MediaControlPanelBackgroundMix : BaseHook() { val backgroundColorMode = if (isDarkMode()) 0 else 248 val backgroundColor = Color.argb( - mPrefsMap.getInt( - "system_ui_control_center_media_control_panel_background_mix_overlay", - 20 - ), backgroundColorMode, backgroundColorMode, backgroundColorMode + overlay, backgroundColorMode, backgroundColorMode, backgroundColorMode ) // 应用颜色过滤器 @@ -407,7 +407,7 @@ class MediaControlPanelBackgroundMix : BaseHook() { // 模糊处理 artworkLayer = BitmapDrawable( imageView.resources, bigBitmap.blur( - mPrefsMap.getInt("system_ui_control_center_media_control_panel_background_mix_blur_radius", 40).toFloat() + radius.toFloat() ) ) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt new file mode 100644 index 0000000000..07ef980e5e --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlPanelTimeViewTextSize.kt @@ -0,0 +1,40 @@ +package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter + +import android.util.* +import android.widget.* +import com.github.kyuubiran.ezxhelper.* +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook +import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper +import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder +import com.sevtinge.hyperceiler.module.base.* + +class MediaControlPanelTimeViewTextSize : BaseHook() { + + private val textSize by lazy { + mPrefsMap.getInt("system_ui_control_center_media_control_time_view_text_size", 13).toFloat() + } + + //from https://github.com/YuKongA/MediaControl-BlurBg + override fun init() { + EzXHelper.initHandleLoadPackage(lpparam) + EzXHelper.setLogTag(TAG) + EzXHelper.setToastTag(TAG) + + val miuiMediaControlPanel = + ClassUtils.loadClassOrNull("com.android.systemui.statusbar.notification.mediacontrol.MiuiMediaControlPanel") + + miuiMediaControlPanel?.methodFinder()?.filterByName("bindPlayer")?.first() + ?.createAfterHook { + val mMediaViewHolder = + it.thisObject.objectHelper().getObjectOrNullUntilSuperclass("mMediaViewHolder") + ?: return@createAfterHook + val elapsedTimeView = + mMediaViewHolder.objectHelper().getObjectOrNullAs("elapsedTimeView") + val totalTimeView = + mMediaViewHolder.objectHelper().getObjectOrNullAs("totalTimeView") + + elapsedTimeView?.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize) + totalTimeView?.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlSeekbarCustom.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlSeekbarCustom.kt new file mode 100644 index 0000000000..5859f380af --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/controlcenter/MediaControlSeekbarCustom.kt @@ -0,0 +1,45 @@ +package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter + +import android.content.res.Resources.* +import android.graphics.drawable.* +import android.util.Log +import android.widget.* +import com.github.kyuubiran.ezxhelper.* +import com.github.kyuubiran.ezxhelper.ClassUtils.loadClassOrNull +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHooks +import com.github.kyuubiran.ezxhelper.ObjectHelper.Companion.objectHelper +import com.sevtinge.hyperceiler.module.base.* + +class MediaControlSeekbarCustom : BaseHook() { + + private val progressThickness by lazy { + mPrefsMap.getInt("system_ui_control_center_media_control_progress_thickness", 80) + } + + //from https://github.com/YuKongA/MediaControl-BlurBg + override fun init() { + EzXHelper.initHandleLoadPackage(lpparam) + EzXHelper.setLogTag(TAG) + EzXHelper.setToastTag(TAG) + + val seekBarObserver = + loadClassOrNull("com.android.systemui.media.controls.models.player.SeekBarObserver") + + seekBarObserver?.constructors?.createHooks { + after { + it.thisObject.objectHelper().setObject("seekBarEnabledMaxHeight", progressThickness.dp) + it.args[0].objectHelper().getObjectOrNullAs("seekBar")?.apply { + thumb = ShapeDrawable().apply { + intrinsicWidth = progressThickness.dp + intrinsicHeight = progressThickness.dp + } + } + } + } + + } + + val Int.dp: Int get() = (this.toFloat().dp).toInt() + + val Float.dp: Float get() = this / getSystem().displayMetrics.density +} \ No newline at end of file diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/HideNavigationBar.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/HideNavigationBar.java index 189a5ca234..3a76efd751 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/HideNavigationBar.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/HideNavigationBar.java @@ -20,11 +20,14 @@ import android.content.Context; import android.database.ContentObserver; +import android.net.Uri; import android.os.Handler; import android.provider.Settings; import android.view.Display; import android.widget.Toast; +import androidx.annotation.Nullable; + import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.module.base.BaseHook; @@ -116,13 +119,20 @@ public void ContentObserver(Context context) { run = true; ContentObserver contentObserver = new ContentObserver(new Handler(context.getMainLooper())) { @Override - public void onChange(boolean z) { - Settings.Global.putInt(context.getContentResolver(), "force_fsg_nav_bar", 1); - Toast.makeText(context, R.string.system_ui_hide_navigation_bar_toast, Toast.LENGTH_SHORT).show(); - logW(TAG, lpparam.packageName, "Please don't switch classic navigation keys"); + public void onChange(boolean selfChange, @Nullable Uri uri) { + if (Settings.Global.getUriFor("hide_gesture_line").toString().equals(uri.toString())) { + Settings.Global.putInt(context.getContentResolver(), "hide_gesture_line", 0); + Toast.makeText(context, R.string.system_ui_hide_navigation_bar_toast_2, Toast.LENGTH_SHORT).show(); + logW(TAG, lpparam.packageName, "Please don't hide gesture lines!"); + } else if (Settings.Global.getUriFor("force_fsg_nav_bar").toString().equals(uri.toString())) { + Settings.Global.putInt(context.getContentResolver(), "force_fsg_nav_bar", 1); + Toast.makeText(context, R.string.system_ui_hide_navigation_bar_toast, Toast.LENGTH_SHORT).show(); + logW(TAG, lpparam.packageName, "Please don't switch classic navigation keys!"); + } } }; context.getContentResolver().registerContentObserver(Settings.Global.getUriFor("force_fsg_nav_bar"), false, contentObserver); + context.getContentResolver().registerContentObserver(Settings.Global.getUriFor("hide_gesture_line"), false, contentObserver); } } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/RotationButton.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/RotationButton.java index 1163de82b1..108307794a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/RotationButton.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/navigation/RotationButton.java @@ -33,6 +33,7 @@ import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.module.base.BaseHook; +import com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt; import java.util.ArrayList; import java.util.Arrays; @@ -41,44 +42,67 @@ public class RotationButton extends BaseHook { boolean isListen = false; - - boolean enable = mPrefsMap.getBoolean("system_framework_other_rotation_button"); + boolean isHyper = false; + boolean enable = mPrefsMap.getStringAsInt("system_framework_other_rotation_button_int", 0) != 1; @Override public void init() throws NoSuchMethodException { - findAndHookConstructor("com.android.systemui.navigationbar.NavigationBarView", - Context.class, AttributeSet.class, new MethodHook() { - @Override - protected void after(MethodHookParam param) { - if (!enable) return; - Context mContext = (Context) param.args[0]; - if (!isListen) { - if (mContext == null) { - logE(TAG, "context can't is null!"); - return; - } - ContentObserver contentObserver = new ContentObserver(new Handler(mContext.getMainLooper())) { - @Override - public void onChange(boolean selfChange, @Nullable Uri uri) { - boolean isShow = getBoolean(mContext); - int rotation = getInt(mContext); - Object mRotationButtonController = XposedHelpers.getObjectField(param.thisObject, "mRotationButtonController"); - try { + isHyper = SystemSDKKt.isMoreHyperOSVersion(1f); + if (!isHyper) + findAndHookConstructor("com.android.systemui.navigationbar.NavigationBarView", + Context.class, AttributeSet.class, new MethodHook() { + @Override + protected void after(MethodHookParam param) { + if (!enable) return; + Context mContext = (Context) param.args[0]; + if (!isListen) { + if (mContext == null) { + logE(TAG, "context can't is null!"); + return; + } + ContentObserver contentObserver = new ContentObserver(new Handler(mContext.getMainLooper())) { + @Override + public void onChange(boolean selfChange, @Nullable Uri uri) { + boolean isShow = getBoolean(mContext); + int rotation = getInt(mContext); + Object mRotationButtonController = XposedHelpers.getObjectField(param.thisObject, "mRotationButtonController"); XposedHelpers.callMethod(mRotationButtonController, "onRotationProposal", rotation, isShow); - } catch (Throwable e) { - Object mUpdateActiveTouchRegionsCallback = XposedHelpers.getObjectField(param.thisObject, "mUpdateActiveTouchRegionsCallback"); - Object NavigationBar = XposedHelpers.getObjectField(mUpdateActiveTouchRegionsCallback, "f$0"); - XposedHelpers.callMethod(NavigationBar, "onRotationProposal", rotation, isShow); } + }; + mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor("rotation_button_data"), + false, contentObserver); + isListen = true; + } + } + } + ); + else + hookAllConstructors("com.android.systemui.navigationbar.NavigationBar", + new MethodHook() { + @Override + protected void after(MethodHookParam param) { + if (!enable) return; + Context mContext = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext"); + if (!isListen) { + if (mContext == null) { + logE(TAG, "context can't is null!"); + return; } - }; - mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor("rotation_button_data"), - false, contentObserver); - isListen = true; + ContentObserver contentObserver = new ContentObserver(new Handler(mContext.getMainLooper())) { + @Override + public void onChange(boolean selfChange, @Nullable Uri uri) { + boolean isShow = getBoolean(mContext); + int rotation = getInt(mContext); + XposedHelpers.callMethod(param.thisObject, "onRotationProposal", rotation, isShow); + } + }; + mContext.getContentResolver().registerContentObserver(Settings.System.getUriFor("rotation_button_data"), + false, contentObserver); + isListen = true; + } } } - } - ); + ); try { @@ -135,6 +159,10 @@ protected void before(MethodHookParam param) { new MethodHook() { @Override protected void before(MethodHookParam param) { + if (!enable) return; + Object mDumpHandler = XposedHelpers.getObjectField(param.thisObject, "mDumpHandler"); + Context context = (Context) XposedHelpers.getObjectField(mDumpHandler, "context"); + setData(context, param.args[0] + "," + param.args[1]); if (enable) param.setResult(null); } } @@ -143,11 +171,21 @@ protected void before(MethodHookParam param) { findAndHookMethod("com.android.systemui.navigationbar.NavigationBar", "onRotationProposal", int.class, boolean.class, new MethodHook() { + Unhook unhook; + @Override protected void before(MethodHookParam param) { if (!enable) { param.setResult(null); + return; } + unhook = findAndHookMethod(View.class, "isAttachedToWindow", + MethodHook.returnConstant(true)); + } + + @Override + protected void after(MethodHookParam param) { + if (unhook != null) unhook.unhook(); } } ); @@ -161,67 +199,6 @@ protected void before(MethodHookParam param) { param.setResult(null); // return; } - /*Context mContext = - (Context) XposedHelpers.getObjectField(param.thisObject, "mContext"); - Object mWindowRotationProvider = XposedHelpers.getObjectField(param.thisObject, "mWindowRotationProvider"); - int i = (int) param.args[0]; - boolean z = (boolean) param.args[1]; - int intValue = switch (getScreenOrientation(mContext)) { - case 0 -> 1; - case 1 -> 0; - default -> -1; - }; - if (intValue == -1) { - logE(TAG, "Unknown parameters, unable to continue execution, execute the original method!"); - return; - } - Object mRotationButton = XposedHelpers.getObjectField(param.thisObject, "mRotationButton"); - boolean acceptRotationProposal = false; - try { - acceptRotationProposal = (boolean) XposedHelpers.callMethod(mRotationButton, "acceptRotationProposal"); - } catch (Throwable e) { - // logE(TAG, "E: " + e); - } - if (true) { - boolean mHomeRotationEnabled = XposedHelpers.getBooleanField(param.thisObject, "mHomeRotationEnabled"); - boolean mIsRecentsAnimationRunning = XposedHelpers.getBooleanField(param.thisObject, "mIsRecentsAnimationRunning"); - Handler mMainThreadHandler = (Handler) XposedHelpers.getObjectField(param.thisObject, "mMainThreadHandler"); - if (mHomeRotationEnabled || !mIsRecentsAnimationRunning) { - if (!z) { - XposedHelpers.callMethod(param.thisObject, "setRotateSuggestionButtonState", false); - param.setResult(null); - } else if (i == intValue) { - mMainThreadHandler.removeCallbacks((Runnable) XposedHelpers.getObjectField(param.thisObject, "mRemoveRotationProposal")); - XposedHelpers.callMethod(param.thisObject, "setRotateSuggestionButtonState", false); - param.setResult(null); - } else { - XposedHelpers.setIntField(param.thisObject, "mLastRotationSuggestion", i); - boolean isRotationAnimationCCW = isRotationAnimationCCW(intValue, i); - if (intValue == 0) { - int mIconCcwStart0ResId = XposedHelpers.getIntField(param.thisObject, "mIconCcwStart0ResId"); - int mIconCwStart0ResId = XposedHelpers.getIntField(param.thisObject, "mIconCwStart0ResId"); - XposedHelpers.setIntField(param.thisObject, "mIconResId", isRotationAnimationCCW ? mIconCcwStart0ResId : mIconCwStart0ResId); - } else { - int mIconCcwStart90ResId = XposedHelpers.getIntField(param.thisObject, "mIconCcwStart90ResId"); - int mIconCwStart90ResId = XposedHelpers.getIntField(param.thisObject, "mIconCwStart90ResId"); - XposedHelpers.setIntField(param.thisObject, "mIconResId", isRotationAnimationCCW ? mIconCcwStart90ResId : mIconCwStart90ResId); - } - int mLightIconColor = XposedHelpers.getIntField(param.thisObject, "mLightIconColor"); - int mDarkIconColor = XposedHelpers.getIntField(param.thisObject, "mDarkIconColor"); - XposedHelpers.callMethod(mRotationButton, "updateIcon", mLightIconColor, mDarkIconColor); - if ((boolean) XposedHelpers.callMethod(param.thisObject, "canShowRotationButton")) { - XposedHelpers.callMethod(param.thisObject, "showAndLogRotationSuggestion"); - param.setResult(null); - return; - } - XposedHelpers.setBooleanField(param.thisObject, "mPendingRotationSuggestion", true); - Runnable mCancelPendingRotationProposal = (Runnable) XposedHelpers.getObjectField(param.thisObject, "mCancelPendingRotationProposal"); - mMainThreadHandler.removeCallbacks(mCancelPendingRotationProposal); - mMainThreadHandler.postDelayed(mCancelPendingRotationProposal, 20000L); - param.setResult(null); - } - } - }*/ } } ); @@ -254,8 +231,10 @@ protected void after(MethodHookParam param) { new MethodHook() { @Override protected void before(MethodHookParam param) { - if (enable) - XposedHelpers.callMethod(param.thisObject, "setRotateSuggestionButtonState", false, false); + if (enable) { + Object rotationButtonController = XposedHelpers.getObjectField(param.thisObject, "f$0"); + XposedHelpers.callMethod(rotationButtonController, "setRotateSuggestionButtonState", false, true); + } } } ); @@ -285,41 +264,8 @@ public int getScreenOrientation(Context context) { return orientation; } - public static boolean isRotationAnimationCCW(int i, int i2) { - if (i == 0 && i2 == 1) { - return false; - } - if (i == 0 && i2 == 2) { - return true; - } - if (i == 0 && i2 == 3) { - return true; - } - if (i == 1 && i2 == 0) { - return true; - } - if (i == 1 && i2 == 2) { - return false; - } - if (i == 1 && i2 == 3) { - return true; - } - if (i == 2 && i2 == 0) { - return true; - } - if (i == 2 && i2 == 1) { - return true; - } - if (i == 2 && i2 == 3) { - return false; - } - if (i == 3 && i2 == 0) { - return false; - } - if (i == 3 && i2 == 1) { - return true; - } - return i == 3 && i2 == 2; + private void setData(Context context, String value) { + Settings.System.putString(context.getContentResolver(), "rotation_button_data", value); } private String getData(Context context) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/plugin/PluginHelper.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/plugin/PluginHelper.java index 172f0d5e8d..ae49e4b0d9 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/plugin/PluginHelper.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/plugin/PluginHelper.java @@ -27,6 +27,7 @@ import com.sevtinge.hyperceiler.module.hook.systemui.NotificationVolumeSeparateSlider; import com.sevtinge.hyperceiler.module.hook.systemui.ShowVolumePct; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.BluetoothTileStyle; +import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.CCGrid; import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.CCGridForHyperOS; public class PluginHelper extends BaseHook { @@ -39,83 +40,82 @@ public class PluginHelper extends BaseHook { public void init() { if (!isAndroidVersion(34) || !isMoreHyperOSVersion(1f)) { String pluginLoaderClass = isAndroidVersion(33) - ? "com.android.systemui.shared.plugins.PluginInstance$Factory" - : "com.android.systemui.shared.plugins.PluginManagerImpl"; - hookAllMethods(pluginLoaderClass, "getClassLoader", new MethodHook() { - private boolean isHooked = false; - // private boolean run = false; + ? "com.android.systemui.shared.plugins.PluginInstance$Factory" + : "com.android.systemui.shared.plugins.PluginManagerImpl"; + hookAllMethods(pluginLoaderClass, "getClassLoader", + new MethodHook() { + private boolean isHooked = false; - @Override - protected void after(MethodHookParam param) { - appInfo = (ApplicationInfo) param.args[0]; - if (appInfo != null) { - if ("miui.systemui.plugin".equals(appInfo.packageName) && !isHooked) { - if (pluginLoader == null) { - pluginLoader = (ClassLoader) param.getResult(); + @Override + protected void after(MethodHookParam param) { + appInfo = (ApplicationInfo) param.args[0]; + if (appInfo != null) { + if ("miui.systemui.plugin".equals(appInfo.packageName) && !isHooked) { + if (pluginLoader == null) { + pluginLoader = (ClassLoader) param.getResult(); + } + isHooked = true; + setClassLoader(pluginLoader); + logW(TAG, "Get ClassLoader: " + pluginLoader); + } else { + if (!isHooked) + logW(TAG, "Get classloader miui.systemui.plugin error"); } - isHooked = true; - setClassLoader(pluginLoader); - logW(TAG, "im get ClassLoader: " + pluginLoader); - // logD("pluginLoader: " + pluginLoader); - // setClassLoader(pluginLoader); - // logE("PluginHelper", "im get ClassLoader: " + pluginLoader); } else { - if (!isHooked) - logW(TAG, "get classloader miui.systemui.plugin error"); + logE(TAG, "AppInfo is null"); } - } else { - logE(TAG, "appInfo is null"); } } - } ); } else { hookAllMethods("com.android.systemui.shared.plugins.PluginInstance$Factory", - "create", new MethodHook() { - @Override - protected void before(MethodHookParam param) { - appInfo = (ApplicationInfo) param.args[1]; + "create", + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + appInfo = (ApplicationInfo) param.args[1]; + } } - } ); findAndHookMethod("com.android.systemui.shared.plugins.PluginInstance$Factory$$ExternalSyntheticLambda0", - "get", new MethodHook() { - private boolean isHooked = false; + "get", + new MethodHook() { + private boolean isHooked = false; - @Override - protected void after(MethodHookParam param) { - Object pathClassLoader = param.getResult(); - if (pluginLoader == null) { - pluginLoader = (ClassLoader) pathClassLoader; - } - if (!isHooked) { - if (appInfo != null) { - if ("miui.systemui.plugin".equals(appInfo.packageName)) { - isHooked = true; - setClassLoader(pluginLoader); - logI(TAG, "im get ClassLoader: " + pluginLoader); - // logD("AU pluginLoader: " + pluginLoader); - } else { - logW(TAG, "Au get classloader miui.systemui.plugin error: " + pluginLoader); - } - } else { - if (pluginLoader.toString().contains("MIUISystemUIPlugin") || - pluginLoader.toString().contains("miui.systemui.plugin")) { - isHooked = true; - setClassLoader(pluginLoader); + @Override + protected void after(MethodHookParam param) { + Object pathClassLoader = param.getResult(); + if (pluginLoader == null) { + pluginLoader = (ClassLoader) pathClassLoader; + } + if (!isHooked) { + if (appInfo != null) { + if ("miui.systemui.plugin".equals(appInfo.packageName)) { + isHooked = true; + setClassLoader(pluginLoader); + logI(TAG, "Get ClassLoader: " + pluginLoader); + } else { + logW(TAG, "Get to the one that doesn't belong to the plugin ClassLoader! " + pluginLoader); + } } else { - logW(TAG, "Au get classloader miui.systemui.plugin error & appInfo is null"); + if (pluginLoader.toString().contains("MIUISystemUIPlugin") || + pluginLoader.toString().contains("miui.systemui.plugin")) { + isHooked = true; + setClassLoader(pluginLoader); + } else { + logW(TAG, "Au get classloader miui.systemui.plugin error & appInfo is null"); + } } } } } - } ); } } public void setClassLoader(ClassLoader classLoader) { + // CCGrid.loadCCGrid(classLoader); if (mPrefsMap.getBoolean("system_ui_plugin_enable_volume_blur")) EnableVolumeBlur.initEnableVolumeBlur(classLoader); if (mPrefsMap.getStringAsInt("system_ui_control_center_mi_smart_hub_entry", 0) != 0) @@ -134,5 +134,11 @@ public void setClassLoader(ClassLoader classLoader) { ShowVolumePct.init(classLoader); if (mPrefsMap.getBoolean("system_ui_unlock_super_volume")) SuperVolume.initSuperVolume(classLoader); + if ((mPrefsMap.getInt("system_control_center_cc_rows", 4) > 4 || + mPrefsMap.getInt("system_control_center_cc_columns", 4) > 4 || + mPrefsMap.getBoolean("system_ui_control_center_rounded_rect") || + mPrefsMap.getBoolean("system_control_center_qs_tile_label")) && !isMoreHyperOSVersion(1f)) { + CCGrid.loadCCGrid(classLoader); + } } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/FixColor.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/FixColor.java index aea6d96269..57ccec77e2 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/FixColor.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/FixColor.java @@ -19,17 +19,12 @@ package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.clock; import android.graphics.Color; -import android.widget.Toast; import com.sevtinge.hyperceiler.module.base.BaseHook; -import com.sevtinge.hyperceiler.ui.fragment.settings.development.DevelopmentDebugInfoFragment; import com.sevtinge.hyperceiler.utils.MathUtils; import java.util.ArrayList; -import java.util.Objects; -import de.robv.android.xposed.XC_MethodReplacement; -import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; public class FixColor extends BaseHook { @@ -38,15 +33,14 @@ public void init() throws NoSuchMethodException { findAndHookMethod("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock", "updateHeaderColor", new MethodHook(){ @Override protected void before(MethodHookParam param) { - /*Object bigTime = XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "bigTime"); - Color bigTimeColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "bigTimeColor"); - Color tintColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mTint"); - Color lightColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mLightColor"); - Color darkColor = (Color) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mDarkColor"); - float whiteFraction = (float) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mWhiteFraction"); - ArrayList areas = (ArrayList) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mAreas"); - float darkIntensity = (float) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mDarkIntensity"); - boolean useTint = (boolean) XposedHelpers.getObjectField(findClassIfExists("com.android.systemui.controlcenter.phone.widget.NotificationShadeFakeStatusBarClock"), "mUseTint"); + Color bigTimeColor = (Color) XposedHelpers.getObjectField(param.thisObject, "bigTimeColor"); + Color tintColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mTint")); + Color lightColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mLightColor")); + Color darkColor = Color.valueOf((int) XposedHelpers.getObjectField(param.thisObject, "mDarkColor")); + float whiteFraction = (float) XposedHelpers.getObjectField(param.thisObject, "mWhiteFraction"); + ArrayList areas = (ArrayList) XposedHelpers.getObjectField(param.thisObject, "mAreas"); + float darkIntensity = (float) XposedHelpers.getObjectField(param.thisObject, "mDarkIntensity"); + boolean useTint = (boolean) XposedHelpers.getObjectField(param.thisObject, "mUseTint"); int inTintColor = Color.argb( MathUtils.lerp(tintColor.alpha(), bigTimeColor.alpha(), whiteFraction), MathUtils.lerp(tintColor.red(), bigTimeColor.red(), whiteFraction), @@ -65,8 +59,8 @@ protected void before(MethodHookParam param) { MathUtils.lerp(darkColor.green(), bigTimeColor.green(), whiteFraction), MathUtils.lerp(darkColor.blue(), bigTimeColor.blue(), whiteFraction) ); - logI(String.valueOf(darkIntensity)); - if (whiteFraction <= 0.01f) XposedHelpers.callMethod(bigTime, "onDarkChanged", areas, darkIntensity, inTintColor, inLightColor, inDarkColor, useTint);*/ + Object getBigTime = XposedHelpers.callMethod(param.thisObject, "getBigTime"); + XposedHelpers.callMethod(getBigTime, "onDarkChanged", areas, darkIntensity, inTintColor, inLightColor, inDarkColor, useTint); param.setResult(null); } }); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt index cfe70502d3..7b40ef89fa 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt @@ -25,7 +25,8 @@ import android.util.* import android.view.* import android.widget.* import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass -import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook +import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createBeforeHook import com.github.kyuubiran.ezxhelper.finders.ConstructorFinder.`-Static`.constructorFinder import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder import com.sevtinge.hyperceiler.module.base.* @@ -50,13 +51,13 @@ object StatusBarClockNew : BaseHook() { mPrefsMap.getBoolean("system_ui_disable_clock_synch") } private val clockSizeS by lazy { - mPrefsMap.getInt("system_ui_statusbar_clock_size_1", 5) + mPrefsMap.getInt("system_ui_statusbar_clock_size_1", 12) } private val clockSizeB by lazy { - mPrefsMap.getInt("system_ui_statusbar_clock_size_2", 20) + mPrefsMap.getInt("system_ui_statusbar_clock_size_2", 54) } private val clockSizeN by lazy { - mPrefsMap.getInt("system_ui_statusbar_clock_size_3", 9) + mPrefsMap.getInt("system_ui_statusbar_clock_size_3", 12) } private val clockTextSpacing by lazy { mPrefsMap.getInt("system_ui_statusbar_clock_double_spacing_margin_1", 16) @@ -105,82 +106,79 @@ object StatusBarClockNew : BaseHook() { override fun init() { statusBarClass.constructorFinder() .filterByParamCount(3) - .first().createHook { - after { - try { - val miuiClock = it.thisObject as TextView - val miuiClockName = miuiClock.resources.getResourceEntryName(miuiClock.id) ?: return@after - - setMiuiClockStyle(miuiClockName, miuiClock) - - val isSec = - miuiClockName in setOf("clock", "big_time", "horizontal_time", "date_time") - // miuiClockName 内部标签分类如下 - // clock 竖屏状态栏时钟 - // big_time 通知中心时钟 - // horizontal_time 横屏通知中心时钟 - // date_time 通知中心日期时钟 - - if (getClockStyle != 0 && miuiClockName == "clock") - miuiClock.isSingleLine = false - - if (isSec) { - val d: Method = miuiClock.javaClass.getDeclaredMethod("updateTime") - val r = Runnable { - d.isAccessible = true - d.invoke(miuiClock) - } + .first().createAfterHook { + try { + val miuiClock = it.thisObject as TextView + val miuiClockName = miuiClock.resources.getResourceEntryName(miuiClock.id) + ?: return@createAfterHook + + setMiuiClockStyle(miuiClockName, miuiClock) + + val isSec = + miuiClockName in setOf("clock", "big_time", "horizontal_time", "date_time") + // miuiClockName 内部标签分类如下 + // clock 竖屏状态栏时钟 + // big_time 通知中心时钟 + // horizontal_time 横屏通知中心时钟 + // date_time 通知中心日期时钟 + + if (getClockStyle != 0 && miuiClockName == "clock") + miuiClock.isSingleLine = false + + if (isSec) { + val d: Method = miuiClock.javaClass.getDeclaredMethod("updateTime") + val r = Runnable { + d.isAccessible = true + d.invoke(miuiClock) + } - class T : TimerTask() { - override fun run() { - Handler(miuiClock.context.mainLooper).post(r) - } + class T : TimerTask() { + override fun run() { + Handler(miuiClock.context.mainLooper).post(r) } - Timer().schedule( - T(), 1000 - System.currentTimeMillis() % 1000, 1000 - ) } - } catch (_: Exception) { + Timer().schedule( + T(), 1000 - System.currentTimeMillis() % 1000, 1000 + ) } + } catch (_: Exception) { } } // 设置格式 statusBarClass.methodFinder() .filterByName("updateTime") - .single().createHook { - before { - try { - val textV = it.thisObject as TextView - val context = textV.context - val miuiClockName = textV.resources.getResourceEntryName(textV.id) ?: return@before - if (miuiClockName in setOf("clock", "big_time", "horizontal_time", "date_time")) { - setMiuiClockStyle(miuiClockName, textV) - - if ((isSync && miuiClockName == "big_time") || (getFormatN.isEmpty() && miuiClockName in setOf("date_time", "horizontal_time"))) return@before - setMiuiClockFormat(context, miuiClockName, textV) - it.result = null - } - } catch (_: Exception) { + .single().createBeforeHook { + try { + val textV = it.thisObject as TextView + val context = textV.context + val miuiClockName = + textV.resources.getResourceEntryName(textV.id) ?: return@createBeforeHook + if (miuiClockName in setOf("clock", "big_time", "horizontal_time", "date_time")) { + setMiuiClockStyle(miuiClockName, textV) + + if ((isSync && miuiClockName == "big_time") || (getFormatN.isEmpty() && miuiClockName in setOf("date_time", "horizontal_time"))) return@createBeforeHook + setMiuiClockFormat(context, miuiClockName, textV) + it.result = null } + } catch (_: Exception) { } } mNewClockClass.methodFinder() .filterByName("updateTime") - .single().createHook { - before { - try { - val textV = it.thisObject as TextView - val context = textV.context - val miuiClockName = textV.resources.getResourceEntryName(textV.id) ?: return@before - setMiuiClockStyle(miuiClockName, textV) - - if ((isSync && miuiClockName == "big_time") || (getFormatN.isEmpty() && miuiClockName in setOf("date_time", "horizontal_time"))) return@before - setMiuiClockFormat(context, miuiClockName, textV) - it.result = null - } catch (_: Exception) { - } + .single().createBeforeHook { + try { + val textV = it.thisObject as TextView + val context = textV.context + val miuiClockName = + textV.resources.getResourceEntryName(textV.id) ?: return@createBeforeHook + setMiuiClockStyle(miuiClockName, textV) + + if ((isSync && miuiClockName == "big_time") || (getFormatN.isEmpty() && miuiClockName in setOf("date_time", "horizontal_time"))) return@createBeforeHook + setMiuiClockFormat(context, miuiClockName, textV) + it.result = null + } catch (_: Exception) { } } } @@ -223,15 +221,15 @@ object StatusBarClockNew : BaseHook() { private fun setStatusBarClock(name: String, text: TextView) { when { - clockSizeS != 5 && name == "clock" -> { + clockSizeS != 12 && name == "clock" -> { text.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSizeS.toFloat()) } - clockSizeB != 20 && name == "big_time" -> { + clockSizeB != 54 && name == "big_time" -> { text.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSizeB.toFloat()) } - clockSizeN != 9 && name in setOf("date_time", "horizontal_time") -> { + clockSizeN != 12 && name in setOf("date_time", "horizontal_time") -> { text.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSizeN.toFloat()) } } @@ -253,6 +251,9 @@ object StatusBarClockNew : BaseHook() { } private fun setMiuiClockFormat(context: Context?, name: String, textV: TextView) { + val textSb: StringBuilder + val formatSb: StringBuilder + // 因为输入对话框限制,所以里面部分内容会比较抽象 val sClockName = if (getFormatN.isEmpty()) { when (getClockStyle) { @@ -280,33 +281,27 @@ object StatusBarClockNew : BaseHook() { when (name) { "clock" -> { - val textSb = StringBuilder() - val formatSb = StringBuilder(sClockName) - mCalendar?.callMethod("format", context, textSb, formatSb) - textV.text = textSb.toString() + textSb = StringBuilder() + formatSb = StringBuilder(sClockName) } "big_time" -> { - val textSb = StringBuilder() - val formatSb = StringBuilder(getFormatS.split("\n")[0]) - mCalendar?.callMethod("format", context, textSb, formatSb) - textV.text = textSb.toString() + textSb = StringBuilder() + formatSb = StringBuilder(getFormatS.split("\n")[0]) } "horizontal_time" -> { - val textSb = StringBuilder() - val formatSb = + textSb = StringBuilder() + formatSb = StringBuilder("${getFormatN.split("\n")[0]} ${getFormatS.split("\n")[0]}") - mCalendar?.callMethod("format", context, textSb, formatSb) - textV.text = textSb.toString() } else -> { - val textSb = StringBuilder() - val formatSb = StringBuilder(getFormatN.split("\n")[0]) - mCalendar?.callMethod("format", context, textSb, formatSb) - textV.text = textSb.toString() + textSb = StringBuilder() + formatSb = StringBuilder(getFormatN.split("\n")[0]) } } + mCalendar?.callMethod("format", context, textSb, formatSb) + textV.text = textSb.toString() } } \ No newline at end of file diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/IconsFromSystemManager.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/IconsFromSystemManager.java index 4c0ee2ba2e..ba9e893c0b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/IconsFromSystemManager.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/icon/all/IconsFromSystemManager.java @@ -23,23 +23,14 @@ import de.robv.android.xposed.XposedHelpers; public class IconsFromSystemManager extends BaseHook { - Class statusBarIcon; @Override public void init() { - try { - statusBarIcon = findClass("com.android.internal.statusbar.StatusBarIcon"); - } catch (Throwable e) { - statusBarIcon = findClass("com.android.systemui.statusbar.phone.StatusBarIconHolder"); - } - - if (statusBarIcon == null) { - logE(TAG, "statusBarIcon is null"); - return; - } + Class statusBarIconControllerImpl = findClass("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl"); - findAndHookMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl", - "setIcon", String.class, statusBarIcon, + boolean successHooked = findAndHookMethodSilently(statusBarIconControllerImpl, + "setIcon", + String.class, findClass("com.android.internal.statusbar.StatusBarIcon"), new MethodHook() { @Override protected void before(MethodHookParam param) { @@ -50,6 +41,23 @@ protected void before(MethodHookParam param) { } } ); + + if (!successHooked) { + findAndHookMethod(statusBarIconControllerImpl, + "setIcon", + String.class, findClass("com.android.systemui.statusbar.phone.StatusBarIconHolder"), + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + String slotName = (String) param.args[0]; + if (checkSlot(slotName)) { + Object statusBarIconInstance = XposedHelpers.getObjectField(param.args[1], "mIcon"); + XposedHelpers.setObjectField(statusBarIconInstance, "visible", false); + } + } + }); + } + } public boolean checkSlot(String slotName) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/MainActivity.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/MainActivity.java index ce991dd2bf..67d896dca7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/MainActivity.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/MainActivity.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; @@ -31,6 +32,7 @@ import com.sevtinge.hyperceiler.ui.base.NavigationActivity; import com.sevtinge.hyperceiler.utils.BackupUtils; import com.sevtinge.hyperceiler.utils.Helpers; +import com.sevtinge.hyperceiler.utils.LanguageHelper; import com.sevtinge.hyperceiler.utils.PropUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.api.ProjectApi; @@ -46,6 +48,11 @@ public class MainActivity extends NavigationActivity implements IResult { @Override public void onCreate(Bundle savedInstanceState) { + SharedPreferences mPrefs = PrefsUtils.mSharedPreferences; + int count = Integer.parseInt(mPrefs.getString("prefs_key_settings_app_language", "-1")); + if (count != -1) { + LanguageHelper.setIndexLanguage(this, count, false); + } handler = new Handler(this.getMainLooper()); context = this; int def = Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_log_level", "2")); 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 80383ec163..0dbf5e20cd 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 @@ -26,13 +26,11 @@ import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; -import android.content.Intent; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.text.SpannableString; import android.view.View; import androidx.annotation.NonNull; @@ -45,11 +43,9 @@ import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; -import com.sevtinge.hyperceiler.prefs.RecommendPreference; import com.sevtinge.hyperceiler.prefs.TipsPreference; import com.sevtinge.hyperceiler.ui.MainActivityContextHelper; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; -import com.sevtinge.hyperceiler.ui.fragment.helper.CantSeeAppsFragment; import com.sevtinge.hyperceiler.ui.fragment.helper.HomepageEntrance; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; @@ -193,10 +189,10 @@ public void isOfficialRom() { public boolean getIsOfficialRom() { return ( !getBaseOs().startsWith("V") && - !getBaseOs().startsWith("Xiaomi") && - !getBaseOs().startsWith("Redmi") && - !getBaseOs().startsWith("POCO") && - !getBaseOs().isEmpty() + !getBaseOs().startsWith("Xiaomi") && + !getBaseOs().startsWith("Redmi") && + !getBaseOs().startsWith("POCO") && + !getBaseOs().isEmpty() ) || !getRomAuthor().isEmpty() || Objects.equals(SystemSDKKt.getHost(), "xiaomi.eu") || 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 767cdea917..df2b6a3157 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 @@ -31,7 +31,6 @@ import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.RecommendPreference; import com.sevtinge.hyperceiler.ui.SubPickerActivity; -import com.sevtinge.hyperceiler.ui.fragment.PhoneFragment; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.ui.fragment.sub.AppPicker; import com.sevtinge.hyperceiler.utils.KillApp; @@ -117,7 +116,7 @@ public void initPrefs() { args1.putString(":settings:fragment_args_key", "prefs_key_system_ui_display_use_aosp_screenshot_enable"); mRecommend.addRecommendView(getString(R.string.system_ui_display_use_aosp_screenshot), null, - PhoneFragment.class, + DisplaySettings.class, args1, R.string.system_framework_display_title ); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/settings/ModuleSettingsFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/settings/ModuleSettingsFragment.java index 90338e34aa..201909fe30 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/settings/ModuleSettingsFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/settings/ModuleSettingsFragment.java @@ -83,53 +83,7 @@ public void initPrefs() { new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(@NonNull Preference preference, Object o) { - String v = LanguageHelper.appLanguages[Integer.parseInt((String) o)]; - switch (v) { - case "en" -> { - LanguageHelper.setLanguage(getContext(), "en"); - getActivity().recreate(); - } - case "zh_CN" -> { - LanguageHelper.setLanguage(getContext(), "zh", "CN"); - getActivity().recreate(); - } - case "zh_TW" -> { - LanguageHelper.setLanguage(getContext(), "zh", "TW"); - getActivity().recreate(); - } - case "zh_HK" -> { - LanguageHelper.setLanguage(getContext(), "zh", "HK"); - getActivity().recreate(); - } - case "ja_JP" -> { - LanguageHelper.setLanguage(getContext(), "ja", "JP"); - getActivity().recreate(); - } - case "ru_RU" -> { - LanguageHelper.setLanguage(getContext(), "ru", "RU"); - getActivity().recreate(); - } - case "es_ES" -> { - LanguageHelper.setLanguage(getContext(), "es", "ES"); - getActivity().recreate(); - } - case "pt_BR" -> { - LanguageHelper.setLanguage(getContext(), "pt", "BR"); - getActivity().recreate(); - } - case "in_ID" -> { - LanguageHelper.setLanguage(getContext(), "in", "ID"); - getActivity().recreate(); - } - case "tr_TR" -> { - LanguageHelper.setLanguage(getContext(), "tr", "TR"); - getActivity().recreate(); - } - case "vi_VN" -> { - LanguageHelper.setLanguage(getContext(), "vi", "VN"); - getActivity().recreate(); - } - } + LanguageHelper.setIndexLanguage(getActivity(), Integer.parseInt((String) o), true); return true; } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/ControlCenterSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/ControlCenterSettings.java index f1b354f27c..2b5dab917f 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/ControlCenterSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/ControlCenterSettings.java @@ -60,6 +60,8 @@ public class ControlCenterSettings extends SettingsPreferenceFragment implements SeekBarPreferenceEx mRoundedRectRadius; SwitchPreference mThemeBlur; SwitchPreference mMusicCtrlPanelMix; + DropDownPreference mProgressMode; + SeekBarPreferenceEx mProgressModeThickness; SwitchPreference mTaplus; SwitchPreference mNotifrowmenu; @@ -95,6 +97,8 @@ public void initPrefs() { mThemeBlur = findPreference("prefs_key_system_ui_control_center_unlock_blur_supported"); mMusicCtrlPanelMix = findPreference("prefs_key_system_ui_control_center_media_control_panel_background_mix"); mNotifrowmenu = findPreference("prefs_key_system_ui_control_center_notifrowmenu"); + mProgressMode = findPreference("prefs_key_system_ui_control_center_media_control_progress_mode"); + mProgressModeThickness = findPreference("prefs_key_system_ui_control_center_media_control_progress_thickness"); handler = new Handler(); mExpandNotification.setOnPreferenceClickListener( @@ -125,8 +129,10 @@ public void initPrefs() { mRoundedRectRadius.setVisible(PrefsUtils.getSharedBoolPrefs(getContext(), "prefs_key_system_ui_control_center_rounded_rect", false) && isMoreHyperOSVersion(1f)); mMusicCtrlPanelMix.setVisible(isMoreHyperOSVersion(1f)); mNotifrowmenu.setVisible(!isMoreHyperOSVersion(1f)); + mProgressModeThickness.setVisible(Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_system_ui_control_center_media_control_progress_mode", "0")) == 2); mRoundedRect.setOnPreferenceChangeListener(this); + mProgressMode.setOnPreferenceChangeListener(this); ((SeekBarPreferenceEx) findPreference("prefs_key_system_control_center_old_qs_grid_columns")).setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override @@ -171,12 +177,18 @@ public void killTaplus() { @Override public boolean onPreferenceChange(Preference preference, Object o) { if (preference == mRoundedRect) { - setCanBeVisible((Boolean) o); + setCanBeVisibleRoundedRect((Boolean) o); + } else if (preference == mProgressMode) { + setCanBeVisibleProgressMode(Integer.parseInt((String) o)); } return true; } - private void setCanBeVisible(boolean mode) { + private void setCanBeVisibleRoundedRect(boolean mode) { mRoundedRectRadius.setVisible(mode && isMoreHyperOSVersion(1f)); } + + private void setCanBeVisibleProgressMode(int mode) { + mProgressModeThickness.setVisible(mode == 2); + } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/LanguageHelper.java b/app/src/main/java/com/sevtinge/hyperceiler/utils/LanguageHelper.java index ee5238e6da..da48eb2804 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/LanguageHelper.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/LanguageHelper.java @@ -18,6 +18,7 @@ */ package com.sevtinge.hyperceiler.utils; +import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -55,6 +56,55 @@ public static void setLanguage(Context context, Locale locale) { resources.updateConfiguration(configuration, resources.getDisplayMetrics()); } + public static void setIndexLanguage(Activity activity, int index, boolean recreate) { + switch (index) { + case 0 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "en"); + if (recreate) activity.recreate(); + } + case 1 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "zh", "CN"); + if (recreate) activity.recreate(); + } + case 2 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "zh", "TW"); + if (recreate) activity.recreate(); + } + case 3 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "zh", "HK"); + if (recreate) activity.recreate(); + } + case 4 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "ja", "JP"); + if (recreate) activity.recreate(); + } + case 5 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "ru", "RU"); + if (recreate) activity.recreate(); + } + case 6 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "es", "ES"); + if (recreate) activity.recreate(); + } + case 7 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "pt", "BR"); + if (recreate) activity.recreate(); + } + case 8 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "in", "ID"); + if (recreate) activity.recreate(); + } + case 9 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "tr", "TR"); + if (recreate) activity.recreate(); + } + case 10 -> { + LanguageHelper.setLanguage(activity.getBaseContext(), "vi", "VN"); + if (recreate) activity.recreate(); + } + } + } + public static String getLanguage(Context context) { Resources resources = context.getResources(); String country = resources.getConfiguration().getLocales().get(0).getCountry(); diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 51841f4046..9c7b318b6d 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -632,7 +632,6 @@ Tamaño del reloj de dos filas Funciona solo cuando se muestra en dos filas Corregir color - Características experimentales Deshabilite la animación de transición del reloj deslizante en el Centro de notificaciones Potencia relacionada Temperatura relacionada diff --git a/app/src/main/res/values-in-rID/strings.xml b/app/src/main/res/values-in-rID/strings.xml index 89b73e0377..be65798f3a 100644 --- a/app/src/main/res/values-in-rID/strings.xml +++ b/app/src/main/res/values-in-rID/strings.xml @@ -655,7 +655,6 @@ Ukuran jam baris ganda Hanya valid jika ditampilkan dalam dua baris Perbaiki warna - Fitur eksperimental Nonaktifkan animasi transisi jam slide di Pusat Pemberitahuan Pengaturan jam bilah status tidak disinkronkan Jam bilah notifikasi besar tidak lagi disinkronkan dengan format jam bilah status diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 152d694daa..fb9a090d68 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -8,7 +8,7 @@ システムアプリの変更 HyperCeiler へようこそ。このアプリはシステムの機能強化をするために Xposed フレームワークを利用して対応アプリを改変します。使用中、より多くの機能を提供するために root/su 権限の許可を求める場合があります。お使いの root/su マネージャーにアクセスして許可してください。 - 日本語 + Japanese (日本語) AndroPlus https://github.com/AndroPlus-org ホーム @@ -58,6 +58,7 @@ 中間 下部 アイコンのスタイル + 言語 (Language) 丸みを帯びた長方形のスタイル 背景の切り抜きスタイル ターゲットアプリを再起動 @@ -654,7 +655,6 @@ 二行の時計のサイズ 2 行で表示されている場合にのみ有効です 色を修正 - 実験的機能です 通知センターでのスライド時計遷移アニメーションを無効化 ステータスバーの時計設定が同期されていません 大きな通知バーの時計はステータスバーの時計形式と同期されなくなりました @@ -742,6 +742,10 @@ 背景ぼかしの値 デフォルトの背景値 メディアコントロールパネルの色混合効果を最適化 + プログレスバー + 波状 + スリーク + 太さ カードから混在色の背景を削除 背景画像のぼかし半径 背景オーバーレイレイヤーの不透明度 @@ -751,6 +755,7 @@ 通知メニューの設定を開いたとき、通知設定を適用するのではなくターゲットアプリの通知チャンネル設定に移動します 天気を表示 都市を表示 + ネットワーク監視のプロンプトを非表示 画面が ON のときはミュートする 通知を展開 画面がオンになっているとき、ポップアップ通知でプロンプト音を再生しません @@ -1083,6 +1088,7 @@ 「ファイル」アイコンの非表示を無効化 テーママネージャーアイコンを非表示にしない Google の非表示を無効化 + デフォルト以外のアイコンを偽装する アニメーションパラメーターのカスタム 減衰 剛性 @@ -1347,6 +1353,8 @@ サイドバー機能 すぐにゲームを起動 ゲーム起動時に開始画面のアニメーションを3倍の速度で表示します。一部のゲームにのみ対応しています + SIM セキュリティとアカウントを不要にする + 一部の機能での SIM と Xiaomi アカウントの要求を回避します。Xiaomi アカウントにログインしなくても機能を使えるようにできます AOSP のアプリ情報 AOSP 版のアプリ情報項目を追加します AOSP アプリマネージャー @@ -1369,6 +1377,9 @@ + カード表示方法 + ライトモード + ダークモード AI 翻訳 AI キャプションを強制的に有効化 @@ -1457,6 +1468,7 @@ アプリを管理 アプリの言語 さらに輝度を下げる + デフォルトのアプリ 入力 Magic Pointer をオフにする Xiaomi Pad のマウスポインターを丸ではなく AOSP 版に戻します @@ -1552,13 +1564,18 @@ ログを無効化 サジェストを無効化 サジェストを有効化 + ホームページのエントリを設定 アプリの機能が見つかりませんか? + 注意:\nこの設定はホームページのエントリーの表示設定だけで、有効にした機能は無効にはなりません!\nポータルを閉じるとすぐ変更が反映されます。再表示するにはアプリの再起動が必要です ホームページでアプリの機能が見つかりませんか? ホームページのシンプルさと使いやすさを維持するため、以下のタイプのアプリ機能を非表示にしています:\n\n - 現在無効か非表示になっているアプリ向けの機能\n - デバイスにないアプリ向けの機能\n - 現在のアプリやバージョンに非対応の機能\n\n上記に当てはまるか確認し、修正したら HyperCeiler を再起動してください。それでも出てこなければバグかもしれません。開発者にフィードバックしてください。\n\n現在非表示になっているアプリ機能:\n\n アンインストールされたアプリ:\n 無効または非表示のアプリ:\n ホームページのシンプルさと使いやすさを維持するため、以下のタイプのアプリ機能を非表示にしています:\n\n - 現在無効か非表示になっているアプリ向けの機能\n - デバイスにないアプリ向けの機能\n - 現在のアプリやバージョンに非対応の機能\n\n上記に当てはまるか確認し、修正したら HyperCeiler を再起動してください。それでも出てこなければバグかもしれません。開発者にフィードバックしてください。\n\n現在非表示になっているアプリ機能はありません + ホームページでこのヘルプを隠す + このページは「設定 - ホームページのエントリを設定」で確認できます。適用するにはアプリを再起動してください。 使用している ROM は Xiaomi 公式ではないかもしれません。 一部の機能が動作しない場合がありますので、ご利用の ROM の提供者にお問い合わせください。 署名の検証に失敗しました。現在使用しているバージョンは Re.chronoRain の公式バージョンではないため、悪意のあるコードが含まれている可能性があります。 ヒント: デフォルトのヒントはこちらです。 このメッセージが出るということは HyperCeiler に問題があります。 出たら開発者に教えてください。 + 何か他のものをお探しですか? diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 0f3c58a0d5..d6ec5b7aee 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -217,7 +217,7 @@ Role para cima Exibir barra lateral Janela flutuante - Fixar janela + Janela lateral Topo Fundo Separado @@ -263,6 +263,7 @@ Fechar Padrão do sistema Forçar brilho máximo + Forçado Fechar Modo de gravação padrão Modo de gravação um @@ -277,9 +278,9 @@ Valores e unidades são exibidos em duas linhas A velocidade da rede uplink e downlink é exibida em uma única linha Exibição de linha dupla de velocidades da rede de uplink e downlink - Relógio da barra de status em linha única - Relógio da barra de status\nMini-relógio da barra de notificação - Mini-relógio da barra de notificação\nRelógio da barra de status + Exibição em uma única linha\n\nSomente relógio da barra de status + Exibição de duas linhas\n\nRelógio da barra de status na parte superior\nMini-relógio da central de notificações na parte inferior + Exibição de duas linhas\n\nMini-relógio da central de notificações na parte superior\nRelógio da barra de status na parte inferior Mickey Mouse Urso de morango @@ -511,6 +512,7 @@ Indicador de tela infinita Ocultar indicador de tela infinita Não alternar teclas de navegação + Não ocultar indicador de tela infinita Por favor, reinicie os escopos Launcher do sistema e UI do Sistema. Indicador de tela infinita personalizado Altura @@ -518,7 +520,7 @@ Largura em paisagem Espessura Cor quando estiver no modo claro - Cor quando estiver no modo escuro + Cor quando estiver no Modo escuro Navegação personalizada Altura da navegação Altura da navegação no modo paisagem @@ -565,7 +567,7 @@ Exibir ícones do lado esquerdo Exibir ícones do lado direito Wi-Fi - Wi-Fi escravo + Wi-Fi auxiliar Padrão Wi-Fi Ponto de acesso Wi-Fi Indicador de atividade de rede @@ -628,7 +630,7 @@ Ativar modificação Intervalo de atualização da velocidade da rede Tamanho da fonte da velocidade da rede - Estilo de fonte da velocidade de rede + Estilo da fonte da velocidade de rede Estilo do indicador da velocidade de rede Trocar velocidades de uplink e downlink e posições de ícones Ocultar velocidade de rede lenta @@ -655,18 +657,17 @@ Tamanho do relógio de duas linhas Válido somente quando exibido em duas linhas Corrigir cor - Recurso experimental Desativar animação de transição do relógio na central de notificações Configurações do relógio da barra de status não sincronizadas - O grande relógio da barra de notificação não está mais sincronizado com o formato do relógio da barra de status + O grande relógio da central de notificações não está mais sincronizado com o formato do relógio da barra de status Exibir - Grande relógio da barra de notificação em negrito + Grande relógio da central de notificações em negrito Relógio da barra de status - Grande relógio da barra de notificação - Mini-relógio da barra de notificação - Este projeto também contém modificações no relógio da barra de notificação horizontal + Grande relógio da central de notificações + Mini-relógio da central de notificações + Este projeto também contém modificações no relógio da central de notificações horizontal Formato do relógio da barra de status - Formato do mini-relógio da barra de notificação + Formato do mini-relógio da central de notificações Arranjo do relógio da barra de status Relacionado à energia Relacionado à temperatura @@ -728,7 +729,7 @@ %d colunas Colunas (Paisagem) Entrada do Mi Play - Entrada do Mi Smart Hub + Entrada do Xiaomi Smart Hub Entrada de controle do dispositivo Valor do blur do detalhe de fundo do controle Desativar modo transparente @@ -743,6 +744,14 @@ Valor do blur de fundo Valor padrão de fundo Otimizar efeito de mistura de cores do painel de controle de mídia + Barra de progresso + Remover restrições de apps de ação personalizada para cartões de notificação de mídia + Ondulado + Suave + Rígido + Tamanho do texto da visualização da hora + Personalizar tamanho do botão de ação + Tamanho do botão de ação intrínseca Remover fundo de cores misturadas do cartão Raio do blur da imagem de fundo Opacidade da camada de sobreposição do fundo @@ -754,6 +763,7 @@ Exibir cidade Ocultar solicitações de monitoramento de rede Silenciar quando a tela estiver ligada + Recolher notificações no histórico é proibido Expandir notificações Quando a tela está ligada, a notificação pop-up não reproduz o som de aviso. Retângulo arredondado @@ -1139,6 +1149,10 @@ Exibir nome do ícone na dock Ocultar ícones de apps recentes da dock Blur de fundo personalizado + Deslizar para cima para mostrar apenas a dock + Deslize para cima uma segunda vez e vá para os recentes + Ocultar a dock + Após ativá-la, a opção Deslizar para cima para mostrar apenas a dock será inválida. Outros Atalho Modo desktop @@ -1434,7 +1448,7 @@ Outros Notas - Mi Smart Hub + Xiaomi Smart Hub Nova tarefa Personalizado Versão não suportada @@ -1465,6 +1479,7 @@ Gerenciamento de apps Idiomas, entrada e gestos Ultra escuro + Apps padrão Entrada Sem ponteiro mágico Transforme o ponteiro redondo do sistema Xiaomi Pad em ponteiro AOSP. @@ -1568,7 +1583,10 @@ Apps desinstalados:\n Apps desativados ou ocultos:\n Para manter a simplicidade e a usabilidade da página inicial, ocultamos o acesso aos seguintes tipos de recursos do app:\n\n - Aqueles atualmente desativados ou ocultos\n - Aqueles que não foram encontrados em seu dispositivo\n - Aqueles incompatíveis com a versão atual do sistema ou do app\n\nPor favor, solucione o problema com base nas informações acima, reinicie o HyperCeiler e tente novamente. Se você ainda não conseguir encontrar o recurso do app, pode ser um bug. Por favor, forneça-nos feedbacks oportunos e eficazes.\n\nAtualmente não há entrada oculta! + Ocultar esta ajuda na página inicial + Você ainda pode encontrar esta página em Configurações - Configurar entrada da página inicial. Reinicie o app para aplicar. A fonte da ROM que você está usando pode não ser oficial da Xiaomi, e algumas funções podem não funcionar. Por favor, entre em contato com o seu fornecedor para obter mais detalhes. A verificação da assinatura falhou, e a versão atual que você está usando pode não ser a oficial de Re.chronoRain, podendo conter código malicioso. Dica: Aqui está a dica padrão. Se você puder me ver, significa que há um problema com o HyperCeiler. Por favor, informe o desenvolvedor de maneira oportuna e eficaz. + Procurando outra coisa? diff --git a/app/src/main/res/values-vi-rVN/strings.xml b/app/src/main/res/values-vi-rVN/strings.xml index 9d465ef780..05796be5a7 100644 --- a/app/src/main/res/values-vi-rVN/strings.xml +++ b/app/src/main/res/values-vi-rVN/strings.xml @@ -215,9 +215,9 @@ Chế độ một tay (trái) Chế độ một tay (phải) Cuộn lên đầu - Hiển thị Thanh bên + Hiện thanh bên Cửa sổ nổi - Ghim cửa sổ + Cửa sổ bên Trên Dưới cùng Riêng lẻ @@ -263,6 +263,7 @@ Đóng Mặc định của hệ thống Buộc độ sáng tối đa + Bắt buộc Đóng Chế độ ghi mặc định Chế độ viết một @@ -277,9 +278,9 @@ Giá trị và đơn vị hiển thị theo hàng đôi Tốc độ mạng up và down được hiển thị trên một dòng duy nhất Tốc độ mạng up và down được hiển thị trên dòng đôi - Đồng hồ ở thanh trạng thái hàng đơn - Đồng hồ trên thanh trạng thái\nĐồng hồ nhỏ trên thanh thông báo - Đồng hồ nhỏ trên thanh thông báo\nĐồng hồ trên thanh trạng thái + Chỉ hiển thị một dòng\n\nChỉ đồng hồ trên thanh trạng thái + Hiển thị hai dòng\n\nĐồng hồ thanh trạng thái ở trên cùng\nĐồng hồ nhỏ trên thanh thông báo ở dưới cùng + Hiển thị hai dòng\n\nĐồng hồ nhỏ trên thanh thông báo ở trên cùng\nĐồng hồ trên thanh trạng thái ở dưới cùng Chuột Mickey Gấu dâu @@ -513,6 +514,7 @@ Chức năng này là chức năng thử nghiệm có độ ổn định caoThanh ngang Ẩn thanh ngang Không chuyển đổi phím điều hướng + Không ẩn dòng nhắc cử chỉ Vui lòng khởi động lại Miui Home và SystemUi Tùy chỉnh thanh ngang Chiều cao @@ -657,7 +659,6 @@ Chức năng này là chức năng thử nghiệm có độ ổn định caoKích thước hàng đôi (0 là giá trị gốc) Chỉ hợp lệ khi hiển thị ở hai hàng Cố định màu - Tính năng thử nghiệm Tắt hoạt ảnh chuyển tiếp đồng hồ trong trung tâm thông báo Cài đặt đồng hồ trên thanh trạng thái không được đồng bộ hóa Đồng hồ trên thanh thông báo lớn không còn đồng bộ với định dạng đồng hồ trên thanh trạng thái @@ -745,6 +746,14 @@ Chức năng này là chức năng thử nghiệm có độ ổn định caoGiá trị làm mờ nền Độ trong suốt nền thanh thông báo kéo xuống Tối ưu hóa hiệu ứng trộn màu của bảng điều khiển phương tiện + Thanh tiến trình + Loại bỏ hạn chế trong việc áp dụng các hành động tùy chỉnh cho thẻ thông báo phương tiện + Sóng + Trơn + Độ dày + Kích thước văn bản xem thời gian + Tùy chỉnh kích thước của nút hành động + Kích thước nút hành động có sẵn Xóa nền màu hỗn hợp khỏi thẻ Bán kính mờ ảnh nền Độ mờ của lớp phủ nền @@ -756,6 +765,7 @@ Chức năng này là chức năng thử nghiệm có độ ổn định caoHiện thị thành phố Ẩn lời nhắc giám sát mạng Tắt âm thông báo khi màn hình bật + Thu gọn vào thông báo lịch sử bị cấm Mở rộng thông báo Khi màn hình đang bật, thông báo không phát âm thanh Ô hình chữ nhật bo tròn @@ -1145,6 +1155,10 @@ Chức năng này là chức năng thử nghiệm có độ ổn định caoHiển thị tiêu đề ứng dụng Ẩn ứng dụng gần đây khỏi thanh Dock Tùy chỉnh làm mờ nền + Vuốt lên để chỉ hiển thị Dock + Vuốt lên lần thứ hai và chuyển đến tác vụ gần đây + Ẩn Dock + Sau khi bật, \"Vuốt lên để chỉ hiển thị Dock\" sẽ không hợp lệ. Khác Phím tắt Chế độ máy tính @@ -1479,6 +1493,7 @@ Hãy đảm bảo rằng các ứng dụng hệ thống có siêu dữ liệu is Quản lý ứng dụng Cài đặt ngôn ngữ Siêu tối + Ứng dụng mặc định Nhập Không có con trỏ ảo Biến con trỏ MIUI tròn thành con trỏ AOSP. @@ -1582,7 +1597,10 @@ Hãy đảm bảo rằng các ứng dụng hệ thống có siêu dữ liệu is Ứng dụng đã gỡ cài đặt:\n Ứng dụng bị tắt hoặc bị ẩn:\n Để duy trì tính đơn giản và khả năng sử dụng của trang chủ, chúng tôi ẩn quyền truy cập vào các loại tính năng ứng dụng sau:\n\n - Những tính năng này hiện bị vô hiệu hóa hoặc bị ẩn\n - Những tính năng này không được tìm thấy trên thiết bị của bạn\n - Những tính năng không tương thích với hệ thống hiện tại hoặc phiên bản ứng dụng\n\nVui lòng khắc phục sự cố dựa trên thông tin ở trên, khởi động lại HyperCeiler và thử lại. Nếu bạn vẫn không thể tìm thấy tính năng ứng dụng thì đó có thể là lỗi. Vui lòng cung cấp cho chúng tôi phản hồi kịp thời và hiệu quả.\n\nHiện không có mục ẩn nào! + Ẩn trợ giúp này trong trang chủ + Bạn vẫn có thể tìm thấy trang này trong \"Cài đặt - Thiết lập lối tắt trang chủ\". Khởi động lại ứng dụng để áp dụng. Nguồn ROM bạn đang sử dụng có thể không phải chính thức từ Xiaomi và một số chức năng có thể không hoạt động, vui lòng liên hệ nhà cung cấp bạn đang sử dụng để biết chi tiết. Xác minh chữ ký không thành công và phiên bản hiện tại bạn đang sử dụng có thể không phải là phiên bản chính thức của Re.chronoRain và có thể chứa mã độc. Mẹo: Đây là mẹo mặc định. Nếu bạn có thể nhìn thấy tôi, điều đó có nghĩa là có vấn đề với HyperCeiler. Vui lòng thông báo cho nhà phát triển một cách kịp thời và hiệu quả. + Bạn đang cần tìm gì? diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c75c8e3f61..4fc7c7f38e 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -308,6 +308,8 @@ 系统默认模式 强制最高亮度 + 强制启用 + 关闭 默认写入模式 写入模式一 @@ -326,9 +328,9 @@ 上下行网速单行显示 上下行网速双排显示 - 单行状态栏时钟 - 状态栏时钟\n通知中心迷你时钟 - 通知中心迷你时钟\n状态栏时钟 + 单行显示\n\n仅状态栏时钟 + 双行显示\n\n状态栏时钟在上\n通知中心迷你时钟在下 + 双行显示\n\n通知中心迷你时钟在上\n状态栏时钟在下 米老鼠 草莓熊 @@ -567,6 +569,7 @@ 手势提示线 隐藏手势提示线 请勿切换经典导航键 + 请勿隐藏手势提示线 请重启 \"系统桌面\" 和 \"系统界面\" 两个作用域 自定义手势提示线 高度 @@ -721,7 +724,6 @@ 不同步状态栏时钟设置 通知中心大时钟不再同步状态栏时钟格式 修复时钟反色时颜色异常 - 实验性功能 显示 通知中心大时钟加粗 @@ -810,7 +812,15 @@ 默认主题无需调节 通知背景透明度 下拉通知背景透明度 + 媒体进度条样式 + 波浪 + 圆滑 + 粗细 + 解除自定义动作应用限制 + 时间预览文本大小 优化音乐面板背景混色效果 + 自定义动作按钮大小 + 固有动作按钮大小 移除卡片混色背景 背景模糊半径 背景叠加层透明度 @@ -821,6 +831,7 @@ 显示天气 显示地区 隐藏网络监控提示 + 禁止折叠为历史通知 亮屏时静音 展开通知 亮屏时弹出通知不播放提示音 @@ -1221,6 +1232,10 @@ 显示应用标题 隐藏 Dock 栏最近应用的图标 添加 Dock 栏背景模糊 + 上滑只展示 Dock 栏 + 第二次上滑再跳转到最近任务 + 隐藏 Dock 栏 + 开启后 \"上滑只展示 Dock 栏\" 将失效 其他 快捷菜单 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index de33872df5..a062e1a5a0 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -263,6 +263,7 @@ 關閉 系統預設模式 強制最大亮度 + 強制 關閉 預設寫入模式 寫入模式一 @@ -277,9 +278,9 @@ 值和單位雙排顯示 上下行網速單行顯示 上下行網速雙排顯示 - 單行狀態欄時鐘 - 狀態欄時鐘\n通知欄迷你時鐘 - 通知欄迷你時鐘\n狀態欄時鐘 + 單行顯示\n\n僅狀態欄時鐘 + 兩行顯示\n\n頂部狀態欄時鐘\n底部通知欄迷你時鐘 + 兩行顯示\n\n頂部通知欄迷你時鐘\n底部狀態欄時鐘 米奇 草莓熊 @@ -511,6 +512,7 @@ 手勢提示線 隱藏導覽欄 不要切換導航鍵 + 不要隱藏手勢提示線 請重新啟動 「系統桌面」 和 「系統介面」 手勢提示線自訂 高度 @@ -655,7 +657,6 @@ 雙排時鐘大小 僅在雙排顯示下生效 修復時鐘反色時的顏色異常 - 實驗性功能 停用通知中心下滑時鐘過渡動畫 狀態欄時鐘設定不同步 大通知欄時鐘不再與狀態欄時鐘格式同步 @@ -743,6 +744,14 @@ 通知背景透明度 下拉通知背景透明度 最佳化媒體控制面板混色效果 + 進度條 + 取消媒體通知卡應用程式自訂操作的限制 + 波浪 + 平滑 + 粗細 + 時間文字大小 + 自訂操作按鈕的大小 + 固有操作按鈕尺寸 從卡片中刪除混合顏色背景 背景圖案模糊半徑 背景覆蓋層的不透明度 @@ -754,6 +763,7 @@ 顯示地區 隱藏網路監控提示 亮屏時靜音 + 禁止折疊到歷史通知中 展開通知 亮屏時彈出通知不播放提示音 圓角矩形磁貼 @@ -1139,6 +1149,10 @@ 顯示應用程式標題 在 Dock 欄中隱藏最近應用圖示 背景模糊自訂 + 向上滑動以僅顯示 Dock + 第二次向上滑動,跳到最近的任務 + 隱藏 Dock + 開啟後「向上滑動僅顯示 Dock」將失效。 其他 快捷選單 桌面模式 @@ -1374,6 +1388,9 @@ + 卡片顯示類型 + 淺色模式 + 深色模式 小愛翻譯 強制啟用實時字幕 @@ -1462,6 +1479,7 @@ 應用程式管理 語言設定 極暗模式 + 預設應用程式 輸入 關閉 Magic Pointer 移除 Xiaomi Pad 系統破爛的圓形滑鼠指針,並恢復為安卓原生的滑鼠指針 @@ -1557,13 +1575,18 @@ 禁用日誌 停用推薦 啟用推薦 + 設定首頁入口 找不到應用程式功能? + 注意:\n此設定只是主頁入口可見性設定,已開啟的功能不會關閉!\n關閉入口會即時生效,需要重新啟動應用程式才能重新出現。 在主頁找不到應用程式功能? 為了保持主頁的簡單性和可用性,我們隱藏了對以下類型的應用程式功能的存取:\n\n - 目前已停用或隱藏的應用程式\n - 在您的裝置中未找到的應用程式\n -與目前版本不相容的應用程式系統或應用程式版本\n\n請根據上述資訊排查問題,重新啟動 HyperCeiler,然後重試。如果您仍然找不到應用程式功能,則可能是錯誤。請提供我們及時有效的回饋。\n\n目前隱藏的應用功能:\n\n 已解除安裝的應用程式:\n 停用或隱藏的應用程式:\n 為了保持主頁的簡單性和可用性,我們隱藏了對以下類型的應用程式功能的存取:\n\n - 目前已停用或隱藏的應用程式\n - 在您的裝置中未找到的應用程式\n -與目前版本不相容的應用程式系統或應用程式版本\n\n請根據上述資訊排查問題,重新啟動 HyperCeiler,然後重試。如果您仍然找不到應用程式功能,則可能是錯誤。請及時有效的回饋給我們。\n\n目前沒有隱藏入口! + 在主頁中隱藏此幫助 + 您仍然可以在「設定-設定主頁入口」中找到該頁面。重新啟動應用程式即可套用。 您所使用的 ROM 來源可能不是屬於小米官方版本,部分功能可能無法使用,具體請聯絡您所使用的 ROM 開發者。 簽章驗證失敗,您目前使用的版本可能不是 Re.chronoRain 的正式版本,並且可能包含惡意程式碼,請注意使用安全。 提示:這是預設提示。如果你能看到我,則表示 HyperCeiler 有問題,請及時有效地向開發者報告。 + 在找什麼嗎? diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 6f37caebd3..f772c0644d 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -263,6 +263,7 @@ 關閉 系統預設模式 強制最大亮度 + 強制 關閉 預設寫入模式 寫入模式一 @@ -277,9 +278,9 @@ 值和單位雙排顯示 上下行網路單行顯示 上下行網路雙排顯示 - 單行狀態欄時鐘 - 狀態欄時鐘\n通知欄迷你時鐘 - 通知欄迷你時鐘\n狀態欄時鐘 + 單行顯示\n\n僅狀態欄時鐘 + 兩行顯示\n\n頂部狀態欄時鐘\n底部通知欄迷你時鐘 + 兩行顯示\n\n頂部通知欄迷你時鐘\n底部狀態欄時鐘 米奇 草莓熊 @@ -511,6 +512,7 @@ 手勢提示線 隱藏導覽列 不要切換導航鍵 + 不要隱藏手勢提示線 請重新啟動 「系統桌面」 和 「系統介面」 手勢提示線自訂 高度 @@ -655,7 +657,6 @@ 雙排時鐘大小 僅在雙排顯示下生效 修復時鐘反色時的顏色異常 - 實驗性功能 停用通知中心下滑時鐘過渡動畫 狀態欄時鐘設定不同步 大通知欄時鐘不再與狀態欄時鐘格式同步 @@ -743,6 +744,14 @@ 通知背景透明度 下拉通知背景透明度 最佳化媒體控制面板混色效果 + 進度條 + 取消媒體通知卡應用程式自訂操作的限制 + 波浪 + 平滑 + 粗細 + 時間文字大小 + 自訂操作按鈕的大小 + 固有操作按鈕尺寸 從卡片中刪除混合顏色背景 背景圖案模糊半徑 背景覆蓋層的不透明度 @@ -754,6 +763,7 @@ 顯示地區 隱藏網路監控提示 開啟螢幕時靜音 + 禁止折疊到歷史通知中 展開通知 開啟螢幕時彈出通知不播放提示音 圓角矩形磁貼 @@ -1139,6 +1149,10 @@ 顯示應用程式標題 在 Dock 欄中隱藏最近應用圖示 背景模糊自訂 + 向上滑動以僅顯示 Dock + 第二次向上滑動,跳到最近的任務 + 隱藏 Dock + 開啟後「向上滑動僅顯示 Dock」將失效。 其他 快捷選單 桌面模式 @@ -1255,7 +1269,7 @@ 需要預先安裝更高版本的「Mi AI Engine」應用程式才能正常使用 規範截圖儲存位置為 /Pictures/Screenshots 自訂帶殼截圖型號 - 請輸入機型代號,有顏色的裝置填寫時應加上後綴,例如:\n- 小米 13 填寫的內容是 fuxi\n-小米 14 粉色版填寫的內容是 houji_PK + 請輸入機型代號,有顏色的裝置填寫時應加上後綴,例如:\n- 小米 13 填寫的內容是 fuxi\n- 小米 14 粉色版填寫的內容是 houji_PK 手機管家 平板管家 @@ -1374,6 +1388,9 @@ + 卡片顯示類型 + 淺色模式 + 深色模式 小愛翻譯 強制啟用即時字幕 @@ -1462,6 +1479,7 @@ 應用程式管理 語言設定 極暗模式 + 預設應用程式 輸入 關閉 Magic Pointer 移除 Xiaomi Pad 系統破爛的圓形滑鼠指針,並恢復為安卓原生的滑鼠指針 @@ -1557,13 +1575,18 @@ 停用日誌輸出 停用推薦 啟用推薦 + 設定首頁入口 找不到應用程式功能? + 注意:\n此設定只是主頁入口可見性設定,已開啟的功能不會關閉!\n關閉入口會即時生效,需要重新啟動應用程式才能重新出現。 在主頁找不到應用程式功能? 為了保持主頁的簡單性和可用性,我們隱藏了對以下類型的應用程式功能的存取:\n\n - 目前已停用或隱藏的應用程式\n - 在您的裝置中未找到的應用程式\n -與目前版本不相容的應用程式系統或應用程式版本\n\n請根據上述資訊排查問題,重新啟動 HyperCeiler,然後重試。如果您仍然找不到應用程式功能,則可能是錯誤。請提供我們及時有效的回饋。\n\n目前隱藏的應用功能:\n\n 已解除安裝的應用程式:\n 停用或隱藏的應用程式:\n 為了保持主頁的簡單性和可用性,我們隱藏了對以下類型的應用程式功能的存取:\n\n - 目前已停用或隱藏的應用程式\n - 在您的裝置中未找到的應用程式\n -與目前版本不相容的應用程式系統或應用程式版本\n\n請根據上述資訊排查問題,重新啟動 HyperCeiler,然後重試。如果您仍然找不到應用程式功能,則可能是錯誤。請及時有效的回饋給我們。\n\n目前沒有隱藏入口! + 在主頁中隱藏此幫助 + 您仍然可以在「設定-設定主頁入口」中找到該頁面。重新啟動應用程式即可套用。 您所使用的 ROM 來源可能不是屬於小米官方版本,部分功能可能無法使用,具體請聯絡您所使用的 ROM 開發者。 簽章驗證失敗,您目前使用的版本可能不是 Re.chronoRain 的正式版本,並且可能包含惡意程式碼,請注意使用安全。 提示:這是預設提示。如果你能看到我,則表示 HyperCeiler 有問題,請及時有效地向開發者報告。 + 在找什麼嗎? diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 08193ce814..6d4628d4bc 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -264,6 +264,12 @@ @string/control_center_sunshine_mode_two + + @string/array_default + @string/array_close + @string/system_framework_other_rotation_button_3 + + @string/security_center_flash_light_default @string/security_center_flash_light_1 @@ -597,6 +603,18 @@ 2 + + @string/array_default + @string/system_ui_control_center_media_control_progress_wavy + @string/system_ui_control_center_media_control_progress_sleek + + + + 0 + 1 + 2 + + @string/array_battery_both @string/array_battery_power diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d5ef682fe7..2867f631fc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -264,16 +264,16 @@ One-Handed Mode (Left) One-Handed Mode (Right) Scroll to top - Show sidebar - Floating window - Pinning window + Show Sidebar + Floating Window + Side Window Top Bottom Separate Slow Rainbow - Version name - Version code + Version Name + Version Code Support SDK Size Disable @@ -312,6 +312,7 @@ Close System default mode Force maximum brightness + Forced Close Default write mode Write mode one @@ -326,9 +327,9 @@ Values and units are displayed in two rows The uplink and downlink network speed is displayed in a single line Dual-row display of uplink and downlink network speeds - Single line status bar clock - Status bar clock\nNotification bar mini clock - Notification bar mini clock\nStatus bar clock + Single line display\n\nStatus bar clock only + Two-line display\n\nStatus bar clock on top\nNotification bar mini clock on bottom + Two-line display\n\nNotification bar mini clock on top\nStatus bar clock on bottom Mickey Mouse Strawberry Bear @@ -561,6 +562,7 @@ Handle line Hide Navigation Bar Don\'t switch navigation keys + Don\'t hide gesture lines Please restart both the Miui Home and SystemUi scopes Custom handle line Height @@ -705,7 +707,6 @@ Double row clock size Valid only when displayed in two rows Fix color - Experimental features Disable the slide clock transition animation in Notification Center Status bar clock settings not synchronized The big notification bar clock is no longer synchronized with the status bar clock format @@ -793,6 +794,14 @@ Blur Background value Default Background value Optimize the color mixing effect of the media control panel + Progress Bar + Remove the restriction on the application of custom actions for media notification cards + Wavy + Sleek + Thickness + Time view text size + Customize the size of the action button + Intrinsic action button size Remove mixed color background from card Background blur radius Opacity of the background overlay layer @@ -804,6 +813,7 @@ Show city Hide network monitoring prompts Mute when screen is on + Collapse into history notifications is prohibited Expand Notifications When the screen is turned on, the pop-up notification does not play the prompt sound Rounded rectangle tile @@ -1194,6 +1204,10 @@ Show icon title in dock Hide recent app icons from the Dock Custom background blur + Swipe up to show only the Dock + Swipe up a second time and jump to the recent task + Hide the Dock + After turning it on, \"Swipe up to show only the Dock\" will be invalid. Other Shortcut diff --git a/app/src/main/res/xml/framework_other.xml b/app/src/main/res/xml/framework_other.xml index 326b28d7e8..bdd378bf41 100644 --- a/app/src/main/res/xml/framework_other.xml +++ b/app/src/main/res/xml/framework_other.xml @@ -3,16 +3,18 @@ xmlns:app="http://schemas.android.com/apk/res-auto" app:myLocation="@string/system_framework_other_title"> + + - - + + + + --> - \ No newline at end of file diff --git a/app/src/main/res/xml/system_ui_control_center.xml b/app/src/main/res/xml/system_ui_control_center.xml index 4cc942ea77..84670455ce 100644 --- a/app/src/main/res/xml/system_ui_control_center.xml +++ b/app/src/main/res/xml/system_ui_control_center.xml @@ -26,6 +26,11 @@ android:key="prefs_key_system_ui_control_center_expand_notification" android:title="@string/system_ui_control_center_expand_notification" /> + + + + + + + + @@ -163,6 +195,35 @@ app:showSeekBarValue="true" app:stepValue="1" /> + + + + + + diff --git a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator.xml b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator.xml index b71fdd9f67..e4cc836e06 100644 --- a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator.xml +++ b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator.xml @@ -37,7 +37,6 @@ diff --git a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_1.xml b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_1.xml index 1c12d6b50c..0e742a2267 100644 --- a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_1.xml +++ b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_1.xml @@ -10,13 +10,13 @@ app:entryValues="@array/system_ui_status_bar_clock_double_mode_value" /> @@ -28,7 +28,7 @@ app:defaultValueText="@string/array_default" app:displayDividerValue="20" app:format="%s dp" - app:maxValue="22" + app:maxValue="32" app:minValue="14" app:stepValue="1" /> diff --git a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_2.xml b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_2.xml index def37abbd8..2129b34b36 100644 --- a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_2.xml +++ b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_2.xml @@ -3,12 +3,12 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> diff --git a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_3.xml b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_3.xml index 38232a21f1..02cc5cd6f7 100644 --- a/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_3.xml +++ b/app/src/main/res/xml/system_ui_status_bar_new_clock_indicator_3.xml @@ -5,9 +5,9 @@