fix(YouTube/Spoof player parameters): error toast shown when you first launch the app

This commit is contained in:
inotia00 2023-12-06 02:31:16 +09:00
parent 78da7f9ccd
commit 2eee2018fe
3 changed files with 5 additions and 4 deletions

View File

@ -80,7 +80,7 @@ object SpoofPlayerParameterPatch : BytecodePatch(
* Hook player parameter * Hook player parameter
*/ */
PlayerResponsePatch += PlayerResponsePatch.Hook.PlayerParameter( 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;"
) )
/** /**

View File

@ -31,7 +31,7 @@ object PlayerResponsePatch : BytecodePatch(
fun hookPlayerParameter(hook: Hook) = playerResponseMethod.addInstructions( fun hookPlayerParameter(hook: Hook) = playerResponseMethod.addInstructions(
0, """ 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 move-result-object p$PLAYER_PARAMETER
""" """
) )

View File

@ -155,7 +155,8 @@ object VideoIdPatch : BytecodePatch(
// Call before any other video id hooks, // Call before any other video id hooks,
// so they can use VideoInformation and check if the video id is for a Short. // so they can use VideoInformation and check if the video id is for a Short.
PlayerResponsePatch += PlayerResponsePatch.Hook.PlayerBeforeVideoId( 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;" const val INTEGRATIONS_CLASS_DESCRIPTOR = "$VIDEO_PATH/VideoInformation;"