mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
fix(return-youtube-dislike): dislikes disappear when you scroll down https://github.com/inotia00/ReVanced_Extended/issues/644
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.youtube.misc.returnyoutubedislike.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TextComponentSpecExtensionFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4
|
||||
),
|
||||
strings = listOf("TextComponentSpec: No converter for extension: %s")
|
||||
)
|
@ -47,6 +47,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
LikeFingerprint,
|
||||
RemoveLikeFingerprint,
|
||||
ShortsTextComponentParentFingerprint,
|
||||
TextComponentSpecExtensionFingerprint,
|
||||
TextComponentSpecParentFingerprint
|
||||
)
|
||||
) {
|
||||
@ -108,6 +109,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
}
|
||||
} ?: return TextComponentSpecObjectFingerprint.toErrorResult()
|
||||
|
||||
|
||||
TextComponentSpecFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let {
|
||||
with (it.mutableMethod) {
|
||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
@ -124,6 +126,25 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
} ?: return TextComponentSpecParentFingerprint.toErrorResult()
|
||||
|
||||
|
||||
TextComponentSpecExtensionFingerprint.result?.let {
|
||||
with (it.mutableMethod) {
|
||||
val targetIndex = it.scanResult.patternScanResult!!.startIndex + 1
|
||||
val targetRegister =
|
||||
(instruction(targetIndex) as OneRegisterInstruction).registerA
|
||||
val dummyRegister =
|
||||
(instruction(targetIndex + 1) as OneRegisterInstruction).registerA
|
||||
|
||||
addInstructions(
|
||||
targetIndex + 1, """
|
||||
move-object/from16 v$dummyRegister, p0
|
||||
invoke-static {v$dummyRegister, v$targetRegister}, $INTEGRATIONS_RYD_CLASS_DESCRIPTOR->overrideLikeDislikeSpan(Ljava/lang/Object;Landroid/text/SpannableString;)Landroid/text/SpannableString;
|
||||
move-result-object v$targetRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return TextComponentSpecExtensionFingerprint.toErrorResult()
|
||||
|
||||
|
||||
ShortsTextComponentParentFingerprint.result?.let {
|
||||
with (context
|
||||
.toMethodWalker(it.method)
|
||||
|
Reference in New Issue
Block a user