Skip to content

Commit

Permalink
fix: FakePhone
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Apr 30, 2024
1 parent 06be187 commit 4c84770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
7 changes: 0 additions & 7 deletions app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,3 @@ data object TroopInfoCardPageABConfig : DexKitTarget.UsingStr() {
override val declaringClass = ""
override val filter: dexkitFilter = DexKitFilter.allowAll
}

data object HdMethodFakePhone : DexKitTarget.UsingStr() {
override val findMethod = true
override val traitString = arrayOf("target_desc")
override val declaringClass = "com/tencent/mobileqq/app/"
override val filter = filter@{ it: DexMethodDescriptor -> it.name == "onUpdate" }
}
14 changes: 3 additions & 11 deletions app/src/main/java/me/hd/hook/FakePhone.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,27 @@
package me.hd.hook

import android.os.Bundle
import cc.ioctl.util.hookAfterIfEnabled
import cc.ioctl.util.hookBeforeIfEnabled
import de.robv.android.xposed.XposedBridge
import io.github.qauxv.base.annotation.FunctionHookEntry
import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.hook.CommonSwitchFunctionHook
import io.github.qauxv.util.Initiator
import io.github.qauxv.util.QQVersion
import io.github.qauxv.util.dexkit.DexKit
import io.github.qauxv.util.dexkit.HdMethodFakePhone
import io.github.qauxv.util.requireMinQQVersion
import java.util.Objects

@FunctionHookEntry
@UiItemAgentEntry
object FakePhone : CommonSwitchFunctionHook(
arrayOf(HdMethodFakePhone)
) {
object FakePhone : CommonSwitchFunctionHook() {

override val name = "自定义手机号码"
override val description = "自定义设置页手机号码显示内容(待完善)"
override val name = "伪装手机号码"
override val description = "伪装设置页手机号码显示内容"
override val uiItemLocation = FunctionEntryRouter.Locations.Entertainment.ENTERTAIN_CATEGORY
override val isAvailable = requireMinQQVersion(QQVersion.QQ_8_9_88)

override fun initOnce(): Boolean {
val onUpdateClass = Initiator.loadClass("com.tencent.mobileqq.app.cd")
val onUpdateMethod = onUpdateClass.getDeclaredMethod("onUpdate", Int::class.java, Boolean::class.java, Object::class.java)
//val onUpdateMethodCache = DexKit.requireMethodFromCache(HdMethodFakePhone)
hookBeforeIfEnabled(onUpdateMethod) { param ->
if (param.args[0] == 5) {
val bundle = param.args[2] as Bundle
Expand Down

0 comments on commit 4c84770

Please sign in to comment.