Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add FakePhone #942

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -944,4 +944,4 @@ data object TroopInfoCardPageABConfig : DexKitTarget.UsingStr() {
override val traitString: Array<String> = arrayOf("exp_qq_grp_idcard_switch_v2")
override val declaringClass = ""
override val filter: dexkitFilter = DexKitFilter.allowAll
}
}
56 changes: 56 additions & 0 deletions app/src/main/java/me/hd/hook/FakePhone.kt
Original file line number Diff line number Diff line change
@@ -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
* <https://github.com/cinit/QAuxiliary/blob/master/LICENSE.md>.
*/

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
}
}
Loading