generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Boost for Reddit): Add
Disable ads
patch (#3474)
Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
1 parent
fd22033
commit b292c20
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...in/kotlin/app/revanced/patches/reddit/customclients/boostforreddit/ads/DisableAdsPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...patches/reddit/customclients/boostforreddit/ads/fingerprints/AdmobMediationFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
) |
7 changes: 7 additions & 0 deletions
7
...d/patches/reddit/customclients/boostforreddit/ads/fingerprints/MaxMediationFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
) |