From fae4029cfccfad7aa3dd8f7fbef1c63ee26b85b3 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 2 Aug 2023 00:11:56 +0200 Subject: [PATCH] feat: add `MutableMethod.getInstructions` extension function --- .../revanced/patcher/extensions/InstructionExtensions.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt index 72d1410..c670bb6 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt @@ -323,4 +323,10 @@ object InstructionExtensions { */ @Suppress("UNCHECKED_CAST") fun MutableMethod.getInstruction(index: Int): T = implementation!!.getInstruction(index) + + /** + * Get the instructions of a method. + * @return The instructions. + */ + fun MutableMethod.getInstructions(): MutableList = implementation!!.instructions } \ No newline at end of file