feat(kakaotalk): add patch and fingerprint to remove OpenLink chat room list ad

This commit is contained in:
2025-05-19 20:49:23 +09:00
parent 9b9679a3aa
commit 57f3a92189
3 changed files with 60 additions and 0 deletions

View File

@ -248,6 +248,10 @@ public final class app/revanced/patches/kakaotalk/ads/RemoveBizBoardPatchKt {
public static final fun getRemoveBizBoardPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/ads/RemoveOlkChatRoomListAdPatchKt {
public static final fun getRemoveOlkChatRoomListAdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/changemodel/ChangeModelPatchKt {
public static final fun getChangeModelPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@ -0,0 +1,31 @@
package app.revanced.patches.kakaotalk.ads
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.kakaotalk.ads.fingerprints.removeOlkChatRoomListAdFingerprint
import app.revanced.patches.kakaotalk.common.fingerprints.kotlinUnitInstanceFingerprint
@Suppress("unused")
val removeOlkChatRoomListAdPatch = bytecodePatch(
name = "Remove OpenLink chat room list ad",
description = "Removes the OpenLink chat room list ad.",
) {
compatibleWith("com.kakao.talk"("25.4.2"))
execute {
val findUnit = kotlinUnitInstanceFingerprint.method
val unitClass = findUnit.definingClass
val method = removeOlkChatRoomListAdFingerprint.method
// I tried to find the field name, but it's pretty obvious to me, so I hardcode it.
// If it changes, we need to fix it
method.addInstructions(
0,
"""
sget-object v0, $unitClass->a:$unitClass
return-object v0
""".trimIndent()
)
}
}

View File

@ -0,0 +1,25 @@
package app.revanced.patches.kakaotalk.ads.fingerprints
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val removeOlkChatRoomListAdFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
parameters("Ljava/lang/Object;")
returns("Ljava/lang/Object;")
strings("list", "key_ad_info", "")
opcodes(
Opcode.MOVE_OBJECT_FROM16,
Opcode.SGET_OBJECT,
Opcode.INVOKE_STATIC_RANGE,
Opcode.SGET_BOOLEAN,
Opcode.IGET_OBJECT,
Opcode.IGET,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
Opcode.CONST_STRING,
Opcode.IGET_OBJECT,
Opcode.IF_EQZ,
)
}