feat(YouTube): Support version 19.04.37 (#2687)

This commit is contained in:
LisoUseInAIKyrios 2024-02-04 21:38:19 +04:00 committed by GitHub
parent 544fc0f646
commit c23e0233cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 207 additions and 83 deletions

View File

@ -1420,6 +1420,10 @@ public final class app/revanced/patches/youtube/layout/startupshortsreset/Disabl
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsFingerprint;
}
public final class app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V

View File

@ -35,7 +35,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -30,7 +30,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -35,7 +35,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -22,7 +22,9 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -22,7 +22,9 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
),
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -34,7 +34,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -30,7 +30,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
],

View File

@ -36,7 +36,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -34,7 +34,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
],

View File

@ -33,7 +33,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -43,7 +43,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -34,7 +34,9 @@ import com.android.tools.smali.dexlib2.Opcode
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -40,7 +40,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -38,7 +38,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -35,7 +35,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -46,7 +46,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -39,7 +39,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -33,7 +33,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -30,7 +30,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -37,7 +37,9 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -40,7 +40,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -27,7 +27,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -29,7 +29,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -23,7 +23,9 @@ import org.w3c.dom.Element
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
],

View File

@ -57,7 +57,9 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -33,7 +33,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -42,7 +42,9 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
],

View File

@ -32,7 +32,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -2,7 +2,10 @@ package app.revanced.patches.youtube.layout.startupshortsreset
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
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.patches.all.misc.resources.AddResourcesPatch
@ -11,6 +14,12 @@ import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserW
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
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.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Patch(
name = "Disable resuming Shorts on startup",
@ -29,7 +38,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]
@ -49,19 +60,30 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch(
SwitchPreference("revanced_disable_resuming_shorts_player")
)
UserWasInShortsFingerprint.result?.apply {
val moveResultIndex = scanResult.patternScanResult!!.endIndex
UserWasInShortsFingerprint.result?.mutableMethod?.apply {
val listenableInstructionIndex = indexOfFirstInstruction {
opcode == Opcode.INVOKE_INTERFACE &&
getReference<MethodReference>()?.definingClass == "Lcom/google/common/util/concurrent/ListenableFuture;" &&
getReference<MethodReference>()?.name == "isDone"
}
if (listenableInstructionIndex < 0) throw PatchException("Could not find instruction index")
val originalInstructionRegister = getInstruction<FiveRegisterInstruction>(listenableInstructionIndex).registerC
val freeRegister = getInstruction<OneRegisterInstruction>(listenableInstructionIndex + 1).registerA
mutableMethod.addInstructionsWithLabels(
moveResultIndex + 1,
// Replace original instruction to preserve control flow label.
replaceInstruction(
listenableInstructionIndex,
"invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z"
)
addInstructionsWithLabels(
listenableInstructionIndex + 1,
"""
move-result v$freeRegister
if-eqz v$freeRegister, :show_startup_shorts_player
return-void
:show_startup_shorts_player
invoke-interface {v$originalInstructionRegister}, Lcom/google/common/util/concurrent/ListenableFuture;->isDone()Z
"""
invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z
move-result v5
if-eqz v5, :disable_shorts_player
return-void
:disable_shorts_player
nop
"""
)
} ?: throw UserWasInShortsFingerprint.exception
}

View File

@ -1,24 +1,12 @@
package app.revanced.patches.youtube.layout.startupshortsreset.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
@FuzzyPatternScanMethod(3)
internal object UserWasInShortsFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"),
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT,
),
object UserWasInShortsFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Ljava/lang/Object;"),
strings = listOf("Failed to read user_was_in_shorts proto after successful warmup"),
)

View File

@ -37,7 +37,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
)
)
]

View File

@ -41,7 +41,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -51,7 +51,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -33,7 +33,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -28,7 +28,9 @@ import app.revanced.util.exception
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -21,7 +21,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -38,7 +38,9 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
)
)
),

View File

@ -30,7 +30,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -34,7 +34,9 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -39,7 +39,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -35,7 +35,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -31,7 +31,9 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -39,7 +39,9 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -18,7 +18,9 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]

View File

@ -35,7 +35,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.49.37",
"19.01.34",
"19.02.39",
"19.03.35"
"19.03.35",
"19.03.36",
"19.04.37"
]
)
]