Skip to content

Commit

Permalink
fix: pangu on 9.0.65+
Browse files Browse the repository at this point in the history
  • Loading branch information
leafmoes committed Oct 1, 2024
1 parent bbf5c78 commit 60dde10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/cc/microblock/hook/Pangu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@ object SendPangu : CommonSwitchFunctionHook("sendMsgPangu", arrayOf(AIOTextEleme
override fun initOnce(): Boolean {
DexKit.requireMethodFromCache(AIOTextElementCtor)
.hookBefore(this) {
val content = it.args[0].get(if (requireMinQQVersion(QQVersion.QQ_9_0_65)) "e" else "a") as String
val inputStrFieldName = if (requireMinQQVersion(QQVersion.QQ_9_0_65)) "e" else "a"
val content = it.args[0].get(inputStrFieldName) as String
if (!content.startsWith(",,") && !content.startsWith(",,"))
it.args[0].set("a", processPangu(content))
it.args[0].set(inputStrFieldName, processPangu(content))
else
it.args[0].set("a", content.substring(2))
it.args[0].set(inputStrFieldName, content.substring(2))
}
return true
}
Expand Down

0 comments on commit 60dde10

Please sign in to comment.