mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-29 22:24:31 +02:00
feat(YouTube): Add support version 20.03.45
https://github.com/inotia00/ReVanced_Extended/issues/2717#issuecomment-2760796211
This commit is contained in:
parent
f0b1155d20
commit
3e8c748f48
@ -38,6 +38,7 @@ import app.revanced.util.fingerprint.methodOrThrow
|
||||
import app.revanced.util.fingerprint.mutableClassOrThrow
|
||||
import app.revanced.util.getReference
|
||||
import app.revanced.util.getWalkerMethod
|
||||
import app.revanced.util.indexOfFirstInstruction
|
||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||
import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
|
||||
import app.revanced.util.replaceLiteralInstructionCall
|
||||
@ -268,30 +269,54 @@ val toolBarComponentsPatch = bytecodePatch(
|
||||
|
||||
createSearchSuggestionsFingerprint.methodOrThrow().apply {
|
||||
val iteratorIndex = indexOfIteratorInstruction(this)
|
||||
val replaceIndex = indexOfFirstInstructionOrThrow(iteratorIndex) {
|
||||
val replaceIndex = indexOfFirstInstruction(iteratorIndex) {
|
||||
opcode == Opcode.IGET_OBJECT &&
|
||||
getReference<FieldReference>()?.type == "Landroid/widget/ImageView;"
|
||||
}
|
||||
val uriIndex = indexOfFirstInstructionOrThrow(replaceIndex) {
|
||||
opcode == Opcode.INVOKE_STATIC &&
|
||||
getReference<MethodReference>()?.toString() == "Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;"
|
||||
}
|
||||
val jumpIndex = indexOfFirstInstructionOrThrow(uriIndex, Opcode.CONST_4)
|
||||
val replaceIndexInstruction = getInstruction<TwoRegisterInstruction>(replaceIndex)
|
||||
val freeRegister = replaceIndexInstruction.registerA
|
||||
val classRegister = replaceIndexInstruction.registerB
|
||||
val replaceIndexReference =
|
||||
getInstruction<ReferenceInstruction>(replaceIndex).reference
|
||||
if (replaceIndex > -1) {
|
||||
val uriIndex = indexOfFirstInstructionOrThrow(replaceIndex) {
|
||||
opcode == Opcode.INVOKE_STATIC &&
|
||||
getReference<MethodReference>()?.toString() == "Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;"
|
||||
}
|
||||
val jumpIndex = indexOfFirstInstructionOrThrow(uriIndex, Opcode.CONST_4)
|
||||
val replaceIndexInstruction = getInstruction<TwoRegisterInstruction>(replaceIndex)
|
||||
val freeRegister = replaceIndexInstruction.registerA
|
||||
val classRegister = replaceIndexInstruction.registerB
|
||||
val replaceIndexReference =
|
||||
getInstruction<ReferenceInstruction>(replaceIndex).reference
|
||||
|
||||
addInstructionsWithLabels(
|
||||
replaceIndex + 1, """
|
||||
invoke-static { }, $GENERAL_CLASS_DESCRIPTOR->hideSearchTermThumbnail()Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hidden
|
||||
iget-object v$freeRegister, v$classRegister, $replaceIndexReference
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
removeInstruction(replaceIndex)
|
||||
addInstructionsWithLabels(
|
||||
replaceIndex + 1, """
|
||||
invoke-static { }, $GENERAL_CLASS_DESCRIPTOR->hideSearchTermThumbnail()Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hidden
|
||||
iget-object v$freeRegister, v$classRegister, $replaceIndexReference
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
removeInstruction(replaceIndex)
|
||||
} else { // only for YT 20.03
|
||||
val insertIndex = indexOfFirstInstructionOrThrow(iteratorIndex) {
|
||||
opcode == Opcode.INVOKE_VIRTUAL &&
|
||||
getReference<MethodReference>()?.toString() == "Landroid/widget/ImageView;->setVisibility(I)V"
|
||||
} - 1
|
||||
if (getInstruction(insertIndex).opcode != Opcode.CONST_4) {
|
||||
throw PatchException("Failed to find insert index")
|
||||
}
|
||||
val freeRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
||||
val uriIndex = indexOfFirstInstructionOrThrow(insertIndex) {
|
||||
opcode == Opcode.INVOKE_STATIC &&
|
||||
getReference<MethodReference>()?.toString() == "Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;"
|
||||
}
|
||||
val jumpIndex = indexOfFirstInstructionOrThrow(uriIndex, Opcode.CONST_4)
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
invoke-static { }, $GENERAL_CLASS_DESCRIPTOR->hideSearchTermThumbnail()Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hidden
|
||||
""", ExternalLabel("hidden", getInstruction(jumpIndex))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (is_19_16_or_greater) {
|
||||
|
@ -634,8 +634,8 @@ val playerComponentsPatch = bytecodePatch(
|
||||
fingerprint.methodOrThrow(filmStripOverlayEnterParentFingerprint).hookFilmstripOverlay()
|
||||
}
|
||||
|
||||
// Removed in YouTube 20.05+
|
||||
if (!is_20_05_or_greater) {
|
||||
// Removed in YouTube 20.03+
|
||||
if (!is_20_03_or_greater) {
|
||||
youtubeControlsOverlayFingerprint.methodOrThrow().apply {
|
||||
val constIndex = indexOfFirstLiteralInstructionOrThrow(fadeDurationFast)
|
||||
val constRegister = getInstruction<OneRegisterInstruction>(constIndex).registerA
|
||||
@ -663,7 +663,7 @@ val playerComponentsPatch = bytecodePatch(
|
||||
)
|
||||
removeInstruction(insertIndex)
|
||||
}
|
||||
} else {
|
||||
} else if (is_20_05_or_greater) {
|
||||
// This is a new film strip overlay added to YouTube 20.05+
|
||||
// Disabling this flag is not related to the operation of the patch.
|
||||
filmStripOverlayConfigV2Fingerprint.injectLiteralInstructionBooleanCall(
|
||||
|
@ -13,7 +13,8 @@ internal object Constants {
|
||||
"19.16.39", // This is the last version where the 'Restore old seekbar thumbnails' setting works.
|
||||
"19.43.41", // This is the latest version where edge-to-edge display is not enforced on Android 15+.
|
||||
"19.44.39", // This is the only version that has experimental shortcut icons.
|
||||
"19.47.53", // This is the latest version supported by the RVX patch.
|
||||
"19.47.53", // This was the latest version supported by the previous RVX patch.
|
||||
"20.03.45", // This is the latest version supported by the RVX patch.
|
||||
)
|
||||
)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user