mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 21:30:19 +02:00
fix(YouTube Music/Enable old player layout): add version constraint (no longer available as legacy code has been completely removed in v6.31.55+
)
This commit is contained in:
parent
d96f8d3216
commit
515ad09e2c
@ -5,7 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
|||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patches.music.utils.fingerprints.NewPlayerLayoutFingerprint
|
import app.revanced.patches.music.player.oldplayerlayout.fingerprints.OldPlayerLayoutFingerprint
|
||||||
import app.revanced.patches.music.utils.integrations.Constants.PLAYER
|
import app.revanced.patches.music.utils.integrations.Constants.PLAYER
|
||||||
import app.revanced.patches.music.utils.settings.CategoryType
|
import app.revanced.patches.music.utils.settings.CategoryType
|
||||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||||
@ -15,16 +15,24 @@ import app.revanced.util.exception
|
|||||||
name = "Enable old player layout",
|
name = "Enable old player layout",
|
||||||
description = "Return the player layout to old style.",
|
description = "Return the player layout to old style.",
|
||||||
dependencies = [SettingsPatch::class],
|
dependencies = [SettingsPatch::class],
|
||||||
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")],
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.apps.youtube.music",
|
||||||
|
[
|
||||||
|
"6.21.52",
|
||||||
|
"6.29.58"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
],
|
||||||
use = false
|
use = false
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object OldPlayerLayoutPatch : BytecodePatch(
|
object OldPlayerLayoutPatch : BytecodePatch(
|
||||||
setOf(NewPlayerLayoutFingerprint)
|
setOf(OldPlayerLayoutFingerprint)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
NewPlayerLayoutFingerprint.result?.let {
|
OldPlayerLayoutFingerprint.result?.let {
|
||||||
it.mutableMethod.apply {
|
it.mutableMethod.apply {
|
||||||
addInstructions(
|
addInstructions(
|
||||||
0, """
|
0, """
|
||||||
@ -34,7 +42,7 @@ object OldPlayerLayoutPatch : BytecodePatch(
|
|||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: throw NewPlayerLayoutFingerprint.exception
|
} ?: throw OldPlayerLayoutFingerprint.exception
|
||||||
|
|
||||||
SettingsPatch.addMusicPreference(
|
SettingsPatch.addMusicPreference(
|
||||||
CategoryType.PLAYER,
|
CategoryType.PLAYER,
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package app.revanced.patches.music.player.oldplayerlayout.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deprecated in YouTube Music v6.31.55+
|
||||||
|
*/
|
||||||
|
object OldPlayerLayoutFingerprint : LiteralValueFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
parameters = emptyList(),
|
||||||
|
literalSupplier = { 45399578 }
|
||||||
|
)
|
@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.music.utils.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
|
||||||
|
|
||||||
object NewPlayerLayoutFingerprint : LiteralValueFingerprint(
|
|
||||||
returnType = "Z",
|
|
||||||
parameters = emptyList(),
|
|
||||||
literalSupplier = { 45399578 }
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user