feat(kakaotalk): add patch and fingerprint to remove native ad
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
)
|
||||
}
|
||||
}
|
@ -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" }
|
||||
}
|
Reference in New Issue
Block a user