Skip to content

Commit

Permalink
[mod] 开始适配微信8.0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
vitvm committed Feb 12, 2024
1 parent 5b17230 commit 35fdbf0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ android {
applicationId "com.lu.wxmask"
minSdk 24
targetSdk 34
versionCode 23
versionName "1.22-bug"
versionCode 24
versionName "1.23-bug"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/lu/wxmask/Constrant.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Constrant {
const val WX_CODE_8_0_42 = 2460
const val WX_CODE_8_0_43 = 2480
const val WX_CODE_8_0_44 = 2502
const val WX_CODE_8_0_45 = 2521
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
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_43..Constrant.WX_CODE_8_0_44 -> "z"
in Constrant.WX_CODE_8_0_44..Constrant.WX_CODE_8_0_45 -> "A"
else -> "l"
}
val MediaHistoryListUI = "com.tencent.mm.ui.chatting.gallery.MediaHistoryListUI"
Expand Down Expand Up @@ -217,9 +218,9 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
Constrant.WX_CODE_8_0_35 -> "P"
Constrant.WX_CODE_8_0_37 -> "Q"
Constrant.WX_CODE_8_0_38 -> "R"
Constrant.WX_CODE_8_0_44 -> "D"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_41, Constrant.WX_CODE_8_0_43 -> "Q"
in Constrant.WX_CODE_8_0_41..Constrant.WX_CODE_8_0_42 -> "R"
in Constrant.WX_CODE_8_0_44..Constrant.WX_CODE_8_0_45 -> "D"
else -> null
}
LogUtil.d("setEmptyActionBarTabPageUI method is :", commonHookMethodName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class EnterChattingUIPluginPart() : IPlugin {
Constrant.WX_CODE_8_0_38 -> "M"
in Constrant.WX_CODE_8_0_40..Constrant.WX_CODE_8_0_41 -> "K"
in Constrant.WX_CODE_8_0_41..Constrant.WX_CODE_8_0_42 -> "M"
Constrant.WX_CODE_8_0_44 -> "z"
in Constrant.WX_CODE_8_0_44 .. Constrant.WX_CODE_8_0_45 -> "z"
else -> null
}
var dispatchMethod: Method? = null
Expand Down Expand Up @@ -162,7 +162,7 @@ class EnterChattingHookAction(
if (listView == null) {
listView = runCatching {
val mmListViewId =
if (AppVersionUtil.getVersionCode() in Constrant.WX_CODE_8_0_42..Constrant.WX_CODE_8_0_44) {
if (AppVersionUtil.getVersionCode() in Constrant.WX_CODE_8_0_42..Constrant.WX_CODE_8_0_45) {
ResUtil.getViewId("bm6")
} else {
ResUtil.getViewId("b5n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ class HideMainUIListPluginPart : IPlugin {
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_43 .. Constrant.WX_CODE_8_0_44 -> "com.tencent.mm.ui.h3"
in Constrant.WX_CODE_8_0_43 .. Constrant.WX_CODE_8_0_45 -> "com.tencent.mm.ui.i3"
else -> null
}
var getItemMethod = if (adapterClazzName != null && getItemMethodName != null) {
var getItemMethod = if (adapterClazzName != null) {
XposedHelpers2.findMethodExactIfExists(adapterClazzName, AppUtil.getClassLoader(), getItemMethodName, Integer.TYPE)
} else {
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,22 @@ class HideSearchListUIPluginPart : IPlugin {
private val jsonResultLruCache = LruCache<String, CharSequence>(16)

override fun handleHook(context: Context, lpparam: XC_LoadPackage.LoadPackageParam) {
// handleGlobalSearch(context, lpparam)
// handleDetailSearch(context, lpparam)
if (AppVersionUtil.getVersionCode() < Constrant.WX_CODE_8_0_44) {
handleGlobalSearch(context, lpparam)
handleDetailSearch(context, lpparam)
return
}

var getItemMethod = when (AppVersionUtil.getVersionCode()) {
Constrant.WX_CODE_8_0_44 -> "h"
else -> "i"
}
//hook getItem --> rename to h
XposedHelpers2.findAndHookMethod(" com.tencent.mm.plugin.fts.ui.a0",
XposedHelpers2.findAndHookMethod("com.tencent.mm.plugin.fts.ui.a0",
context.classLoader,
"h",
getItemMethod ,
java.lang.Integer.TYPE,
object : XC_MethodHook2(){
object : XC_MethodHook2() {
override fun afterHookedMethod(param: MethodHookParam) {
super.afterHookedMethod(param)
if (needHideUserName2(param, param.result)) {
Expand Down Expand Up @@ -308,9 +315,9 @@ class HideSearchListUIPluginPart : IPlugin {
var compareText = if (fieldValue is CharSequence) {
fieldValue
} else {
if (jsonResultLruCache[jsonKey] == null){
if (jsonResultLruCache[jsonKey] == null) {
GsonUtil.toJson(fieldValue)
}else{
} else {
jsonResultLruCache[jsonKey]
}
}
Expand Down

0 comments on commit 35fdbf0

Please sign in to comment.