refactor(boostforreddit): DisableAdsPatch

This commit is contained in:
Pun Butrach 2026-01-12 15:42:53 +07:00
parent 8b833268bb
commit 968dfde7a8
2 changed files with 13 additions and 14 deletions

View file

@ -1,17 +1,15 @@
package app.revanced.patches.reddit.customclients.boostforreddit.ads package app.revanced.patches.reddit.customclients.boostforreddit.ads
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.creatingBytecodePatch
@Suppress("unused") @Suppress("unused", "ObjectPropertyName")
val disableAdsPatch = bytecodePatch( val `Disable ads` by creatingBytecodePatch {
name = "Disable ads",
) {
compatibleWith("com.rubenmayayo.reddit") compatibleWith("com.rubenmayayo.reddit")
apply { apply {
arrayOf(maxMediationFingerprint, admobMediationFingerprint).forEach { fingerprint -> arrayOf(maxMediationMethod, admobMediationMethod).forEach { method ->
fingerprint.method.addInstructions(0, "return-void") method.addInstructions(0, "return-void")
} }
} }
} }

View file

@ -1,11 +1,12 @@
package app.revanced.patches.reddit.customclients.boostforreddit.ads package app.revanced.patches.reddit.customclients.boostforreddit.ads
import app.revanced.patcher.fingerprint import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.patch.BytecodePatchContext
internal val maxMediationFingerprint = fingerprint { internal val BytecodePatchContext.maxMediationMethod by gettingFirstMutableMethodDeclaratively(
strings("MaxMediation: Attempting to initialize SDK") "MaxMediation: Attempting to initialize SDK"
} )
internal val admobMediationFingerprint = fingerprint { internal val BytecodePatchContext.admobMediationMethod by gettingFirstMutableMethodDeclaratively(
strings("AdmobMediation: Attempting to initialize SDK") "AdmobMediation: Attempting to initialize SDK"
} )