mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-28 21:00:19 +02:00
feat(music): remove enable-dismiss-queue
patch (applied to all users)
This commit is contained in:
parent
152888535b
commit
3663d072b9
@ -1,15 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.dismissqueue.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import app.revanced.util.bytecode.isWide32LiteralExists
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
|
|
||||||
object DismissQueueFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.CONST_WIDE_32,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT
|
|
||||||
),
|
|
||||||
customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45413042) }
|
|
||||||
)
|
|
@ -1,55 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.dismissqueue.patch
|
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.layout.dismissqueue.fingerprints.DismissQueueFingerprint
|
|
||||||
import app.revanced.patches.music.utils.annotations.MusicCompatibility
|
|
||||||
import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch
|
|
||||||
import app.revanced.util.enum.CategoryType
|
|
||||||
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
|
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("Enable dismiss queue")
|
|
||||||
@Description("Add dismiss queue to flyout menu. (YT Music v6.04.51+)")
|
|
||||||
@DependsOn([SettingsPatch::class])
|
|
||||||
@MusicCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class DismissQueuePatch : BytecodePatch(
|
|
||||||
listOf(DismissQueueFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
|
|
||||||
DismissQueueFingerprint.result?.let {
|
|
||||||
it.mutableMethod.apply {
|
|
||||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
|
||||||
val targetRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
|
||||||
|
|
||||||
addInstructions(
|
|
||||||
insertIndex + 1, """
|
|
||||||
invoke-static {v$targetRegister}, $MUSIC_LAYOUT->enableDismissQueue(Z)Z
|
|
||||||
move-result v$targetRegister
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return DismissQueueFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
SettingsPatch.addMusicPreference(
|
|
||||||
CategoryType.LAYOUT,
|
|
||||||
"revanced_enable_dismiss_queue",
|
|
||||||
"true"
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
@ -18,8 +18,6 @@
|
|||||||
<string name="revanced_enable_compact_dialog_title">Enable compact dialog</string>
|
<string name="revanced_enable_compact_dialog_title">Enable compact dialog</string>
|
||||||
<string name="revanced_enable_debug_logging_summary">Prints the debug log</string>
|
<string name="revanced_enable_debug_logging_summary">Prints the debug log</string>
|
||||||
<string name="revanced_enable_debug_logging_title">Enable debug logging</string>
|
<string name="revanced_enable_debug_logging_title">Enable debug logging</string>
|
||||||
<string name="revanced_enable_dismiss_queue_summary">Add dismiss queue to flyout menu. (YT Music v6.04.51+)</string>
|
|
||||||
<string name="revanced_enable_dismiss_queue_title">Enable dismiss queue</string>
|
|
||||||
<string name="revanced_enable_force_minimized_player_summary">Keep player permanently minimized even if another track is played.</string>
|
<string name="revanced_enable_force_minimized_player_summary">Keep player permanently minimized even if another track is played.</string>
|
||||||
<string name="revanced_enable_force_minimized_player_title">Enable force minimized player</string>
|
<string name="revanced_enable_force_minimized_player_title">Enable force minimized player</string>
|
||||||
<string name="revanced_enable_force_shuffle_summary">Enable force shuffle even if another track is played.</string>
|
<string name="revanced_enable_force_shuffle_summary">Enable force shuffle even if another track is played.</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user