refactor: Migrate to new extension methods for String.toInstruction(...) and String.toInstructions(...) (#45)

This commit is contained in:
Itroublve
2022-06-23 02:22:42 +02:00
committed by GitHub
parent 9094a69be8
commit 579297efa3
13 changed files with 31 additions and 38 deletions
@@ -67,4 +67,4 @@ class ExclusiveAudioPatch : BytecodePatch(
return PatchResultSuccess()
}
}
}
@@ -9,7 +9,6 @@ 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.PatchResultSuccess
import app.revanced.patcher.util.smali.toInstructions
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
import app.revanced.patches.music.layout.tastebuilder.signatures.TasteBuilderConstructorSignature
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
@@ -9,7 +9,6 @@ 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.PatchResultSuccess
import app.revanced.patcher.util.smali.toInstructions
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
import app.revanced.patches.music.premium.backgroundplay.signatures.BackgroundPlaybackDisableSignature
@@ -24,12 +23,12 @@ class BackgroundPlayPatch : BytecodePatch(
)
) {
override fun execute(data: BytecodeData): PatchResult {
BackgroundPlaybackDisableSignature.result!!.method.implementation!!.addInstructions(
BackgroundPlaybackDisableSignature.result!!.method.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
""".trimIndent().toInstructions()
"""
)
return PatchResultSuccess()