From e9fb849d5f82595125c4c14847265b56041a1862 Mon Sep 17 00:00:00 2001 From: kitadai31 <90122968+kitadai31@users.noreply.github.com> Date: Wed, 28 Jun 2023 02:03:25 +0900 Subject: [PATCH] refactor: use method to add instructions without labels (#2518) --- .../debugging/patch/RemoveDebuggingDetectionPatch.kt | 4 ++-- .../revanced/patches/vsco/misc/pro/patch/UnlockProPatch.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/scbeasy/detection/debugging/patch/RemoveDebuggingDetectionPatch.kt b/src/main/kotlin/app/revanced/patches/scbeasy/detection/debugging/patch/RemoveDebuggingDetectionPatch.kt index 5d335f9e3..3ece29f93 100644 --- a/src/main/kotlin/app/revanced/patches/scbeasy/detection/debugging/patch/RemoveDebuggingDetectionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/scbeasy/detection/debugging/patch/RemoveDebuggingDetectionPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess @@ -21,7 +21,7 @@ class RemoveDebuggingDetectionPatch : BytecodePatch( listOf(DebuggingDetectionFingerprint) ) { override fun execute(context: BytecodeContext): PatchResult { - DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructionsWithLabels( + DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions( 0, """ const/4 v0, 0x0 diff --git a/src/main/kotlin/app/revanced/patches/vsco/misc/pro/patch/UnlockProPatch.kt b/src/main/kotlin/app/revanced/patches/vsco/misc/pro/patch/UnlockProPatch.kt index e58773e95..67e6fe1d9 100644 --- a/src/main/kotlin/app/revanced/patches/vsco/misc/pro/patch/UnlockProPatch.kt +++ b/src/main/kotlin/app/revanced/patches/vsco/misc/pro/patch/UnlockProPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.vsco.misc.pro.patch import app.revanced.extensions.toErrorResult import app.revanced.patcher.annotation.* import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess @@ -22,7 +22,7 @@ class UnlockProPatch : BytecodePatch( override fun execute(context: BytecodeContext): PatchResult { RevCatSubscriptionFingerprint.result?.mutableMethod?.apply { // Set isSubscribed to true. - addInstructionsWithLabels( + addInstruction( 0, """ const p1, 0x1