feat(kakaotalk): add patch and fingerprint to remove native ad

This commit is contained in:
2025-05-21 17:29:43 +09:00
parent 76dcd4c479
commit d62649da49
3 changed files with 62 additions and 0 deletions

View File

@ -256,6 +256,10 @@ public final class app/revanced/patches/kakaotalk/ads/RemoveMoreTabAdPatchKt {
public static final fun getRemoveMoreTabAdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/ads/RemoveNativeAdPatchKt {
public static final fun getRemoveNativeAdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/kakaotalk/ads/RemoveOlkChatRoomListAdPatchKt {
public static final fun getRemoveOlkChatRoomListAdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@ -0,0 +1,24 @@
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.loadNativeAdFingerprint
val removeNativeAdPatch = bytecodePatch(
name = "Remove native ad",
description = "Removes the native ad from the app.",
) {
compatibleWith("com.kakao.talk"("25.4.2"))
execute {
val method = loadNativeAdFingerprint.method
method.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
""".trimIndent()
)
}
}

View File

@ -0,0 +1,34 @@
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 loadNativeAdFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
parameters("I", "Lcom/kakao/adfit/ads/media/NativeAdLoader\$AdLoadListener;")
returns("Z")
strings(
"listener",
" owner is destroyed.",
" loading is already started.",
"Request Native AD",
" loading is started.",
"Native ad is cached. [id = ",
"] [dsp = ",
"] [count = ",
"Invalid Count: "
)
opcodes(
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.IF_LEZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.CONST_4,
Opcode.IF_NE,
)
custom { method, classDef -> method.name == "load" }
}