fix(Spotify - Hide premium navbar): Support latest version

This commit is contained in:
oSumAtrIX
2023-11-23 19:35:41 +01:00
parent 96382cf498
commit b87005de0c
5 changed files with 53 additions and 52 deletions

View File

@ -0,0 +1,22 @@
package app.revanced.patches.spotify.navbar
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
@Patch(dependencies = [ResourceMappingPatch::class])
object PremiumNavbarTabResourcePatch : ResourcePatch() {
internal var showBottomNavigationItemsTextId = -1L
internal var premiumTabId = -1L
override fun execute(context: ResourceContext) {
premiumTabId = ResourceMappingPatch.resourceMappings.single {
it.type == "id" && it.name == "premium_tab"
}.id
showBottomNavigationItemsTextId = ResourceMappingPatch.resourceMappings.single {
it.type == "bool" && it.name == "show_bottom_navigation_items_text"
}.id
}
}