Itroublve 98956e8f1a
fix(Pixiv - Hide ads): Fix for latest version (#3616)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-09-06 09:13:57 +02:00

26 lines
916 B
Kotlin

package app.revanced.patches.pixiv.ads
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.pixiv.ads.fingerprints.ShouldShowAdsFingerprint
import app.revanced.util.exception
@Patch(
name = "Hide ads",
compatiblePackages = [CompatiblePackage("jp.pxv.android")],
)
@Suppress("unused")
object HideAdsPatch : BytecodePatch(setOf(ShouldShowAdsFingerprint)) {
override fun execute(context: BytecodeContext) =
ShouldShowAdsFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x0
return v0
""",
) ?: throw ShouldShowAdsFingerprint.exception
}