Skip to content

Commit

Permalink
feat: device spoof
Browse files Browse the repository at this point in the history
  • Loading branch information
parallelcc committed Nov 12, 2024
1 parent 57ac3c5 commit b5a8bc0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
45 changes: 32 additions & 13 deletions app/src/main/java/com/parallelc/micts/ModuleMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
}
3 changes: 2 additions & 1 deletion app/src/main/resources/META-INF/xposed/scope.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
system
com.miui.home
com.mi.android.globallauncher
com.mi.android.globallauncher
com.google.android.googlequicksearchbox

0 comments on commit b5a8bc0

Please sign in to comment.