feat(YouTube Music): Support version 8.05.50 (#4439)

This commit is contained in:
Alberto Ponces 2025-02-11 18:37:58 +00:00 committed by GitHub
parent c631ce91a5
commit b31fed9890
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 64 additions and 27 deletions

View File

@ -8,7 +8,12 @@ val hideVideoAdsPatch = bytecodePatch(
name = "Hide music video ads", name = "Hide music video ads",
description = "Hides ads that appear while listening to or streaming music videos, podcasts, or songs.", description = "Hides ads that appear while listening to or streaming music videos, podcasts, or songs.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
navigate(showVideoAdsParentFingerprint.originalMethod) navigate(showVideoAdsParentFingerprint.originalMethod)

View File

@ -1,24 +1,21 @@
package app.revanced.patches.music.audio.exclusiveaudio package app.revanced.patches.music.audio.exclusiveaudio
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused") @Suppress("unused")
val enableExclusiveAudioPlaybackPatch = bytecodePatch( val enableExclusiveAudioPlaybackPatch = bytecodePatch(
name = "Enable exclusive audio playback", name = "Enable exclusive audio playback",
description = "Enables the option to play audio without video.", description = "Enables the option to play audio without video.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
allowExclusiveAudioPlaybackFingerprint.method.apply { allowExclusiveAudioPlaybackFingerprint.method.returnEarly(true)
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
""",
)
}
} }
} }

View File

@ -9,16 +9,15 @@ internal val allowExclusiveAudioPlaybackFingerprint = fingerprint {
returns("Z") returns("Z")
parameters() parameters()
opcodes( opcodes(
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST, Opcode.CHECK_CAST,
Opcode.IF_NEZ, Opcode.IF_NEZ,
Opcode.IGET_OBJECT, Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT, Opcode.MOVE_RESULT
Opcode.GOTO,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.RETURN
) )
} }

View File

@ -11,10 +11,14 @@ val permanentRepeatPatch = bytecodePatch(
description = "Permanently remember your repeating preference even if the playlist ends or another track is played.", description = "Permanently remember your repeating preference even if the playlist ends or another track is played.",
use = false, use = false,
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
val startIndex = repeatTrackFingerprint.patternMatch!!.endIndex val startIndex = repeatTrackFingerprint.patternMatch!!.endIndex
val repeatIndex = startIndex + 1 val repeatIndex = startIndex + 1

View File

@ -11,7 +11,12 @@ val hideCategoryBar = bytecodePatch(
description = "Hides the category bar at the top of the homepage.", description = "Hides the category bar at the top of the homepage.",
use = false, use = false,
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
constructCategoryBarFingerprint.method.apply { constructCategoryBarFingerprint.method.apply {

View File

@ -11,7 +11,12 @@ val hideGetPremiumPatch = bytecodePatch(
name = "Hide 'Get Music Premium' label", name = "Hide 'Get Music Premium' label",
description = "Hides the \"Get Music Premium\" label from the account menu and settings.", description = "Hides the \"Get Music Premium\" label from the account menu and settings.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
hideGetPremiumFingerprint.method.apply { hideGetPremiumFingerprint.method.apply {

View File

@ -18,7 +18,12 @@ val removeUpgradeButtonPatch = bytecodePatch(
name = "Remove upgrade button", name = "Remove upgrade button",
description = "Removes the upgrade tab from the pivot bar.", description = "Removes the upgrade tab from the pivot bar.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
pivotBarConstructorFingerprint.method.apply { pivotBarConstructorFingerprint.method.apply {

View File

@ -8,7 +8,12 @@ val bypassCertificateChecksPatch = bytecodePatch(
name = "Bypass certificate checks", name = "Bypass certificate checks",
description = "Bypasses certificate checks which prevent YouTube Music from working on Android Auto.", description = "Bypasses certificate checks which prevent YouTube Music from working on Android Auto.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music"("7.29.52")) compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
checkCertificateFingerprint.method.returnEarly(true) checkCertificateFingerprint.method.returnEarly(true)

View File

@ -4,8 +4,10 @@ import com.android.tools.smali.dexlib2.AccessFlags
import app.revanced.patcher.fingerprint import app.revanced.patcher.fingerprint
internal val checkCertificateFingerprint = fingerprint { internal val checkCertificateFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returns("Z") returns("Z")
parameters("Ljava/lang/String;") parameters("Ljava/lang/String;")
strings("X509", "Failed to get certificate.") strings(
"X509",
"Failed to get certificate" // Partial String match.
)
} }

View File

@ -8,7 +8,12 @@ val backgroundPlaybackPatch = bytecodePatch(
name = "Remove background playback restrictions", name = "Remove background playback restrictions",
description = "Removes restrictions on background playback, including playing kids videos in the background.", description = "Removes restrictions on background playback, including playing kids videos in the background.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
execute { execute {
kidsBackgroundPlaybackPolicyControllerFingerprint.method.addInstruction( kidsBackgroundPlaybackPolicyControllerFingerprint.method.addInstruction(

View File

@ -25,7 +25,12 @@ val spoofClientPatch = bytecodePatch(
name = "Spoof client", name = "Spoof client",
description = "Spoofs the client to fix playback.", description = "Spoofs the client to fix playback.",
) { ) {
compatibleWith("com.google.android.apps.youtube.music") compatibleWith(
"com.google.android.apps.youtube.music"(
"7.16.53",
"8.05.50"
)
)
dependsOn( dependsOn(
sharedExtensionPatch, sharedExtensionPatch,