mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(Boost for Reddit): Add Disable ads
patch (#3474)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
fd220337f4
commit
b292c200bf
4 changed files with 43 additions and 0 deletions
|
@ -684,6 +684,12 @@ public final class app/revanced/patches/reddit/customclients/baconreader/api/Spo
|
||||||
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/reddit/customclients/boostforreddit/ads/DisableAdsPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||||
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/ads/DisableAdsPatch;
|
||||||
|
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/BaseSpoofClientPatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
|
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
|
||||||
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
|
|
|
@ -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")
|
||||||
|
)
|
Loading…
Reference in a new issue