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 d34c6905cb
commit 314e955a3d
13 changed files with 31 additions and 38 deletions

View File

@ -36,11 +36,11 @@ class IntegrationsPatch : BytecodePatch(
val implementation = result.method.implementation!!
val count = implementation.registerCount - 1
implementation.addInstructions(
result.method.addInstructions(
result.scanResult.endIndex + 1, """
invoke-static {v$count}, Lpl/jakubweg/StringRef;->setContext(Landroid/content/Context;)V
sput-object v$count, Lapp/revanced/integrations/Globals;->context:Landroid/content/Context;
""".trimIndent().toInstructions()
"""
)
val classDef = result.definingClassProxy.resolve()