Skip to content

Commit

Permalink
chore: update QQ ver and add first beta ver
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Sep 20, 2024
1 parent 6f9a667 commit 14631b9
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public RepeaterPlusIconSettingDialog(Context context) {
check_showInMenu.setChecked(cfg.getBooleanOrFalse(qn_repeat_show_in_menu));

// temporary
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
check_showUpper.setEnabled(false);
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cc/hicore/hook/RepeaterPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public String[] getUiItemLocation() {
@Override
@SuppressLint({"WrongConstant", "ResourceType"})
public boolean initOnce() throws Exception {
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
if (!RepeaterPlusIconSettingDialog.getIsShowInMenu()) {
XC_MethodHook callback = new XC_MethodHook() {
private ImageView img;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cc/hicore/hook/UnlockLeftSlipLimit.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String[] getUiItemLocation() {

@Override
protected boolean initOnce() throws Exception {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
XposedHelpers.findAndHookMethod(Initiator.loadClass("com.tencent.mobileqq.ark.api.impl.ArkHelperImpl"), "isSupportReply", String.class,
String.class, String.class, new XC_MethodHook() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean isAvailable() {

@Override
public boolean initOnce() {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
Method m = DexKit.requireMethodFromCache(TroopEnterEffect_QQNT.INSTANCE);
HookUtils.hookBeforeIfEnabled(this, m, param -> param.setResult(null));
return true;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/cc/ioctl/hook/file/BaseApk.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package cc.ioctl.hook.file;

import static io.github.qauxv.util.QQVersion.QQ_8_6_0;
import static io.github.qauxv.util.QQVersion.QQ_8_9_63;
import static io.github.qauxv.util.QQVersion.QQ_8_9_63_BETA_11345;

import android.app.Activity;
import android.content.pm.ApplicationInfo;
Expand Down Expand Up @@ -96,7 +96,7 @@ public Function3<IUiItemAgent, Activity, View, Unit> getOnUiItemClickListener()

@Override
public boolean initOnce() throws Exception {
if (HostInfo.requireMinQQVersion(QQ_8_9_63)) {
if (HostInfo.requireMinQQVersion(QQ_8_9_63_BETA_11345)) {
HookUtils.hookBeforeIfEnabled(this, DexKit.requireMethodFromCache(TroopSendFile_QQNT.INSTANCE), param -> {
Field[] fs = param.thisObject.getClass().getDeclaredFields();
Field f = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ object MultiForwardAvatarHook : CommonSwitchFunctionHook(arrayOf(CAIOUtils, Mult
@SuppressLint("DiscouragedApi")
@Throws(Exception::class)
public override fun initOnce(): Boolean {
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
val clz = Initiator.loadClass("com.tencent.mobileqq.aio.msglist.holder.component.avatar.AIOAvatarContentComponent")
// 设置头像点击和长按事件的方法
DexKit.requireMethodFromCache(Multiforward_Avatar_setListener_NT).hookBefore { param ->
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/cc/ioctl/hook/msg/ShowMsgCount.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object ShowMsgCount : CommonSwitchFunctionHook(

override fun initOnce() = throwOrTrue {

if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
// 小程序菜单键消息数量
Initiator.loadClass("com.tencent.qqmini.sdk.core.utils.CustomWidgetUtil")
.getDeclaredMethod("updateCustomNoteTxt", TextView::class.java, Int::class.java)
Expand All @@ -80,7 +80,7 @@ object ShowMsgCount : CommonSwitchFunctionHook(
}
}

if (QQVersion.QQ_8_9_63 <= hostInfo.versionCode && hostInfo.versionCode <= QQVersion.QQ_9_0_68) {
if (QQVersion.QQ_8_9_63_BETA_11345 <= hostInfo.versionCode && hostInfo.versionCode <= QQVersion.QQ_9_0_68) {
// 隐藏会话右上角消息数量
Initiator.loadClass("com.tencent.mobileqq.activity.miniaio.h")
.getDeclaredMethod("updateUnreadCount", Int::class.java, Boolean::class.java)
Expand Down Expand Up @@ -116,7 +116,7 @@ object ShowMsgCount : CommonSwitchFunctionHook(
param.result = null
}
} else {
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
// 群消息数量
val clz = DexKit.requireClassFromCache(CCustomWidgetUtil_updateCustomNoteTxt_NT)
val updateNum = clz.declaredMethods.single { method ->
Expand Down Expand Up @@ -149,7 +149,7 @@ object ShowMsgCount : CommonSwitchFunctionHook(
requireMinQQVersion(QQVersion.QQ_9_0_0) -> Pair("e", "v")
requireMinQQVersion(QQVersion.QQ_8_9_80) -> Pair("e", "s")
requireMinQQVersion(QQVersion.QQ_8_9_70) -> Pair("e", "t")
requireMinQQVersion(QQVersion.QQ_8_9_63) -> Pair("e", "s")
requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) -> Pair("e", "s")
else -> Pair("", "")
}
if (mTitleBinding.isNotEmpty() && unreadTv.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object MessageInterception : BasePersistBackgroundHook() {
Initiator._C2CMessageManager().methodWithSuper(
when {
requireMinQQVersion(QQVersion.QQ_9_0_56) -> "x0"
requireMinQQVersion(QQVersion.QQ_8_9_63) -> "y0"
requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) -> "y0"
requireMinQQVersion(QQVersion.QQ_8_9_3) -> "E0"
requireMinQQVersion(QQVersion.QQ_8_8_93) -> "A0"
else -> "d"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object RemoveCameraButton : CommonSwitchFunctionHook("kr_disable_camera_button")
override fun initOnce() = throwOrTrue {
findMethod(Initiator._ConversationTitleBtnCtrl()) {
val methodName = when {
requireMinQQVersion(QQVersion.QQ_8_9_63) -> "D"
requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) -> "D"
requireMinQQVersion(QQVersion.QQ_8_9_10) -> "C"
requireMinQQVersion(QQVersion.QQ_8_8_93) -> "G"
else -> "a"
Expand All @@ -57,7 +57,7 @@ object RemoveCameraButton : CommonSwitchFunctionHook("kr_disable_camera_button")
}
findMethod(Initiator._ConversationTitleBtnCtrl()) {
val methodName = when {
requireMinQQVersion(QQVersion.QQ_8_9_63) -> "C"
requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) -> "C"
requireMinQQVersion(QQVersion.QQ_8_9_10) -> "B"
requireMinQQVersion(QQVersion.QQ_8_9_5) -> "E"
requireMinQQVersion(QQVersion.QQ_8_8_93) -> "F"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ object MessageCopyHook : CommonSwitchFunctionHook(), DexKitFinder, OnMenuBuilder
}

override val isNeedFind: Boolean
get() = HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63) && TextMsgItem_getText.descCache == null
get() = HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) && TextMsgItem_getText.descCache == null

override fun doFind(): Boolean {
DexDeobfsProvider.getCurrentBackend().use { backend ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ object MessageTTSHook : CommonSwitchFunctionHook(), OnMenuBuilder, DexKitFinder
}

override val isNeedFind: Boolean
get() = HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63) && TextMsgItem_getText.descCache == null
get() = HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) && TextMsgItem_getText.descCache == null

override fun doFind(): Boolean {
DexDeobfsProvider.getCurrentBackend().use { backend ->
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/github/qauxv/tlb/QQConfigTable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import io.github.qauxv.util.QQVersion.QQ_8_9_2
import io.github.qauxv.util.QQVersion.QQ_8_9_25
import io.github.qauxv.util.QQVersion.QQ_8_9_28
import io.github.qauxv.util.QQVersion.QQ_8_9_3
import io.github.qauxv.util.QQVersion.QQ_8_9_63
import io.github.qauxv.util.QQVersion.QQ_8_9_63_BETA_11345
import io.github.qauxv.util.QQVersion.QQ_8_9_68
import io.github.qauxv.util.QQVersion.QQ_8_9_70
import io.github.qauxv.util.QQVersion.QQ_8_9_8
Expand Down Expand Up @@ -105,7 +105,7 @@ class QQConfigTable : ConfigTableInterface {
QQ_8_8_80 to "nmx",
QQ_8_8_83 to "nnl",
// NT begin
QQ_8_9_63 to "nxj",
QQ_8_9_63_BETA_11345 to "nxj",
QQ_8_9_68 to "nyb",
QQ_8_9_70 to "nyn"
),
Expand Down
64 changes: 46 additions & 18 deletions app/src/main/java/io/github/qauxv/util/QQVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,42 +95,70 @@ private QQVersion() {
public static final long QQ_8_9_55 = 4030;

// The first NT version
public static final long QQ_8_9_63 = 4194;
public static final long QQ_8_9_63_BETA_11345 = 4176;
public static final long QQ_8_9_68 = 4264;
public static final long QQ_8_9_70_BETA_11625 = 4288;
public static final long QQ_8_9_70 = 4330;
public static final long QQ_8_9_71 = 4332;
public static final long QQ_8_9_73_BETA_11790 = 4354;
public static final long QQ_8_9_73 = 4416;
public static final long QQ_8_9_75_BETA_12005 = 4440;
public static final long QQ_8_9_75 = 4482;
public static final long QQ_8_9_76 = 4484;
public static final long QQ_8_9_78_BETA_12170 = 4506;
public static final long QQ_8_9_78 = 4548;
public static final long QQ_8_9_80_BETA_12335 = 4572;
public static final long QQ_8_9_80 = 4614;
public static final long QQ_8_9_83_BETA_12500 = 4638;
public static final long QQ_8_9_83 = 4680;
public static final long QQ_8_9_85_BETA_12650 = 4698;
public static final long QQ_8_9_85 = 4766;
public static final long QQ_8_9_88_BETA_12880 = 4790;
public static final long QQ_8_9_88 = 4852;
public static final long QQ_8_9_90_BETA_13095 = 4876;
public static final long QQ_8_9_90 = 4938;
public static final long QQ_8_9_93_BETA_13315 = 4964;
public static final long QQ_8_9_93 = 5028;
public static final long QQ_9_0_0 = 5220;
public static final long QQ_9_0_8 = 5478;
public static final long QQ_9_0_15 = 5564;
public static final long QQ_9_0_0_BETA_13955 = 5220;
public static final long QQ_9_0_0 = 5282;
public static final long QQ_9_0_8_BETA_14600 = 5478;
public static final long QQ_9_0_8 = 5540;
public static final long QQ_9_0_15_BETA_14815 = 5564;
public static final long QQ_9_0_15 = 5626;
public static final long QQ_9_0_17 = 5712;
public static final long QQ_9_0_20 = 5782;
public static final long QQ_9_0_25 = 5900;
public static final long QQ_9_0_30 = 6014;
public static final long QQ_9_0_35 = 6126;
public static final long QQ_9_0_50 = 6236;
public static final long QQ_9_0_55 = 6346;
public static final long QQ_9_0_20_BETA_15360 = 5782;
public static final long QQ_9_0_20 = 5844;
public static final long QQ_9_0_25_BETA_15655 = 5900;
public static final long QQ_9_0_25 = 5942;
public static final long QQ_9_0_30_BETA_15940 = 6014;
public static final long QQ_9_0_30 = 6038;
public static final long QQ_9_0_35_BETA_16215 = 6126;
public static final long QQ_9_0_35 = 6150;
public static final long QQ_9_0_50_BETA_16490 = 6236;
public static final long QQ_9_0_50 = 6258;
public static final long QQ_9_0_55_BETA_16765 = 6346;
public static final long QQ_9_0_55 = 6368;
public static final long QQ_9_0_56 = 6372;
public static final long QQ_9_0_60 = 6456;
public static final long QQ_9_0_65 = 6566;
public static final long QQ_9_0_60_BETA_17040 = 6456;
public static final long QQ_9_0_60 = 6478;
public static final long QQ_9_0_65_BETA_17315 = 6566;
public static final long QQ_9_0_65 = 6588;
public static final long QQ_9_0_68 = 6612;
public static final long QQ_9_0_70 = 6676;
public static final long QQ_9_0_70_BETA_17590 = 6676;
public static final long QQ_9_0_70 = 6698;
public static final long QQ_9_0_71 = 6702;
public static final long QQ_9_0_73 = 6722;
public static final long QQ_9_0_75 = 6786;
public static final long QQ_9_0_80 = 6896;
public static final long QQ_9_0_75_BETA_17865 = 6786;
public static final long QQ_9_0_75 = 6808;
public static final long QQ_9_0_80_BETA_18140 = 6896;
public static final long QQ_9_0_80 = 6918;
public static final long QQ_9_0_81 = 6922;
public static final long QQ_9_0_85 = 7046;
public static final long QQ_9_0_90 = 7196;
public static final long QQ_9_0_95 = 7346;
public static final long QQ_9_0_85_BETA_18515 = 7046;
public static final long QQ_9_0_85 = 7068;
public static final long QQ_9_0_90_BETA_18890 = 7196;
public static final long QQ_9_0_90 = 7218;
public static final long QQ_9_0_95_BETA_19265 = 7346;
public static final long QQ_9_0_95 = 7368;
public static final long QQ_9_1_0_BETA_19640 = 7496;
public static final long QQ_9_1_0 = 7518;
}
2 changes: 1 addition & 1 deletion app/src/main/java/me/ketal/hook/ChatItemShowQQUin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ object ChatItemShowQQUin : CommonConfigFunctionHook(), OnBubbleBuilder {
val isFlashPicTagNeedShow = FlashPicHook.INSTANCE.isInitializationSuccessful && isFlashPicNt(chatMessage)
if (!isEnabled && !isFlashPicTagNeedShow) return

if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
if (!rootView.children.map { it.id }.contains(ID_ADD_LAYOUT)) {
val layout = LinearLayout(rootView.context).apply {
layoutParams = ConstraintLayout.LayoutParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ object MessagingStyleNotification : CommonSwitchFunctionHook(SyncUtils.PROC_ANY)
createNotificationChannels()
}

if (!HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (!HostInfo.requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
return NonNTMessageStyleNotification(this).hook()
}
val cNotificationFacade = "com.tencent.qqnt.notification.NotificationFacade".clazz!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.hook.CommonSwitchFunctionHook
import io.github.qauxv.step.Step
import io.github.qauxv.util.Initiator
import io.github.qauxv.util.Initiator.getHostClassLoader
import io.github.qauxv.util.PlayQQVersion
import io.github.qauxv.util.QQVersion
Expand Down Expand Up @@ -60,7 +59,7 @@ object AutoReceiveOriginalPhoto : CommonSwitchFunctionHook(
override val uiItemLocation = FunctionEntryRouter.Locations.Auxiliary.CHAT_CATEGORY

override fun initOnce(): Boolean {
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
// Initiator.loadClass("com.tencent.qqnt.aio.gallery.part.d").declaredMethods.single { method ->
DexKit.requireMethodFromCache(OriginalPhotoNT_onInitView).declaringClass.declaredMethods.single { method ->
val params = method.parameterTypes
Expand Down Expand Up @@ -114,12 +113,12 @@ object AutoReceiveOriginalPhoto : CommonSwitchFunctionHook(
}

override val isNeedFind: Boolean
get() = NAIOPictureView_onDownloadOriginalPictureClick.descCache == null || (requireMinQQVersion(QQVersion.QQ_8_9_63) && OriginalPhotoNT_onInitView.descCache == null)
get() = NAIOPictureView_onDownloadOriginalPictureClick.descCache == null || (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345) && OriginalPhotoNT_onInitView.descCache == null)

override fun doFind(): Boolean {
getCurrentBackend().use { backend ->
val dexKit = backend.getDexKitBridge()
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
dexKit.findMethod {
matcher {
name = "onInitView"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/xyz/nextalone/hook/ChatInputHint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object ChatInputHint : CommonConfigFunctionHook("na_chat_input_hint", arrayOf(NB
private const val strCfg = "na_chat_input_hint_str"

override fun initOnce(): Boolean = throwOrTrue {
if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
// 私聊 && QQ9.0.35版本后的群聊
DexKit.requireMethodFromCache(AIO_InputRootInit_QQNT).hookAfter(this) {
it.thisObject.javaClass.declaredFields.single { it.type == EditText::class.java }.apply {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/xyz/nextalone/hook/SimplifyQQSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object SimplifyQQSettings : MultiItemDelayableHook("na_simplify_qq_settings_mult
}
}
})
} else if (requireMinQQVersion(QQVersion.QQ_8_9_63)) {
} else if (requireMinQQVersion(QQVersion.QQ_8_9_63_BETA_11345)) {
//Lcom/tencent/mobileqq/managers/CUOpenCardGuideMng;->b(I)Lcom/tencent/mobileqq/managers/CUOpenCardGuideMng$a;
Initiator.loadClass("com/tencent/mobileqq/managers/CUOpenCardGuideMng").let { clz ->
val m = clz.declaredMethods.single {
Expand Down

0 comments on commit 14631b9

Please sign in to comment.