feat(Boost for Reddit): Add Disable ads
patch (#3474)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
package app.revanced.patches.reddit.customclients.boostforreddit.ads
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patches.reddit.customclients.boostforreddit.ads.fingerprints.*
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.util.resultOrThrow
|
||||
|
||||
@Patch(
|
||||
name = "Disable ads",
|
||||
compatiblePackages = [CompatiblePackage("com.rubenmayayo.reddit")],
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableAdsPatch : BytecodePatch(
|
||||
setOf(MaxMediationFingerprint, AdmobMediationFingerprint),
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
arrayOf(MaxMediationFingerprint, AdmobMediationFingerprint).forEach {
|
||||
it.resultOrThrow().mutableMethod.addInstructions(0, "return-void")
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.reddit.customclients.boostforreddit.ads.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object AdmobMediationFingerprint : MethodFingerprint(
|
||||
strings = listOf("AdmobMediation: Attempting to initialize SDK")
|
||||
)
|
@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.reddit.customclients.boostforreddit.ads.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object MaxMediationFingerprint : MethodFingerprint(
|
||||
strings = listOf("MaxMediation: Attempting to initialize SDK")
|
||||
)
|
Reference in New Issue
Block a user