From 3f3d2fe780c73c628f31d2dd4dc232cdb603f08d Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Tue, 8 Oct 2024 19:46:10 +0400 Subject: [PATCH 1/4] feat(Twitter - Replace Sharing Domain): Initial commit --- api/revanced-patches.api | 18 +++ .../links/ChangeLinkSharingDomainPatch.kt | 108 ++++++++++++++++++ .../fingerprints/LinkBuilderFingerprint.kt | 8 ++ .../LinkResourceGetterFingerprint.kt | 12 ++ .../LinkSharingDomainFingerprint.kt | 7 ++ 5 files changed, 153 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index d5a47720a9..2ce99428c5 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1490,6 +1490,12 @@ public final class app/revanced/patches/twitter/misc/hook/patch/recommendation/H public static final field INSTANCE Lapp/revanced/patches/twitter/misc/hook/patch/recommendation/HideRecommendedUsersPatch; } +public final class app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch : app/revanced/patcher/patch/BytecodePatch { + public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch; + public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V + public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V +} + public final class app/revanced/patches/twitter/misc/links/OpenLinksWithAppChooserPatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/OpenLinksWithAppChooserPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V @@ -1502,6 +1508,18 @@ public final class app/revanced/patches/twitter/misc/links/SanitizeSharingLinksP public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } +public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { + public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint; +} + +public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { + public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint; +} + +public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { + public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint; +} + public final class app/revanced/patches/vsco/misc/pro/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/vsco/misc/pro/UnlockProPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt new file mode 100644 index 0000000000..97730c413d --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt @@ -0,0 +1,108 @@ +package app.revanced.patches.twitter.misc.links + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchException +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption +import app.revanced.patches.twitter.misc.links.fingerprints.LinkBuilderFingerprint +import app.revanced.patches.twitter.misc.links.fingerprints.LinkResourceGetterFingerprint +import app.revanced.patches.twitter.misc.links.fingerprints.LinkSharingDomainFingerprint +import app.revanced.util.exception +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.StringReference + + +@Patch( + name = "Change link sharing domain", + description = "Replaces the domain name of Twitter links when sharing them.", + compatiblePackages = [CompatiblePackage("com.twitter.android")] +) +@Suppress("unused") +object ChangeLinkSharingDomainPatch : BytecodePatch( + setOf( + LinkBuilderFingerprint, + LinkResourceGetterFingerprint, + LinkSharingDomainFingerprint, + ) +) { + private var domainName by stringPatchOption( + key = "domainName", + default = "fxtwitter.com", + title = "Domain name", + description = "The domain to use when sharing links.", + required = true + ) + + // This method is used to build the link that is shared when the "Share via..." button is pressed. + private const val FORMAT_METHOD_RESOURCE_REFERENCE = + "Lapp/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch;->" + + "formatResourceLink([Ljava/lang/Object;)Ljava/lang/String;" + + // This method is used to build the link that is shared when the "Copy link" button is pressed. + private const val FORMAT_METHOD_REFERENCE = + "Lapp/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch;->" + + "formatLink(JLjava/lang/String;)Ljava/lang/String;" + + override fun execute(context: BytecodeContext) { + + LinkSharingDomainFingerprint.result?.let { + val replacementIndex = it.scanResult.stringsScanResult!!.matches.first().index + val domainRegister = it.mutableMethod.getInstruction(replacementIndex).registerA + it.mutableMethod.replaceInstruction( + replacementIndex, + "const-string v$domainRegister, \"https://$domainName\"" + ) + } ?: throw LinkSharingDomainFingerprint.exception + + fun Method.indexOfFirstOrThrow(errorMessage: String, predicate: Instruction.() -> Boolean) = + indexOfFirstInstruction(predicate).also { + if (it == -1) throw PatchException(errorMessage) + } + + // Replace the domain name when copying a link with "Copy link" button. + LinkBuilderFingerprint.result?.let { + it.mutableMethod.apply { + addInstructions( + 0, + """ + invoke-static { p0, p1, p2 }, $FORMAT_METHOD_REFERENCE + move-result-object p0 + return-object p0 + """ + ) + } + } ?: throw LinkBuilderFingerprint.exception + + // Used in the Share via... dialog. + LinkResourceGetterFingerprint.result?.mutableMethod?.apply { + val constWithParameterName = indexOfFirstOrThrow("Could not find constWithParameterName") { + val reference = getReference() + opcode == Opcode.CONST_STRING && + (reference?.string?.contains("id.toString()") == true) + } + + // Format the link with the new domain name call address. (2 instructions above the const-string) + val formatLinkCallIndex = constWithParameterName - 2 + + val formatLinkCall = getInstruction(formatLinkCallIndex) + if (formatLinkCall.registerCount != 3) throw LinkResourceGetterFingerprint.exception + + // Replace the original method call with the new method call. + replaceInstruction( + formatLinkCallIndex, + "invoke-static { v${formatLinkCall.registerE} }, $FORMAT_METHOD_RESOURCE_REFERENCE" + ) + } ?: throw LinkResourceGetterFingerprint.exception + } +} diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt new file mode 100644 index 0000000000..5c9d2581c1 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt @@ -0,0 +1,8 @@ +package app.revanced.patches.twitter.misc.links.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint + +// Returns a shareable link string based on a tweet ID and a username. +object LinkBuilderFingerprint : MethodFingerprint( + strings = listOf("/%1\$s/status/%2\$d"), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt new file mode 100644 index 0000000000..583f8fd0cc --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.twitter.misc.links.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +// Gets Resource string for share link view available by pressing "Share via" button. +object LinkResourceGetterFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Landroid/content/res/Resources;"), + strings = listOf("res", "res.getString(R.string.t", "hareUrl"), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt new file mode 100644 index 0000000000..b8f53ba248 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt @@ -0,0 +1,7 @@ +package app.revanced.patches.twitter.misc.links.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint + +object LinkSharingDomainFingerprint : MethodFingerprint( + strings = listOf("https://fxtwitter.com"), +) \ No newline at end of file From cca8feb6da3fa093c3edc7ae69e5f02b4b78beb5 Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Fri, 11 Oct 2024 12:06:52 +0400 Subject: [PATCH 2/4] feat(Twitter - Replace Sharing Domain): Make fingerprints internal, improve resource getter fingerprint and remove custom exception --- .../misc/links/ChangeLinkSharingDomainPatch.kt | 12 ++---------- .../links/fingerprints/LinkBuilderFingerprint.kt | 2 +- .../fingerprints/LinkResourceGetterFingerprint.kt | 4 ++-- .../fingerprints/LinkSharingDomainFingerprint.kt | 2 +- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt index 97730c413d..aa9849fc75 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt @@ -5,7 +5,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption @@ -14,11 +13,9 @@ import app.revanced.patches.twitter.misc.links.fingerprints.LinkResourceGetterFi import app.revanced.patches.twitter.misc.links.fingerprints.LinkSharingDomainFingerprint import app.revanced.util.exception import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstruction +import app.revanced.util.indexOfFirstInstructionOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.StringReference @@ -65,11 +62,6 @@ object ChangeLinkSharingDomainPatch : BytecodePatch( ) } ?: throw LinkSharingDomainFingerprint.exception - fun Method.indexOfFirstOrThrow(errorMessage: String, predicate: Instruction.() -> Boolean) = - indexOfFirstInstruction(predicate).also { - if (it == -1) throw PatchException(errorMessage) - } - // Replace the domain name when copying a link with "Copy link" button. LinkBuilderFingerprint.result?.let { it.mutableMethod.apply { @@ -86,7 +78,7 @@ object ChangeLinkSharingDomainPatch : BytecodePatch( // Used in the Share via... dialog. LinkResourceGetterFingerprint.result?.mutableMethod?.apply { - val constWithParameterName = indexOfFirstOrThrow("Could not find constWithParameterName") { + val constWithParameterName = indexOfFirstInstructionOrThrow { val reference = getReference() opcode == Opcode.CONST_STRING && (reference?.string?.contains("id.toString()") == true) diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt index 5c9d2581c1..0df584cf2c 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint.kt @@ -3,6 +3,6 @@ package app.revanced.patches.twitter.misc.links.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint // Returns a shareable link string based on a tweet ID and a username. -object LinkBuilderFingerprint : MethodFingerprint( +internal object LinkBuilderFingerprint : MethodFingerprint( strings = listOf("/%1\$s/status/%2\$d"), ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt index 583f8fd0cc..a84181f62c 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.kt @@ -5,8 +5,8 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags // Gets Resource string for share link view available by pressing "Share via" button. -object LinkResourceGetterFingerprint : MethodFingerprint( +internal object LinkResourceGetterFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/content/res/Resources;"), - strings = listOf("res", "res.getString(R.string.t", "hareUrl"), + strings = listOf("res.getString(R.string.t…lUsername, id.toString())"), ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt index b8f53ba248..e4b1a7f300 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint.kt @@ -2,6 +2,6 @@ package app.revanced.patches.twitter.misc.links.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -object LinkSharingDomainFingerprint : MethodFingerprint( +internal object LinkSharingDomainFingerprint : MethodFingerprint( strings = listOf("https://fxtwitter.com"), ) \ No newline at end of file From 38fa7db7ebbb43338ed19e5f9baaa1fd8a1d7f4f Mon Sep 17 00:00:00 2001 From: Alex Uskov Date: Fri, 11 Oct 2024 12:08:21 +0400 Subject: [PATCH 3/4] feat(Twitter - Replace Sharing Domain): Rebuild api --- api/revanced-patches.api | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 2ce99428c5..74523ce8c9 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1508,18 +1508,6 @@ public final class app/revanced/patches/twitter/misc/links/SanitizeSharingLinksP public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } -public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { - public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkBuilderFingerprint; -} - -public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { - public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint; -} - -public final class app/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { - public static final field INSTANCE Lapp/revanced/patches/twitter/misc/links/fingerprints/LinkSharingDomainFingerprint; -} - public final class app/revanced/patches/vsco/misc/pro/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/vsco/misc/pro/UnlockProPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V From 3088bffefb0640fe2aa19ac927a11c80736a136f Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 17 Oct 2024 17:22:36 +0200 Subject: [PATCH 4/4] slight refactor --- .../links/ChangeLinkSharingDomainPatch.kt | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt index aa9849fc75..06597dd81d 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt @@ -14,16 +14,14 @@ import app.revanced.patches.twitter.misc.links.fingerprints.LinkSharingDomainFin import app.revanced.util.exception import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c import com.android.tools.smali.dexlib2.iface.reference.StringReference - @Patch( name = "Change link sharing domain", description = "Replaces the domain name of Twitter links when sharing them.", - compatiblePackages = [CompatiblePackage("com.twitter.android")] + compatiblePackages = [CompatiblePackage("com.twitter.android")], ) @Suppress("unused") object ChangeLinkSharingDomainPatch : BytecodePatch( @@ -31,34 +29,33 @@ object ChangeLinkSharingDomainPatch : BytecodePatch( LinkBuilderFingerprint, LinkResourceGetterFingerprint, LinkSharingDomainFingerprint, - ) + ), ) { private var domainName by stringPatchOption( key = "domainName", default = "fxtwitter.com", title = "Domain name", - description = "The domain to use when sharing links.", - required = true + description = "The domain name to use when sharing links.", + required = true, ) // This method is used to build the link that is shared when the "Share via..." button is pressed. private const val FORMAT_METHOD_RESOURCE_REFERENCE = "Lapp/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch;->" + - "formatResourceLink([Ljava/lang/Object;)Ljava/lang/String;" + "formatResourceLink([Ljava/lang/Object;)Ljava/lang/String;" // This method is used to build the link that is shared when the "Copy link" button is pressed. private const val FORMAT_METHOD_REFERENCE = "Lapp/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch;->" + - "formatLink(JLjava/lang/String;)Ljava/lang/String;" + "formatLink(JLjava/lang/String;)Ljava/lang/String;" override fun execute(context: BytecodeContext) { - LinkSharingDomainFingerprint.result?.let { val replacementIndex = it.scanResult.stringsScanResult!!.matches.first().index val domainRegister = it.mutableMethod.getInstruction(replacementIndex).registerA it.mutableMethod.replaceInstruction( replacementIndex, - "const-string v$domainRegister, \"https://$domainName\"" + "const-string v$domainRegister, \"https://$domainName\"", ) } ?: throw LinkSharingDomainFingerprint.exception @@ -71,7 +68,7 @@ object ChangeLinkSharingDomainPatch : BytecodePatch( invoke-static { p0, p1, p2 }, $FORMAT_METHOD_REFERENCE move-result-object p0 return-object p0 - """ + """, ) } } ?: throw LinkBuilderFingerprint.exception @@ -79,21 +76,17 @@ object ChangeLinkSharingDomainPatch : BytecodePatch( // Used in the Share via... dialog. LinkResourceGetterFingerprint.result?.mutableMethod?.apply { val constWithParameterName = indexOfFirstInstructionOrThrow { - val reference = getReference() - opcode == Opcode.CONST_STRING && - (reference?.string?.contains("id.toString()") == true) + getReference()?.string?.contains("id.toString()") == true } - // Format the link with the new domain name call address. (2 instructions above the const-string) + // Format the link with the new domain name register (2 instructions above the const-string). val formatLinkCallIndex = constWithParameterName - 2 - - val formatLinkCall = getInstruction(formatLinkCallIndex) - if (formatLinkCall.registerCount != 3) throw LinkResourceGetterFingerprint.exception + val formatLinkCall = getInstruction(formatLinkCallIndex) // Replace the original method call with the new method call. replaceInstruction( formatLinkCallIndex, - "invoke-static { v${formatLinkCall.registerE} }, $FORMAT_METHOD_RESOURCE_REFERENCE" + "invoke-static { v${formatLinkCall.registerE} }, $FORMAT_METHOD_RESOURCE_REFERENCE", ) } ?: throw LinkResourceGetterFingerprint.exception }