From 3663d072b944f1f745cdb1cbc57a3d819591f940 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Mon, 24 Jul 2023 04:19:05 +0900 Subject: [PATCH] feat(music): remove `enable-dismiss-queue` patch (applied to all users) --- .../fingerprints/DismissQueueFingerprint.kt | 15 ----- .../dismissqueue/patch/DismissQueuePatch.kt | 55 ------------------- .../music/settings/host/values/strings.xml | 2 - 3 files changed, 72 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/fingerprints/DismissQueueFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt diff --git a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/fingerprints/DismissQueueFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/fingerprints/DismissQueueFingerprint.kt deleted file mode 100644 index a5869ae332..0000000000 --- a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/fingerprints/DismissQueueFingerprint.kt +++ /dev/null @@ -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) } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt deleted file mode 100644 index 2651d10a47..0000000000 --- a/src/main/kotlin/app/revanced/patches/music/layout/dismissqueue/patch/DismissQueuePatch.kt +++ /dev/null @@ -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(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() - } -} \ No newline at end of file diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index a13a2513af..f583183464 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -18,8 +18,6 @@ Enable compact dialog Prints the debug log Enable debug logging - Add dismiss queue to flyout menu. (YT Music v6.04.51+) - Enable dismiss queue Keep player permanently minimized even if another track is played. Enable force minimized player Enable force shuffle even if another track is played.