mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 09:04:34 +02:00
fix(YouTube/Return YouTube Dislike): dislike count for previous video is displayed after clicking dislike button in Shorts
This commit is contained in:
parent
a153a80989
commit
3273b6fc8c
@ -2,6 +2,7 @@ package app.revanced.patches.youtube.utils.returnyoutubedislike.shorts
|
|||||||
|
|
||||||
import app.revanced.extensions.exception
|
import app.revanced.extensions.exception
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
@ -9,6 +10,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
|||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
|
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.IncognitoFingerprint
|
||||||
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.ShortsTextViewFingerprint
|
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.ShortsTextViewFingerprint
|
||||||
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.TextComponentSpecFingerprint
|
import app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints.TextComponentSpecFingerprint
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||||
@ -21,6 +23,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
@Patch(dependencies = [SettingsPatch::class])
|
@Patch(dependencies = [SettingsPatch::class])
|
||||||
object ReturnYouTubeDislikeShortsPatch : BytecodePatch(
|
object ReturnYouTubeDislikeShortsPatch : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
|
IncognitoFingerprint,
|
||||||
ShortsTextViewFingerprint,
|
ShortsTextViewFingerprint,
|
||||||
TextComponentSpecFingerprint
|
TextComponentSpecFingerprint
|
||||||
)
|
)
|
||||||
@ -85,6 +88,15 @@ object ReturnYouTubeDislikeShortsPatch : BytecodePatch(
|
|||||||
removeInstruction(insertIndex)
|
removeInstruction(insertIndex)
|
||||||
}
|
}
|
||||||
} ?: throw TextComponentSpecFingerprint.exception
|
} ?: throw TextComponentSpecFingerprint.exception
|
||||||
|
|
||||||
|
IncognitoFingerprint.result?.let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
addInstruction(
|
||||||
|
1,
|
||||||
|
"sput-boolean p4, $INTEGRATIONS_RYD_CLASS_DESCRIPTOR->isIncognito:Z"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw IncognitoFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.youtube.utils.returnyoutubedislike.shorts.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object IncognitoFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
|
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("${'$'}AutoValue_AccountIdentity;") }
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user