Skip to content

Commit

Permalink
Merge pull request #49 from mislock/main
Browse files Browse the repository at this point in the history
支持Google Play Store最新版微信
  • Loading branch information
Mingyueyixi authored Jun 9, 2024
2 parents bceae45 + 50f7603 commit 3ef1bdf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/lu/wxmask/Constrant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class Constrant {
const val WX_CODE_8_0_45 = 2521
const val WX_CODE_8_0_46 = 2540
const val WX_CODE_8_0_47 = 2560

// Google Play Store
const val WX_CODE_PLAY_8_0_42 = 2429
}

}
5 changes: 3 additions & 2 deletions app/src/main/java/com/lu/wxmask/plugin/WXConfigPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ private Object findChatUserObject(Object fragmentObj) {
//8.0.33: oi3.b
//8.0.34: ck3.b
//8.0.37: zq3.b
Object f = XposedHelpers2.getObjectField(fragmentObj, "f");
// fragmentObj is instance of com.tencent.mm.ui.chatting.BaseChattingFragment
Object f = XposedHelpers2.getObjectField(fragmentObj, "f"); // WX_CODE_PLAY_8_0_42 matches
if (f != null) {
//com.tencent.mm.storage.y1
if (AppVersionUtil.getVersionCode() <= Constrant.WX_CODE_8_0_32) {
Expand All @@ -237,7 +238,7 @@ private Object findChatUserObject(Object fragmentObj) {
//8.0.34开始,数据库基类改变。包:com.tencent.mm.autogen.table 已经不存在,不再校验
Object v = XposedHelpers2.getObjectField(f, "h");
return v;
} else if (AppVersionUtil.getVersionCode() <= Constrant.WX_CODE_8_0_40) {
} else if (AppVersionUtil.getVersionCode() <= Constrant.WX_CODE_8_0_40 || AppVersionUtil.getVersionCode() == Constrant.WX_CODE_PLAY_8_0_42) {
Object v = XposedHelpers2.getObjectField(f, "i");
return v;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
private fun setEmptyDetailHistoryUIForMedia(context: Context, lpparam: XC_LoadPackage.LoadPackageParam?) {
var mediaMethodName = when (AppVersionUtil.getVersionCode()) {
in Constrant.WX_CODE_8_0_32..Constrant.WX_CODE_8_0_35 -> "k"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_43 -> "l"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_43 -> "l" // WX_CODE_PLAY_8_0_42 matches
in Constrant.WX_CODE_8_0_43..Constrant.WX_CODE_8_0_44 -> "z"
in Constrant.WX_CODE_8_0_44..Constrant.WX_CODE_8_0_45 -> "A"
Constrant.WX_CODE_8_0_47 -> "B"
Expand Down Expand Up @@ -107,7 +107,7 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
private fun setEmptyDetailHistoryUIForGallery(context: Context, lpparam: XC_LoadPackage.LoadPackageParam?) {
val methodName = when (AppVersionUtil.getVersionCode()) {
in Constrant.WX_CODE_8_0_22..Constrant.WX_CODE_8_0_35 -> "k"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_43 -> "l"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_43 -> "l" // WX_CODE_PLAY_8_0_42 matches
else -> null
}
var galleryMethod: Method? = null
Expand Down Expand Up @@ -226,7 +226,7 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
else "R"
}

Constrant.WX_CODE_8_0_35 -> "P"
Constrant.WX_CODE_8_0_35, Constrant.WX_CODE_PLAY_8_0_42 -> "P"
Constrant.WX_CODE_8_0_37 -> "Q"
Constrant.WX_CODE_8_0_38 -> "R"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_41, Constrant.WX_CODE_8_0_43 -> "Q"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class EnterChattingUIPluginPart() : IPlugin {
else "M"
}

Constrant.WX_CODE_8_0_35 -> "J"
Constrant.WX_CODE_8_0_35, Constrant.WX_CODE_PLAY_8_0_42 -> "J"
Constrant.WX_CODE_8_0_37, Constrant.WX_CODE_8_0_43 -> "K"
Constrant.WX_CODE_8_0_38 -> "M"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_41 -> "K"
Expand Down Expand Up @@ -161,8 +161,11 @@ class EnterChattingHookAction(
}.getOrNull()
if (listView == null) {
listView = runCatching {
// Res com.tencent.mm.ui.chatting.view.MMChattingListView under com.tencent.mm.pluginsdk.ui.chat.ChattingUILayout
val mmListViewId =
if (AppVersionUtil.getVersionCode() in Constrant.WX_CODE_8_0_42..Constrant.WX_CODE_8_0_47) {
if (AppVersionUtil.getVersionCode() == Constrant.WX_CODE_PLAY_8_0_42) {
ResUtil.getViewId("bnu")
} else if (AppVersionUtil.getVersionCode() in Constrant.WX_CODE_8_0_42..Constrant.WX_CODE_8_0_47) {
ResUtil.getViewId("bm6")
} else {
ResUtil.getViewId("b5n")
Expand Down Expand Up @@ -259,7 +262,13 @@ class EnterChattingHookAction(
//糊界面一脸
val contentView = ReflectUtil.invokeMethod(fragmentObj, "getView") as? ViewGroup?
contentView?.let {
val pvId = ResUtil.getViewId("b49")
// Res com.tencent.mm.pluginsdk.ui.chat.ChattingContent under com.tencent.mm.pluginsdk.ui.chat.ChattingUILayout
val pvId =
if (AppVersionUtil.getVersionCode() == Constrant.WX_CODE_PLAY_8_0_42) {
ResUtil.getViewId("bm7")
} else {
ResUtil.getViewId("b49")
}
val parent = contentView.findViewById<ViewGroup>(pvId)
var maskView = it.findViewWithTag<View>(tagConst)
if (maskView == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import java.lang.reflect.Modifier
class HideMainUIListPluginPart : IPlugin {
val GetItemMethodName = when (AppVersionUtil.getVersionCode()) {
Constrant.WX_CODE_8_0_22 -> "aCW"
in Constrant.WX_CODE_8_0_22..Constrant.WX_CODE_8_0_43 -> "k"
in Constrant.WX_CODE_8_0_22..Constrant.WX_CODE_8_0_43 -> "k" // WX_CODE_PLAY_8_0_42 matches
else -> "m"
}

Expand All @@ -59,7 +59,7 @@ class HideMainUIListPluginPart : IPlugin {
}

Constrant.WX_CODE_8_0_35 -> "com.tencent.mm.ui.conversation.r"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_41 -> "com.tencent.mm.ui.conversation.x"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_41 -> "com.tencent.mm.ui.conversation.x" // WX_CODE_PLAY_8_0_42 matches
Constrant.WX_CODE_8_0_47 -> "com.tencent.mm.ui.conversation.p3"
else -> null
}
Expand Down Expand Up @@ -155,8 +155,10 @@ class HideMainUIListPluginPart : IPlugin {
//隐藏未读消息红点
private fun hideUnReadTipView(itemView: View, param: MethodHookParam) {
//带文字的未读红点
// Res TextView under com.tencent.mm.ui.conversation.ConversationFolderItemView
val tipTvIdTextID = when (AppVersionUtil.getVersionCode()) {
in 0..Constrant.WX_CODE_8_0_22 -> "tipcnt_tv"
Constrant.WX_CODE_PLAY_8_0_42 -> "oqu"
in Constrant.WX_CODE_8_0_22..Constrant.WX_CODE_8_0_41 -> "kmv"
else -> "kmv"
}
Expand All @@ -166,6 +168,7 @@ class HideMainUIListPluginPart : IPlugin {
//头像上的小红点
val small_red = when (AppVersionUtil.getVersionCode()) {
in 0..Constrant.WX_CODE_8_0_40 -> "a2f"
Constrant.WX_CODE_PLAY_8_0_42 -> "a_w"
Constrant.WX_CODE_8_0_41 -> "o_u"
else -> "o_u"
}
Expand All @@ -175,9 +178,11 @@ class HideMainUIListPluginPart : IPlugin {

//隐藏最后一条消息等
private fun hideMsgViewItemText(itemView: View, param: MethodHookParam) {
// Res com.tencent.mm.ui.base.NoMeasuredTextView (tag last_msg_tv) under com.tencent.mm.ui.conversation.ConversationFolderItemView
val msgTvIdName = when (AppVersionUtil.getVersionCode()) {
in 0..Constrant.WX_CODE_8_0_22 -> "last_msg_tv"
in Constrant.WX_CODE_8_0_22..Constrant.WX_CODE_8_0_40 -> "fhs"
Constrant.WX_CODE_PLAY_8_0_42 -> "i2_"
Constrant.WX_CODE_8_0_41 -> "ht5"
else -> "ht5"
}
Expand Down Expand Up @@ -261,7 +266,7 @@ class HideMainUIListPluginPart : IPlugin {
Constrant.WX_CODE_8_0_22 -> "com.tencent.mm.ui.g"
in Constrant.WX_CODE_8_0_32..Constrant.WX_CODE_8_0_34 -> "com.tencent.mm.ui.y"
in Constrant.WX_CODE_8_0_35..Constrant.WX_CODE_8_0_38 -> "com.tencent.mm.ui.z"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_43 -> "com.tencent.mm.ui.b0"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_43 -> "com.tencent.mm.ui.b0" // WX_CODE_PLAY_8_0_42 matches
in Constrant.WX_CODE_8_0_43..Constrant.WX_CODE_8_0_44 -> "com.tencent.mm.ui.h3"
in Constrant.WX_CODE_8_0_43..Constrant.WX_CODE_8_0_47 -> "com.tencent.mm.ui.i3"
else -> null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import com.lu.lposed.api2.XC_MethodHook2
import com.lu.lposed.api2.XposedHelpers2
import com.lu.lposed.plugin.IPlugin
import com.lu.lposed.plugin.PluginProviders
import com.lu.magic.util.AppUtil
import com.lu.magic.util.GsonUtil
import com.lu.magic.util.ReflectUtil
import com.lu.magic.util.TextUtil
import com.lu.magic.util.log.LogUtil
import com.lu.wxmask.BuildConfig
import com.lu.wxmask.Constrant
Expand All @@ -22,7 +19,6 @@ import com.lu.wxmask.util.dev.DebugUtil
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.callbacks.XC_LoadPackage
import java.lang.reflect.Field
import java.sql.Ref

/**
* 隐藏搜索列表
Expand All @@ -32,7 +28,7 @@ class HideSearchListUIPluginPart : IPlugin {
private val jsonResultLruCache = LruCache<String, CharSequence>(16)

override fun handleHook(context: Context, lpparam: XC_LoadPackage.LoadPackageParam) {
if (AppVersionUtil.getVersionCode() < Constrant.WX_CODE_8_0_44) {
if (AppVersionUtil.getVersionCode() < Constrant.WX_CODE_8_0_44) { // WX_CODE_PLAY_8_0_42 matches
handleGlobalSearch(context, lpparam)
handleDetailSearch(context, lpparam)
return
Expand Down Expand Up @@ -118,7 +114,7 @@ class HideSearchListUIPluginPart : IPlugin {

private fun handleDetailSearch(context: Context, lpparam: XC_LoadPackage.LoadPackageParam) {
var hookClazzName = when (AppVersionUtil.getVersionCode()) {
in Constrant.WX_CODE_8_0_38..Constrant.WX_CODE_8_0_41 -> "com.tencent.mm.plugin.fts.ui.x"
in Constrant.WX_CODE_8_0_38..Constrant.WX_CODE_8_0_41 -> "com.tencent.mm.plugin.fts.ui.x" // WX_CODE_PLAY_8_0_42 matches
else -> "com.tencent.mm.plugin.fts.ui.y"
}
//全局搜索详情置空
Expand Down Expand Up @@ -150,7 +146,7 @@ class HideSearchListUIPluginPart : IPlugin {
// val wxVersionCode = AppVersionUtil.getVersionCode()
// 理论上 hook com.tencent.mm.plugin.fts.ui.z#getItem 也是一样的,但是被覆盖重命名了
var hookClazzName = when (AppVersionUtil.getVersionCode()) {
in Constrant.WX_CODE_8_0_38..Constrant.WX_CODE_8_0_43 -> "com.tencent.mm.plugin.fts.ui.y"
in Constrant.WX_CODE_8_0_38..Constrant.WX_CODE_8_0_43 -> "com.tencent.mm.plugin.fts.ui.y" // WX_CODE_PLAY_8_0_42 matches
else -> "com.tencent.mm.plugin.fts.ui.z"
}
//全局搜索首页
Expand Down Expand Up @@ -201,7 +197,7 @@ class HideSearchListUIPluginPart : IPlugin {
// else -> null
// } ?: return false

val fieldName = when (AppVersionUtil.getVersionCode()) {
val fieldName = when (AppVersionUtil.getVersionCode()) { // WX_CODE_PLAY_8_0_42 not applied here
Constrant.WX_CODE_8_0_40 -> "q1"
else -> "q"
}
Expand All @@ -213,7 +209,7 @@ class HideSearchListUIPluginPart : IPlugin {
if (chatUser == null) {
when (AppVersionUtil.getVersionCode()) {
in Constrant.WX_CODE_8_0_33..Constrant.WX_CODE_8_0_41 -> {
val fieldValue: Any = XposedHelpers2.getObjectField<Any?>(itemData, "p") ?: return false
val fieldValue: Any = XposedHelpers2.getObjectField<Any?>(itemData, "p") ?: return false // WX_CODE_PLAY_8_0_42 matches
chatUser = XposedHelpers2.getObjectField<String?>(fieldValue, "e")
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/lu/wxmask/util/AppVersionUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class AppVersionUtil {
Constrant.WX_CODE_8_0_44,
Constrant.WX_CODE_8_0_45,
Constrant.WX_CODE_8_0_46,
Constrant.WX_CODE_8_0_47
Constrant.WX_CODE_8_0_47,
Constrant.WX_CODE_PLAY_8_0_42
-> true
else -> false
}
Expand Down

0 comments on commit 3ef1bdf

Please sign in to comment.