├── .github ├── ISSUE_TEMPLATE │ ├── ----.md │ └── bug--.md └── workflows │ ├── dev.yml │ └── pr.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── README_EN.md ├── app ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── xposed_init │ ├── ic_launcher-playstore.png │ ├── java │ └── com │ │ └── lt2333 │ │ └── simplicitytools │ │ ├── activity │ │ ├── MainActivity.kt │ │ └── pages │ │ │ ├── all │ │ │ ├── AboutPage.kt │ │ │ └── MenuPage.kt │ │ │ ├── s │ │ │ ├── AndroidPageForS.kt │ │ │ ├── HideIconPageForS.kt │ │ │ ├── MainPageForS.kt │ │ │ ├── OtherPageForS.kt │ │ │ └── SystemUIPageForS.kt │ │ │ └── t │ │ │ ├── AndroidPageForT.kt │ │ │ ├── HideIconPageForT.kt │ │ │ ├── MainPageForT.kt │ │ │ ├── OtherPageForT.kt │ │ │ └── SystemUIPageForT.kt │ │ ├── hooks │ │ ├── MainHook.kt │ │ ├── apps │ │ │ ├── Android.kt │ │ │ ├── Cast.kt │ │ │ ├── MediaEditor.kt │ │ │ ├── MiuiHome.kt │ │ │ ├── PackageInstaller.kt │ │ │ ├── PowerKeeper.kt │ │ │ ├── RearDisplay.kt │ │ │ ├── ScreenShot.kt │ │ │ ├── SecurityCenter.kt │ │ │ ├── Settings.kt │ │ │ ├── SystemUI.kt │ │ │ ├── ThemeManager.kt │ │ │ └── Updater.kt │ │ └── rules │ │ │ ├── all │ │ │ ├── android │ │ │ │ ├── AllowUntrustedTouchesForAll.kt │ │ │ │ ├── DeleteOnPostNotificationForAll.kt │ │ │ │ └── DisableFlagSecureForAll.kt │ │ │ ├── cast │ │ │ │ └── ForceSupportSendAppForAll.kt │ │ │ ├── corepatch │ │ │ │ ├── CorePatchForQ.java │ │ │ │ ├── CorePatchForR.java │ │ │ │ ├── CorePatchForS.java │ │ │ │ ├── CorePatchForSv2.java │ │ │ │ ├── CorePatchForT.java │ │ │ │ ├── CorePatchMainHook.java │ │ │ │ ├── ReturnConstant.java │ │ │ │ └── XposedHelper.java │ │ │ ├── miuihome │ │ │ │ ├── AlwaysShowStatusBarClockForAll.kt │ │ │ │ ├── DisableRecentViewWallpaperDarkeningForAll.kt │ │ │ │ ├── DoubleTapControllerForAll.kt │ │ │ │ ├── DoubleTapToSleepForAll.kt │ │ │ │ ├── ModifyRecentViewRemoveCardAnimForAll.kt │ │ │ │ ├── RemoveSmallWindowRestrictionForMiuiHomeForAll.kt │ │ │ │ ├── ScrollIconNameForAll.kt │ │ │ │ └── ShortcutAddSmallWindowForAll.kt │ │ │ ├── powerkeeper │ │ │ │ └── LockMaxFpsForAll.kt │ │ │ ├── reardisplay │ │ │ │ └── RearDisplayWeatherForAll.kt │ │ │ ├── securitycenter │ │ │ │ ├── LockOneHundredForAll.kt │ │ │ │ ├── RemoveMacroBlacklistForAll.kt │ │ │ │ ├── RemoveOpenAppConfirmationPopupForAll.kt │ │ │ │ └── SkipWaitingTimeForAll.kt │ │ │ ├── settings │ │ │ │ └── ShowNotificationImportanceForAll.kt │ │ │ └── thememanager │ │ │ │ └── RemoveAdsForAll.kt │ │ │ ├── s │ │ │ ├── android │ │ │ │ ├── MaxWallpaperScaleForS.kt │ │ │ │ ├── RemoveSmallWindowRestrictionsForS.kt │ │ │ │ └── SystemPropertiesHookForS.kt │ │ │ ├── mediaeditor │ │ │ │ └── UnlockUnlimitedCroppingForS.kt │ │ │ ├── powerkeeper │ │ │ │ ├── DoNotClearAppForS.kt │ │ │ │ ├── MakeMilletMoreAggressiveForS.kt │ │ │ │ └── PreventRecoveryOfBatteryOptimizationWhitelistForS.kt │ │ │ ├── screenshot │ │ │ │ └── UnlockUnlimitedCroppingForS.kt │ │ │ ├── securitycenter │ │ │ │ └── ShowBatteryTemperatureForS.kt │ │ │ └── systemui │ │ │ │ ├── BatteryPercentageForS.kt │ │ │ │ ├── CanNotificationSlideForS.kt │ │ │ │ ├── ControlCenterWeatherForS.kt │ │ │ │ ├── CustomMobileTypeTextForS.kt │ │ │ │ ├── DoubleLineNetworkSpeedForS.kt │ │ │ │ ├── HideBatteryIconForS.kt │ │ │ │ ├── HideHDIconForS.kt │ │ │ │ ├── HideMobileActivityIconForS.kt │ │ │ │ ├── HideMobileTypeIconForS.kt │ │ │ │ ├── HideNetworkSpeedSplitterForS.kt │ │ │ │ ├── HideSimIconForS.kt │ │ │ │ ├── HideStatusBarIconForS.kt │ │ │ │ ├── HideStatusBarNetworkSpeedSecondForS.kt │ │ │ │ ├── HideWifiActivityIconForS.kt │ │ │ │ ├── LockScreenClockDisplaySecondsForS.kt │ │ │ │ ├── LockScreenCurrentForS.kt │ │ │ │ ├── LockScreenDoubleTapToSleepForS.kt │ │ │ │ ├── MaximumNumberOfNotificationIconsForS.kt │ │ │ │ ├── NewNotificationWeatherForS.kt │ │ │ │ ├── NotificationWeatherForS.kt │ │ │ │ ├── OldNotificationWeatherForS.kt │ │ │ │ ├── OldQSCustomForS.kt │ │ │ │ ├── RemoveLockScreenCameraForS.kt │ │ │ │ ├── RemoveTheLeftSideOfTheLockScreenForS.kt │ │ │ │ ├── ShowWifiStandardForS.kt │ │ │ │ ├── StatusBarBigMobileTypeIconForS.kt │ │ │ │ ├── StatusBarDoubleTapToSleepForS.kt │ │ │ │ ├── StatusBarLayoutForS.kt │ │ │ │ ├── StatusBarNetworkSpeedRefreshSpeedForS.kt │ │ │ │ ├── StatusBarTimeCustomizationForS.kt │ │ │ │ └── WaveChargeForS.kt │ │ │ └── t │ │ │ ├── android │ │ │ ├── MaxWallpaperScaleForT.kt │ │ │ └── SystemPropertiesHookForT.kt │ │ │ ├── mediaeditor │ │ │ └── UnlockUnlimitedCroppingForT.kt │ │ │ ├── securitycenter │ │ │ └── ShowBatteryTemperatureForT.kt │ │ │ └── systemui │ │ │ ├── BatteryPercentageForT.kt │ │ │ ├── CanNotificationSlideForT.kt │ │ │ ├── ControlCenterWeatherForT.kt │ │ │ ├── CustomMobileTypeTextForT.kt │ │ │ ├── DisableBluetoothTemporarilyOffForT.kt │ │ │ ├── DoubleLineNetworkSpeedForT.kt │ │ │ ├── HideBatteryIconForT.kt │ │ │ ├── HideHDIconForT.kt │ │ │ ├── HideMobileActivityIconForT.kt │ │ │ ├── HideMobileTypeIconForT.kt │ │ │ ├── HideNetworkSpeedSplitterForT.kt │ │ │ ├── HideSimIconForT.kt │ │ │ ├── HideStatusBarIconForT.kt │ │ │ ├── HideStatusBarNetworkSpeedSecondForT.kt │ │ │ ├── HideWifiActivityIconForT.kt │ │ │ ├── LockScreenClockDisplaySecondsForT.kt │ │ │ ├── LockScreenCurrentForT.kt │ │ │ ├── LockScreenDoubleTapToSleepForT.kt │ │ │ ├── MaximumNumberOfNotificationIconsForT.kt │ │ │ ├── NewNotificationWeatherForT.kt │ │ │ ├── NotificationWeatherForT.kt │ │ │ ├── OldNotificationWeatherForT.kt │ │ │ ├── OldQSCustomForT.kt │ │ │ ├── RemoveLockScreenCameraForT.kt │ │ │ ├── RemoveTheLeftSideOfTheLockScreenForT.kt │ │ │ ├── ShowWifiStandardForT.kt │ │ │ ├── StatusBarBigMobileTypeIconForT.kt │ │ │ ├── StatusBarDoubleTapToSleepForT.kt │ │ │ ├── StatusBarLayoutForT.kt │ │ │ ├── StatusBarNetworkSpeedRefreshSpeedForT.kt │ │ │ ├── StatusBarTimeCustomizationForT.kt │ │ │ └── WaveChargeForT.kt │ │ ├── tiles │ │ ├── AllowScreenshots.kt │ │ └── LockMaxFpsTile.kt │ │ ├── utils │ │ ├── KotlinXposedHelper.kt │ │ ├── SPUtils.kt │ │ ├── ShellUtils.java │ │ ├── SystemProperties.kt │ │ ├── XSPUtils.kt │ │ └── xposed │ │ │ ├── EasyXposedInit.kt │ │ │ └── base │ │ │ ├── AppRegister.kt │ │ │ └── HookRegister.kt │ │ └── views │ │ ├── WeatherData.kt │ │ └── WeatherView.kt │ └── res │ ├── drawable │ ├── app_icon.png │ ├── ic_baseline_fullscreen_24.xml │ ├── ic_fps.xml │ ├── ic_launcher_background.xml │ ├── ic_launcher_foreground.xml │ ├── ic_small_window_dark.xml │ ├── ic_small_window_light.xml │ └── lt.jpg │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-af │ └── strings.xml │ ├── values-ar │ └── strings.xml │ ├── values-ca │ └── strings.xml │ ├── values-cs │ └── strings.xml │ ├── values-da │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-el │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fi │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-he │ └── strings.xml │ ├── values-hu │ └── strings.xml │ ├── values-id │ └── strings.xml │ ├── values-it │ └── strings.xml │ ├── values-ja │ └── strings.xml │ ├── values-ko │ └── strings.xml │ ├── values-night │ └── styles.xml │ ├── values-nl │ └── strings.xml │ ├── values-no │ └── strings.xml │ ├── values-pl │ └── strings.xml │ ├── values-pt │ └── strings.xml │ ├── values-ro │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values-sr │ └── strings.xml │ ├── values-sv │ └── strings.xml │ ├── values-th │ └── strings.xml │ ├── values-tr │ └── strings.xml │ ├── values-uk │ └── strings.xml │ ├── values-vi │ └── strings.xml │ ├── values-zh-rCN │ └── strings.xml │ ├── values-zh-rHK │ └── strings.xml │ ├── values-zh-rTW │ └── strings.xml │ └── values │ ├── arrays.xml │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle.kts ├── crowdin.yml ├── doc ├── PRIVACY.md ├── cn.jpg ├── en.jpg └── ic_launcher.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle.kts /.github/ISSUE_TEMPLATE/----.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 功能请求 3 | about: 为这个项目提供好的建议 4 | title: "[Feature]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | 请清晰明了地讲述您的建议 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug--.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: BUG反馈 3 | about: 创建报告使我们更快改进 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **描述一下BUG情况** 11 | 清晰明了的描述BUG的情况 12 | 13 | **如何复现** 14 | 复现的步骤 15 | 1. 去 '...' 16 | 2. 点击 '....' 17 | 3. 滚动到 '....' 18 | 4. 问题出现 19 | 20 | **截图** 21 | 如果可以,请添加截图以帮助解释您的问题。 22 | 23 | **手机信息:** 24 | - 设备型号: 25 | - MIUI版本: 26 | - Android版本: 27 | 28 | **附加信息** 29 | 在此处添加有关此问题的任何其他内容。 30 | -------------------------------------------------------------------------------- /.github/workflows/dev.yml: -------------------------------------------------------------------------------- 1 | name: Dev 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: set up JDK 11 16 | uses: actions/setup-java@v3 17 | with: 18 | java-version: '11' 19 | distribution: 'temurin' 20 | cache: gradle 21 | 22 | - name: Grant execute permission for gradlew 23 | run: chmod +x gradlew 24 | 25 | - name: Clone UI 26 | run: | 27 | cd blockmiui 28 | git submodule init 29 | git submodule update 30 | 31 | - name: Build with Gradle 32 | run: | 33 | bash ./gradlew assembleDebug 34 | 35 | - name: Sign Debug APK 36 | if: success() 37 | id: sign_debug 38 | uses: r0adkll/sign-android-release@v1.0.4 39 | with: 40 | releaseDirectory: ./app/build/outputs/apk/debug 41 | signingKeyBase64: ${{ secrets.SIGNING_KEY }} 42 | alias: ${{ secrets.KEY_STORE_ALIAS }} 43 | keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} 44 | keyPassword: ${{ secrets.KEY_STORE_PASSWORD }} 45 | 46 | - name: Upload Debug APK 47 | uses: actions/upload-artifact@v2 48 | with: 49 | name: WooBox_Debug 50 | path: ${{ steps.sign_debug.outputs.signedReleaseFile }} 51 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: PR Check 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | paths-ignore: 7 | - 'README.md' 8 | - 'README_EN.md' 9 | - 'doc/*' 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | with: 17 | submodules: 'recursive' 18 | - name: set up JDK 17 19 | uses: actions/setup-java@v2 20 | with: 21 | java-version: '17' 22 | distribution: 'temurin' 23 | cache: gradle 24 | - uses: actions/cache@v2 25 | with: 26 | path: | 27 | ~/.gradle/caches 28 | ~/.gradle/wrapper 29 | !~/.gradle/caches/build-cache-* 30 | key: gradle-deps-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} 31 | restore-keys: gradle-deps 32 | - uses: actions/cache@v2 33 | with: 34 | path: | 35 | ~/.gradle/caches/build-cache-* 36 | key: gradle-builds-${{ github.sha }} 37 | - name: Init Submodule 38 | run: | 39 | git submodule init 40 | git submodule update 41 | - name: Build with Gradle 42 | run: bash ./gradlew :app:packageDebug 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | /app/release/app-release.apk 18 | /app/release/output-metadata.json 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "blockmiui"] 2 | path = blockmiui 3 | url = https://github.com/577fkj/blockmiui.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | logo 3 |

WooBox For MIUI

4 |

English 丨 简体中文

5 | GitHub all releases 6 | GitHub stars 7 | GitHub issues 8 | GitHub license 9 |

一个基于 MIUI13+(Android12+)适配的系统拓展Xposed模块

10 |
11 | 12 | --- 13 | 14 | ### 模块说明 15 | 16 | 开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441) 17 | 18 | 当前仅基于`Android13`进行开发,`Android12`几乎不再维护。也有基于`Android13`开发,但是能在`Android12`使用的情况,请广大社区使用`Android12`的开发者自行测试和修复后提交`Pull Request`。 19 | 20 | --- 21 | 22 | ### 模块截图 23 | 24 | ![截图](https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/cn.jpg) 25 | 26 | --- 27 | 28 | ### 下载地址 29 | 30 | Xposed 31 | 仓库下载:[点击此处下载最新发行版](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases) 32 | 33 | 酷安下载:[点击此处下载最新发行版](https://www.coolapk.com/apk/com.lt2333.simplicitytools) 34 | 35 | --- 36 | 37 | ### 改进翻译 38 | 39 | [![Crowdin](https://badges.crowdin.net/simplicitytools/localized.svg)](https://crowdin.com/project/simplicitytools) [点击此处进入Crowdin](https://crowdin.com/project/simplicitytools) 40 | 41 | --- 42 | 43 | ### 第三方开源引用 44 | 45 | ##### GNU General Public License v3.0 46 | 47 | [yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming) 48 | [Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer) 49 | [MonwF/customiuizer](https://github.com/MonwF/customiuizer) 50 | 51 | ##### GNU General Public License v2.0 52 | 53 | [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) 54 | 55 | ##### GNU Lesser General Public License v2.1 56 | 57 | [577fkj/blockmiui](https://github.com/577fkj/blockmiui) 58 | 59 | ##### Apache License 2.0 60 | 61 | [KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper) 62 | 63 | --- 64 | 65 | ### License 66 | 67 | [GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE) 68 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 |
2 | logo 3 |

WooBox For MIUI

4 |

English 丨 简体中文

5 | GitHub all releases 6 | GitHub stars 7 | GitHub issues 8 | GitHub license 9 |

A system extension Xposed module based on MIUI13+ (Android12+)

10 |
11 | 12 | --- 13 | 14 | ### Module Description 15 | 16 | Currently only developed based on `Android13`, `Android12` is almost no longer maintained. There are also cases where the development is based on `Android13`, but it can be used in `Android12`. Developers in the community who use `Android12` are requested to submit `Pull Request` after testing and repairing by themselves. 17 | 18 | --- 19 | 20 | ### Screenshot 21 | 22 | ![Screenshot](https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/en.jpg) 23 | 24 | --- 25 | 26 | ### Download 27 | 28 | Xposed Repo:[Click here to download the latest release](https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases) 29 | 30 | --- 31 | 32 | ### Participate in translation 33 | 34 | [![Crowdin](https://badges.crowdin.net/simplicitytools/localized.svg)](https://crowdin.com/project/simplicitytools) [Click here to Crowdin](https://crowdin.com/project/simplicitytools) 35 | 36 | --- 37 | 38 | ## Third party open source references 39 | 40 | ##### GNU General Public License v3.0 41 | 42 | [yujincheng08/BiliRoaming](https://github.com/yujincheng08/BiliRoaming) 43 | [Mikanoshi/CustoMIUIzer](https://code.highspec.ru/Mikanoshi/CustoMIUIzer) 44 | [MonwF/customiuizer](https://github.com/MonwF/customiuizer) 45 | 46 | ##### GNU General Public License v2.0 47 | 48 | [LSPosed/CorePatch](https://github.com/LSPosed/CorePatch) 49 | 50 | ##### GNU Lesser General Public License v2.1 51 | 52 | [577fkj/blockmiui](https://github.com/577fkj/blockmiui) 53 | 54 | ##### Apache License 2.0 55 | 56 | [KyuubiRan/EzXHelper](https://github.com/KyuubiRan/EzXHelper) 57 | 58 | --- 59 | 60 | ## License 61 | 62 | [GNU General Public License v3.0](https://github.com/LittleTurtle2333/SimplicityTools/blob/main/LICENSE) 63 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release 3 | /debug 4 | /src/androidTest 5 | /src/test -------------------------------------------------------------------------------- /app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.android.build.gradle.internal.api.BaseVariantOutputImpl 2 | 3 | plugins { 4 | id("com.android.application") 5 | id("kotlin-android") 6 | } 7 | 8 | android { 9 | compileSdk = 33 10 | defaultConfig { 11 | applicationId = "com.lt2333.simplicitytools" 12 | minSdk = 31 13 | targetSdk = 33 14 | versionCode = 75 15 | versionName = "1.7.5" 16 | buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"") 17 | } 18 | 19 | buildTypes { 20 | release { 21 | isMinifyEnabled = true 22 | isShrinkResources = true 23 | setProguardFiles(listOf("proguard-rules.pro")) 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_11 28 | targetCompatibility = JavaVersion.VERSION_11 29 | } 30 | kotlinOptions { 31 | jvmTarget = JavaVersion.VERSION_11.majorVersion 32 | } 33 | packagingOptions { 34 | resources { 35 | excludes += "/META-INF/**" 36 | excludes += "/kotlin/**" 37 | excludes += "/*.txt" 38 | excludes += "/*.bin" 39 | } 40 | dex { 41 | useLegacyPackaging = true 42 | } 43 | } 44 | applicationVariants.all { 45 | outputs.all { 46 | (this as BaseVariantOutputImpl).outputFileName = "WooBoxForMIUI-$versionName-$name.apk" 47 | } 48 | } 49 | } 50 | 51 | dependencies { 52 | //API 53 | compileOnly("de.robv.android.xposed:api:82") 54 | implementation("com.github.kyuubiran:EzXHelper:1.0.3") 55 | //UI 56 | implementation(project(":blockmiui")) 57 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") 58 | //APP Center 59 | val appCenterSdkVersion = "4.4.3" 60 | implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}") 61 | implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}") 62 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class * implements de.robv.android.xposed.IXposedHookLoadPackage { 23 | public void *(de.robv.android.xposed.callbacks.XC_LoadPackage$LoadPackageParam); 24 | } 25 | 26 | -keep class * implements de.robv.android.xposed.IXposedHookZygoteInit { 27 | public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam); 28 | } 29 | 30 | -keep class * extends com.lt2333.simplicitytools.utils.xposed.EasyXposedInit 31 | 32 | -assumenosideeffects class kotlin.jvm.internal.Intrinsics { 33 | public static void check*(...); 34 | public static void throw*(...); 35 | } 36 | 37 | -allowaccessmodification 38 | -overloadaggressively -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 43 | 46 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.lt2333.simplicitytools.hooks.MainHook -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/activity/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.activity 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Build 5 | import android.os.Bundle 6 | import cn.fkj233.ui.activity.MIUIActivity 7 | import cn.fkj233.ui.dialog.MIUIDialog 8 | import com.lt2333.simplicitytools.BuildConfig 9 | import com.lt2333.simplicitytools.R 10 | import com.lt2333.simplicitytools.activity.pages.all.AboutPage 11 | import com.lt2333.simplicitytools.activity.pages.all.MenuPage 12 | import com.lt2333.simplicitytools.activity.pages.s.* 13 | import com.lt2333.simplicitytools.activity.pages.t.* 14 | import com.lt2333.simplicitytools.hooks.rules.s.android.* 15 | import com.microsoft.appcenter.AppCenter 16 | import com.microsoft.appcenter.analytics.Analytics 17 | import com.microsoft.appcenter.crashes.Crashes 18 | import java.util.* 19 | import kotlin.system.exitProcess 20 | 21 | class MainActivity : MIUIActivity() { 22 | private val activity = this 23 | override fun onCreate(savedInstanceState: Bundle?) { 24 | if (!checkLSPosed()) isLoad = false 25 | super.onCreate(savedInstanceState) 26 | if (isLoad && !BuildConfig.DEBUG) { 27 | AppCenter.start( 28 | application, 29 | "ae2037d3-9914-4e0c-b02b-f9b2bb2574e5", 30 | Analytics::class.java, 31 | Crashes::class.java 32 | ) 33 | } 34 | } 35 | 36 | //检测LSPosed是否激活 37 | @SuppressLint("WorldReadableFiles") 38 | private fun checkLSPosed(): Boolean { 39 | try { 40 | setSP(getSharedPreferences("config", MODE_WORLD_READABLE)) 41 | return true 42 | } catch (exception: SecurityException) { 43 | MIUIDialog(this) { 44 | setTitle(R.string.Tips) 45 | setMessage(R.string.not_support) 46 | setCancelable(false) 47 | setRButton(R.string.Done) { 48 | exitProcess(0) 49 | } 50 | }.show() 51 | } 52 | return false 53 | } 54 | 55 | 56 | init { 57 | when (Build.VERSION.SDK_INT) { 58 | Build.VERSION_CODES.TIRAMISU -> { 59 | registerPage(MainPageForT::class.java) 60 | registerPage(SystemUIPageForT::class.java) 61 | registerPage(AndroidPageForT::class.java) 62 | registerPage(OtherPageForT::class.java) 63 | registerPage(HideIconPageForT::class.java) 64 | registerPage(AboutPage::class.java) 65 | registerPage(MenuPage::class.java) 66 | } 67 | Build.VERSION_CODES.S -> { 68 | registerPage(MainPageForS::class.java) 69 | registerPage(SystemUIPageForS::class.java) 70 | registerPage(AndroidPageForS::class.java) 71 | registerPage(OtherPageForS::class.java) 72 | registerPage(HideIconPageForS::class.java) 73 | registerPage(AboutPage::class.java) 74 | registerPage(MenuPage::class.java) 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/activity/pages/all/MenuPage.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.activity.pages.all 2 | 3 | import cn.fkj233.ui.activity.annotation.BMMenuPage 4 | import cn.fkj233.ui.activity.data.BasePage 5 | import cn.fkj233.ui.activity.view.TextSummaryV 6 | import cn.fkj233.ui.dialog.MIUIDialog 7 | import com.lt2333.simplicitytools.R 8 | import com.lt2333.simplicitytools.utils.ShellUtils 9 | import java.util.* 10 | 11 | 12 | @BMMenuPage("Menu") 13 | class MenuPage : BasePage() { 14 | 15 | override fun onCreate() { 16 | TextSummaryWithArrow(TextSummaryV(textId = R.string.reboot, onClickListener = { 17 | MIUIDialog(activity) { 18 | setTitle(R.string.Tips) 19 | setMessage(R.string.are_you_sure_reboot) 20 | setLButton(R.string.cancel) { 21 | dismiss() 22 | } 23 | setRButton(R.string.Done) { 24 | val command = arrayOf("reboot") 25 | ShellUtils.execCommand(command, true) 26 | dismiss() 27 | } 28 | }.show() 29 | })) 30 | 31 | TextSummaryWithArrow(TextSummaryV(textId = R.string.reboot_host, onClickListener = { 32 | MIUIDialog(activity) { 33 | setTitle(R.string.Tips) 34 | setMessage(R.string.are_you_sure_reboot_scope) 35 | setLButton(R.string.cancel) { 36 | dismiss() 37 | } 38 | setRButton(R.string.Done) { 39 | val command = arrayOf( 40 | "killall com.android.systemui", 41 | "killall com.miui.home", 42 | "killall com.miui.securitycenter ", 43 | "killall com.android.settings", 44 | "killall com.miui.powerkeeper", 45 | "killall com.android.updater", 46 | "killall com.miui.mediaeditor", 47 | "killall com.miui.screenshot", 48 | "killall com.milink.service", 49 | "killall com.xiaomi.misubscreenui", 50 | "killall com.miui.packageinstaller" 51 | ) 52 | ShellUtils.execCommand(command, true) 53 | dismiss() 54 | } 55 | }.show() 56 | })) 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/activity/pages/s/MainPageForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.activity.pages.s 2 | 3 | import android.content.ComponentName 4 | import android.content.pm.PackageManager 5 | import cn.fkj233.ui.activity.annotation.BMMainPage 6 | import cn.fkj233.ui.activity.data.BasePage 7 | import cn.fkj233.ui.activity.view.SwitchV 8 | import cn.fkj233.ui.activity.view.TextSummaryV 9 | import cn.fkj233.ui.dialog.MIUIDialog 10 | import com.lt2333.simplicitytools.BuildConfig 11 | import com.lt2333.simplicitytools.R 12 | 13 | 14 | @BMMainPage("WooBox[MIUI13]") 15 | class MainPageForS : BasePage() { 16 | 17 | override fun onCreate() { 18 | TextSummaryWithSwitch( 19 | TextSummaryV( 20 | textId = R.string.main_switch, 21 | colorId = R.color.blue 22 | ), SwitchV("main_switch", true) 23 | ) 24 | TextSummaryWithSwitch( 25 | TextSummaryV(textId = R.string.HideLauncherIcon), 26 | SwitchV("hLauncherIcon", onClickListener = { 27 | activity.packageManager.setComponentEnabledSetting( 28 | ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"), 29 | if (it) { 30 | PackageManager.COMPONENT_ENABLED_STATE_DISABLED 31 | } else { 32 | PackageManager.COMPONENT_ENABLED_STATE_ENABLED 33 | }, 34 | PackageManager.DONT_KILL_APP 35 | ) 36 | }) 37 | ) 38 | TextSummaryWithArrow( 39 | TextSummaryV( 40 | textId = R.string.matters_needing_attention, 41 | colorId = R.color.red, 42 | onClickListener = { 43 | MIUIDialog(activity) { 44 | setTitle(R.string.matters_needing_attention) 45 | setMessage(R.string.matters_needing_attention_context) 46 | setRButton(R.string.Done) { 47 | dismiss() 48 | } 49 | }.show() 50 | }) 51 | ) 52 | Line() 53 | TitleText(textId = R.string.scope) 54 | TextSummaryWithArrow( 55 | TextSummaryV( 56 | textId = R.string.scope_systemui, 57 | tipsId = R.string.scope_systemui_summary, 58 | onClickListener = { showFragment("scope_systemui") }) 59 | ) 60 | TextSummaryWithArrow( 61 | TextSummaryV( 62 | textId = R.string.scope_android, 63 | tipsId = R.string.scope_android_summary, 64 | onClickListener = { showFragment("scope_android") }) 65 | ) 66 | TextSummaryWithArrow( 67 | TextSummaryV( 68 | textId = R.string.scope_other, 69 | tipsId = R.string.scope_other_summary, 70 | onClickListener = { showFragment("scope_other") }) 71 | ) 72 | Line() 73 | TitleText(textId = R.string.about) 74 | TextSummaryWithArrow( 75 | TextSummaryV( 76 | textId = R.string.about_module, 77 | tips = getString(R.string.about_module_summary), 78 | onClickListener = { showFragment("about_module") }) 79 | ) 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/activity/pages/t/MainPageForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.activity.pages.t 2 | 3 | import android.content.ComponentName 4 | import android.content.pm.PackageManager 5 | import cn.fkj233.ui.activity.annotation.BMMainPage 6 | import cn.fkj233.ui.activity.data.BasePage 7 | import cn.fkj233.ui.activity.view.SwitchV 8 | import cn.fkj233.ui.activity.view.TextSummaryV 9 | import cn.fkj233.ui.dialog.MIUIDialog 10 | import com.lt2333.simplicitytools.BuildConfig 11 | import com.lt2333.simplicitytools.R 12 | 13 | 14 | @BMMainPage("WooBox[MIUI14]") 15 | class MainPageForT : BasePage() { 16 | 17 | override fun onCreate() { 18 | TextSummaryWithSwitch( 19 | TextSummaryV( 20 | textId = R.string.main_switch, 21 | colorId = R.color.blue 22 | ), SwitchV("main_switch", true) 23 | ) 24 | TextSummaryWithSwitch( 25 | TextSummaryV(textId = R.string.HideLauncherIcon), 26 | SwitchV("hLauncherIcon", onClickListener = { 27 | activity.packageManager.setComponentEnabledSetting( 28 | ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"), 29 | if (it) { 30 | PackageManager.COMPONENT_ENABLED_STATE_DISABLED 31 | } else { 32 | PackageManager.COMPONENT_ENABLED_STATE_ENABLED 33 | }, 34 | PackageManager.DONT_KILL_APP 35 | ) 36 | }) 37 | ) 38 | TextSummaryWithArrow( 39 | TextSummaryV( 40 | textId = R.string.matters_needing_attention, 41 | colorId = R.color.red, 42 | onClickListener = { 43 | MIUIDialog(activity) { 44 | setTitle(R.string.matters_needing_attention) 45 | setMessage(R.string.matters_needing_attention_context) 46 | setRButton(R.string.Done) { 47 | dismiss() 48 | } 49 | }.show() 50 | }) 51 | ) 52 | Line() 53 | TitleText(textId = R.string.scope) 54 | TextSummaryWithArrow( 55 | TextSummaryV( 56 | textId = R.string.scope_systemui, 57 | tipsId = R.string.scope_systemui_summary, 58 | onClickListener = { showFragment("scope_systemui") }) 59 | ) 60 | TextSummaryWithArrow( 61 | TextSummaryV( 62 | textId = R.string.scope_android, 63 | tipsId = R.string.scope_android_summary, 64 | onClickListener = { showFragment("scope_android") }) 65 | ) 66 | TextSummaryWithArrow( 67 | TextSummaryV( 68 | textId = R.string.scope_other, 69 | tipsId = R.string.scope_other_summary, 70 | onClickListener = { showFragment("scope_other") }) 71 | ) 72 | Line() 73 | TitleText(textId = R.string.about) 74 | TextSummaryWithArrow( 75 | TextSummaryV( 76 | textId = R.string.about_module, 77 | tips = getString(R.string.about_module_summary), 78 | onClickListener = { showFragment("about_module") }) 79 | ) 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/MainHook.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks 2 | 3 | import com.lt2333.simplicitytools.BuildConfig 4 | import com.lt2333.simplicitytools.hooks.apps.* 5 | import com.lt2333.simplicitytools.hooks.rules.all.corepatch.CorePatchMainHook 6 | import com.lt2333.simplicitytools.utils.xposed.EasyXposedInit 7 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 8 | import de.robv.android.xposed.IXposedHookZygoteInit 9 | import de.robv.android.xposed.XSharedPreferences 10 | import de.robv.android.xposed.callbacks.XC_LoadPackage 11 | 12 | class MainHook : EasyXposedInit() { 13 | private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config") 14 | 15 | override val registeredApp: List = listOf( 16 | Android, // Android 17 | SystemUI, // 系统界面 18 | PowerKeeper, // 电量与性能 19 | MiuiHome, // 桌面 20 | SecurityCenter, // 手机管家 21 | MediaEditor, // 相册编辑 22 | Updater, // 系统更新 23 | Settings, // 设置 24 | ThemeManager, // 主题壁纸 25 | ScreenShot, // 截屏 26 | Cast, //投屏 27 | RearDisplay, //背屏 28 | PackageInstaller, // 应用包管理组件 29 | ) 30 | 31 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) { 32 | if (prefs.getBoolean("main_switch", true)) { 33 | super.handleLoadPackage(lpparam) 34 | } 35 | } 36 | 37 | override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) { 38 | super.initZygote(startupParam) 39 | CorePatchMainHook().initZygote(startupParam) 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/Android.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.android.AllowUntrustedTouchesForAll 5 | import com.lt2333.simplicitytools.hooks.rules.all.android.DeleteOnPostNotificationForAll 6 | import com.lt2333.simplicitytools.hooks.rules.all.android.DisableFlagSecureForAll 7 | import com.lt2333.simplicitytools.hooks.rules.all.corepatch.CorePatchMainHook 8 | import com.lt2333.simplicitytools.hooks.rules.s.android.MaxWallpaperScaleForS 9 | import com.lt2333.simplicitytools.hooks.rules.s.android.RemoveSmallWindowRestrictionsForS 10 | import com.lt2333.simplicitytools.hooks.rules.s.android.SystemPropertiesHookForS 11 | import com.lt2333.simplicitytools.hooks.rules.t.android.MaxWallpaperScaleForT 12 | import com.lt2333.simplicitytools.hooks.rules.t.android.SystemPropertiesHookForT 13 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage 15 | 16 | object Android : AppRegister() { 17 | override val packageName: String = "android" 18 | 19 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 20 | //核心破解 21 | CorePatchMainHook().handleLoadPackage(lpparam) 22 | when (Build.VERSION.SDK_INT) { 23 | Build.VERSION_CODES.TIRAMISU -> { 24 | autoInitHooks( 25 | lpparam, 26 | DisableFlagSecureForAll, //允许截图 27 | DeleteOnPostNotificationForAll, //上层显示 28 | RemoveSmallWindowRestrictionsForS, //解除小窗限制 29 | MaxWallpaperScaleForT, //壁纸缩放比例 30 | SystemPropertiesHookForT, //SystemPropertiesHook 31 | AllowUntrustedTouchesForAll, //允许不受信任的触摸 32 | ) 33 | } 34 | 35 | Build.VERSION_CODES.S -> { 36 | autoInitHooks( 37 | lpparam, 38 | DisableFlagSecureForAll, //允许截图 39 | DeleteOnPostNotificationForAll, //上层显示 40 | RemoveSmallWindowRestrictionsForS, //解除小窗限制 41 | MaxWallpaperScaleForS, //壁纸缩放比例 42 | SystemPropertiesHookForS, //SystemPropertiesHook 43 | AllowUntrustedTouchesForAll, //允许不受信任的触摸 44 | ) 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/Cast.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.cast.ForceSupportSendAppForAll 5 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage 7 | 8 | object Cast : AppRegister() { 9 | override val packageName: String = "com.milink.service" 10 | 11 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 12 | when (Build.VERSION.SDK_INT) { 13 | Build.VERSION_CODES.TIRAMISU -> { 14 | autoInitHooks( 15 | lpparam, 16 | ForceSupportSendAppForAll, //强制允许所有应用接力 17 | ) 18 | } 19 | 20 | Build.VERSION_CODES.S -> { 21 | autoInitHooks( 22 | lpparam, 23 | ForceSupportSendAppForAll, //强制允许所有应用接力 24 | ) 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/MediaEditor.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.s.mediaeditor.UnlockUnlimitedCroppingForS 5 | import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT 6 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 7 | import de.robv.android.xposed.callbacks.XC_LoadPackage 8 | 9 | object MediaEditor : AppRegister() { 10 | override val packageName: String = "com.miui.mediaeditor" 11 | 12 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 13 | when (Build.VERSION.SDK_INT) { 14 | Build.VERSION_CODES.TIRAMISU -> { 15 | autoInitHooks( 16 | lpparam, 17 | UnlockUnlimitedCroppingForT, //解锁裁切最小值 18 | ) 19 | } 20 | 21 | Build.VERSION_CODES.S -> { 22 | autoInitHooks( 23 | lpparam, 24 | UnlockUnlimitedCroppingForS, //解锁裁切最小值 25 | ) 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/MiuiHome.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.AlwaysShowStatusBarClockForAll 5 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.DisableRecentViewWallpaperDarkeningForAll 6 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.DoubleTapToSleepForAll 7 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ModifyRecentViewRemoveCardAnimForAll 8 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.RemoveSmallWindowRestrictionForMiuiHomeForAll 9 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ScrollIconNameForAll 10 | import com.lt2333.simplicitytools.hooks.rules.all.miuihome.ShortcutAddSmallWindowForAll 11 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 12 | import de.robv.android.xposed.callbacks.XC_LoadPackage 13 | 14 | object MiuiHome : AppRegister() { 15 | override val packageName: String = "com.miui.home" 16 | 17 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 18 | when (Build.VERSION.SDK_INT) { 19 | Build.VERSION_CODES.TIRAMISU -> { 20 | autoInitHooks( 21 | lpparam, 22 | AlwaysShowStatusBarClockForAll, //时钟显示时钟 23 | DoubleTapToSleepForAll, //双击锁屏 24 | DisableRecentViewWallpaperDarkeningForAll, //取消后台壁纸压暗效果 25 | ModifyRecentViewRemoveCardAnimForAll, //横向排布后台划卡动画 26 | ScrollIconNameForAll, //滚动显示应用标题 27 | RemoveSmallWindowRestrictionForMiuiHomeForAll, //取消小窗限制 28 | ShortcutAddSmallWindowForAll, //快捷菜单添加小窗 29 | ) 30 | } 31 | 32 | Build.VERSION_CODES.S -> { 33 | autoInitHooks( 34 | lpparam, 35 | AlwaysShowStatusBarClockForAll, //时钟显示时钟 36 | DoubleTapToSleepForAll, //双击锁屏 37 | DisableRecentViewWallpaperDarkeningForAll, //取消后台壁纸压暗效果 38 | ModifyRecentViewRemoveCardAnimForAll, //横向排布后台划卡动画 39 | ScrollIconNameForAll, //滚动显示应用标题 40 | RemoveSmallWindowRestrictionForMiuiHomeForAll, //取消小窗限制 41 | ShortcutAddSmallWindowForAll, //快捷菜单添加小窗 42 | ) 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/PackageInstaller.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 7 | import de.robv.android.xposed.XposedBridge 8 | import de.robv.android.xposed.callbacks.XC_LoadPackage 9 | 10 | object PackageInstaller : AppRegister() { 11 | 12 | override val packageName: String = "com.miui.packageinstaller" 13 | 14 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 15 | hasEnable("pkg_installer_count_checking") { 16 | findMethod("com.miui.packageInstaller.model.RiskControlRules") { 17 | name == "getCurrentLevel" 18 | }.hookBefore { param -> 19 | XposedBridge.log("Hooked getCurrentLevel, param result = ${param.result}") 20 | param.result = 0 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/PowerKeeper.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.powerkeeper.LockMaxFpsForAll 5 | import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.DoNotClearAppForS 6 | import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.MakeMilletMoreAggressiveForS 7 | import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelistForS 8 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 9 | import de.robv.android.xposed.callbacks.XC_LoadPackage 10 | 11 | object PowerKeeper : AppRegister() { 12 | override val packageName: String = "com.miui.powerkeeper" 13 | 14 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 15 | when (Build.VERSION.SDK_INT) { 16 | Build.VERSION_CODES.TIRAMISU -> { 17 | autoInitHooks( 18 | lpparam, 19 | LockMaxFpsForAll, //锁定最高刷新率 20 | PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单 21 | DoNotClearAppForS,//阻止杀后台 22 | MakeMilletMoreAggressiveForS,//使 Millet 更激进 23 | ) 24 | } 25 | 26 | Build.VERSION_CODES.S -> { 27 | autoInitHooks( 28 | lpparam, 29 | LockMaxFpsForAll, //锁定最高刷新率 30 | PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单 31 | DoNotClearAppForS,//阻止杀后台 32 | MakeMilletMoreAggressiveForS,//使 Millet 更激进 33 | ) 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/RearDisplay.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.reardisplay.RearDisplayWeatherForAll 5 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage 7 | 8 | object RearDisplay : AppRegister() { 9 | override val packageName: String = "com.xiaomi.misubscreenui" 10 | 11 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 12 | when (Build.VERSION.SDK_INT) { 13 | Build.VERSION_CODES.TIRAMISU -> { 14 | autoInitHooks( 15 | lpparam, 16 | RearDisplayWeatherForAll, //背屏显示天气 17 | ) 18 | } 19 | 20 | Build.VERSION_CODES.S -> { 21 | autoInitHooks( 22 | lpparam, 23 | RearDisplayWeatherForAll, //背屏显示天气 24 | ) 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/ScreenShot.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.s.screenshot.UnlockUnlimitedCroppingForS 5 | import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT 6 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 7 | import de.robv.android.xposed.callbacks.XC_LoadPackage 8 | 9 | object ScreenShot : AppRegister() { 10 | override val packageName: String = "com.miui.screenshot" 11 | 12 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 13 | when (Build.VERSION.SDK_INT) { 14 | Build.VERSION_CODES.TIRAMISU -> { 15 | autoInitHooks( 16 | lpparam, 17 | UnlockUnlimitedCroppingForT, //解锁裁切限制 18 | ) 19 | } 20 | 21 | Build.VERSION_CODES.S -> { 22 | autoInitHooks( 23 | lpparam, 24 | UnlockUnlimitedCroppingForS, //解锁裁切限制 25 | ) 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/SecurityCenter.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.LockOneHundredForAll 5 | import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.RemoveMacroBlacklistForAll 6 | import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.RemoveOpenAppConfirmationPopupForAll 7 | import com.lt2333.simplicitytools.hooks.rules.all.securitycenter.SkipWaitingTimeForAll 8 | import com.lt2333.simplicitytools.hooks.rules.s.securitycenter.ShowBatteryTemperatureForS 9 | import com.lt2333.simplicitytools.hooks.rules.t.securitycenter.ShowBatteryTemperatureForT 10 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 11 | import de.robv.android.xposed.callbacks.XC_LoadPackage 12 | 13 | object SecurityCenter : AppRegister() { 14 | override val packageName: String = "com.miui.securitycenter" 15 | 16 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 17 | when (Build.VERSION.SDK_INT) { 18 | Build.VERSION_CODES.TIRAMISU -> { 19 | autoInitHooks( 20 | lpparam, 21 | SkipWaitingTimeForAll, //跳过 5/10秒等待时间 22 | LockOneHundredForAll, //锁定 100分 23 | RemoveMacroBlacklistForAll, //去除自动连招黑名单 24 | ShowBatteryTemperatureForT, //显示电池温度 25 | RemoveOpenAppConfirmationPopupForAll, //去除打开应用弹窗 26 | ) 27 | } 28 | 29 | Build.VERSION_CODES.S -> { 30 | autoInitHooks( 31 | lpparam, 32 | SkipWaitingTimeForAll, //跳过 5/10秒等待时间 33 | LockOneHundredForAll, //锁定 100分 34 | RemoveMacroBlacklistForAll, //去除自动连招黑名单 35 | ShowBatteryTemperatureForS, //显示电池温度 36 | RemoveOpenAppConfirmationPopupForAll, //去除打开应用弹窗 37 | ) 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/Settings.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.settings.ShowNotificationImportanceForAll 5 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage 7 | 8 | object Settings : AppRegister() { 9 | override val packageName: String = "com.android.settings" 10 | 11 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 12 | when (Build.VERSION.SDK_INT) { 13 | Build.VERSION_CODES.TIRAMISU -> { 14 | autoInitHooks( 15 | lpparam, 16 | ShowNotificationImportanceForAll, //显示通知重要程度 17 | ) 18 | } 19 | 20 | Build.VERSION_CODES.S -> { 21 | autoInitHooks( 22 | lpparam, 23 | ShowNotificationImportanceForAll, //显示通知重要程度 24 | ) 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/ThemeManager.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import android.os.Build 4 | import com.lt2333.simplicitytools.hooks.rules.all.thememanager.RemoveAdsForAll 5 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage 7 | 8 | object ThemeManager : AppRegister() { 9 | override val packageName: String = "com.android.thememanager" 10 | 11 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 12 | when (Build.VERSION.SDK_INT) { 13 | Build.VERSION_CODES.TIRAMISU -> { 14 | autoInitHooks( 15 | lpparam, 16 | RemoveAdsForAll, //移除主题壁纸的广告 17 | ) 18 | } 19 | 20 | Build.VERSION_CODES.S -> { 21 | autoInitHooks( 22 | lpparam, 23 | RemoveAdsForAll, //移除主题壁纸的广告 24 | ) 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/apps/Updater.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.apps 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant 6 | import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 9 | import de.robv.android.xposed.callbacks.XC_LoadPackage 10 | 11 | object Updater : AppRegister() { 12 | override val packageName: String = "com.android.updater" 13 | 14 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { 15 | 16 | hasEnable("remove_ota_validate") { 17 | Array(26) { "com.android.updater.common.utils.${'a' + it}" } 18 | .mapNotNull { loadClassOrNull(it) } 19 | .firstOrNull { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 } 20 | ?.findMethod { name == "T" && returnType == Boolean::class.java } 21 | ?.hookReturnConstant(false) 22 | 23 | findMethod("miui.util.FeatureParser") { 24 | name == "hasFeature" && parameterCount == 2 25 | }.hookBefore { 26 | if (it.args[0] == "support_ota_validate") { 27 | it.result = false 28 | } 29 | } 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/android/AllowUntrustedTouchesForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.android 2 | 3 | import android.content.Context 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object AllowUntrustedTouchesForAll : HookRegister() { 10 | override fun init() = hasEnable("allow_untrusted_touches") { 11 | findMethod("android.hardware.input.InputManager") { 12 | name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java 13 | }.hookReturnConstant(0) 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/android/DeleteOnPostNotificationForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.android 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object DeleteOnPostNotificationForAll : HookRegister() { 9 | override fun init() { 10 | findMethod("com.android.server.wm.AlertWindowNotification") { 11 | name == "onPostNotification" 12 | }.hookBefore { 13 | hasEnable("delete_on_post_notification") { 14 | it.result = null 15 | } 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/android/DisableFlagSecureForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.android 2 | 3 | import android.os.Build 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorBefore 6 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object DisableFlagSecureForAll : HookRegister() { 11 | override fun init() { 12 | findMethod("com.android.server.wm.WindowState") { 13 | name == "isSecureLocked" 14 | }.hookBefore { 15 | hasEnable("disable_flag_secure") { 16 | it.result = false 17 | } 18 | } 19 | 20 | if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) { 21 | findMethod("com.android.server.wm.WindowSurfaceController") { 22 | name == "setSecure" 23 | }.hookBefore { 24 | it.args[0] = false 25 | } 26 | hookAllConstructorBefore("com.android.server.wm.WindowSurfaceController") { 27 | var flags = it.args[2] as Int 28 | val secureFlag = 128 29 | flags = flags and secureFlag.inv() 30 | it.args[2] = flags 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/cast/ForceSupportSendAppForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.cast 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object ForceSupportSendAppForAll : HookRegister() { 9 | 10 | override fun init() = hasEnable("force_support_send_app") { 11 | findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") { 12 | name == "isSupportSendApp" 13 | }.hookAfter { 14 | it.result = true 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/corepatch/CorePatchForS.java: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.corepatch; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | 5 | import de.robv.android.xposed.XC_MethodHook; 6 | import de.robv.android.xposed.XposedHelpers; 7 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 8 | 9 | public class CorePatchForS extends CorePatchForR { 10 | @Override 11 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException { 12 | super.handleLoadPackage(loadPackageParam); 13 | if (prefs.getBoolean("digestCreak", true) && prefs.getBoolean("UsePreSig", false)) { 14 | findAndHookMethod("com.android.server.pm.PackageManagerService", loadPackageParam.classLoader, "doesSignatureMatchForPermissions", String.class, "com.android.server.pm.parsing.pkg.ParsedPackage", int.class, new XC_MethodHook() { 15 | @Override 16 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 17 | //If we decide to crack this then at least make sure they are same apks, avoid another one that tries to impersonate. 18 | if (param.getResult().equals(false)) { 19 | String pPname = (String) XposedHelpers.callMethod(param.args[1], "getPackageName"); 20 | if (pPname.contentEquals((String) param.args[0])) { 21 | param.setResult(true); 22 | } 23 | } 24 | } 25 | }); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/corepatch/CorePatchForSv2.java: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.corepatch; 2 | 3 | public class CorePatchForSv2 extends CorePatchForS{ 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/corepatch/CorePatchMainHook.java: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.corepatch; 2 | 3 | import android.os.Build; 4 | import android.util.Log; 5 | 6 | import de.robv.android.xposed.IXposedHookLoadPackage; 7 | import de.robv.android.xposed.IXposedHookZygoteInit; 8 | import de.robv.android.xposed.XposedBridge; 9 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 10 | 11 | public class CorePatchMainHook implements IXposedHookLoadPackage, IXposedHookZygoteInit { 12 | public static final String TAG = "WooBox: CorePatch"; 13 | 14 | @Override 15 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { 16 | if (("android".equals(lpparam.packageName)) && (lpparam.processName.equals("android"))) { 17 | Log.d(TAG, "Current sdk version " + Build.VERSION.SDK_INT); 18 | switch (Build.VERSION.SDK_INT) { 19 | case Build.VERSION_CODES.TIRAMISU: // 33 20 | new CorePatchForT().handleLoadPackage(lpparam); 21 | break; 22 | case Build.VERSION_CODES.S_V2: // 32 23 | new CorePatchForSv2().handleLoadPackage(lpparam); 24 | break; 25 | case Build.VERSION_CODES.S: // 31 26 | new CorePatchForS().handleLoadPackage(lpparam); 27 | break; 28 | case Build.VERSION_CODES.R: // 30 29 | new CorePatchForR().handleLoadPackage(lpparam); 30 | break; 31 | case Build.VERSION_CODES.Q: // 29 32 | new CorePatchForQ().handleLoadPackage(lpparam); 33 | break; 34 | default: 35 | XposedBridge.log(TAG + ": Warning: Unsupported Version of Android " + Build.VERSION.SDK_INT); 36 | break; 37 | } 38 | } 39 | } 40 | 41 | @Override 42 | public void initZygote(StartupParam startupParam) throws Throwable { 43 | if (startupParam.startsSystemServer) { 44 | Log.d(TAG, "Current sdk version " + Build.VERSION.SDK_INT); 45 | switch (Build.VERSION.SDK_INT) { 46 | case Build.VERSION_CODES.TIRAMISU: // 33 47 | new CorePatchForT().initZygote(startupParam); 48 | break; 49 | case Build.VERSION_CODES.S_V2: // 32 50 | new CorePatchForSv2().initZygote(startupParam); 51 | break; 52 | case Build.VERSION_CODES.S: // 31 53 | new CorePatchForS().initZygote(startupParam); 54 | break; 55 | case Build.VERSION_CODES.R: // 30 56 | new CorePatchForR().initZygote(startupParam); 57 | break; 58 | case Build.VERSION_CODES.Q: // 29 59 | new CorePatchForQ().initZygote(startupParam); 60 | break; 61 | default: 62 | XposedBridge.log(TAG + ": Warning: Unsupported Version of Android " + Build.VERSION.SDK_INT); 63 | break; 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/corepatch/ReturnConstant.java: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.corepatch; 2 | 3 | import de.robv.android.xposed.XC_MethodHook; 4 | import de.robv.android.xposed.XSharedPreferences; 5 | 6 | public class ReturnConstant extends XC_MethodHook { 7 | private final XSharedPreferences prefs; 8 | private final String prefsKey; 9 | private final Object value; 10 | 11 | public ReturnConstant(XSharedPreferences prefs, String prefsKey, Object value) { 12 | this.prefs = prefs; 13 | this.prefsKey = prefsKey; 14 | this.value = value; 15 | } 16 | 17 | @Override 18 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 19 | super.beforeHookedMethod(param); 20 | prefs.reload(); 21 | if (prefs.getBoolean(prefsKey, false)) { 22 | param.setResult(value); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/AlwaysShowStatusBarClockForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object AlwaysShowStatusBarClockForAll : HookRegister() { 9 | override fun init() { 10 | try { 11 | findMethod("com.miui.home.launcher.Workspace") { 12 | name == "isScreenHasClockGadget" 13 | } 14 | } catch (e: Exception) { 15 | findMethod("com.miui.home.launcher.Workspace") { 16 | name == "isScreenHasClockWidget" 17 | } 18 | } catch (e: Exception) { 19 | findMethod("com.miui.home.launcher.Workspace") { 20 | name == "isClockWidget" 21 | } 22 | }.hookBefore { 23 | hasEnable("home_time") { 24 | it.result = false 25 | } 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/DisableRecentViewWallpaperDarkeningForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.github.kyuubiran.ezxhelper.utils.putObject 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object DisableRecentViewWallpaperDarkeningForAll : HookRegister() { 10 | override fun init() = hasEnable("miuihome_recentwiew_wallpaper_darkening") { 11 | findMethod("com.miui.home.recents.DimLayer") { 12 | name == "dim" && parameterCount == 3 13 | }.hookBefore { 14 | it.args[0] = 0.0f 15 | it.thisObject.putObject("mCurrentAlpha", 0.0f) 16 | } 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/DoubleTapControllerForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import android.content.Context 4 | import android.os.SystemClock 5 | import android.view.MotionEvent 6 | import android.view.ViewConfiguration 7 | import kotlin.math.abs 8 | 9 | class DoubleTapControllerForAll internal constructor(mContext: Context) { 10 | 11 | private val maxDuration: Long = 500 12 | private var mActionDownRawX: Float = 0f 13 | private var mActionDownRawY: Float = 0f 14 | private var mClickCount: Int = 0 15 | private var mFirstClickRawX: Float = 0f 16 | private var mFirstClickRawY: Float = 0f 17 | private var mLastClickTime: Long = 0 18 | private val mTouchSlop: Int = ViewConfiguration.get(mContext).scaledTouchSlop * 2 19 | fun isDoubleTapEvent(motionEvent: MotionEvent): Boolean { 20 | val action = motionEvent.actionMasked 21 | return when { 22 | action == MotionEvent.ACTION_DOWN -> { 23 | mActionDownRawX = motionEvent.rawX 24 | mActionDownRawY = motionEvent.rawY 25 | false 26 | } 27 | action != MotionEvent.ACTION_UP -> false 28 | else -> { 29 | val rawX = motionEvent.rawX 30 | val rawY = motionEvent.rawY 31 | if (abs(rawX - mActionDownRawX) <= mTouchSlop.toFloat() && abs(rawY - mActionDownRawY) <= mTouchSlop.toFloat()) { 32 | if (SystemClock.elapsedRealtime() - mLastClickTime > maxDuration || rawY - mFirstClickRawY > mTouchSlop.toFloat() || rawX - mFirstClickRawX > mTouchSlop.toFloat()) mClickCount = 33 | 0 34 | mClickCount++ 35 | if (mClickCount == 1) { 36 | mFirstClickRawX = rawX 37 | mFirstClickRawY = rawY 38 | mLastClickTime = SystemClock.elapsedRealtime() 39 | return false 40 | } else if (abs(rawY - mFirstClickRawY) <= mTouchSlop.toFloat() && abs(rawX - mFirstClickRawX) <= mTouchSlop.toFloat() && SystemClock.elapsedRealtime() - mLastClickTime <= maxDuration 41 | ) { 42 | mClickCount = 0 43 | return true 44 | } 45 | } 46 | mClickCount = 0 47 | false 48 | } 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/DoubleTapToSleepForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.view.MotionEvent 6 | import com.github.kyuubiran.ezxhelper.utils.* 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | import de.robv.android.xposed.XposedHelpers 10 | 11 | object DoubleTapToSleepForAll : HookRegister() { 12 | 13 | override fun init() = hasEnable("double_tap_to_sleep") { 14 | hookAllConstructorAfter("com.miui.home.launcher.Workspace") { 15 | var mDoubleTapControllerEx = 16 | XposedHelpers.getAdditionalInstanceField(it.thisObject, "mDoubleTapControllerEx") 17 | if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter 18 | mDoubleTapControllerEx = DoubleTapControllerForAll((it.args[0] as Context)) 19 | XposedHelpers.setAdditionalInstanceField( 20 | it.thisObject, 21 | "mDoubleTapControllerEx", 22 | mDoubleTapControllerEx 23 | ) 24 | } 25 | findMethod("com.miui.home.launcher.Workspace") { 26 | name == "dispatchTouchEvent" && parameterTypes[0] == MotionEvent::class.java 27 | }.hookBefore { 28 | val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField( 29 | it.thisObject, 30 | "mDoubleTapControllerEx" 31 | ) as DoubleTapControllerForAll 32 | if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore 33 | val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int 34 | val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex) 35 | if (cellLayout != null) if (cellLayout.invokeMethodAuto("lastDownOnOccupiedCell") as Boolean) return@hookBefore 36 | if (it.thisObject.invokeMethodAuto("isInNormalEditingMode") as Boolean) return@hookBefore 37 | val context = it.thisObject.invokeMethodAuto("getContext") as Context 38 | context.sendBroadcast( 39 | Intent("com.miui.app.ExtraStatusBarManager.action_TRIGGER_TOGGLE").putExtra( 40 | "com.miui.app.ExtraStatusBarManager.extra_TOGGLE_ID", 41 | 10 42 | ) 43 | ) 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/ModifyRecentViewRemoveCardAnimForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import android.animation.ObjectAnimator 4 | import android.animation.TimeInterpolator 5 | import android.view.MotionEvent 6 | import android.view.View 7 | import com.lt2333.simplicitytools.utils.* 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | import de.robv.android.xposed.XposedHelpers 10 | 11 | 12 | object ModifyRecentViewRemoveCardAnimForAll : HookRegister() { 13 | override fun init() = hasEnable("miuihome_recentview_remove_card_animation") { 14 | "com.miui.home.recents.views.SwipeHelperForRecents".hookAfterMethod("onTouchEvent", MotionEvent::class.java) { 15 | val mCurrView = it.thisObject.getObjectField("mCurrView") as View? 16 | if (mCurrView != null) { 17 | mCurrView.alpha = 1f 18 | mCurrView.scaleX = 1f 19 | mCurrView.scaleY = 1f 20 | } 21 | } 22 | 23 | "com.miui.home.recents.TaskStackViewLayoutStyleHorizontal".replaceMethod("createScaleDismissAnimation", View::class.java, Float::class.java) { 24 | val view = it.args[0] as View 25 | val getScreenHeight = "com.miui.home.launcher.DeviceConfig".findClass().callStaticMethod("getScreenHeight") as Int 26 | val ofFloat = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, view.translationY, -getScreenHeight * 1.1484375f) 27 | val physicBasedInterpolator = XposedHelpers.newInstance("com.miui.home.launcher.anim.PhysicBasedInterpolator".findClass(), 0.9f, 0.78f) 28 | ofFloat.interpolator = physicBasedInterpolator as TimeInterpolator 29 | ofFloat.duration = 400 30 | return@replaceMethod ofFloat 31 | } 32 | 33 | "com.miui.home.recents.views.VerticalSwipe".hookAfterMethod("calculate", Float::class.java) { 34 | val f = it.args[0] as Float 35 | val asScreenHeightWhenDismiss = "com.miui.home.recents.views.VerticalSwipe".findClass().callStaticMethod("getAsScreenHeightWhenDismiss") as Int 36 | val f2 = f / asScreenHeightWhenDismiss 37 | val mTaskViewHeight = it.thisObject.getObjectField("mTaskViewHeight") as Float 38 | val mCurScale = it.thisObject.getObjectField("mCurScale") as Float 39 | val f3: Float = mTaskViewHeight * mCurScale 40 | val i = if (f2 > 0.0f) 1 else if (f2 == 0.0f) 0 else -1 41 | val afterFrictionValue: Float = it.thisObject.callMethod("afterFrictionValue", f, asScreenHeightWhenDismiss) as Float 42 | if (i < 0) it.thisObject.setObjectField("mCurTransY", (mTaskViewHeight / 2.0f + afterFrictionValue * 2) - (f3 / 2.0f)) 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/miuihome/RemoveSmallWindowRestrictionForMiuiHomeForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.miuihome 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findAllMethods 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object RemoveSmallWindowRestrictionForMiuiHomeForAll : HookRegister() { 9 | override fun init() { 10 | 11 | findAllMethods("com.miui.home.launcher.RecentsAndFSGestureUtils") { 12 | name == "canTaskEnterSmallWindow" 13 | }.hookBefore { 14 | hasEnable("android_remove_small_window_restriction") { 15 | it.result = true 16 | } 17 | } 18 | findAllMethods("com.miui.home.launcher.RecentsAndFSGestureUtils") { 19 | name == "canTaskEnterMiniSmallWindow" 20 | }.hookBefore { 21 | hasEnable("android_remove_small_window_restriction") { 22 | it.result = true 23 | } 24 | } 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/powerkeeper/LockMaxFpsForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.powerkeeper 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object LockMaxFpsForAll: HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.miui.powerkeeper.statemachine.DisplayFrameSetting") { 12 | name == "setScreenEffect" && parameterCount == 3 13 | }.hookBefore { 14 | hasEnable("lock_max_fps") { 15 | it.result = null 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/securitycenter/LockOneHundredForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.securitycenter 2 | 3 | import android.view.View 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object LockOneHundredForAll : HookRegister() { 10 | 11 | override fun init() { 12 | //防止点击重新检测 13 | findMethod("com.miui.securityscan.ui.main.MainContentFrame") { 14 | name == "onClick" && parameterTypes[0] == View::class.java 15 | }.hookBefore { 16 | hasEnable("lock_one_hundred") { 17 | it.result = null 18 | } 19 | } 20 | 21 | //锁定100分 22 | findMethod("com.miui.securityscan.scanner.ScoreManager") { 23 | name == "B" 24 | }.hookBefore { 25 | hasEnable("lock_one_hundred") { 26 | it.result = 0 27 | } 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/securitycenter/RemoveMacroBlacklistForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.securitycenter 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.* 4 | import com.lt2333.simplicitytools.utils.XSPUtils 5 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 6 | import de.robv.android.xposed.XC_MethodHook 7 | import de.robv.android.xposed.XposedBridge 8 | import de.robv.android.xposed.XposedHelpers 9 | 10 | object RemoveMacroBlacklistForAll : HookRegister() { 11 | 12 | override fun init() { 13 | if (XSPUtils.getBoolean("remove_macro_blacklist", false)) { 14 | var letter = 'a' 15 | for (i in 0..25) { 16 | val classIfExists = XposedHelpers.findClassIfExists( 17 | "com.miui.gamebooster.utils.$letter" + "0", getDefaultClassLoader() 18 | ) ?: continue 19 | if (classIfExists.declaredMethods.size in 10..15 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) { 20 | XposedBridge.log("Woobox: RemoveMacroBlacklist in ${classIfExists.name}") 21 | findMethod(classIfExists){ 22 | name=="c" && returnType==Boolean::class.java && isStatic &¶meterCount==1 23 | }.hookBefore { 24 | XposedBridge.log("Woobox: c") 25 | it.result = false 26 | } 27 | return 28 | } 29 | letter++ 30 | } 31 | } 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/securitycenter/RemoveOpenAppConfirmationPopupForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.securitycenter 2 | 3 | import android.widget.TextView 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object RemoveOpenAppConfirmationPopupForAll : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("android.widget.TextView") { 13 | name == "setText" && parameterTypes[0] == CharSequence::class.java 14 | }.hookAfter { 15 | hasEnable("remove_open_app_confirmation_popup") { 16 | val textView = it.thisObject as TextView 17 | if (it.args.isNotEmpty() && it.args[0]?.toString().equals( 18 | textView.context.resources.getString( 19 | textView.context.resources.getIdentifier( 20 | "button_text_accept", 21 | "string", 22 | textView.context.packageName 23 | ) 24 | ) 25 | ) 26 | ) { 27 | textView.performClick() 28 | } 29 | } 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/securitycenter/SkipWaitingTimeForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.securitycenter 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object SkipWaitingTimeForAll : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("android.widget.TextView") { 12 | name == "setText" && parameterCount == 4 13 | }.hookBefore { 14 | hasEnable("skip_waiting_time") { 15 | if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true 16 | ) { 17 | it.args[0] = "确定" 18 | } 19 | } 20 | } 21 | 22 | findMethod("android.widget.TextView") { 23 | name == "setEnabled" && parameterTypes[0] == Boolean::class.java 24 | }.hookBefore { 25 | hasEnable("skip_waiting_time") { 26 | it.args[0] = true 27 | } 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/settings/ShowNotificationImportanceForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.settings 2 | 3 | import android.app.NotificationChannel 4 | import com.github.kyuubiran.ezxhelper.utils.* 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | import de.robv.android.xposed.XposedHelpers 8 | 9 | object ShowNotificationImportanceForAll : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("com.android.settings.notification.ChannelNotificationSettings") { 13 | name == "removeDefaultPrefs" 14 | }.hookBefore { 15 | if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBefore 16 | val importance = it.thisObject.invokeMethodAuto("findPreference", "importance") ?: return@hookBefore 17 | val mChannel = it.thisObject.getObject("mChannel") as NotificationChannel 18 | val index = importance.invokeMethodAutoAs("findSpinnerIndexOfValue", mChannel.importance.toString())!! 19 | if (index < 0) return@hookBefore 20 | importance.invokeMethodAuto("setValueIndex", index) 21 | XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject) 22 | it.result = null 23 | } 24 | 25 | findMethod("androidx.preference.Preference") { 26 | name == "callChangeListener" && parameterTypes[0] == Any::class.java 27 | }.hookAfter { 28 | val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfter 29 | val mChannel = channelNotificationSettings.getObject("mChannel") as NotificationChannel 30 | mChannel.invokeMethodAuto("setImportance", (it.args[0] as String).toInt()) 31 | val mBackend = channelNotificationSettings.getObjectOrNull("mBackend") ?: return@hookAfter 32 | val mPkg = channelNotificationSettings.getObjectAs("mPkg") 33 | val mUid = channelNotificationSettings.getObjectAs("mUid") 34 | mBackend.invokeMethodAuto("updateChannel", mPkg, mUid, mChannel) 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/all/thememanager/RemoveAdsForAll.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.all.thememanager 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object RemoveAdsForAll : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.thememanager.basemodule.ad.model.AdInfoResponse") { 12 | name == "isAdValid" && parameterCount == 1 13 | }.hookBefore { 14 | hasEnable("remove_thememanager_ads") { 15 | it.result = false 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/android/MaxWallpaperScaleForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.android 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.github.kyuubiran.ezxhelper.utils.putObject 6 | import com.lt2333.simplicitytools.utils.XSPUtils 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object MaxWallpaperScaleForS : HookRegister() { 10 | override fun init() { 11 | findMethod("com.android.server.wm.WallpaperController") { 12 | name == "zoomOutToScale" && parameterTypes[0] == Float::class.java 13 | }.hookBefore { 14 | val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f) 15 | it.thisObject.putObject("mMaxWallpaperScale", value) 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/android/RemoveSmallWindowRestrictionsForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.android 2 | 3 | import android.content.Context 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 6 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object RemoveSmallWindowRestrictionsForS : HookRegister() { 11 | override fun init() { 12 | // 强制所有活动设为可以调整大小 13 | findMethod("com.android.server.wm.Task") { 14 | name == "isResizeable" 15 | }.hookBefore { 16 | hasEnable("remove_small_window_restrictions") { 17 | it.result = true 18 | } 19 | } 20 | 21 | findMethod("android.util.MiuiMultiWindowAdapter") { 22 | name == "getFreeformBlackList" 23 | }.hookAfter { 24 | hasEnable("remove_small_window_restrictions") { 25 | it.result = (it.result as MutableList<*>).apply { clear() } 26 | } 27 | } 28 | 29 | findMethod("android.util.MiuiMultiWindowAdapter") { 30 | name == "getFreeformBlackListFromCloud" && parameterTypes[0] == Context::class.java 31 | }.hookAfter { 32 | hasEnable("remove_small_window_restrictions") { 33 | it.result = (it.result as MutableList<*>).apply { clear() } 34 | } 35 | } 36 | 37 | findMethod("android.util.MiuiMultiWindowUtils") { 38 | name == "supportFreeform" 39 | }.hookAfter { 40 | hasEnable("remove_small_window_restrictions") { 41 | it.result = true 42 | } 43 | } 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/android/SystemPropertiesHookForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.android 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object SystemPropertiesHookForS : HookRegister() { 9 | override fun init() { 10 | val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false) 11 | val mediaSteps = XSPUtils.getInt("media_volume_steps", 15) 12 | 13 | findMethod("android.os.SystemProperties") { 14 | name == "getInt" && returnType == Int::class.java 15 | }.hookBefore { 16 | when (it.args[0] as String) { 17 | "ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps 18 | } 19 | } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/mediaeditor/UnlockUnlimitedCroppingForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.mediaeditor 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object UnlockUnlimitedCroppingForS : HookRegister() { 9 | 10 | override fun init() { 11 | //解锁图库裁切最小值 12 | findMethod("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector") { 13 | name == "calculateMinSize" 14 | }.hookBefore { 15 | hasEnable("unlock_unlimited_cropping") { 16 | it.result = 0 17 | } 18 | } 19 | //截图无限裁切 20 | findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector") { 21 | name == "calculateMinSize" 22 | }.hookBefore { 23 | hasEnable("unlock_unlimited_cropping") { 24 | it.result = 0 25 | } 26 | } 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/powerkeeper/DoNotClearAppForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object DoNotClearAppForS : HookRegister() { 9 | override fun init() { 10 | findMethod("com.miui.powerkeeper.statemachine.SleepModeControllerNew") { 11 | name == "clearApp" 12 | }.hookBefore { 13 | hasEnable("do_not_clear_app") { 14 | it.result = null 15 | } 16 | } 17 | 18 | findMethod("com.miui.powerkeeper.statemachine.PowerStateMachine") { 19 | name == "clearAppWhenScreenOffTimeOut" 20 | }.hookBefore { 21 | hasEnable("do_not_clear_app") { 22 | it.result = null 23 | } 24 | } 25 | 26 | findMethod("com.miui.powerkeeper.statemachine.PowerStateMachine") { 27 | name == "clearAppWhenScreenOffTimeOutInNight" 28 | }.hookBefore { 29 | hasEnable("do_not_clear_app") { 30 | it.result = null 31 | } 32 | } 33 | 34 | findMethod("com.miui.powerkeeper.powerchecker.PowerCheckerController") { 35 | name == "clearApp" 36 | }.hookBefore { 37 | hasEnable("do_not_clear_app") { 38 | it.result = null 39 | } 40 | } 41 | 42 | findMethod("com.miui.powerkeeper.powerchecker.PowerCheckerController") { 43 | name == "autoKillApp" 44 | }.hookBefore { 45 | hasEnable("do_not_clear_app") { 46 | it.result = null 47 | } 48 | } 49 | 50 | findMethod("com.miui.powerkeeper.statemachine.SleepModeController\$SleepProcessHelper") { 51 | name == "killAppsInSleep" 52 | }.hookBefore { 53 | hasEnable("do_not_clear_app") { 54 | it.result = null 55 | } 56 | } 57 | 58 | findMethod("com.miui.powerkeeper.statemachine.DynamicTurboPowerHandler") { 59 | name == "clearApp" 60 | }.hookBefore { 61 | hasEnable("do_not_clear_app") { 62 | it.result = null 63 | } 64 | } 65 | 66 | findMethod("miui.process.ProcessManager") { 67 | name == "kill" 68 | }.hookBefore { 69 | hasEnable("do_not_clear_app") { 70 | it.result = false 71 | } 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/powerkeeper/MakeMilletMoreAggressiveForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object MakeMilletMoreAggressiveForS : HookRegister() { 9 | override fun init() { 10 | findMethod("com.miui.powerkeeper.controller.FrozenAppController") { 11 | name == "appIsAllowToFrozen" 12 | }.hookBefore { 13 | hasEnable("make_millet_more_aggressive") { 14 | it.result = true 15 | } 16 | } 17 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$FrozenUtil") { 18 | name == "isHasRunningStateProcess" 19 | }.hookBefore { 20 | hasEnable("make_millet_more_aggressive") { 21 | it.result = false 22 | } 23 | } 24 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$FrozenUtil") { 25 | name == "isExectingService" 26 | }.hookBefore { 27 | hasEnable("make_millet_more_aggressive") { 28 | it.result = false 29 | } 30 | } 31 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$FrozenUtil") { 32 | name == "isReceivingBroadcast" 33 | }.hookBefore { 34 | hasEnable("make_millet_more_aggressive") { 35 | it.result = false 36 | } 37 | } 38 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$FrozenUtil") { 39 | name == "isHasProcessOOMTooLow" 40 | }.hookBefore { 41 | hasEnable("make_millet_more_aggressive") { 42 | it.result = false 43 | } 44 | } 45 | findMethod("com.miui.powerkeeper.controller.FrozenAppController") { 46 | name == "isHasNotification" 47 | }.hookBefore { 48 | hasEnable("make_millet_more_aggressive") { 49 | it.result = false 50 | } 51 | } 52 | findMethod("com.miui.powerkeeper.millet.MilletConfig") { 53 | name == "getEnable" 54 | }.hookBefore { 55 | hasEnable("make_millet_more_aggressive") { 56 | it.result = true 57 | } 58 | } 59 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$AppStateFrozenControl") { 60 | name == "frozenAppLater" && 61 | parameterTypes.contentEquals(arrayOf(Int::class.java)) 62 | }.hookBefore { 63 | hasEnable("make_millet_more_aggressive") { 64 | it.args[0] = 3000 65 | } 66 | } 67 | findMethod("com.miui.powerkeeper.controller.FrozenAppController\$AppStateFrozenControl") { 68 | name == "isAllowFrozenNow" 69 | }.hookBefore { 70 | hasEnable("make_millet_more_aggressive") { 71 | hasEnable("make_millet_ignore_active") { 72 | it.result = true 73 | } 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/powerkeeper/PreventRecoveryOfBatteryOptimizationWhitelistForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object PreventRecoveryOfBatteryOptimizationWhitelistForS : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod( 12 | "com.miui.powerkeeper.statemachine.ForceDozeController" 13 | ) { 14 | name == "restoreWhiteListAppsIfQuitForceIdle" 15 | }.hookBefore { 16 | hasEnable("prevent_recovery_of_battery_optimization_white_list") { 17 | it.result = null 18 | } 19 | } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/screenshot/UnlockUnlimitedCroppingForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.screenshot 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object UnlockUnlimitedCroppingForS : HookRegister() { 9 | 10 | override fun init() { 11 | //截图无限裁切 12 | findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b") { 13 | name == "a" && parameterCount == 0 && returnType == Int::class.java 14 | }.hookBefore { 15 | hasEnable("unlock_unlimited_cropping") { 16 | it.result = 0 17 | } 18 | } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/BatteryPercentageForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.util.TypedValue 4 | import android.widget.TextView 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.lt2333.simplicitytools.utils.XSPUtils 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | 11 | object BatteryPercentageForS : HookRegister() { 12 | 13 | override fun init() { 14 | val size = XSPUtils.getFloat("battery_percentage_font_size", 0f) 15 | if (size == 0f) return 16 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 17 | name == "updateResources" 18 | }.hookAfter { 19 | (it.thisObject.getObjectAs("mBatteryPercentView")).setTextSize( 20 | TypedValue.COMPLEX_UNIT_DIP, size 21 | ) 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/CanNotificationSlideForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object CanNotificationSlideForS: HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") { 12 | name == "canSlide" 13 | }.hookAfter { 14 | hasEnable("can_notification_slide") { 15 | it.result = true 16 | } 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/CustomMobileTypeTextForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object CustomMobileTypeTextForS : HookRegister() { 10 | 11 | override fun init() = hasEnable("custom_mobile_type_text_switch") { 12 | findMethod("com.android.systemui.statusbar.policy.MobileSignalController") { 13 | name == "getMobileTypeName" && parameterTypes[0] == Int::class.java 14 | }.hookAfter { 15 | it.result = XSPUtils.getString("custom_mobile_type_text", "5G") 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideBatteryIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.FrameLayout 5 | import android.widget.ImageView 6 | import android.widget.TextView 7 | import com.github.kyuubiran.ezxhelper.utils.findMethod 8 | import com.github.kyuubiran.ezxhelper.utils.getObject 9 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 10 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 11 | import com.lt2333.simplicitytools.utils.hasEnable 12 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 13 | 14 | object HideBatteryIconForS : HookRegister() { 15 | 16 | override fun init() { 17 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 18 | name == "updateResources" 19 | }.hookAfter { 20 | //隐藏电池图标 21 | hasEnable("hide_battery_icon") { 22 | (it.thisObject.getObjectAs("mBatteryIconView")).visibility = View.GONE 23 | if (it.thisObject.getObject("mBatteryStyle") == 1) { 24 | (it.thisObject.getObjectAs("mBatteryDigitalView")).visibility = 25 | View.GONE 26 | } 27 | } 28 | //隐藏电池内的百分比 29 | hasEnable("hide_battery_percentage_icon") { 30 | (it.thisObject.getObjectAs("mBatteryPercentMarkView")).textSize = 0F 31 | } 32 | //隐藏电池百分号 33 | hasEnable("hide_battery_percentage_icon") { 34 | (it.thisObject.getObjectAs("mBatteryPercentMarkView")).textSize = 0F 35 | } 36 | } 37 | 38 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 39 | name == "updateChargeAndText" 40 | }.hookAfter { 41 | //隐藏电池充电图标 42 | hasEnable("hide_battery_charging_icon") { 43 | (it.thisObject.getObjectAs("mBatteryChargingInView")).visibility = 44 | View.GONE 45 | (it.thisObject.getObjectAs("mBatteryChargingView")).visibility = 46 | View.GONE 47 | } 48 | } 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideHDIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import com.github.kyuubiran.ezxhelper.utils.* 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | import de.robv.android.xposed.XC_MethodHook 9 | 10 | object HideHDIconForS : HookRegister() { 11 | 12 | override fun init() { 13 | 14 | 15 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 16 | name == "initViewState" && parameterCount == 1 17 | }.hookAfter { 18 | hide(it) 19 | } 20 | 21 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 22 | name == "updateState" && parameterCount == 1 23 | }.hookAfter { 24 | hide(it) 25 | } 26 | hasEnable("hide_new_hd_icon") { 27 | findMethod("com.android.systemui.statusbar.policy.HDController") { name == "update" }.hookBefore { 28 | it.result = null 29 | } 30 | } 31 | } 32 | 33 | private fun hide(it: XC_MethodHook.MethodHookParam) { 34 | hasEnable("hide_big_hd_icon") { 35 | (it.thisObject.getObjectAs("mVolte")).visibility = View.GONE 36 | } 37 | hasEnable("hide_small_hd_icon") { 38 | (it.thisObject.getObjectAs("mSmallHd")).visibility = View.GONE 39 | } 40 | hasEnable("hide_hd_no_service_icon") { 41 | (it.thisObject.getObjectAs("mVolteNoService")).visibility = View.GONE 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideMobileActivityIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.lt2333.simplicitytools.utils.hasEnable 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | import de.robv.android.xposed.XC_MethodHook 11 | 12 | object HideMobileActivityIconForS : HookRegister() { 13 | 14 | override fun init() { 15 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 16 | name == "initViewState" && parameterCount == 1 17 | }.hookAfter { 18 | hide(it) 19 | } 20 | 21 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 22 | name == "updateState" && parameterCount == 1 23 | }.hookAfter { 24 | hide(it) 25 | } 26 | } 27 | 28 | private fun hide(it: XC_MethodHook.MethodHookParam) { 29 | hasEnable("hide_mobile_activity_icon") { 30 | (it.thisObject.getObjectAs("mLeftInOut")).visibility = View.GONE 31 | (it.thisObject.getObjectAs("mRightInOut")).visibility = View.GONE 32 | } 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideMobileTypeIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.findMethod 7 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 8 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 9 | import com.lt2333.simplicitytools.utils.XSPUtils 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | import de.robv.android.xposed.XC_MethodHook 13 | 14 | object HideMobileTypeIconForS : HookRegister() { 15 | 16 | private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false) 17 | 18 | override fun init() { 19 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 20 | name == "initViewState" && parameterCount == 1 21 | }.hookAfter { 22 | hideMobileTypeIcon(it) 23 | } 24 | 25 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 26 | name == "updateState" && parameterCount == 1 27 | }.hookAfter { 28 | hideMobileTypeIcon(it) 29 | } 30 | } 31 | 32 | private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) { 33 | hasEnable("hide_mobile_type_icon") { 34 | if (isBigType) { 35 | (it.thisObject.getObjectAs("mMobileType")).visibility = 36 | View.GONE 37 | (it.thisObject.getObjectAs("mMobileTypeImage")).visibility = 38 | View.GONE 39 | (it.thisObject.getObjectAs("mMobileTypeSingle")).visibility = 40 | View.GONE 41 | } else { 42 | (it.thisObject.getObjectAs("mMobileType")).visibility = 43 | View.INVISIBLE 44 | (it.thisObject.getObjectAs("mMobileTypeImage")).visibility = 45 | View.INVISIBLE 46 | (it.thisObject.getObjectAs("mMobileTypeSingle")).visibility = 47 | View.INVISIBLE 48 | } 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideNetworkSpeedSplitterForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.widget.TextView 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object HideNetworkSpeedSplitterForS : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") { 13 | name == "init" 14 | }.hookAfter { 15 | hasEnable("hide_network_speed_splitter") { 16 | val textView = it.thisObject as TextView 17 | textView.text = " " 18 | } 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideSimIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object HideSimIconForS : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") { 12 | name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java 13 | }.hookBefore { 14 | val list = it.args[0] as MutableList<*> 15 | val size = list.size 16 | hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) { 17 | list.removeAt(1) 18 | } 19 | hasEnable("hide_sim_one_icon", extraCondition = { size >= 1 }) { 20 | list.removeAt(0) 21 | } 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideStatusBarIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | import de.robv.android.xposed.XC_MethodHook 8 | 9 | object HideStatusBarIconForS : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") { 13 | name == "setIconVisibility" && parameterCount == 2 14 | }.hookBefore { 15 | hideIcon(it) 16 | } 17 | 18 | findMethod("com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl") { 19 | name == "setIconVisibility" && parameterCount == 2 20 | }.hookBefore { 21 | hideIcon(it) 22 | } 23 | } 24 | 25 | private fun hideIcon(it: XC_MethodHook.MethodHookParam) { 26 | //Log.d("图标名字", "handleLoadPackage: " + it.args[0]) 27 | when (it.args[0] as String) { 28 | //隐藏蓝牙 29 | "bluetooth" -> hasEnable("hide_bluetooth_icon") { 30 | it.args[1] = false 31 | } 32 | //隐藏蓝牙电量 33 | "bluetooth_handsfree_battery" -> hasEnable("hide_bluetooth_battery_icon") { 34 | it.args[1] = false 35 | } 36 | //隐藏勿扰 37 | "zen" -> hasEnable("hide_zen_icon") { 38 | it.args[1] = false 39 | } 40 | //隐藏声音 41 | "volume" -> hasEnable("hide_volume_icon") { 42 | it.args[1] = false 43 | } 44 | //隐藏WIFI 45 | "wifi" -> hasEnable("hide_wifi_icon") { 46 | it.args[1] = false 47 | } 48 | //隐藏WIFI辅助 49 | "slave_wifi" -> hasEnable("hide_slave_wifi_icon") { 50 | it.args[1] = false 51 | } 52 | //隐藏飞行模式 53 | "airplane" -> hasEnable("hide_airplane_icon") { 54 | it.args[1] = false 55 | } 56 | //隐藏闹钟 57 | "alarm_clock" -> hasEnable("hide_alarm_icon") { 58 | it.args[1] = false 59 | } 60 | //隐藏定位 61 | "location" -> hasEnable("hide_gps_icon") { 62 | it.args[1] = false 63 | } 64 | //隐藏热点 65 | "hotspot" -> hasEnable("hide_hotspot_icon") { 66 | it.args[1] = false 67 | } 68 | //隐藏耳机 69 | "headset" -> hasEnable("hide_headset_icon") { 70 | it.args[1] = false 71 | } 72 | //隐藏VPN 73 | "vpn" -> hasEnable("hide_vpn_icon") { 74 | it.args[1] = false 75 | } 76 | //隐藏无SIM卡 77 | "no_sim" -> hasEnable("hide_no_sim_icon") { 78 | it.args[1] = false 79 | } 80 | //隐藏NFC图标 81 | "nfc" -> hasEnable("hide_nfc_icon") { 82 | it.args[1] = false 83 | } 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideStatusBarNetworkSpeedSecondForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object HideStatusBarNetworkSpeedSecondForS : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") { 12 | name == "setNetworkSpeed" && parameterCount == 1 13 | }.hookBefore { 14 | hasEnable("hide_status_bar_network_speed_second") { 15 | if (it.args[0] != null) { 16 | val mText = (it.args[0] as String) 17 | .replace("/", "") 18 | .replace("s", "") 19 | .replace("\'", "") 20 | .replace("วิ", "") 21 | it.args[0] = mText 22 | } 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/HideWifiActivityIconForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.findMethod 7 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 8 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 9 | import com.lt2333.simplicitytools.utils.hasEnable 10 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 11 | import de.robv.android.xposed.XC_MethodHook 12 | 13 | object HideWifiActivityIconForS : HookRegister() { 14 | 15 | override fun init() { 16 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 17 | name == "initViewState" && parameterCount == 1 18 | }.hookAfter { 19 | hide(it) 20 | } 21 | 22 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 23 | name == "updateState" && parameterCount == 1 24 | }.hookAfter { 25 | hide(it) 26 | } 27 | } 28 | 29 | private fun hide(it: XC_MethodHook.MethodHookParam) { 30 | //隐藏WIFI箭头 31 | hasEnable("hide_wifi_activity_icon") { 32 | (it.thisObject.getObjectAs("mWifiActivityView")).visibility = 33 | View.INVISIBLE 34 | } 35 | //隐藏WIFI标准图标 36 | hasEnable("hide_wifi_standard_icon") { 37 | (it.thisObject.getObjectAs("mWifiStandardView")).visibility = 38 | View.INVISIBLE 39 | } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/LockScreenClockDisplaySecondsForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | import android.os.Handler 6 | import android.provider.Settings 7 | import android.util.Log 8 | import android.widget.LinearLayout 9 | import android.widget.TextView 10 | import com.github.kyuubiran.ezxhelper.utils.* 11 | import com.lt2333.simplicitytools.utils.hasEnable 12 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 13 | import de.robv.android.xposed.XC_MethodHook 14 | import java.lang.reflect.Method 15 | import java.text.SimpleDateFormat 16 | import java.util.* 17 | 18 | object LockScreenClockDisplaySecondsForS : HookRegister() { 19 | 20 | private var nowTime: Date = Calendar.getInstance().time 21 | 22 | override fun init() = hasEnable("lock_screen_clock_display_seconds") { 23 | findConstructor("com.miui.clock.MiuiBaseClock") { 24 | paramCount == 2 25 | }.hookAfter { 26 | try { 27 | val viewGroup = it.thisObject as LinearLayout 28 | val d: Method = viewGroup.javaClass.getDeclaredMethod("updateTime") 29 | val r = Runnable { 30 | d.isAccessible = true 31 | d.invoke(viewGroup) 32 | } 33 | 34 | class T : TimerTask() { 35 | override fun run() { 36 | Handler(viewGroup.context.mainLooper).post(r) 37 | } 38 | } 39 | Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000) 40 | } catch (_: Exception) { 41 | } 42 | } 43 | 44 | findMethod("com.miui.clock.MiuiLeftTopClock") { 45 | name == "updateTime" 46 | }.hookAfter { updateTime(it, false) } 47 | 48 | findMethod("com.miui.clock.MiuiCenterHorizontalClock") { 49 | name == "updateTime" 50 | }.hookAfter { updateTime(it, false) } 51 | 52 | findMethod("com.miui.clock.MiuiLeftTopLargeClock") { 53 | name == "updateTime" 54 | }.hookAfter { updateTime(it, false) } 55 | 56 | findMethod("com.miui.clock.MiuiVerticalClock") { 57 | name == "updateTime" 58 | }.hookAfter { updateTime(it, true) } 59 | } 60 | 61 | private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) { 62 | val textV = it.thisObject.getObjectAs("mTimeText") 63 | val c: Context = textV.context 64 | 65 | Log.d("lock_screen_clock_display_seconds", "updateTime: ${it.thisObject.javaClass.simpleName}") 66 | val is24 = Settings.System.getString(c.contentResolver, Settings.System.TIME_12_24) == "24" 67 | 68 | nowTime = Calendar.getInstance().time 69 | 70 | textV.text = getTime(is24, isVertical) 71 | 72 | } 73 | 74 | 75 | @SuppressLint("SimpleDateFormat") 76 | private fun getTime(is24: Boolean, isVertical: Boolean): String { 77 | var timePattern = "" 78 | timePattern += if (isVertical) { //垂直 79 | if (is24) "HH\nmm\nss" else "hh\nmm\nss" 80 | } else { //水平 81 | if (is24) "HH:mm:ss" else "h:mm:ss" 82 | } 83 | timePattern = SimpleDateFormat(timePattern).format(nowTime) 84 | return timePattern 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/LockScreenCurrentForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | 4 | import android.app.AndroidAppHelper 5 | import android.content.Context 6 | import android.os.BatteryManager 7 | import android.widget.TextView 8 | import com.github.kyuubiran.ezxhelper.init.InitFields 9 | import com.github.kyuubiran.ezxhelper.utils.findMethod 10 | import com.github.kyuubiran.ezxhelper.utils.getObject 11 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 12 | import com.lt2333.simplicitytools.R 13 | import com.lt2333.simplicitytools.utils.hasEnable 14 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 15 | import java.io.BufferedReader 16 | import java.io.FileReader 17 | import kotlin.math.abs 18 | 19 | object LockScreenCurrentForS : HookRegister() { 20 | 21 | override fun init() = hasEnable("lock_screen_charging_current") { 22 | findMethod("com.android.keyguard.charge.ChargeUtils") { 23 | name == "getChargingHintText" && parameterCount == 3 24 | }.hookAfter { 25 | it.result = "${getCurrent()}\n${it.result}" 26 | } 27 | 28 | findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { 29 | name == "onFinishInflate" 30 | }.hookAfter { 31 | (it.thisObject.getObject("mIndicationText") as TextView).isSingleLine = false 32 | } 33 | } 34 | 35 | 36 | 37 | private fun getCurrent(): String { 38 | val batteryManager = AndroidAppHelper.currentApplication().getSystemService(Context.BATTERY_SERVICE) as BatteryManager 39 | val current = abs(batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW) / 1000) 40 | return "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA" 41 | } 42 | 43 | /** 44 | * 获取平均电流值 45 | * 获取 filePath 文件 totalCount 次数的平均值,每次采样间隔 intervalMs 时间 46 | */ 47 | private fun getMeanCurrentVal(filePath: String, totalCount: Int, intervalMs: Int): Float { 48 | var meanVal = 0.0f 49 | if (totalCount <= 0) { 50 | return 0.0f 51 | } 52 | for (i in 0 until totalCount) { 53 | try { 54 | val f: Float = readFile(filePath, 0).toFloat() 55 | meanVal += f / totalCount 56 | } catch (e: Exception) { 57 | e.printStackTrace() 58 | } 59 | if (intervalMs <= 0) { 60 | continue 61 | } 62 | try { 63 | Thread.sleep(intervalMs.toLong()) 64 | } catch (e: Exception) { 65 | e.printStackTrace() 66 | } 67 | } 68 | return meanVal 69 | } 70 | 71 | private fun readFile(path: String, defaultValue: Int): Int { 72 | try { 73 | val bufferedReader = BufferedReader(FileReader(path)) 74 | val i: Int = bufferedReader.readLine().toInt(10) 75 | bufferedReader.close() 76 | return i 77 | } catch (_: java.lang.Exception) { 78 | } 79 | return defaultValue 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/MaximumNumberOfNotificationIconsForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookReplace 5 | import com.github.kyuubiran.ezxhelper.utils.invokeMethod 6 | import com.github.kyuubiran.ezxhelper.utils.putObject 7 | import com.lt2333.simplicitytools.utils.XSPUtils 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object MaximumNumberOfNotificationIconsForS : HookRegister() { 11 | 12 | override fun init() { 13 | val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3) 14 | val dots = XSPUtils.getInt("maximum_number_of_notification_dots", 3) 15 | findMethod("com.android.systemui.statusbar.phone.NotificationIconContainer") { 16 | name == "miuiShowNotificationIcons" && parameterCount == 1 17 | }.hookReplace { 18 | if (it.args[0] as Boolean) { 19 | it.thisObject.putObject("MAX_DOTS", dots) 20 | it.thisObject.putObject("MAX_STATIC_ICONS", icons) 21 | it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", icons) 22 | } else { 23 | it.thisObject.putObject("MAX_DOTS", 0) 24 | it.thisObject.putObject("MAX_STATIC_ICONS", 0) 25 | it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", 0) 26 | } 27 | it.thisObject.invokeMethod("updateState") 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/NewNotificationWeatherForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.pm.ApplicationInfo 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.* 7 | import com.lt2333.simplicitytools.utils.XSPUtils 8 | import com.lt2333.simplicitytools.utils.hasEnable 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | import com.lt2333.simplicitytools.views.WeatherData 11 | 12 | 13 | @SuppressLint("StaticFieldLeak") 14 | object NewNotificationWeatherForS : HookRegister() { 15 | lateinit var weather: WeatherData 16 | var clockId: Int = -2 17 | 18 | @SuppressLint("DiscouragedApi", "ClickableViewAccessibility") 19 | override fun init() = hasEnable("control_center_weather") { 20 | val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) 21 | findMethod("com.android.systemui.controlcenter.phone.widget.ControlCenterDateView", findSuper = true) { name == "onDetachedFromWindow" }.hookBefore { 22 | if ((it.thisObject as TextView).id == clockId && this::weather.isInitialized) { 23 | weather.onDetachedFromWindow() 24 | } 25 | } 26 | findMethod("com.android.systemui.controlcenter.phone.widget.ControlCenterDateView", findSuper = true) { name == "setText" }.hookBefore { 27 | val time = it.args[0]?.toString() 28 | val view = it.thisObject as TextView 29 | if (view.id == clockId && time != null && this::weather.isInitialized) { 30 | // val layout = view.layoutParams as ViewGroup.MarginLayoutParams 31 | // val y = view.height / 2 32 | // layout.topMargin = -y 33 | it.args[0] = "${weather.weatherData}$time" 34 | } 35 | } 36 | 37 | findMethod("com.android.systemui.shared.plugins.PluginManagerImpl") { name == "getClassLoader" }.hookAfter { getClassLoader -> 38 | val appInfo = getClassLoader.args[0] as ApplicationInfo 39 | val classLoader = getClassLoader.result as ClassLoader 40 | if (appInfo.packageName == "miui.systemui.plugin") { 41 | findMethod("miui.systemui.controlcenter.windowview.MainPanelHeaderController", classLoader = classLoader) { name == "addClockViews" }.hookAfter { 42 | val dateView = it.thisObject.getObjectAs("dateView") 43 | clockId = dateView.id 44 | weather = WeatherData(dateView.context, isDisplayCity) 45 | weather.callBacks = { 46 | dateView.invokeMethod("updateTime") 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/OldQSCustomForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.content.res.Configuration 4 | import android.view.ViewGroup 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 7 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 8 | import com.github.kyuubiran.ezxhelper.utils.putObject 9 | import com.lt2333.simplicitytools.utils.XSPUtils 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | 13 | object OldQSCustomForS : HookRegister() { 14 | 15 | override fun init() = hasEnable("old_qs_custom_switch") { 16 | val mRows = XSPUtils.getInt("qs_custom_rows", 3) 17 | val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2) 18 | val mColumns = XSPUtils.getInt("qs_custom_columns", 4) 19 | val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5) 20 | 21 | findMethod("com.android.systemui.qs.MiuiQuickQSPanel") { 22 | name == "setMaxTiles" && parameterCount == 1 23 | }.hookBefore { 24 | //未展开时的列数 25 | it.args[0] = mColumnsUnexpanded 26 | } 27 | 28 | findMethod("com.android.systemui.qs.MiuiTileLayout") { 29 | name == "updateColumns" 30 | }.hookAfter { 31 | //展开时的列数 32 | it.thisObject.putObject("mColumns", mColumns) 33 | } 34 | 35 | findMethod("com.android.systemui.qs.MiuiTileLayout") { 36 | name == "updateResources" 37 | }.hookAfter { 38 | //展开时的行数 39 | val viewGroup = it.thisObject as ViewGroup 40 | val mConfiguration: Configuration = viewGroup.context.resources.configuration 41 | if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) { 42 | viewGroup.putObject("mMaxAllowedRows", mRows) 43 | } else { 44 | viewGroup.putObject("mMaxAllowedRows", mRowsHorizontal) 45 | } 46 | viewGroup.requestLayout() 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/RemoveLockScreenCameraForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.view.View 4 | import android.widget.LinearLayout 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObject 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 9 | import com.lt2333.simplicitytools.utils.hasEnable 10 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 11 | 12 | object RemoveLockScreenCameraForS : HookRegister() { 13 | 14 | override fun init() { 15 | //屏蔽右下角组件显示 16 | findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { 17 | name == "onFinishInflate" 18 | }.hookAfter { 19 | hasEnable("remove_lock_screen_camera") { 20 | (it.thisObject.getObject("mRightAffordanceViewLayout") as LinearLayout).visibility = 21 | View.GONE 22 | } 23 | } 24 | 25 | //屏蔽滑动撞墙动画 26 | findMethod("com.android.keyguard.KeyguardMoveRightController") { 27 | name == "onTouchMove" && parameterCount == 2 28 | }.hookBefore { 29 | hasEnable("remove_lock_screen_camera") { 30 | it.result = false 31 | } 32 | } 33 | findMethod("com.android.keyguard.KeyguardMoveRightController") { 34 | name == "reset" 35 | }.hookBefore { 36 | hasEnable("remove_lock_screen_camera") { 37 | it.result = null 38 | } 39 | } 40 | } 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/RemoveTheLeftSideOfTheLockScreenForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object RemoveTheLeftSideOfTheLockScreenForS : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") { 12 | name == "inflateLeftView" 13 | }.hookBefore { 14 | hasEnable("remove_the_left_side_of_the_lock_screen") { 15 | it.result = null 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/ShowWifiStandardForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 5 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 6 | import com.github.kyuubiran.ezxhelper.utils.putObject 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object ShowWifiStandardForS : HookRegister() { 11 | 12 | override fun init() { 13 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 14 | name == "initViewState" && parameterCount == 1 15 | }.hookBefore { 16 | hasEnable("show_wifi_standard") { 17 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") { 18 | name == "copyTo" && parameterCount == 1 19 | }.hookBefore { 20 | val wifiStandard = it.thisObject.getObjectAs("wifiStandard") 21 | it.thisObject.putObject("showWifiStandard", wifiStandard != 0) 22 | } 23 | } 24 | } 25 | 26 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 27 | name == "updateState" && parameterCount == 1 28 | }.hookBefore { 29 | hasEnable("show_wifi_standard") { 30 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") { 31 | name == "copyTo" && parameterCount == 1 32 | }.hookBefore { 33 | val wifiStandard = it.thisObject.getObjectAs("wifiStandard") 34 | it.thisObject.putObject("showWifiStandard", wifiStandard != 0) 35 | } 36 | } 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/StatusBarDoubleTapToSleepForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import android.content.Context 4 | import android.os.SystemClock 5 | import android.view.MotionEvent 6 | import android.view.View.OnTouchListener 7 | import android.view.ViewGroup 8 | import com.github.kyuubiran.ezxhelper.utils.findMethod 9 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | import de.robv.android.xposed.XposedHelpers 13 | import kotlin.math.abs 14 | 15 | object StatusBarDoubleTapToSleepForS : HookRegister() { 16 | 17 | override fun init() = hasEnable("status_bar_double_tap_to_sleep") { 18 | findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") { 19 | name == "onFinishInflate" 20 | }.hookBefore { 21 | val view = it.thisObject as ViewGroup 22 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L) 23 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f) 24 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", 0f) 25 | view.setOnTouchListener(OnTouchListener { v, event -> 26 | if (event.action != MotionEvent.ACTION_DOWN) return@OnTouchListener false 27 | var currentTouchTime = 28 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchTime") as Long 29 | var currentTouchX = 30 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchX") as Float 31 | var currentTouchY = 32 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchY") as Float 33 | val lastTouchTime = currentTouchTime 34 | val lastTouchX = currentTouchX 35 | val lastTouchY = currentTouchY 36 | currentTouchTime = System.currentTimeMillis() 37 | currentTouchX = event.x 38 | currentTouchY = event.y 39 | if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs( 40 | currentTouchY - lastTouchY 41 | ) < 100f 42 | ) { 43 | XposedHelpers.callMethod( 44 | v.context.getSystemService(Context.POWER_SERVICE), 45 | "goToSleep", 46 | SystemClock.uptimeMillis() 47 | ) 48 | currentTouchTime = 0L 49 | currentTouchX = 0f 50 | currentTouchY = 0f 51 | } 52 | XposedHelpers.setAdditionalInstanceField( 53 | view, 54 | "currentTouchTime", 55 | currentTouchTime 56 | ) 57 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX) 58 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY) 59 | v.performClick() 60 | false 61 | }) 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/StatusBarNetworkSpeedRefreshSpeedForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object StatusBarNetworkSpeedRefreshSpeedForS : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") { 12 | name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java 13 | }.hookBefore { 14 | hasEnable("status_bar_network_speed_refresh_speed") { 15 | it.args[0] = 1000L 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/s/systemui/WaveChargeForS.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.s.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.github.kyuubiran.ezxhelper.utils.putObject 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object WaveChargeForS: HookRegister() { 10 | 11 | override fun init() { 12 | hasEnable("enable_wave_charge_animation") { 13 | findMethod("com.android.keyguard.charge.ChargeUtils") { 14 | name == "supportWaveChargeAnimation" 15 | }.hookAfter { 16 | val ex = Throwable() 17 | val stackElement = ex.stackTrace 18 | var mResult = false 19 | val classTrue = setOf( 20 | "com.android.keyguard.charge.ChargeUtils", 21 | "com.android.keyguard.charge.container.MiuiChargeContainerView" 22 | ) 23 | for (i in stackElement.indices) { 24 | when (stackElement[i].className) { 25 | in classTrue -> { 26 | mResult = true 27 | break 28 | } 29 | } 30 | } 31 | it.result = mResult 32 | } 33 | findMethod("com.android.keyguard.charge.wave.WaveView") { 34 | name == "updateWaveHeight" 35 | }.hookAfter { 36 | it.thisObject.putObject("mWaveXOffset", 0) 37 | } 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/android/MaxWallpaperScaleForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.android 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorAfter 4 | import com.github.kyuubiran.ezxhelper.utils.putObject 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object MaxWallpaperScaleForT : HookRegister() { 9 | override fun init() { 10 | hookAllConstructorAfter("com.android.server.wm.WallpaperController") { 11 | val value = XSPUtils.getFloat("max_wallpaper_scale", 1.2f) 12 | it.thisObject.putObject("mMaxWallpaperScale", value) 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/android/SystemPropertiesHookForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.android 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object SystemPropertiesHookForT : HookRegister() { 9 | override fun init() { 10 | val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false) 11 | val mediaSteps = XSPUtils.getInt("media_volume_steps", 15) 12 | 13 | findMethod("android.os.SystemProperties") { 14 | name == "getInt" && returnType == Int::class.java 15 | }.hookBefore { 16 | when (it.args[0] as String) { 17 | "ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps 18 | } 19 | } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/mediaeditor/UnlockUnlimitedCroppingForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.mediaeditor 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object UnlockUnlimitedCroppingForT : HookRegister() { 10 | 11 | override fun init() { 12 | val resizeDetectorClass = loadClassOrNull("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector") 13 | if (resizeDetectorClass != null) { 14 | findMethod("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector") { 15 | name == "calculateMinSize" 16 | }.hookBefore { 17 | hasEnable("unlock_unlimited_cropping") { 18 | it.result = 0 19 | } 20 | } 21 | } else { 22 | var resizeDetector = 'a' 23 | for (i in 0..25) { 24 | try { 25 | findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$${resizeDetector}") { 26 | returnType == Int::class.javaPrimitiveType && parameterCount == 0 27 | }.hookBefore { 28 | hasEnable("unlock_unlimited_cropping") { 29 | it.result = 0 30 | } 31 | } 32 | } catch (t: Throwable) { 33 | resizeDetector++ 34 | } 35 | } 36 | } 37 | val resizeDetectorClass1 = loadClassOrNull("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector") 38 | if (resizeDetectorClass1 != null) { 39 | findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector") { 40 | name == "calculateMinSize" 41 | }.hookBefore { 42 | hasEnable("unlock_unlimited_cropping") { 43 | it.result = 0 44 | } 45 | } 46 | } else { 47 | var resizeDetector1 = 'a' 48 | for (i in 0..25) { 49 | try { 50 | findMethod("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$${resizeDetector1}") { 51 | returnType == Int::class.javaPrimitiveType && parameterCount == 0 52 | }.hookBefore { 53 | hasEnable("unlock_unlimited_cropping") { 54 | it.result = 0 55 | } 56 | } 57 | } catch (_: Throwable) { 58 | resizeDetector1++ 59 | } 60 | } 61 | } 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/BatteryPercentageForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.util.TypedValue 4 | import android.widget.TextView 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.lt2333.simplicitytools.utils.XSPUtils 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | 11 | object BatteryPercentageForT : HookRegister() { 12 | 13 | override fun init() { 14 | val size = XSPUtils.getFloat("battery_percentage_font_size", 0f) 15 | if (size == 0f) return 16 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 17 | name == "updateResources" 18 | }.hookAfter { 19 | (it.thisObject.getObjectAs("mBatteryPercentView")).setTextSize( 20 | TypedValue.COMPLEX_UNIT_DIP, size 21 | ) 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/CanNotificationSlideForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object CanNotificationSlideForT: HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") { 12 | name == "canSlide" 13 | }.hookAfter { 14 | hasEnable("can_notification_slide") { 15 | it.result = true 16 | } 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/CustomMobileTypeTextForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.lt2333.simplicitytools.utils.XSPUtils 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object CustomMobileTypeTextForT : HookRegister() { 10 | 11 | override fun init() = hasEnable("custom_mobile_type_text_switch") { 12 | findMethod("com.android.systemui.statusbar.connectivity.MobileSignalController") { 13 | name == "getMobileTypeName" && parameterTypes[0] == Int::class.java 14 | }.hookAfter { 15 | it.result = XSPUtils.getString("custom_mobile_type_text", "5G") 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/DisableBluetoothTemporarilyOffForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object DisableBluetoothTemporarilyOffForT: HookRegister() { 9 | override fun init()= hasEnable("disable_bluetooth_temporarily_off") { 10 | findMethod("com.android.settingslib.bluetooth.LocalBluetoothAdapter"){ 11 | name == "isSupportBluetoothRestrict" && parameterCount==1 12 | }.hookBefore { 13 | it.result = false 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideBatteryIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.FrameLayout 5 | import android.widget.ImageView 6 | import android.widget.TextView 7 | import com.github.kyuubiran.ezxhelper.utils.findMethod 8 | import com.github.kyuubiran.ezxhelper.utils.getObject 9 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 10 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 11 | import com.lt2333.simplicitytools.utils.hasEnable 12 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 13 | 14 | object HideBatteryIconForT : HookRegister() { 15 | 16 | override fun init() { 17 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 18 | name == "updateResources" 19 | }.hookAfter { 20 | //隐藏电池图标 21 | hasEnable("hide_battery_icon") { 22 | (it.thisObject.getObjectAs("mBatteryIconView")).visibility = View.GONE 23 | if (it.thisObject.getObject("mBatteryStyle") == 1) { 24 | (it.thisObject.getObjectAs("mBatteryDigitalView")).visibility = 25 | View.GONE 26 | } 27 | } 28 | //隐藏电池内的百分比 29 | hasEnable("hide_battery_percentage_icon") { 30 | (it.thisObject.getObjectAs("mBatteryPercentMarkView")).textSize = 0F 31 | } 32 | //隐藏电池百分号 33 | hasEnable("hide_battery_percentage_icon") { 34 | (it.thisObject.getObjectAs("mBatteryPercentMarkView")).textSize = 0F 35 | } 36 | } 37 | 38 | findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { 39 | name == "updateChargeAndText" 40 | }.hookAfter { 41 | //隐藏电池充电图标 42 | hasEnable("hide_battery_charging_icon") { 43 | (it.thisObject.getObjectAs("mBatteryChargingInView")).visibility = 44 | View.GONE 45 | (it.thisObject.getObjectAs("mBatteryChargingView")).visibility = 46 | View.GONE 47 | } 48 | } 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideHDIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import com.github.kyuubiran.ezxhelper.utils.* 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | import de.robv.android.xposed.XC_MethodHook 9 | 10 | object HideHDIconForT : HookRegister() { 11 | 12 | override fun init() { 13 | 14 | 15 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 16 | name == "initViewState" && parameterCount == 1 17 | }.hookAfter { 18 | hide(it) 19 | } 20 | 21 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 22 | name == "updateState" && parameterCount == 1 23 | }.hookAfter { 24 | hide(it) 25 | } 26 | hasEnable("hide_new_hd_icon") { 27 | findMethod("com.android.systemui.statusbar.policy.HDController") { name == "update" }.hookBefore { 28 | it.result = null 29 | } 30 | } 31 | } 32 | 33 | private fun hide(it: XC_MethodHook.MethodHookParam) { 34 | hasEnable("hide_big_hd_icon") { 35 | (it.thisObject.getObjectAs("mVolte")).visibility = View.GONE 36 | } 37 | hasEnable("hide_small_hd_icon") { 38 | (it.thisObject.getObjectAs("mSmallHd")).visibility = View.GONE 39 | } 40 | hasEnable("hide_hd_no_service_icon") { 41 | (it.thisObject.getObjectAs("mVolteNoService")).visibility = View.GONE 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideMobileActivityIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.lt2333.simplicitytools.utils.hasEnable 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | import de.robv.android.xposed.XC_MethodHook 11 | 12 | object HideMobileActivityIconForT : HookRegister() { 13 | 14 | override fun init() { 15 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 16 | name == "initViewState" && parameterCount == 1 17 | }.hookAfter { 18 | hide(it) 19 | } 20 | 21 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 22 | name == "updateState" && parameterCount == 1 23 | }.hookAfter { 24 | hide(it) 25 | } 26 | } 27 | 28 | private fun hide(it: XC_MethodHook.MethodHookParam) { 29 | hasEnable("hide_mobile_activity_icon") { 30 | (it.thisObject.getObjectAs("mLeftInOut")).visibility = View.GONE 31 | (it.thisObject.getObjectAs("mRightInOut")).visibility = View.GONE 32 | } 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideMobileTypeIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.findMethod 7 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 8 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 9 | import com.lt2333.simplicitytools.utils.XSPUtils 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | import de.robv.android.xposed.XC_MethodHook 13 | 14 | object HideMobileTypeIconForT : HookRegister() { 15 | 16 | private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false) 17 | 18 | override fun init() { 19 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 20 | name == "initViewState" && parameterCount == 1 21 | }.hookAfter { 22 | hideMobileTypeIcon(it) 23 | } 24 | 25 | findMethod("com.android.systemui.statusbar.StatusBarMobileView") { 26 | name == "updateState" && parameterCount == 1 27 | }.hookAfter { 28 | hideMobileTypeIcon(it) 29 | } 30 | } 31 | 32 | private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) { 33 | hasEnable("hide_mobile_type_icon") { 34 | if (isBigType) { 35 | (it.thisObject.getObjectAs("mMobileType")).visibility = 36 | View.GONE 37 | (it.thisObject.getObjectAs("mMobileTypeImage")).visibility = 38 | View.GONE 39 | (it.thisObject.getObjectAs("mMobileTypeSingle")).visibility = 40 | View.GONE 41 | } else { 42 | (it.thisObject.getObjectAs("mMobileType")).visibility = 43 | View.INVISIBLE 44 | (it.thisObject.getObjectAs("mMobileTypeImage")).visibility = 45 | View.INVISIBLE 46 | (it.thisObject.getObjectAs("mMobileTypeSingle")).visibility = 47 | View.INVISIBLE 48 | } 49 | } 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideNetworkSpeedSplitterForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.widget.TextView 4 | import com.github.kyuubiran.ezxhelper.utils.findMethod 5 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object HideNetworkSpeedSplitterForT : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") { 13 | name == "init" 14 | }.hookAfter { 15 | hasEnable("hide_network_speed_splitter") { 16 | val textView = it.thisObject as TextView 17 | textView.text = " " 18 | } 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideSimIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object HideSimIconForT : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") { 12 | name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java 13 | }.hookBefore { 14 | val list = it.args[0] as MutableList<*> 15 | val size = list.size 16 | hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) { 17 | list.removeAt(1) 18 | } 19 | hasEnable("hide_sim_one_icon", extraCondition = { size >= 1 }) { 20 | list.removeAt(0) 21 | } 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideStatusBarIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | import de.robv.android.xposed.XC_MethodHook 8 | 9 | object HideStatusBarIconForT : HookRegister() { 10 | 11 | override fun init() { 12 | findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") { 13 | name == "setIconVisibility" && parameterCount == 2 14 | }.hookBefore { 15 | hideIcon(it) 16 | } 17 | 18 | findMethod("com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl") { 19 | name == "setIconVisibility" && parameterCount == 2 20 | }.hookBefore { 21 | hideIcon(it) 22 | } 23 | } 24 | 25 | private fun hideIcon(it: XC_MethodHook.MethodHookParam) { 26 | //Log.d("图标名字", "handleLoadPackage: " + it.args[0]) 27 | when (it.args[0] as String) { 28 | //隐藏蓝牙 29 | "bluetooth" -> hasEnable("hide_bluetooth_icon") { 30 | it.args[1] = false 31 | } 32 | //隐藏蓝牙电量 33 | "bluetooth_handsfree_battery" -> hasEnable("hide_bluetooth_battery_icon") { 34 | it.args[1] = false 35 | } 36 | //隐藏勿扰 37 | "zen" -> hasEnable("hide_zen_icon") { 38 | it.args[1] = false 39 | } 40 | //隐藏声音 41 | "volume" -> hasEnable("hide_volume_icon") { 42 | it.args[1] = false 43 | } 44 | //隐藏WIFI 45 | "wifi" -> hasEnable("hide_wifi_icon") { 46 | it.args[1] = false 47 | } 48 | //隐藏WIFI辅助 49 | "slave_wifi" -> hasEnable("hide_slave_wifi_icon") { 50 | it.args[1] = false 51 | } 52 | //隐藏飞行模式 53 | "airplane" -> hasEnable("hide_airplane_icon") { 54 | it.args[1] = false 55 | } 56 | //隐藏闹钟 57 | "alarm_clock" -> hasEnable("hide_alarm_icon") { 58 | it.args[1] = false 59 | } 60 | //隐藏定位 61 | "location" -> hasEnable("hide_gps_icon") { 62 | it.args[1] = false 63 | } 64 | //隐藏热点 65 | "hotspot" -> hasEnable("hide_hotspot_icon") { 66 | it.args[1] = false 67 | } 68 | //隐藏耳机 69 | "headset" -> hasEnable("hide_headset_icon") { 70 | it.args[1] = false 71 | } 72 | //隐藏VPN 73 | "vpn" -> hasEnable("hide_vpn_icon") { 74 | it.args[1] = false 75 | } 76 | //隐藏无SIM卡 77 | "no_sim" -> hasEnable("hide_no_sim_icon") { 78 | it.args[1] = false 79 | } 80 | //隐藏NFC图标 81 | "nfc" -> hasEnable("hide_nfc_icon") { 82 | it.args[1] = false 83 | } 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideStatusBarNetworkSpeedSecondForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object HideStatusBarNetworkSpeedSecondForT : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") { 12 | name == "setNetworkSpeed" && parameterCount == 1 13 | }.hookBefore { 14 | hasEnable("hide_status_bar_network_speed_second") { 15 | if (it.args[0] != null) { 16 | val mText = (it.args[0] as String) 17 | .replace("/", "") 18 | .replace("s", "") 19 | .replace("\'", "") 20 | .replace("วิ", "") 21 | it.args[0] = mText 22 | } 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/HideWifiActivityIconForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.findMethod 7 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 8 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 9 | import com.lt2333.simplicitytools.utils.hasEnable 10 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 11 | import de.robv.android.xposed.XC_MethodHook 12 | 13 | object HideWifiActivityIconForT : HookRegister() { 14 | 15 | override fun init() { 16 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 17 | name == "initViewState" && parameterCount == 1 18 | }.hookAfter { 19 | hide(it) 20 | } 21 | 22 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 23 | name == "updateState" && parameterCount == 1 24 | }.hookAfter { 25 | hide(it) 26 | } 27 | } 28 | 29 | private fun hide(it: XC_MethodHook.MethodHookParam) { 30 | //隐藏WIFI箭头 31 | hasEnable("hide_wifi_activity_icon") { 32 | (it.thisObject.getObjectAs("mWifiActivityView")).visibility = 33 | View.INVISIBLE 34 | } 35 | //隐藏WIFI标准图标 36 | hasEnable("hide_wifi_standard_icon") { 37 | (it.thisObject.getObjectAs("mWifiStandardView")).visibility = 38 | View.INVISIBLE 39 | } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/LockScreenCurrentForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | 4 | import android.app.AndroidAppHelper 5 | import android.content.Context 6 | import android.os.BatteryManager 7 | import android.widget.TextView 8 | import com.github.kyuubiran.ezxhelper.init.InitFields 9 | import com.github.kyuubiran.ezxhelper.utils.findMethod 10 | import com.github.kyuubiran.ezxhelper.utils.getObject 11 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 12 | import com.lt2333.simplicitytools.R 13 | import com.lt2333.simplicitytools.utils.hasEnable 14 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 15 | import java.io.BufferedReader 16 | import java.io.FileReader 17 | import kotlin.math.abs 18 | 19 | object LockScreenCurrentForT : HookRegister() { 20 | 21 | override fun init() = hasEnable("lock_screen_charging_current") { 22 | findMethod("com.android.keyguard.charge.ChargeUtils") { 23 | name == "getChargingHintText" && parameterCount == 3 24 | }.hookAfter { 25 | it.result = "${getCurrent()}\n${it.result}" 26 | } 27 | 28 | findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { 29 | name == "onFinishInflate" 30 | }.hookAfter { 31 | (it.thisObject.getObject("mIndicationText") as TextView).isSingleLine = false 32 | } 33 | } 34 | 35 | 36 | 37 | private fun getCurrent(): String { 38 | val batteryManager = AndroidAppHelper.currentApplication().getSystemService(Context.BATTERY_SERVICE) as BatteryManager 39 | val current = abs(batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW) / 1000) 40 | return "${InitFields.moduleRes.getString(R.string.current_current)} ${current}mA" 41 | } 42 | 43 | /** 44 | * 获取平均电流值 45 | * 获取 filePath 文件 totalCount 次数的平均值,每次采样间隔 intervalMs 时间 46 | */ 47 | private fun getMeanCurrentVal(filePath: String, totalCount: Int, intervalMs: Int): Float { 48 | var meanVal = 0.0f 49 | if (totalCount <= 0) { 50 | return 0.0f 51 | } 52 | for (i in 0 until totalCount) { 53 | try { 54 | val f: Float = readFile(filePath, 0).toFloat() 55 | meanVal += f / totalCount 56 | } catch (e: Exception) { 57 | e.printStackTrace() 58 | } 59 | if (intervalMs <= 0) { 60 | continue 61 | } 62 | try { 63 | Thread.sleep(intervalMs.toLong()) 64 | } catch (e: Exception) { 65 | e.printStackTrace() 66 | } 67 | } 68 | return meanVal 69 | } 70 | 71 | private fun readFile(path: String, defaultValue: Int): Int { 72 | try { 73 | val bufferedReader = BufferedReader(FileReader(path)) 74 | val i: Int = bufferedReader.readLine().toInt(10) 75 | bufferedReader.close() 76 | return i 77 | } catch (_: java.lang.Exception) { 78 | } 79 | return defaultValue 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/MaximumNumberOfNotificationIconsForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookReplace 5 | import com.github.kyuubiran.ezxhelper.utils.invokeMethod 6 | import com.github.kyuubiran.ezxhelper.utils.putObject 7 | import com.lt2333.simplicitytools.utils.XSPUtils 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object MaximumNumberOfNotificationIconsForT : HookRegister() { 11 | 12 | override fun init() { 13 | val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3) 14 | val dots = XSPUtils.getInt("maximum_number_of_notification_dots", 3) 15 | findMethod("com.android.systemui.statusbar.phone.NotificationIconContainer") { 16 | name == "miuiShowNotificationIcons" && parameterCount == 1 17 | }.hookReplace { 18 | if (it.args[0] as Boolean) { 19 | it.thisObject.putObject("MAX_DOTS", dots) 20 | it.thisObject.putObject("MAX_STATIC_ICONS", icons) 21 | it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", icons) 22 | } else { 23 | it.thisObject.putObject("MAX_DOTS", 0) 24 | it.thisObject.putObject("MAX_STATIC_ICONS", 0) 25 | it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", 0) 26 | } 27 | it.thisObject.invokeMethod("updateState") 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/NewNotificationWeatherForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.pm.ApplicationInfo 5 | import android.widget.TextView 6 | import com.github.kyuubiran.ezxhelper.utils.* 7 | import com.lt2333.simplicitytools.utils.XSPUtils 8 | import com.lt2333.simplicitytools.utils.hasEnable 9 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 10 | import com.lt2333.simplicitytools.views.WeatherData 11 | 12 | 13 | @SuppressLint("StaticFieldLeak") 14 | object NewNotificationWeatherForT : HookRegister() { 15 | // TODO: Android13控制中心天气不可用 16 | lateinit var weather: WeatherData 17 | var clockId: Int = -2 18 | 19 | @SuppressLint("DiscouragedApi", "ClickableViewAccessibility") 20 | override fun init() = hasEnable("control_center_weather") { 21 | val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) 22 | findMethod("com.android.systemui.controlcenter.phone.widget.ControlCenterDateView", findSuper = true) { name == "onDetachedFromWindow" }.hookBefore { 23 | if ((it.thisObject as TextView).id == clockId && this::weather.isInitialized) { 24 | weather.onDetachedFromWindow() 25 | } 26 | } 27 | findMethod("com.android.systemui.controlcenter.phone.widget.ControlCenterDateView", findSuper = true) { name == "setText" }.hookBefore { 28 | val time = it.args[0]?.toString() 29 | val view = it.thisObject as TextView 30 | if (view.id == clockId && time != null && this::weather.isInitialized) { 31 | // val layout = view.layoutParams as ViewGroup.MarginLayoutParams 32 | // val y = view.height / 2 33 | // layout.topMargin = -y 34 | it.args[0] = "${weather.weatherData}$time" 35 | } 36 | } 37 | 38 | findMethod("com.android.systemui.shared.plugins.PluginManagerImpl") { name == "getClassLoader" }.hookAfter { getClassLoader -> 39 | val appInfo = getClassLoader.args[0] as ApplicationInfo 40 | val classLoader = getClassLoader.result as ClassLoader 41 | if (appInfo.packageName == "miui.systemui.plugin") { 42 | findMethod("miui.systemui.controlcenter.windowview.MainPanelHeaderController", classLoader = classLoader) { name == "addClockViews" }.hookAfter { 43 | val dateView = it.thisObject.getObjectAs("dateView") 44 | clockId = dateView.id 45 | weather = WeatherData(dateView.context, isDisplayCity) 46 | weather.callBacks = { 47 | dateView.invokeMethod("updateTime") 48 | } 49 | } 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/OldQSCustomForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.content.res.Configuration 4 | import android.view.ViewGroup 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 7 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 8 | import com.github.kyuubiran.ezxhelper.utils.putObject 9 | import com.lt2333.simplicitytools.utils.XSPUtils 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | 13 | object OldQSCustomForT : HookRegister() { 14 | 15 | override fun init() = hasEnable("old_qs_custom_switch") { 16 | val mRows = XSPUtils.getInt("qs_custom_rows", 3) 17 | val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2) 18 | val mColumns = XSPUtils.getInt("qs_custom_columns", 4) 19 | val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5) 20 | 21 | findMethod("com.android.systemui.qs.MiuiQuickQSPanel") { 22 | name == "setMaxTiles" && parameterCount == 1 23 | }.hookBefore { 24 | //未展开时的列数 25 | it.args[0] = mColumnsUnexpanded 26 | } 27 | 28 | findMethod("com.android.systemui.qs.MiuiTileLayout") { 29 | name == "updateColumns" 30 | }.hookAfter { 31 | //展开时的列数 32 | it.thisObject.putObject("mColumns", mColumns) 33 | } 34 | 35 | findMethod("com.android.systemui.qs.MiuiTileLayout") { 36 | name == "updateResources" 37 | }.hookAfter { 38 | //展开时的行数 39 | val viewGroup = it.thisObject as ViewGroup 40 | val mConfiguration: Configuration = viewGroup.context.resources.configuration 41 | if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) { 42 | viewGroup.putObject("mMaxAllowedRows", mRows) 43 | } else { 44 | viewGroup.putObject("mMaxAllowedRows", mRowsHorizontal) 45 | } 46 | viewGroup.requestLayout() 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/RemoveLockScreenCameraForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.view.View 4 | import android.widget.LinearLayout 5 | import com.github.kyuubiran.ezxhelper.utils.findMethod 6 | import com.github.kyuubiran.ezxhelper.utils.getObject 7 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 8 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 9 | import com.lt2333.simplicitytools.utils.hasEnable 10 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 11 | 12 | object RemoveLockScreenCameraForT : HookRegister() { 13 | 14 | override fun init() { 15 | //屏蔽右下角组件显示 16 | findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { 17 | name == "onFinishInflate" 18 | }.hookAfter { 19 | hasEnable("remove_lock_screen_camera") { 20 | (it.thisObject.getObject("mRightAffordanceViewLayout") as LinearLayout).visibility = 21 | View.GONE 22 | } 23 | } 24 | 25 | //屏蔽滑动撞墙动画 26 | findMethod("com.android.keyguard.KeyguardMoveRightController") { 27 | name == "onTouchMove" && parameterCount == 2 28 | }.hookBefore { 29 | hasEnable("remove_lock_screen_camera") { 30 | it.result = false 31 | } 32 | } 33 | findMethod("com.android.keyguard.KeyguardMoveRightController") { 34 | name == "reset" 35 | }.hookBefore { 36 | hasEnable("remove_lock_screen_camera") { 37 | it.result = null 38 | } 39 | } 40 | } 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/RemoveTheLeftSideOfTheLockScreenForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object RemoveTheLeftSideOfTheLockScreenForT : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") { 12 | name == "inflateLeftView" 13 | }.hookBefore { 14 | hasEnable("remove_the_left_side_of_the_lock_screen") { 15 | it.result = null 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/ShowWifiStandardForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.getObjectAs 5 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 6 | import com.github.kyuubiran.ezxhelper.utils.putObject 7 | import com.lt2333.simplicitytools.utils.hasEnable 8 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 9 | 10 | object ShowWifiStandardForT : HookRegister() { 11 | 12 | override fun init() { 13 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 14 | name == "initViewState" && parameterCount == 1 15 | }.hookBefore { 16 | hasEnable("show_wifi_standard") { 17 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") { 18 | name == "copyTo" && parameterCount == 1 19 | }.hookBefore { 20 | val wifiStandard = it.thisObject.getObjectAs("wifiStandard") 21 | it.thisObject.putObject("showWifiStandard", wifiStandard != 0) 22 | } 23 | } 24 | } 25 | 26 | findMethod("com.android.systemui.statusbar.StatusBarWifiView") { 27 | name == "updateState" && parameterCount == 1 28 | }.hookBefore { 29 | hasEnable("show_wifi_standard") { 30 | findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") { 31 | name == "copyTo" && parameterCount == 1 32 | }.hookBefore { 33 | val wifiStandard = it.thisObject.getObjectAs("wifiStandard") 34 | it.thisObject.putObject("showWifiStandard", wifiStandard != 0) 35 | } 36 | } 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/StatusBarDoubleTapToSleepForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import android.content.Context 4 | import android.os.SystemClock 5 | import android.view.MotionEvent 6 | import android.view.View.OnTouchListener 7 | import android.view.ViewGroup 8 | import com.github.kyuubiran.ezxhelper.utils.findMethod 9 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 10 | import com.lt2333.simplicitytools.utils.hasEnable 11 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 12 | import de.robv.android.xposed.XposedHelpers 13 | import kotlin.math.abs 14 | 15 | object StatusBarDoubleTapToSleepForT : HookRegister() { 16 | 17 | override fun init() = hasEnable("status_bar_double_tap_to_sleep") { 18 | findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") { 19 | name == "onFinishInflate" 20 | }.hookBefore { 21 | val view = it.thisObject as ViewGroup 22 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L) 23 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f) 24 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", 0f) 25 | view.setOnTouchListener(OnTouchListener { v, event -> 26 | if (event.action != MotionEvent.ACTION_DOWN) return@OnTouchListener false 27 | var currentTouchTime = 28 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchTime") as Long 29 | var currentTouchX = 30 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchX") as Float 31 | var currentTouchY = 32 | XposedHelpers.getAdditionalInstanceField(view, "currentTouchY") as Float 33 | val lastTouchTime = currentTouchTime 34 | val lastTouchX = currentTouchX 35 | val lastTouchY = currentTouchY 36 | currentTouchTime = System.currentTimeMillis() 37 | currentTouchX = event.x 38 | currentTouchY = event.y 39 | if (currentTouchTime - lastTouchTime < 250L && abs(currentTouchX - lastTouchX) < 100f && abs( 40 | currentTouchY - lastTouchY 41 | ) < 100f 42 | ) { 43 | XposedHelpers.callMethod( 44 | v.context.getSystemService(Context.POWER_SERVICE), 45 | "goToSleep", 46 | SystemClock.uptimeMillis() 47 | ) 48 | currentTouchTime = 0L 49 | currentTouchX = 0f 50 | currentTouchY = 0f 51 | } 52 | XposedHelpers.setAdditionalInstanceField( 53 | view, 54 | "currentTouchTime", 55 | currentTouchTime 56 | ) 57 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX) 58 | XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY) 59 | v.performClick() 60 | false 61 | }) 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/StatusBarNetworkSpeedRefreshSpeedForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookBefore 5 | import com.lt2333.simplicitytools.utils.hasEnable 6 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 7 | 8 | object StatusBarNetworkSpeedRefreshSpeedForT : HookRegister() { 9 | 10 | override fun init() { 11 | findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") { 12 | name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java 13 | }.hookBefore { 14 | hasEnable("status_bar_network_speed_refresh_speed") { 15 | it.args[0] = 1000L 16 | } 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/hooks/rules/t/systemui/WaveChargeForT.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.hooks.rules.t.systemui 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.findMethod 4 | import com.github.kyuubiran.ezxhelper.utils.hookAfter 5 | import com.github.kyuubiran.ezxhelper.utils.putObject 6 | import com.lt2333.simplicitytools.utils.hasEnable 7 | import com.lt2333.simplicitytools.utils.xposed.base.HookRegister 8 | 9 | object WaveChargeForT: HookRegister() { 10 | 11 | override fun init() { 12 | hasEnable("enable_wave_charge_animation") { 13 | findMethod("com.android.keyguard.charge.ChargeUtils") { 14 | name == "supportWaveChargeAnimation" 15 | }.hookAfter { 16 | val ex = Throwable() 17 | val stackElement = ex.stackTrace 18 | var mResult = false 19 | val classTrue = setOf( 20 | "com.android.keyguard.charge.ChargeUtils", 21 | "com.android.keyguard.charge.container.MiuiChargeContainerView" 22 | ) 23 | for (i in stackElement.indices) { 24 | when (stackElement[i].className) { 25 | in classTrue -> { 26 | mResult = true 27 | break 28 | } 29 | } 30 | } 31 | it.result = mResult 32 | } 33 | findMethod("com.android.keyguard.charge.wave.WaveView") { 34 | name == "updateWaveHeight" 35 | }.hookAfter { 36 | it.thisObject.putObject("mWaveXOffset", 0) 37 | } 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/tiles/AllowScreenshots.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.tiles 2 | 3 | import android.service.quicksettings.Tile 4 | import android.service.quicksettings.TileService 5 | 6 | class AllowScreenshots : TileService() { 7 | private val key = "disable_flag_secure" 8 | 9 | override fun onClick() { 10 | super.onClick() 11 | try { 12 | val pref = getSharedPreferences("config", MODE_WORLD_READABLE) 13 | val prefEditor = pref.edit() 14 | if (pref.getBoolean(key, false)) { 15 | prefEditor.putBoolean(key, false) 16 | qsTile.state = Tile.STATE_INACTIVE 17 | } else { 18 | prefEditor.putBoolean(key, true) 19 | qsTile.state = Tile.STATE_ACTIVE 20 | } 21 | prefEditor.commit() 22 | qsTile.updateTile() 23 | } catch (e: SecurityException) { 24 | } 25 | } 26 | 27 | override fun onStartListening() { 28 | super.onStartListening() 29 | try { 30 | val pref = getSharedPreferences("config", MODE_WORLD_READABLE) 31 | if (pref.getBoolean(key, false)) { 32 | qsTile.state = Tile.STATE_ACTIVE 33 | } else { 34 | qsTile.state = Tile.STATE_INACTIVE 35 | } 36 | qsTile.updateTile() 37 | } catch (e: SecurityException) { 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/tiles/LockMaxFpsTile.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.tiles 2 | 3 | import android.service.quicksettings.Tile 4 | import android.service.quicksettings.TileService 5 | 6 | class LockMaxFpsTile : TileService() { 7 | 8 | private val key = "lock_max_fps" 9 | 10 | override fun onClick() { 11 | super.onClick() 12 | try { 13 | val pref = getSharedPreferences("config", MODE_WORLD_READABLE) 14 | val prefEditor = pref.edit() 15 | if (pref.getBoolean(key, false)) { 16 | prefEditor.putBoolean(key, false) 17 | qsTile.state = Tile.STATE_INACTIVE 18 | } else { 19 | prefEditor.putBoolean(key, true) 20 | qsTile.state = Tile.STATE_ACTIVE 21 | } 22 | prefEditor.commit() 23 | qsTile.updateTile() 24 | } catch (e: SecurityException) { 25 | } 26 | } 27 | 28 | override fun onStartListening() { 29 | super.onStartListening() 30 | try { 31 | val pref = getSharedPreferences("config", MODE_WORLD_READABLE) 32 | if (pref.getBoolean(key, false)) { 33 | qsTile.state = Tile.STATE_ACTIVE 34 | } else { 35 | qsTile.state = Tile.STATE_INACTIVE 36 | } 37 | qsTile.updateTile() 38 | } catch (e: SecurityException) { 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/SPUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils 2 | import android.annotation.SuppressLint 3 | import android.content.Context 4 | 5 | 6 | object SPUtils { 7 | @SuppressLint("WorldReadableFiles") 8 | fun getBoolean(context: Context, key: String, defValue: Boolean): Boolean { 9 | val pref = context.getSharedPreferences("config",Context.MODE_WORLD_READABLE) 10 | return pref.getBoolean(key, defValue) 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/SystemProperties.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | 6 | object SystemProperties { 7 | @SuppressLint("PrivateApi") 8 | operator fun get(context: Context, key: String?): String { 9 | var ret = "" 10 | try { 11 | val cl = context.classLoader 12 | val systemProperties = cl.loadClass("android.os.SystemProperties") 13 | //参数类型 14 | val paramTypes: Array?> = arrayOfNulls(1) 15 | paramTypes[0] = String::class.java 16 | val get = systemProperties.getMethod("get", *paramTypes) 17 | //参数 18 | val params = arrayOfNulls(1) 19 | params[0] = key 20 | ret = get.invoke(systemProperties, *params) as String 21 | } catch (iAE: IllegalArgumentException) { 22 | throw iAE 23 | } catch (e: Exception) { 24 | ret = "" 25 | } 26 | return ret 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/XSPUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils 2 | 3 | import com.lt2333.simplicitytools.BuildConfig 4 | import de.robv.android.xposed.XSharedPreferences 5 | 6 | object XSPUtils { 7 | private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config") 8 | 9 | fun getBoolean(key: String, defValue: Boolean): Boolean { 10 | if (prefs.hasFileChanged()) { 11 | prefs.reload() 12 | } 13 | return prefs.getBoolean(key, defValue) 14 | } 15 | 16 | fun getInt(key: String, defValue: Int): Int { 17 | if (prefs.hasFileChanged()) { 18 | prefs.reload() 19 | } 20 | return prefs.getInt(key, defValue) 21 | } 22 | 23 | fun getFloat(key: String, defValue: Float): Float { 24 | if (prefs.hasFileChanged()) { 25 | prefs.reload() 26 | } 27 | return prefs.getFloat(key, defValue) 28 | } 29 | 30 | fun getString(key: String, defValue: String): String? { 31 | if (prefs.hasFileChanged()) { 32 | prefs.reload() 33 | } 34 | return prefs.getString(key, defValue) 35 | } 36 | } 37 | 38 | inline fun hasEnable( 39 | key: String, 40 | default: Boolean = false, 41 | noinline extraCondition: (() -> Boolean)? = null, 42 | crossinline block: () -> Unit 43 | ) { 44 | val conditionResult = if (extraCondition != null) extraCondition() else true 45 | if (XSPUtils.getBoolean(key, default) && conditionResult) { 46 | block() 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/xposed/EasyXposedInit.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils.xposed 2 | 3 | import com.github.kyuubiran.ezxhelper.init.EzXHelperInit 4 | import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow 5 | import com.lt2333.simplicitytools.utils.xposed.base.AppRegister 6 | import de.robv.android.xposed.IXposedHookLoadPackage 7 | import de.robv.android.xposed.IXposedHookZygoteInit 8 | import de.robv.android.xposed.callbacks.XC_LoadPackage 9 | 10 | abstract class EasyXposedInit : IXposedHookLoadPackage, IXposedHookZygoteInit { 11 | 12 | private lateinit var packageParam: XC_LoadPackage.LoadPackageParam 13 | abstract val registeredApp: List 14 | private val TAG = "WooBox" 15 | 16 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) { 17 | 18 | packageParam = lpparam!! 19 | registeredApp.forEach { app -> 20 | if (app.packageName == lpparam.packageName) { 21 | EzXHelperInit.apply { 22 | setLogXp(true) 23 | setLogTag(TAG) 24 | setToastTag(TAG) 25 | initHandleLoadPackage(lpparam) 26 | } 27 | runCatching { app.handleLoadPackage(lpparam) }.logexIfThrow("Failed call handleLoadPackage, package: ${app.packageName}") 28 | } 29 | } 30 | } 31 | 32 | override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) { 33 | EzXHelperInit.initZygote(startupParam!!) 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/xposed/base/AppRegister.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils.xposed.base 2 | 3 | import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow 4 | import de.robv.android.xposed.IXposedHookLoadPackage 5 | import de.robv.android.xposed.XposedBridge 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage 7 | 8 | abstract class AppRegister: IXposedHookLoadPackage { 9 | 10 | abstract val packageName: String 11 | 12 | override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {} 13 | 14 | protected fun autoInitHooks(lpparam: XC_LoadPackage.LoadPackageParam, vararg hook: HookRegister) { 15 | hook.also { 16 | XposedBridge.log("WooBox: Try to Hook [$packageName]") 17 | }.forEach { 18 | runCatching { 19 | if (it.isInit) return@forEach 20 | it.setLoadPackageParam(lpparam) 21 | it.init() 22 | it.isInit = true 23 | }.logexIfThrow("Failed to Hook [$packageName]") 24 | } 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/utils/xposed/base/HookRegister.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.utils.xposed.base 2 | 3 | import de.robv.android.xposed.callbacks.XC_LoadPackage 4 | 5 | abstract class HookRegister { 6 | private lateinit var lpparam: XC_LoadPackage.LoadPackageParam 7 | var isInit: Boolean = false 8 | abstract fun init() 9 | 10 | fun setLoadPackageParam(loadPackageParam: XC_LoadPackage.LoadPackageParam) { 11 | lpparam = loadPackageParam 12 | } 13 | 14 | protected fun getLoadPackageParam(): XC_LoadPackage.LoadPackageParam { 15 | if (!this::lpparam.isInitialized) { 16 | throw RuntimeException("lpparam should be initialized") 17 | } 18 | return lpparam 19 | } 20 | 21 | protected fun getDefaultClassLoader(): ClassLoader { 22 | return getLoadPackageParam().classLoader 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/lt2333/simplicitytools/views/WeatherView.kt: -------------------------------------------------------------------------------- 1 | package com.lt2333.simplicitytools.views 2 | 3 | import android.annotation.SuppressLint 4 | import android.content.Context 5 | import android.database.ContentObserver 6 | import android.net.Uri 7 | import android.os.Handler 8 | import android.os.Looper 9 | import android.os.Message 10 | import android.text.TextUtils 11 | import android.widget.TextView 12 | 13 | @SuppressLint("ViewConstructor") 14 | class WeatherView(context: Context?, private val showCity: Boolean) : TextView(context) { 15 | 16 | private val mContext: Context 17 | private val weatherUri = Uri.parse("content://weather/weather") 18 | private val mHandler: Handler 19 | private val mWeatherObserver: ContentObserver? 20 | private val mWeatherRunnable: WeatherRunnable 21 | 22 | init { 23 | mHandler = 24 | object : Handler(Looper.getMainLooper()) { 25 | override fun handleMessage(message: Message) { 26 | val str = message.obj as String 27 | this@WeatherView.text = if (TextUtils.isEmpty(str)) " " else str 28 | } 29 | } 30 | mWeatherObserver = WeatherContentObserver(mHandler) 31 | mContext = context!! 32 | mWeatherRunnable = WeatherRunnable() 33 | context.contentResolver.registerContentObserver(weatherUri, true, mWeatherObserver) 34 | updateWeatherInfo() 35 | } 36 | 37 | private inner class WeatherContentObserver(handler: Handler?) : ContentObserver(handler) { 38 | override fun onChange(z: Boolean) { 39 | updateWeatherInfo() 40 | } 41 | } 42 | 43 | inner class WeatherRunnable : Runnable { 44 | override fun run() { 45 | var str = "" 46 | try { 47 | val query = mContext.contentResolver.query(weatherUri, null, null, null, null) 48 | if (query != null) { 49 | if (query.moveToFirst()) { 50 | str = if (showCity) { 51 | query.getString(query.getColumnIndexOrThrow("city_name")) + " " + query.getString(query.getColumnIndexOrThrow("description")) + " " + query.getString(query.getColumnIndexOrThrow("temperature")) 52 | } else { 53 | query.getString(query.getColumnIndexOrThrow("description")) + " " + query.getString(query.getColumnIndexOrThrow("temperature")) 54 | } 55 | } 56 | query.close() 57 | } 58 | } catch (e: Exception) { 59 | 60 | } 61 | val obtainMessage2 = mHandler.obtainMessage() 62 | obtainMessage2.what = 100 63 | obtainMessage2.obj = str 64 | mHandler.sendMessage(obtainMessage2) 65 | } 66 | } 67 | 68 | private fun updateWeatherInfo() { 69 | mHandler.removeCallbacks(mWeatherRunnable) 70 | mHandler.postDelayed(mWeatherRunnable, 200) 71 | } 72 | 73 | public override fun onDetachedFromWindow() { 74 | super.onDetachedFromWindow() 75 | if (mWeatherObserver != null) { 76 | mContext.contentResolver.unregisterContentObserver(mWeatherObserver) 77 | } 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_fullscreen_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_fps.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 7 | 9 | 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 13 | 16 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_small_window_dark.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_small_window_light.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/lt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/drawable/lt.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-af/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-ar/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | غير ذلك 4 | السماح بلقطة الشاشة 5 | الصفحة الرئيسية 6 | عرض ساعة الشاشة الرئيسية دائماً 7 | إعادة تشغيل النظام 8 | 9 | أيقونات شريط الحالة 10 | إخفاء أيقونة No SIM 11 | إخفاء أيقونة SIM Card 1 12 | إخفاء أيقونة SIM Card 2 13 | إخفاء أيقونة VPN 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/values-ca/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-da/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-el/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-fi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-he/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-it/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alte prestazioni 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values-no/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-pt/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Desempenho 4 | Bloqueie o limite superior da taxa de atualização atual 5 | ‘Interface’ 6 | Remover exibição sobre notificação 7 | Remover a notificação \"este aplicativo é exibido sobre outros aplicativos\" 8 | Outros 9 | Permitir captura de ecrã 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-sr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-sv/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-th/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ประสิทธิภาพ 4 | ล็อคค่า FPS สูงสุด 5 | การแสดงผล 6 | ลบการแสดงผล บนแถบการแจ้งเตือน 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-uk/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | android 5 | com.miui.securitycenter 6 | com.android.systemui 7 | com.miui.powerkeeper 8 | com.miui.home 9 | com.miui.mediaeditor 10 | com.android.updater 11 | com.android.settings 12 | com.android.thememanager 13 | com.miui.screenshot 14 | com.milink.service 15 | com.xiaomi.misubscreenui 16 | com.miui.packageinstaller 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | #FF0000 11 | #0d84ff 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath("com.android.tools.build:gradle:7.4.1") 9 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0") 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle.kts files 13 | } 14 | } 15 | 16 | tasks.register("Delete", Delete::class) { 17 | delete(rootProject.buildDir) 18 | } -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | commit_message: '[ci skip] New translations from Crowdin' 2 | files: 3 | - source: /app/src/main/res/values/strings.xml 4 | translation: /app/src/main/res/values-%two_letters_code%/strings.xml 5 | translate_content: 0 6 | translate_attributes: 0 7 | content_segmentation: 0 8 | -------------------------------------------------------------------------------- /doc/cn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/doc/cn.jpg -------------------------------------------------------------------------------- /doc/en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/doc/en.jpg -------------------------------------------------------------------------------- /doc/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/doc/ic_launcher.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | android.enableAppCompileTimeRClass=true 21 | android.nonTransitiveRClass=true 22 | org.gradle.caching=true 23 | org.gradle.parallel=true 24 | org.gradle.vfs.watch=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplicity-Team/WooBoxForMIUI/1401ddcc528f59b37c93e4e24ba4ce4b6fb3f112/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Apr 23 16:13:18 CST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven("https://api.xposed.info") 7 | } 8 | } 9 | rootProject.name = "WooBoxForMIUI" 10 | include(":app", ":blockmiui") --------------------------------------------------------------------------------