From 65ddd522dca19e0590d9cb6fdb2d85ad7b98481e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 20 Jun 2022 21:33:45 +0200 Subject: [PATCH] fix: old usage of `toInstructions` extension method --- .../patch/FullscreenPanelsRemoverPatch.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt index c97580e35..556dd8573 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/patch/FullscreenPanelsRemoverPatch.kt @@ -5,13 +5,11 @@ import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.implementation.BytecodeData import app.revanced.patcher.data.implementation.proxy +import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.implementation.BytecodePatch import app.revanced.patcher.patch.implementation.misc.PatchResult -import app.revanced.patcher.patch.implementation.misc.PatchResultError import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess -import app.revanced.patcher.util.smali.toInstructions -import app.revanced.patcher.extensions.addInstructions import app.revanced.patches.youtube.layout.fullscreenpanels.annotations.FullscreenPanelsCompatibility @Patch @@ -21,17 +19,17 @@ import app.revanced.patches.youtube.layout.fullscreenpanels.annotations.Fullscre @Version("0.0.1") class FullscreenPanelsRemovalPatch : BytecodePatch(listOf()) { override fun execute(data: BytecodeData): PatchResult { - val classDef = data.classes.first { it.type.endsWith("FullscreenEngagementPanelOverlay;") } - val method = data.proxy(classDef).resolve().methods.first { it.name == "" } - val implementation = method.implementation!! + val classDef = data.classes.first { it.type.endsWith("FullscreenEngagementPanelOverlay;") } + val method = data.proxy(classDef).resolve().methods.first { it.name == "" } + val implementation = method.implementation!! - implementation.addInstructions( - implementation.instructions.count() - 1, - """ + method.addInstructions( + implementation.instructions.count() - 1, + """ const/4 v1, 0x0 iput-boolean v1, v0, ${classDef.type}->a:Z - """.trimIndent().toInstructions("", 2, true)) - + """ + ) return PatchResultSuccess() }