mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-07 18:14:36 +02:00
chore(YouTube): no longer checks PlayerType
or VideoInformation
to determine if it's a Short or not
This commit is contained in:
parent
bb4f8bfc04
commit
70b45b2a26
@ -14,7 +14,6 @@ import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PAC
|
|||||||
import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH
|
import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH
|
||||||
import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch
|
import app.revanced.patches.youtube.utils.playertype.PlayerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|
||||||
import app.revanced.util.findOpcodeIndicesReversed
|
import app.revanced.util.findOpcodeIndicesReversed
|
||||||
import app.revanced.util.getWalkerMethod
|
import app.revanced.util.getWalkerMethod
|
||||||
import app.revanced.util.patch.BaseBytecodePatch
|
import app.revanced.util.patch.BaseBytecodePatch
|
||||||
@ -31,7 +30,6 @@ object BackgroundPlaybackPatch : BaseBytecodePatch(
|
|||||||
description = "Removes restrictions on background playback, including for music and kids videos.",
|
description = "Removes restrictions on background playback, including for music and kids videos.",
|
||||||
dependencies = setOf(
|
dependencies = setOf(
|
||||||
PlayerTypeHookPatch::class,
|
PlayerTypeHookPatch::class,
|
||||||
VideoInformationPatch::class,
|
|
||||||
SettingsPatch::class
|
SettingsPatch::class
|
||||||
),
|
),
|
||||||
compatiblePackages = COMPATIBLE_PACKAGE,
|
compatiblePackages = COMPATIBLE_PACKAGE,
|
||||||
|
@ -5,17 +5,14 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patches.youtube.shorts.components.fingerprints.BottomBarContainerHeightFingerprint
|
import app.revanced.patches.youtube.shorts.components.fingerprints.BottomBarContainerHeightFingerprint
|
||||||
import app.revanced.patches.youtube.shorts.components.fingerprints.ReelWatchPagerFingerprint
|
|
||||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS_CLASS_DESCRIPTOR
|
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS_CLASS_DESCRIPTOR
|
||||||
import app.revanced.patches.youtube.utils.navigation.NavigationBarHookPatch
|
import app.revanced.patches.youtube.utils.navigation.NavigationBarHookPatch
|
||||||
|
import app.revanced.patches.youtube.utils.playertype.fingerprint.ReelWatchPagerFingerprint
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomBarContainer
|
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomBarContainer
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelWatchPlayer
|
|
||||||
import app.revanced.util.REGISTER_TEMPLATE_REPLACEMENT
|
|
||||||
import app.revanced.util.fingerprint.MultiMethodFingerprint
|
import app.revanced.util.fingerprint.MultiMethodFingerprint
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
import app.revanced.util.indexOfFirstWideLiteralInstructionValue
|
import app.revanced.util.indexOfFirstWideLiteralInstructionValue
|
||||||
import app.revanced.util.injectLiteralInstructionViewCall
|
|
||||||
import app.revanced.util.patch.MultiMethodBytecodePatch
|
import app.revanced.util.patch.MultiMethodBytecodePatch
|
||||||
import app.revanced.util.resultOrThrow
|
import app.revanced.util.resultOrThrow
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@ -55,7 +52,7 @@ object ShortsNavigationBarPatch : MultiMethodBytecodePatch(
|
|||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
targetIndex + 1, """
|
targetIndex + 1, """
|
||||||
invoke-static {v$heightRegister}, $SHORTS_CLASS_DESCRIPTOR->overrideNavigationBarHeight(I)I
|
invoke-static {v$heightRegister}, $SHORTS_CLASS_DESCRIPTOR->setNavigationBarHeight(I)I
|
||||||
move-result v$heightRegister
|
move-result v$heightRegister
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
@ -66,18 +63,5 @@ object ShortsNavigationBarPatch : MultiMethodBytecodePatch(
|
|||||||
|
|
||||||
// endregion.
|
// endregion.
|
||||||
|
|
||||||
// region patch for addOnAttachStateChangeListener.
|
|
||||||
|
|
||||||
val smaliInstruction = """
|
|
||||||
invoke-static {v$REGISTER_TEMPLATE_REPLACEMENT}, $SHORTS_CLASS_DESCRIPTOR->onShortsCreate(Landroid/view/View;)V
|
|
||||||
"""
|
|
||||||
|
|
||||||
ReelWatchPagerFingerprint.injectLiteralInstructionViewCall(
|
|
||||||
ReelWatchPlayer,
|
|
||||||
smaliInstruction
|
|
||||||
)
|
|
||||||
|
|
||||||
// endregion.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,12 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.shorts.components.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ReelWatchPlayer
|
|
||||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
internal object ReelWatchPagerFingerprint : LiteralValueFingerprint(
|
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
returnType = "Landroid/view/View;",
|
|
||||||
literalSupplier = { ReelWatchPlayer }
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user