Skip to content

Commit

Permalink
[feat] 1. 合并mislock的 google play store 8.0.48版本支持;2. 适配国内版8.0.50并修复一些…
Browse files Browse the repository at this point in the history
…小bug
  • Loading branch information
Mingyueyixi committed Jul 14, 2024
1 parent a0eaff7 commit acf074b
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ v1.13版本开始,默认隐藏App在桌面的图标。隐藏以后,打开模
play store版本:

8.0.42 2429
8.0.48 2589

感谢 @mislock 大胸弟。

官网版本:
8.0.22 (2140) 2022-04-29 0
8.0.22 (2140) 2022-04-29
80.0.32 (2300) 2023-01-06
8.0.33 (2320) 2023-02-23
8.0.34 (2340) 2023-03-23
Expand All @@ -92,6 +93,7 @@ play store版本:
8.0.46 (2540) 2024-01-23
8.0.47 (2560) 2024-02-01
8.0.49 (2600) 2024-04-22
8.0.50 (2701) 2024-07-02

**PS.**
- 仅支持上述版本,所有其他版本号以及32位版本未经测试,预计百分之九十九不可用
Expand Down Expand Up @@ -167,6 +169,9 @@ SHA1: 79F1341563A9CCCAF3090D27A5E9D529008EEC42
8.0.49(2600): [https://dldir1.qq.com/weixin/android/weixin8049android2600_0x2800313d_arm64.apk](https://dldir1.qq.com/weixin/android/weixin8049android2600_0x2800313d_arm64.apk)
SHA1: 6F2B100D9A14833E371651017E154147C21BC6B9

8.0.50(2701): [https://dldir1.qq.com/weixin/android/weixin8050android2701_0x2800323e_arm64.apk](https://dldir1.qq.com/weixin/android/weixin8050android2701_0x2800323e_arm64.apk)
SHA1: EC9A3352879B3B9793A9FA1A9FCCD31D48F88DB0


推荐适配的最后两个版本,因为其他版本,作者自己不再使用

Expand Down
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 1001
versionName "2.1-bug"
versionCode 1003
versionName "2.3-niubi"

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 @@ -51,6 +51,7 @@ class Constrant {
const val WX_CODE_8_0_46 = 2540
const val WX_CODE_8_0_47 = 2560
const val WX_CODE_8_0_49 = 2600
const val WX_CODE_8_0_50 = 2701

// Google Play Store
const val WX_CODE_PLAY_8_0_42 = 2429
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/com/lu/wxmask/bean/OptionData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ class OptionData private constructor(
viewWxDbPw = json.optBoolean("viewWxDbPw", false),
)
}
fun toJson(data: OptionData): String {
return JSONObject().apply {
put("hideMainSearch", data.hideMainSearch)
put("enableMapConversation", data.enableMapConversation)
put("hideSingleSearch", data.hideSingleSearch)
put("hideMainSearchStrong", data.hideMainSearchStrong)
put("viewWxDbPw", data.viewWxDbPw)
}.toString()
}

}
}
Expand Down
11 changes: 9 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 @@ -238,14 +238,21 @@ 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
|| AppVersionUtil.getVersionCode() == Constrant.WX_CODE_PLAY_8_0_42
} else if (AppVersionUtil.getVersionCode() <= Constrant.WX_CODE_8_0_50
|| AppVersionUtil.getVersionCode() <= Constrant.WX_CODE_PLAY_8_0_42
|| AppVersionUtil.getVersionCode() == Constrant.WX_CODE_PLAY_8_0_48) {
Object v = XposedHelpers2.getObjectField(f, "i");
return v;
} else {
//8.0.33与8.0.34共同的父类: com.tencent.mm.contact.d
Field[] hitFields = XposedHelpers2.findFieldsByExactPredicate(f.getClass(), field -> ClazzN.from("com.tencent.mm.contact.d").isAssignableFrom(field.getType()));
if (hitFields == null || hitFields.length == 0) {
hitFields = XposedHelpers2.findFieldsByExactPredicate(f.getClass(), field -> {
//用户信息对象包名改了
return field.getType().getName().startsWith("com.tencent.mm.storage.");
});
}

if (hitFields.length > 0) {
Field field = hitFields[0];
Object result = field.get(f);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/lu/wxmask/plugin/WXMaskPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class WXMaskPlugin : IPlugin, ConfigSetObserver {
}

private fun loadConfigData() {
maskIdList.clear()
maskListMap.clear()
ConfigUtil.getMaskList().forEach {
maskListMap[it.maskId] = it
maskIdList.add(it.maskId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
in Constrant.WX_CODE_8_0_44..Constrant.WX_CODE_8_0_45 -> "A"
Constrant.WX_CODE_8_0_47 -> "B"
Constrant.WX_CODE_8_0_49 -> "y"
Constrant.WX_CODE_8_0_49 -> "K"

else -> "l"
}
val MediaHistoryListUI = "com.tencent.mm.ui.chatting.gallery.MediaHistoryListUI"
Expand Down Expand Up @@ -235,6 +237,7 @@ class EmptySingChatHistoryGalleryPluginPart : IPlugin {
in Constrant.WX_CODE_8_0_44..Constrant.WX_CODE_8_0_47 -> "D"
Constrant.WX_CODE_PLAY_8_0_48 -> "G"
Constrant.WX_CODE_8_0_49 -> "F"
Constrant.WX_CODE_8_0_50 -> "D"
else -> null
}
LogUtil.d("setEmptyActionBarTabPageUI method is :", commonHookMethodName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class EnterChattingUIPluginPart() : IPlugin {
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"
in Constrant.WX_CODE_8_0_44 .. Constrant.WX_CODE_8_0_47 -> "z"
Constrant.WX_CODE_PLAY_8_0_48 -> "B"
Constrant.WX_CODE_8_0_49 -> "B"
Constrant.WX_CODE_PLAY_8_0_48,Constrant.WX_CODE_8_0_49 -> "B"
Constrant.WX_CODE_8_0_50 -> "z"
else -> null
}
var dispatchMethod: Method? = null
Expand Down Expand Up @@ -167,7 +167,7 @@ class EnterChattingHookAction(
val mmListViewId =
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) {
} else if (AppVersionUtil.getVersionCode() in Constrant.WX_CODE_8_0_42..Constrant.WX_CODE_8_0_50) {
ResUtil.getViewId("bm6")
} else {
ResUtil.getViewId("b5n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ 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" // 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, Constrant.WX_CODE_PLAY_8_0_48 , Constrant.WX_CODE_8_0_49 -> "com.tencent.mm.ui.i3"
in Constrant.WX_CODE_8_0_43..Constrant.WX_CODE_8_0_47,
Constrant.WX_CODE_PLAY_8_0_48 , Constrant.WX_CODE_8_0_49, Constrant.WX_CODE_8_0_50-> "com.tencent.mm.ui.i3"
else -> null
}
var getItemMethod = if (adapterClazzName != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ class MaskManagerCenterUI @JvmOverloads constructor(
layoutParams = FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
}
isChecked = mOptionData.hideMainSearchStrong
setOnCheckedChangeListener { buttonView, isChecked ->
mOptionData.viewWxDbPw = isChecked
ConfigUtil.setOptionData(mOptionData)
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/lu/wxmask/util/AppVersionUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class AppVersionUtil {
Constrant.WX_CODE_PLAY_8_0_42,
Constrant.WX_CODE_PLAY_8_0_48,
Constrant.WX_CODE_8_0_49,
Constrant.WX_CODE_8_0_50
-> true

else -> false
}
}
Expand Down
27 changes: 18 additions & 9 deletions app/src/main/java/com/lu/wxmask/util/ConfigUtil.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.lu.wxmask.util

import android.content.SharedPreferences
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import android.text.TextUtils
import com.google.gson.JsonArray
import com.google.gson.JsonObject
Expand All @@ -15,11 +17,20 @@ import org.json.JSONObject

class ConfigUtil {
companion object {
val sp by lazy { LocalKVUtil.getTable("mask_wechat_config") }
val KEY_MASK_LIST = "maskList"
val KEY_TEMPORARY = "temporary"
val KEY_OPTIONS = "options"

val sp by lazy {
//偏好文件变更监听
LocalKVUtil.getTable("mask_wechat_config").apply {
registerOnSharedPreferenceChangeListener { _share, _key ->
LogUtil.d("onSharedPreferenceChanged", _key)
notifyConfigSetObserverChanged()
}
}
}

@JvmStatic
private val dataSetObserverList = arrayListOf<ConfigSetObserver>()

Expand Down Expand Up @@ -58,7 +69,7 @@ class ConfigUtil {
GsonUtil.toJson(data).let {
sp.edit().putString(KEY_MASK_LIST, it).apply()
}
notifyConfigSetObserverChanged()
// notifyConfigSetObserverChanged()
}

fun addMaskList(item: MaskItemBean) {
Expand All @@ -72,7 +83,7 @@ class ConfigUtil {
GsonUtil.toJson(maskList).let {
sp.edit().putString(KEY_MASK_LIST, it).apply()
}
notifyConfigSetObserverChanged()
// notifyConfigSetObserverChanged()
}

fun getTemporaryJson(): JsonObject? {
Expand All @@ -87,7 +98,7 @@ class ConfigUtil {
fun <T : BaseTemporary> setTemporary(data: T) {
try {
sp.edit().putString(KEY_TEMPORARY, data.toJson()).apply()
notifyConfigSetObserverChanged()
// notifyConfigSetObserverChanged()
} catch (e: Exception) {
LogUtil.w("save temporary fail", e)
}
Expand All @@ -99,8 +110,8 @@ class ConfigUtil {

fun setOptionData(data: OptionData) {
try {
sp.edit().putString(KEY_OPTIONS, data.toJson()).apply()
notifyConfigSetObserverChanged()
sp.edit().putString(KEY_OPTIONS, OptionData.toJson(data)).apply()
// notifyConfigSetObserverChanged()
} catch (e: Exception) {
LogUtil.w("setOptionJson fail", e)
}
Expand All @@ -112,7 +123,7 @@ class ConfigUtil {
if (!result) {
LogUtil.w("clear sp data fail$result")
}
notifyConfigSetObserverChanged()
// notifyConfigSetObserverChanged()
} catch (e: Exception) {
LogUtil.w("clear sp data fail", e)
}
Expand All @@ -135,8 +146,6 @@ class ConfigUtil {
it.onConfigChange()
}
}


}

fun interface ConfigSetObserver {
Expand Down

0 comments on commit acf074b

Please sign in to comment.