From fd3813f66ededdae1e52bf021a3de9d818f65096 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 19 Aug 2023 02:48:21 +0200 Subject: [PATCH] fix(YouTube Music - Remove upgrade button): Remove the correct navigation bar item A new item has been added to the list, so the index has to be shifted by one. This is not a final solution and the last index should be removed dynamically --- .../layout/upgradebutton/patch/RemoveUpgradeButtonPatch.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/patch/RemoveUpgradeButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/patch/RemoveUpgradeButtonPatch.kt index 43a08317..2cf4fdb9 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/patch/RemoveUpgradeButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/patch/RemoveUpgradeButtonPatch.kt @@ -18,7 +18,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @Patch -@Name("Upgrade button remover") +@Name("Remove upgrade button") @Description("Removes the upgrade tab from the pivot bar.") @MusicCompatibility class RemoveUpgradeButtonPatch : BytecodePatch( @@ -36,7 +36,7 @@ class RemoveUpgradeButtonPatch : BytecodePatch( val instructionList = """ invoke-interface { v0 }, Ljava/util/List;->size()I move-result v1 - const/4 v2, 0x3 + const/4 v2, 0x4 invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object; iput-object v0, v$register, $pivotBarElementFieldRef """.toInstructions().toMutableList()