-
-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(youtube/integrations): fix playback of embedded videos (#2304)
- Loading branch information
1 parent
2669f88
commit 1dffbaf
Showing
10 changed files
with
121 additions
and
24 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...pp/revanced/patches/youtube/misc/integrations/fingerprints/APIPlayerServiceFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package app.revanced.patches.youtube.misc.integrations.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
/** | ||
* For embedded playback. | ||
* It appears this hook may no longer be needed as one of the constructor parameters is the already hooked | ||
* [EmbeddedPlayerControlsOverlayFingerprint] | ||
*/ | ||
object APIPlayerServiceFingerprint : IntegrationsFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
customFingerprint = { methodDef, _ -> methodDef.definingClass == "Lcom/google/android/apps/youtube/embeddedplayer/service/service/jar/ApiPlayerService;" }, | ||
// Integrations context is the first method parameter. | ||
contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size } | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
.../app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package app.revanced.patches.youtube.misc.integrations.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
/** | ||
* For embedded playback inside the Google app (such as the in app 'discover' tab). | ||
* | ||
* Note: this fingerprint may or may not be needed, as | ||
* [RemoteEmbedFragmentFingerprint] might be set before this is called. | ||
*/ | ||
object EmbeddedPlayerFingerprint : IntegrationsFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
returnType = "L", | ||
parameters = listOf("L", "L", "Landroid/content/Context;"), | ||
strings = listOf("android.hardware.type.television"), // String is also found in other classes | ||
// Integrations context is the third method parameter. | ||
contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size + 2 } | ||
) |
19 changes: 19 additions & 0 deletions
19
...revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package app.revanced.patches.youtube.misc.integrations.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
/** | ||
* For embedded playback. Likely covers Google Play store and other Google products. | ||
*/ | ||
object RemoteEmbedFragmentFingerprint : IntegrationsFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
returnType = "V", | ||
parameters = listOf("Landroid/content/Context;", "L", "L"), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass == "Lcom/google/android/apps/youtube/embeddedplayer/service/jar/client/RemoteEmbedFragment;" | ||
}, | ||
// Integrations context is the first method parameter. | ||
contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size } | ||
) |
19 changes: 19 additions & 0 deletions
19
...evanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package app.revanced.patches.youtube.misc.integrations.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
/** | ||
* For embedded playback inside 3rd party android app (such as 3rd party Reddit apps). | ||
*/ | ||
object RemoteEmbeddedPlayerFingerprint : IntegrationsFingerprint( | ||
accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR, | ||
returnType = "V", | ||
parameters = listOf("Landroid/content/Context;", "L", "L", "Z"), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass == "Lcom/google/android/youtube/api/jar/client/RemoteEmbeddedPlayer;" | ||
}, | ||
// Integrations context is the first method parameter. | ||
contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size } | ||
) |
8 changes: 0 additions & 8 deletions
8
.../kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/ServiceFingerprint.kt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...ced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package app.revanced.patches.youtube.misc.integrations.fingerprints | ||
|
||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint | ||
|
||
/** | ||
* Old API activity to embed YouTube into 3rd party Android apps. | ||
* | ||
* In 2023 supported was ended and is no longer available, | ||
* but this may still be used by older apps: | ||
* https://developers.google.com/youtube/android/player | ||
*/ | ||
object StandalonePlayerActivityFingerprint : IntegrationsFingerprint( | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass == "Lcom/google/android/youtube/api/StandalonePlayerActivity;" | ||
&& methodDef.name == "onCreate" | ||
}, | ||
// Integrations context is the Activity itself. | ||
) |
10 changes: 0 additions & 10 deletions
10
...pp/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerFingerprint.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters