refactor(peacocktv): HideAdsPatch
This commit is contained in:
parent
043cae5db6
commit
6dfe4440bb
2 changed files with 11 additions and 10 deletions
|
|
@ -1,10 +1,12 @@
|
||||||
package app.revanced.patches.peacocktv.ads
|
package app.revanced.patches.peacocktv.ads
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||||
|
import app.revanced.patcher.accessFlags
|
||||||
|
import app.revanced.patcher.patch.BytecodePatchContext
|
||||||
|
import app.revanced.patcher.returnType
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
internal val mediaTailerAdServiceFingerprint = fingerprint {
|
internal val BytecodePatchContext.mediaTailerAdServiceMethod by gettingFirstMutableMethodDeclaratively("Could not build MT Advertising service") {
|
||||||
accessFlags(AccessFlags.PUBLIC)
|
accessFlags(AccessFlags.PUBLIC)
|
||||||
returns("Ljava/lang/Object")
|
returnType("Ljava/lang/Object;")
|
||||||
strings("Could not build MT Advertising service")
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
package app.revanced.patches.peacocktv.ads
|
package app.revanced.patches.peacocktv.ads
|
||||||
|
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||||
import app.revanced.util.returnEarly
|
import app.revanced.util.returnEarly
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused", "ObjectPropertyName")
|
||||||
val hideAdsPatch = bytecodePatch(
|
val `Hide Ads` by creatingBytecodePatch(
|
||||||
name = "Hide ads",
|
description = "Hides all video ads."
|
||||||
description = "Hides all video ads.",
|
|
||||||
) {
|
) {
|
||||||
compatibleWith("com.peacocktv.peacockandroid")
|
compatibleWith("com.peacocktv.peacockandroid")
|
||||||
|
|
||||||
apply {
|
apply {
|
||||||
mediaTailerAdServiceFingerprint.method.returnEarly(false)
|
mediaTailerAdServiceMethod.returnEarly(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue