├── app ├── .gitignore ├── src │ └── main │ │ ├── assets │ │ └── xposed_init │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── array.xml │ │ │ └── colors.xml │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── layout │ │ │ └── activity_main.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ └── drawable │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ └── com │ │ │ └── xhy │ │ │ └── xp │ │ │ └── miuicustom │ │ │ ├── MainActivity.java │ │ │ ├── MainHook.java │ │ │ └── dispatch │ │ │ ├── PowerKeeperHook.java │ │ │ └── SecurityCenterHook.java │ │ └── AndroidManifest.xml ├── release │ └── output-metadata.json ├── proguard-rules.pro └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── .gitignore ├── README.md └── gradle.properties /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.xhy.xp.miuicustom.MainHook -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MIUICustom 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XhyEax/MIUICustom/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/array.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.miui.securitycenter 5 | com.miui.powerkeeper 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 02 12:12:49 CST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 3 | repositories { 4 | google() 5 | mavenCentral() 6 | jcenter() // Warning: this repository is going to shut down soon 7 | } 8 | } 9 | rootProject.name = "MIUICustom" 10 | include ':app' 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | .idea 17 | gradlew.bat 18 | gradlew 19 | *.apk -------------------------------------------------------------------------------- /app/src/main/java/com/xhy/xp/miuicustom/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.xhy.xp.miuicustom; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends Activity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_main); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/release/output-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "com.xhy.xp.miuicustom", 8 | "variantName": "release", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "attributes": [], 14 | "versionCode": 1, 15 | "versionName": "1.0", 16 | "outputFile": "app-release.apk" 17 | } 18 | ], 19 | "elementType": "File" 20 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MIUICustom 2 | MIUI 12+ Custom Module (Xposed) 3 | 4 | ## Feature 5 | 10s CountDownTimer Bypass 6 | 7 | Global High Frame Rate 8 | 9 | ## APP Domain and Version Tested 10 | `Security` (`com.miui.securitycenter`): `5.4.0`、`5.6.0`、`7.0.0` 、`7.2.1` 、`7.5.5` 11 | 12 | `Battery and performance` (`com.miui.powerkeeper`): `4.2.00` 13 | 14 | ## SecurityCenterHook 15 | [miui-countdowntimer-bypass](https://blog.xhyeax.com/2021/10/02/miui-countdowntimer-bypass/) 16 | 17 | ## PowerKeeperHook 18 | [miui-powerkeeper-bypass](https://blog.xhyeax.com/2022/05/26/miui-powerkeeper-bypass/) 19 | -------------------------------------------------------------------------------- /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. 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 -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdk 31 7 | 8 | defaultConfig { 9 | applicationId "com.xhy.xp.miuicustom" 10 | minSdk 23 11 | targetSdk 31 12 | versionCode 1012 13 | versionName "1.012" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | compileOptions { 25 | sourceCompatibility JavaVersion.VERSION_1_8 26 | targetCompatibility JavaVersion.VERSION_1_8 27 | } 28 | namespace 'com.xhy.xp.miuicustom' 29 | } 30 | 31 | dependencies { 32 | compileOnly 'de.robv.android.xposed:api:82' 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xhy/xp/miuicustom/MainHook.java: -------------------------------------------------------------------------------- 1 | package com.xhy.xp.miuicustom; 2 | 3 | import com.xhy.xp.miuicustom.dispatch.PowerKeeperHook; 4 | import com.xhy.xp.miuicustom.dispatch.SecurityCenterHook; 5 | 6 | import de.robv.android.xposed.IXposedHookLoadPackage; 7 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 8 | 9 | public class MainHook implements IXposedHookLoadPackage { 10 | 11 | @Override 12 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) { 13 | String packageName = lpparam.packageName; 14 | switch (packageName) { 15 | case "com.miui.securitycenter": 16 | SecurityCenterHook.handleLoadPackage(lpparam); 17 | break; 18 | case "com.miui.powerkeeper": 19 | PowerKeeperHook.handleLoadPackage(lpparam); 20 | break; 21 | } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/xhy/xp/miuicustom/dispatch/PowerKeeperHook.java: -------------------------------------------------------------------------------- 1 | package com.xhy.xp.miuicustom.dispatch; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import de.robv.android.xposed.XC_MethodReplacement; 6 | import de.robv.android.xposed.XposedBridge; 7 | import de.robv.android.xposed.XposedHelpers; 8 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 9 | 10 | public class PowerKeeperHook { 11 | public static void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) { 12 | // 4.2.00 13 | Method mtd_isFeatureOn_4200 = XposedHelpers.findMethodExactIfExists("com.miui.powerkeeper.statemachine.DisplayFrameSetting", 14 | lpparam.classLoader, "isFeatureOn"); 15 | if (mtd_isFeatureOn_4200 != null) { 16 | XposedBridge.hookMethod(mtd_isFeatureOn_4200, new XC_MethodReplacement() { 17 | @Override 18 | protected Object replaceHookedMethod(MethodHookParam param) { 19 | return false; 20 | } 21 | }); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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.defaults.buildfeatures.buildconfig=true 21 | android.nonTransitiveRClass=false 22 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 27 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/xhy/xp/miuicustom/dispatch/SecurityCenterHook.java: -------------------------------------------------------------------------------- 1 | package com.xhy.xp.miuicustom.dispatch; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import de.robv.android.xposed.XC_MethodHook; 6 | import de.robv.android.xposed.XC_MethodReplacement; 7 | import de.robv.android.xposed.XposedBridge; 8 | import de.robv.android.xposed.XposedHelpers; 9 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 10 | 11 | public class SecurityCenterHook { 12 | public static void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) { 13 | // miui-countdowntimer-bypass 14 | 15 | XC_MethodReplacement methodReplacement_d = new XC_MethodReplacement() { 16 | @Override 17 | protected Object replaceHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable { 18 | Method mtdConfirm = param.thisObject.getClass().getDeclaredMethod("d", boolean.class); 19 | mtdConfirm.invoke(param.thisObject, true); 20 | return null; 21 | } 22 | }; 23 | 24 | // 7.2.1、7.5.5 25 | Method mtd_SpecialPermissionIntercept_721 = XposedHelpers.findMethodExactIfExists("com.miui.permcenter.privacymanager.InterceptBaseFragment", lpparam.classLoader, "n"); 26 | if (mtd_SpecialPermissionIntercept_721 != null) { 27 | XposedBridge.hookMethod(mtd_SpecialPermissionIntercept_721, methodReplacement_d); 28 | } 29 | 30 | // 7.0.0 31 | Method mtd_SpecialPermissionIntercept_700 = XposedHelpers.findMethodExactIfExists("com.miui.permcenter.privacymanager.InterceptBaseFragment", lpparam.classLoader, "m"); 32 | if (mtd_SpecialPermissionIntercept_700 != null) { 33 | XposedBridge.hookMethod(mtd_SpecialPermissionIntercept_700, methodReplacement_d); 34 | } 35 | 36 | // 5.6.0 37 | Method mtd_SpecialPermissionIntercept_560 = XposedHelpers.findMethodExactIfExists("com.miui.permcenter.privacymanager.h", lpparam.classLoader, "n"); 38 | if (mtd_SpecialPermissionIntercept_560 != null) { 39 | XposedBridge.hookMethod(mtd_SpecialPermissionIntercept_560, methodReplacement_d); 40 | } 41 | 42 | // 5.4.0 43 | Method mtd_SpecialPermissionIntercept_540 = XposedHelpers.findMethodExactIfExists("com.miui.permcenter.privacymanager.d", lpparam.classLoader, "c"); 44 | if (mtd_SpecialPermissionIntercept_540 != null) { 45 | XposedBridge.hookMethod(mtd_SpecialPermissionIntercept_540, new XC_MethodReplacement() { 46 | @Override 47 | protected Object replaceHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable { 48 | Method mtdConfirm = param.thisObject.getClass().getDeclaredMethod("a", boolean.class); 49 | mtdConfirm.invoke(param.thisObject, true); 50 | return null; 51 | } 52 | }); 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | --------------------------------------------------------------------------------