feat(kakaotalk): Add patches to remove 300+ unread limit in chatrooms

This commit is contained in:
2025-05-04 00:10:46 +09:00
parent b80ec7758f
commit ccfc313ff7
3 changed files with 84 additions and 0 deletions

View File

@ -248,6 +248,11 @@ public final class app/revanced/patches/kakaotalk/changemodel/ChangeModelPatchKt
public static final fun getChangeModelPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/chatroom/Remove300PlusLimitPatchKt {
public static final fun getRemove300PlusLimitBaseChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
public static final fun getRemove300PlusLimitOpenChatRoomPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/signature/VerifyingSignaturePatchKt {
public static final fun getVerifyingSignaturePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@ -0,0 +1,59 @@
package app.revanced.patches.kakaotalk.chatroom
import app.revanced.patcher.extensions.InstructionExtensions.instructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.Package
import app.revanced.patches.kakaotalk.chatroom.fingerprints.remove300PlusLimitBaseChatRoomFingerprint
import app.revanced.patches.kakaotalk.chatroom.fingerprints.remove300PlusLimitOpenChatRoomFingerprint
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction10t
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction22t
@Suppress("unused")
val remove300PlusLimitBaseChatRoomPatch = bytecodePatch(
name = "Disable 300+ unread limit (BaseChatRoom)",
description = "Always show the real unread count instead of '300+' in base chatroom list"
) {
compatibleWith(Package("com.kakao.talk", setOf("25.3.5")))
execute {
val method = remove300PlusLimitBaseChatRoomFingerprint.method
val branches = method.instructions
.filterIsInstance<BuilderInstruction22t>()
.filter { it.opcode == Opcode.IF_LT }
.toList()
branches.forEach { iflt ->
val idx = method.instructions.indexOf(iflt)
val gotoInsn = BuilderInstruction10t(
Opcode.GOTO,
iflt.target
)
method.replaceInstruction(idx, gotoInsn)
}
}
}
@Suppress("unused")
val remove300PlusLimitOpenChatRoomPatch = bytecodePatch(
name = "Disable 300+ unread limit (OpenChatRoom)",
description = "Always show the real unread count instead of '300+' in open chatroom list"
) {
compatibleWith(Package("com.kakao.talk", setOf("25.3.5")))
execute {
val method = remove300PlusLimitOpenChatRoomFingerprint.method
method.instructions
.filterIsInstance<BuilderInstruction22t>()
.filter { it.opcode == Opcode.IF_LT }
.toList()
.forEach { iflt ->
val idx = method.instructions.indexOf(iflt)
val gotoInsn = BuilderInstruction10t(Opcode.GOTO, iflt.target)
method.replaceInstruction(idx, gotoInsn)
}
}
}

View File

@ -0,0 +1,20 @@
package app.revanced.patches.kakaotalk.chatroom.fingerprints
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
@Suppress("unused")
internal val remove300PlusLimitBaseChatRoomFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("V")
parameters("Lcom/kakao/talk/widget/ViewBindable;")
strings("300+")
}
@Suppress("unused")
internal val remove300PlusLimitOpenChatRoomFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("V")
parameters()
strings("300+")
}