mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-04 08:34:27 +02:00
fix(YouTube/Spoof player parameters): error toast shown when you first launch the app
This commit is contained in:
parent
78da7f9ccd
commit
2eee2018fe
@ -80,7 +80,7 @@ object SpoofPlayerParameterPatch : BytecodePatch(
|
||||
* Hook player parameter
|
||||
*/
|
||||
PlayerResponsePatch += PlayerResponsePatch.Hook.PlayerParameter(
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;Z)Ljava/lang/String;"
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;"
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,7 @@ import java.io.Closeable
|
||||
|
||||
object PlayerResponsePatch : BytecodePatch(
|
||||
setOf(PlayerParameterBuilderFingerprint)
|
||||
), Closeable,MutableSet<PlayerResponsePatch.Hook> by mutableSetOf() {
|
||||
), Closeable, MutableSet<PlayerResponsePatch.Hook> by mutableSetOf() {
|
||||
private const val VIDEO_ID_PARAMETER = 1
|
||||
private const val PLAYER_PARAMETER = 3
|
||||
private const val IS_SHORT_AND_OPENING_OR_PLAYING_PARAMETER = 11
|
||||
@ -31,7 +31,7 @@ object PlayerResponsePatch : BytecodePatch(
|
||||
|
||||
fun hookPlayerParameter(hook: Hook) = playerResponseMethod.addInstructions(
|
||||
0, """
|
||||
invoke-static {p$PLAYER_PARAMETER, p$IS_SHORT_AND_OPENING_OR_PLAYING_PARAMETER}, $hook
|
||||
invoke-static {p$VIDEO_ID_PARAMETER, p$PLAYER_PARAMETER, p$IS_SHORT_AND_OPENING_OR_PLAYING_PARAMETER}, $hook
|
||||
move-result-object p$PLAYER_PARAMETER
|
||||
"""
|
||||
)
|
||||
|
@ -155,7 +155,8 @@ object VideoIdPatch : BytecodePatch(
|
||||
// Call before any other video id hooks,
|
||||
// so they can use VideoInformation and check if the video id is for a Short.
|
||||
PlayerResponsePatch += PlayerResponsePatch.Hook.PlayerBeforeVideoId(
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->newPlayerResponseSignature(Ljava/lang/String;Z)Ljava/lang/String;")
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->newPlayerParameter(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;"
|
||||
)
|
||||
}
|
||||
|
||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "$VIDEO_PATH/VideoInformation;"
|
||||
|
Loading…
x
Reference in New Issue
Block a user