refactor: remove trimIndent before compiling instructions

This commit is contained in:
oSumAtrIX 2022-06-27 01:09:40 +02:00
parent 9329b7323a
commit a7ee89d497
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 7 additions and 7 deletions

View File

@ -244,20 +244,20 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
val block1 = """
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
move-result-object v0
""".trimIndent().toInstructions(lithoMethod)
""".toInstructions(lithoMethod)
val block2 = """
move-object/from16 v1, p3
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
invoke-static {v0, v2}, Lapp/revanced/integrations/patches/GeneralBytecodeAdsPatch;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
move-result v1
""".trimIndent().toInstructions(lithoMethod)
""".toInstructions(lithoMethod)
val block3 = """
move-object/from16 v2, p1
invoke-static {v2}, $descriptor1
move-result-object v0
iget-object v0, v0, $descriptor2
return-object v0
""".trimIndent().toInstructions(lithoMethod)
""".toInstructions(lithoMethod)
// insert blocks and branch instructions
lithoMethodImplementation.insertBlocks(
@ -368,7 +368,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
const v0, $lithoConstant
invoke-static {p0, v0}, ${descriptors[1]}
move-result-object p0
""".trimIndent().toInstructions()
""".toInstructions()
val block2 = """
invoke-static {p0}, ${descriptors[2]}
move-result-object p0
@ -376,12 +376,12 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
move-result-object v0
invoke-static {v0}, ${this.type}->getIsEmpty(Ljava/lang/String;)Z
move-result v0
""".trimIndent().toInstructions()
""".toInstructions()
val block3 = """
invoke-virtual {p0}, ${descriptors[3]}
move-result-object p0
return-object p0
""".trimIndent().toInstructions()
""".toInstructions()
// create target instruction
val targetInstruction = BuilderInstruction11n(Opcode.CONST_4, 1, 0)

View File

@ -59,7 +59,7 @@ class IntegrationsPatch : BytecodePatch(
invoke-static { }, Lapp/revanced/integrations/utils/Globals;->getAppContext()Landroid/content/Context;
move-result-object v0
return-object v0
""".trimIndent().toInstructions(), null, null
""".toInstructions(), null, null
)
).toMutable()
)