mirror of
https://github.com/revanced/revanced-patches
synced 2024-06-07 05:37:53 +02:00
28 lines
920 B
Kotlin
28 lines
920 B
Kotlin
package app.revanced.patches.hexeditor.ad
|
|
|
|
import app.revanced.patcher.data.BytecodeContext
|
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
|
import app.revanced.patcher.patch.BytecodePatch
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
import app.revanced.patcher.patch.annotation.Patch
|
|
import app.revanced.patches.hexeditor.ad.fingerprints.PrimaryAdsFingerprint
|
|
import app.revanced.util.exception
|
|
|
|
@Patch(
|
|
name = "Disable ads",
|
|
compatiblePackages = [CompatiblePackage("com.myprog.hexedit")]
|
|
)
|
|
@Suppress("unused")
|
|
object DisableAdsPatch : BytecodePatch(
|
|
setOf(PrimaryAdsFingerprint)
|
|
) {
|
|
override fun execute(context: BytecodeContext) =
|
|
PrimaryAdsFingerprint.result?.mutableMethod?.replaceInstructions(
|
|
0,
|
|
"""
|
|
const/4 v0, 0x1
|
|
return v0
|
|
"""
|
|
) ?: throw PrimaryAdsFingerprint.exception
|
|
}
|