diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/fingerprints/SpannableStringBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/fingerprints/SpannableStringBuilderFingerprint.kt deleted file mode 100644 index ff15ead1d..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/fingerprints/SpannableStringBuilderFingerprint.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patches.youtube.utils.returnyoutubeusername.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.Opcode - -object SpannableStringBuilderFingerprint : MethodFingerprint( - returnType = "L", - opcodes = listOf( - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CONST_4 - ), - strings = listOf("TextComponentSpec: No converter for extension: %s") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/patch/ReturnYouTubeUserNamePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/patch/ReturnYouTubeUserNamePatch.kt deleted file mode 100644 index 4bc3aca56..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/returnyoutubeusername/patch/ReturnYouTubeUserNamePatch.kt +++ /dev/null @@ -1,52 +0,0 @@ -package app.revanced.patches.youtube.utils.returnyoutubeusername.patch - -import app.revanced.extensions.toErrorResult -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.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility -import app.revanced.patches.youtube.utils.returnyoutubeusername.fingerprints.SpannableStringBuilderFingerprint -import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch -import org.jf.dexlib2.iface.instruction.ReferenceInstruction -import org.jf.dexlib2.iface.instruction.formats.Instruction35c - -@Patch -@Name("return-youtube-user-name") -@Description("Replace user handles in YouTube comments with user nicknames.") -@DependsOn([SettingsPatch::class]) -@YouTubeCompatibility -@Version("0.0.1") -class ReturnYouTubeUserNamePatch : BytecodePatch( - listOf(SpannableStringBuilderFingerprint) -) { - override fun execute(context: BytecodeContext): PatchResult { - - SpannableStringBuilderFingerprint.result?.let { - it.mutableMethod.apply { - val targetIndex = it.scanResult.patternScanResult!!.startIndex - val targetReference = getInstruction(targetIndex).reference - val targetRegister = getInstruction(targetIndex).registerC - - addInstructions( - targetIndex + 1, """ - invoke-static {v$targetRegister}, Lapp/revanced/integrations/patches/utils/ReturnYouTubeCommentUsernamePatch;->onCharSequenceLoaded(Ljava/lang/CharSequence;)Ljava/lang/CharSequence; - move-result-object v$targetRegister - invoke-static {v$targetRegister}, $targetReference - """ - ) - removeInstruction(targetIndex) - } - } ?: return SpannableStringBuilderFingerprint.toErrorResult() - - return PatchResultSuccess() - } -}