Skip to content
Closed
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 @@ -21,10 +21,10 @@ class AntiFoldMsg : BaseSwitchFunctionHookItem(), IDexFind {
matcher {
usingStrings(".msgsource.sec_msg_node.clip-len")
paramTypes(
Int::class.java,
CharSequence::class.java,
null,
Boolean::class.javaPrimitiveType,
"int",
"java.lang.CharSequence",
"com.tencent.mm.ui.widget.MMNeat7extView",
"boolean",
null,
null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AvatarTransparent : BaseSwitchFunctionHookItem(), IDexFind {
val descriptors = mutableMapOf<String, String>()

methodSaveBitmap.find(dexKit, descriptors = descriptors) {
searchPackages("com.tencent.mm.sdk.platformtools")
matcher {
usingStrings("saveBitmapToImage pathName null or nil", "MicroMsg.BitmapUtil")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import moe.ouom.wekit.hooks.core.annotation.HookItem
import moe.ouom.wekit.util.log.WeLogger
import org.luckypray.dexkit.DexKitBridge
import org.luckypray.dexkit.query.enums.StringMatchType
import java.lang.reflect.Modifier
import java.util.concurrent.CopyOnWriteArrayList

@HookItem(path = "API/聊天右键菜单增强")
Expand Down Expand Up @@ -99,8 +100,20 @@ class WeChatChatContextMenuApi : ApiHookItem(), IDexFind {
// 可能会变更
val messageTagClass = item::class.java.superclass
val messageHolderClass = messageTagClass.superclass
val messageField = messageHolderClass.getField("a")
val messageObject = messageField.get(item)
var messageObject: Any?
// 新版使用方法获取 不存在父类
if (messageHolderClass === Any::class.java) {
messageObject = messageTagClass.methods.find { method ->
Modifier.isPublic(method.modifiers) &&
!Modifier.isStatic(method.modifiers) &&
method.returnType.`package`?.name?.startsWith("com.tencent.mm.storage") == true &&
method.parameterCount == 0
}!!.invoke(item)
// 部分旧版通过获取字段实现 (可能在部分旧版本不可以 因为模块最低版本为8.0.67 所以不想兼容了)
} else {
val messageField = messageHolderClass.getField("a")
messageObject = messageField.get(item)
}
val messageImplClass = messageObject::class.java
val messageWrapperClass = messageImplClass.superclass
val databaseMappingClass = messageWrapperClass.superclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class ScriptManagerDialog(

// 设置现有值
etName.text = script.name
etDesc.text = script.description ?: ""
etDesc.text = script.description
etContent.text = script.content

MaterialDialog(wrappedContext)
Expand Down Expand Up @@ -462,8 +462,10 @@ class ScriptManagerDialog(
existingScript.description = newDescription
existingScript.modifiedTime = System.currentTimeMillis()

existingScript.enabled = false

scriptManager.saveScript(existingScript)
showToast(context, "已覆盖相同ID的脚本")
showToast(context, "已覆盖相同ID的脚本 请手动启用导入脚本")

contentContainer.removeAllViews()
renderScriptList()
Expand All @@ -475,6 +477,7 @@ class ScriptManagerDialog(
name = newName,
content = newContent,
description = newDescription,
enabled = false,
order = scripts.size
)

Expand All @@ -483,7 +486,7 @@ class ScriptManagerDialog(

contentContainer.removeAllViews()
renderScriptList()
showToast(context, "已从剪贴板导入脚本")
showToast(context, "已从剪贴板导入脚本 请手动启用导入脚本")
} else {
showToast(context, "剪贴板内容格式不正确,缺少必要字段(name, id, description, content)")
}
Expand Down