refactor(pandora): DisableAudioAdsPatch
This commit is contained in:
parent
b6d1f1c62a
commit
b174421e2b
2 changed files with 17 additions and 16 deletions
|
|
@ -1,16 +1,16 @@
|
|||
package app.revanced.patches.pandora.ads
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val disableAudioAdsPatch = bytecodePatch(
|
||||
name = "Disable audio ads",
|
||||
@Suppress("unused", "ObjectPropertyName")
|
||||
val `Disable Audio Ads` by creatingBytecodePatch(
|
||||
description = "Disable audio ads"
|
||||
) {
|
||||
compatibleWith("com.pandora.android")
|
||||
|
||||
apply {
|
||||
getIsAdSupportedFingerprint.method.returnEarly(false)
|
||||
requestAudioAdFingerprint.method.returnEarly()
|
||||
getIsAdSupportedMethod.returnEarly(false)
|
||||
requestAudioAdMethod.returnEarly()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
package app.revanced.patches.pandora.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||
import app.revanced.patcher.definingClass
|
||||
import app.revanced.patcher.name
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val getIsAdSupportedFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "getIsAdSupported" && classDef.endsWith("UserData;")
|
||||
}
|
||||
internal val BytecodePatchContext.getIsAdSupportedMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("getIsAdSupported")
|
||||
definingClass("UserData;")
|
||||
}
|
||||
|
||||
internal val requestAudioAdFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "requestAudioAdFromAdSDK" && classDef.endsWith("ContentServiceOpsImpl;")
|
||||
}
|
||||
}
|
||||
internal val BytecodePatchContext.requestAudioAdMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("requestAudioAdFromAdSDK")
|
||||
definingClass("ContentServiceOpsImpl;"::endsWith)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue