feat(kakaotalk): rename and update patch to handle deleted and hidden messages in chat logs

This is the 7th commit to make deleted, hidden messages visible.
This commit is contained in:
2025-05-28 02:58:16 +09:00
parent 39ef7f16bc
commit 21b69efddf
3 changed files with 53 additions and 18 deletions

View File

@ -284,8 +284,8 @@ public final class app/revanced/patches/kakaotalk/chatlog/Remove99ClampPatchKt {
public static final fun getRemove99ClampPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/chatlog/ShowDeletedMessagePatchKt {
public static final fun getShowDeletedMessagePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
public final class app/revanced/patches/kakaotalk/chatlog/ShowDeletedOrHiddenMessagePatchKt {
public static final fun getShowDeletedOrHiddenMessagePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/chatroom/Remove300PlusLimitPatchKt {

View File

@ -1,16 +0,0 @@
package app.revanced.patches.kakaotalk.chatlog
import app.revanced.patcher.patch.bytecodePatch
val showDeletedMessagePatch = bytecodePatch(
name = "Show deleted message",
description = "Shows deleted messages in chat logs",
) {
compatibleWith("com.kakao.talk"("25.4.2"))
dependsOn(addRealDeletedOrHiddenFlagPatch)
execute {
// TODO: Implement the patch to show deleted messages
}
}

View File

@ -0,0 +1,51 @@
package app.revanced.patches.kakaotalk.chatlog
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.instructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.kakaotalk.chatlog.fingerprints.createChatLogViewHolderFromRealFingerprint
import app.revanced.util.getReference
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
val showDeletedOrHiddenMessagePatch = bytecodePatch(
name = "Show deleted or hidden message",
description = "Shows deleted & hidden messages in chat logs",
) {
compatibleWith("com.kakao.talk"("25.4.2"))
dependsOn(addRealDeletedOrHiddenFlagPatch)
execute {
val method = createChatLogViewHolderFromRealFingerprint.method
val insns = method.instructions
val modifyInst = insns
.filterIsInstance<BuilderInstruction35c>()
.filter { it.opcode == Opcode.INVOKE_VIRTUAL }
.find {
it.getReference<MethodReference>()?.name == "setModify"
}
val modifyIndex = insns.indexOf(modifyInst ?: return@execute)
println("Modify index: $modifyIndex")
method.addInstructions(
modifyIndex,
"""
const/4 v12, 0x0
if-eqz v14, :skip_get_deleted_flag
iget-boolean v12, v14, LXo/c;->isRealDeleted:Z
:skip_get_deleted_flag
invoke-virtual {v4, v12}, Lcom/kakao/talk/widget/chatlog/ChatInfoView;->setDeleted(Z)V
const/4 v12, 0x0
if-eqz v14, :skip_get_hidden_flag
iget-boolean v12, v14, LXo/c;->isHidden:Z
:skip_get_hidden_flag
invoke-virtual {v4, v12}, Lcom/kakao/talk/widget/chatlog/ChatInfoView;->setHidden(Z)V
""".trimIndent()
)
}
}