-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube Music - Player components):
Hide Audio / Video toggle
s…
…etting not working in landscape mode
- Loading branch information
Showing
3 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
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
25 changes: 19 additions & 6 deletions
25
...evanced/patches/music/player/components/fingerprints/AudioVideoSwitchToggleFingerprint.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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
package app.revanced.patches.music.player.components.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.AudioVideoSwitchToggle | ||
import app.revanced.util.fingerprint.LiteralValueFingerprint | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.patches.music.player.components.fingerprints.AudioVideoSwitchToggleFingerprint.AUDIO_VIDEO_SWITCH_TOGGLE_VISIBILITY | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference | ||
|
||
internal object AudioVideoSwitchToggleFingerprint : LiteralValueFingerprint( | ||
internal object AudioVideoSwitchToggleFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
literalSupplier = { AudioVideoSwitchToggle }, | ||
) | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = emptyList(), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.indexOfFirstInstruction { | ||
opcode == Opcode.INVOKE_VIRTUAL && | ||
getReference<MethodReference>()?.toString() == AUDIO_VIDEO_SWITCH_TOGGLE_VISIBILITY | ||
} >= 0 | ||
} | ||
) { | ||
const val AUDIO_VIDEO_SWITCH_TOGGLE_VISIBILITY = | ||
"Lcom/google/android/apps/youtube/music/player/AudioVideoSwitcherToggleView;->setVisibility(I)V" | ||
} |
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