diff --git a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt index 0195b95087..6d70912ad7 100644 --- a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt +++ b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt @@ -944,4 +944,4 @@ data object TroopInfoCardPageABConfig : DexKitTarget.UsingStr() { override val traitString: Array = arrayOf("exp_qq_grp_idcard_switch_v2") override val declaringClass = "" override val filter: dexkitFilter = DexKitFilter.allowAll -} \ No newline at end of file +} diff --git a/app/src/main/java/me/hd/hook/FakePhone.kt b/app/src/main/java/me/hd/hook/FakePhone.kt new file mode 100644 index 0000000000..c20bd5f4b5 --- /dev/null +++ b/app/src/main/java/me/hd/hook/FakePhone.kt @@ -0,0 +1,56 @@ +/* + * QAuxiliary - An Xposed module for QQ/TIM + * Copyright (C) 2019-2024 QAuxiliary developers + * https://github.com/cinit/QAuxiliary + * + * This software is an opensource software: you can redistribute it + * and/or modify it under the terms of the General Public License + * as published by the Free Software Foundation; either + * version 3 of the License, or any later version as published + * by QAuxiliary contributors. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the General Public License for more details. + * + * You should have received a copy of the General Public License + * along with this software. + * If not, see + * . + */ + +package me.hd.hook + +import android.os.Bundle +import cc.ioctl.util.hookBeforeIfEnabled +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.requireMinQQVersion + +@FunctionHookEntry +@UiItemAgentEntry +object FakePhone : CommonSwitchFunctionHook() { + + 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) + hookBeforeIfEnabled(onUpdateMethod) { param -> + if (param.args[0] == 5) { + val bundle = param.args[2] as Bundle + bundle.putString("phone", "100******00") + param.args[2] = bundle + } + } + return true + } +} \ No newline at end of file