diff --git a/app/src/main/java/com/parallelc/micts/ModuleMain.kt b/app/src/main/java/com/parallelc/micts/ModuleMain.kt index e88ba26..2ee13cd 100644 --- a/app/src/main/java/com/parallelc/micts/ModuleMain.kt +++ b/app/src/main/java/com/parallelc/micts/ModuleMain.kt @@ -41,20 +41,39 @@ class ModuleMain(base: XposedInterface, param: ModuleLoadedParam) : XposedModule override fun onPackageLoaded(param: PackageLoadedParam) { super.onPackageLoaded(param) - if ((param.packageName != "com.miui.home" && param.packageName != "com.mi.android.globallauncher") || !param.isFirstPackage) return - - runCatching { - val circleToSearchHelper = param.classLoader.loadClass("com.miui.home.recents.cts.CircleToSearchHelper") - hook(circleToSearchHelper.getDeclaredMethod("invokeOmni", Context::class.java, Int::class.java, Int::class.java), InvokeOmniHooker::class.java) - return - }.onFailure { e -> - log("hook CircleToSearchHelper fail", e) - } + if (!param.isFirstPackage) return + + when (param.packageName) { + "com.miui.home", "com.mi.android.globallauncher" -> { + runCatching { + val circleToSearchHelper = param.classLoader.loadClass("com.miui.home.recents.cts.CircleToSearchHelper") + hook(circleToSearchHelper.getDeclaredMethod("invokeOmni", Context::class.java, Int::class.java, Int::class.java), InvokeOmniHooker::class.java) + return + }.onFailure { e -> + log("hook CircleToSearchHelper fail", e) + } - runCatching { - NavStubViewHooker.hook(param) - }.onFailure { e -> - log("hook NavStubView fail", e) + runCatching { + NavStubViewHooker.hook(param) + }.onFailure { e -> + log("hook NavStubView fail", e) + } + } + "com.google.android.googlequicksearchbox" -> { + val buildClass = param.classLoader.loadClass("android.os.Build") + val MANUFACTURER = buildClass.getDeclaredField("MANUFACTURER") + MANUFACTURER.isAccessible = true + MANUFACTURER.set(null, "Google") + val BRAND = buildClass.getDeclaredField("BRAND") + BRAND.isAccessible = true + BRAND.set(null, "google") + val MODEL = buildClass.getDeclaredField("MODEL") + MODEL.isAccessible = true + MODEL.set(null, "Pixel 8 Pro") + val DEVICE = buildClass.getDeclaredField("DEVICE") + DEVICE.isAccessible = true + DEVICE.set(null, "husky") + } } } } \ No newline at end of file diff --git a/app/src/main/resources/META-INF/xposed/scope.list b/app/src/main/resources/META-INF/xposed/scope.list index 1eb4ea0..0b447f6 100644 --- a/app/src/main/resources/META-INF/xposed/scope.list +++ b/app/src/main/resources/META-INF/xposed/scope.list @@ -1,3 +1,4 @@ system com.miui.home -com.mi.android.globallauncher \ No newline at end of file +com.mi.android.globallauncher +com.google.android.googlequicksearchbox \ No newline at end of file