mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-18 08:43:56 +00:00
refactor(boostforreddit): DisableAdsPatch
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
package app.revanced.patches.reddit.customclients.boostforreddit.ads
|
||||
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
|
||||
@Suppress("unused")
|
||||
val disableAdsPatch = bytecodePatch(
|
||||
name = "Disable ads",
|
||||
) {
|
||||
@Suppress("unused", "ObjectPropertyName")
|
||||
val `Disable ads` by creatingBytecodePatch {
|
||||
compatibleWith("com.rubenmayayo.reddit")
|
||||
|
||||
apply {
|
||||
arrayOf(maxMediationFingerprint, admobMediationFingerprint).forEach { fingerprint ->
|
||||
fingerprint.method.addInstructions(0, "return-void")
|
||||
arrayOf(maxMediationMethod, admobMediationMethod).forEach { method ->
|
||||
method.addInstructions(0, "return-void")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
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 {
|
||||
strings("MaxMediation: Attempting to initialize SDK")
|
||||
}
|
||||
internal val BytecodePatchContext.maxMediationMethod by gettingFirstMutableMethodDeclaratively(
|
||||
"MaxMediation: Attempting to initialize SDK"
|
||||
)
|
||||
|
||||
internal val admobMediationFingerprint = fingerprint {
|
||||
strings("AdmobMediation: Attempting to initialize SDK")
|
||||
}
|
||||
internal val BytecodePatchContext.admobMediationMethod by gettingFirstMutableMethodDeclaratively(
|
||||
"AdmobMediation: Attempting to initialize SDK"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user