mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-22 19:09:12 +02:00
fix(YouTube Music/Enable old style miniplayer): apply fingerprints compatible with the wider version
This commit is contained in:
parent
65f7a35ec2
commit
d9042ba18c
@ -6,10 +6,11 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.MiniPlayerParentFingerprint
|
||||
import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.NextButtonVisibilityFingerprint
|
||||
import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.SwipeToCloseFingerprint
|
||||
import app.revanced.patches.music.utils.fingerprints.PlayerColorFingerprint
|
||||
import app.revanced.patches.music.utils.integrations.Constants.PLAYER
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.music.utils.settings.CategoryType
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
@ -18,7 +19,10 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Patch(
|
||||
name = "Enable old style miniplayer",
|
||||
description = "Adds an option to return the miniplayer to the old style.",
|
||||
dependencies = [SettingsPatch::class],
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.apps.youtube.music",
|
||||
@ -40,13 +44,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Suppress("unused")
|
||||
object OldStyleMiniPlayerPatch : BytecodePatch(
|
||||
setOf(
|
||||
PlayerColorFingerprint,
|
||||
MiniPlayerParentFingerprint,
|
||||
SwipeToCloseFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
PlayerColorFingerprint.result?.let { parentResult ->
|
||||
MiniPlayerParentFingerprint.result?.let { parentResult ->
|
||||
NextButtonVisibilityFingerprint.also {
|
||||
it.resolve(
|
||||
context,
|
||||
@ -66,7 +70,7 @@ object OldStyleMiniPlayerPatch : BytecodePatch(
|
||||
)
|
||||
}
|
||||
} ?: throw NextButtonVisibilityFingerprint.exception
|
||||
} ?: throw PlayerColorFingerprint.exception
|
||||
} ?: throw MiniPlayerParentFingerprint.exception
|
||||
|
||||
SwipeToCloseFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.music.player.oldstyleminiplayer.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MiniPlayerMdxPlaying
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object MiniPlayerParentFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = emptyList(),
|
||||
literalSupplier = { MiniPlayerMdxPlaying }
|
||||
)
|
@ -29,6 +29,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
var IsTablet: Long = -1
|
||||
var LikeDislikeContainer: Long = -1
|
||||
var MenuEntry: Long = -1
|
||||
var MiniPlayerMdxPlaying: Long = -1
|
||||
var MusicMenuLikeButtons: Long = -1
|
||||
var MusicNotifierShelf: Long = -1
|
||||
var NamesInactiveAccountThumbnailSize: Long = -1
|
||||
@ -63,6 +64,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
IsTablet = find(BOOL, "is_tablet")
|
||||
LikeDislikeContainer = find(ID, "like_dislike_container")
|
||||
MenuEntry = find(LAYOUT, "menu_entry")
|
||||
MiniPlayerMdxPlaying = find(STRING, "mini_player_mdx_playing")
|
||||
MusicMenuLikeButtons = find(LAYOUT, "music_menu_like_buttons")
|
||||
MusicNotifierShelf = find(LAYOUT, "music_notifier_shelf")
|
||||
NamesInactiveAccountThumbnailSize = find(DIMEN, "names_inactive_account_thumbnail_size")
|
||||
|
Loading…
x
Reference in New Issue
Block a user