refactor(boostforreddit): DisableAdsPatch
This commit is contained in:
parent
8b833268bb
commit
968dfde7a8
2 changed files with 13 additions and 14 deletions
|
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
}
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue