From 5a2f02b97dcde95dbe901fa68cca6c6c0219cb82 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 21 Jun 2022 23:52:09 +0200 Subject: [PATCH] fix: `String.toInstructions` defaulting `forStaticMethod` to `false` Fixes revanced/revanced-patches#46 --- .../app/revanced/patcher/util/smali/InlineSmaliCompiler.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt b/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt index 39920a4..eb5eca5 100644 --- a/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt +++ b/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt @@ -67,7 +67,8 @@ class InlineSmaliCompiler { fun String.toInstructions(templateMethod: Method? = null) = InlineSmaliCompiler.compile(this, templateMethod?.parameters?.joinToString("") { it } ?: "", templateMethod?.implementation?.registerCount ?: 1, - (templateMethod?.accessFlags ?: 0) and AccessFlags.STATIC.value != 0) + templateMethod?.let { AccessFlags.STATIC.isSet(it.accessFlags) } ?: true +) /** * Compile a line of Smali code to an instruction.