mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-04 19:02:54 +01:00
feat(facebook): hide-inbox-ads
patch (#1893)
Signed-off-by: badawoll <129878899+badawoll@users.noreply.github.com>
This commit is contained in:
parent
43464fd6ff
commit
2cfc9829e1
@ -0,0 +1,18 @@
|
||||
package app.revanced.patches.messenger.ads.inbox.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object LoadInboxAdsFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
strings = listOf(
|
||||
"ads_load_begin",
|
||||
"inbox_ads_fetch_start"
|
||||
),
|
||||
access = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
customFingerprint = {
|
||||
it.definingClass == "Lcom/facebook/messaging/business/inboxads/plugins/inboxads/itemsupplier/InboxAdsItemSupplierImplementation;"
|
||||
}
|
||||
)
|
||||
|
@ -0,0 +1,29 @@
|
||||
package app.revanced.patches.messenger.ads.inbox.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.messenger.ads.inbox.fingerprints.LoadInboxAdsFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("hide-inbox-ads")
|
||||
@Description("Hides ads in inbox.")
|
||||
@Compatibility([Package("com.facebook.orca")])
|
||||
@Version("0.0.1")
|
||||
class HideInboxAdsPatch : BytecodePatch(
|
||||
listOf(LoadInboxAdsFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
LoadInboxAdsFingerprint.result?.mutableMethod?.apply {
|
||||
this.replaceInstruction(0, "return-void")
|
||||
} ?: return LoadInboxAdsFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user