feat(Stocard): Add Hide offers tab and Hide story bubbles patch (#3359)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
epireyn 2024-06-27 22:26:35 +02:00 committed by GitHub
parent c6b2f8c017
commit fbd0507ce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 0 deletions

View file

@ -1040,6 +1040,18 @@ public final class app/revanced/patches/spotify/navbar/PremiumNavbarTabResourceP
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V
}
public final class app/revanced/patches/stocard/layout/HideOffersTabPatch : app/revanced/patcher/patch/ResourcePatch {
public static final field INSTANCE Lapp/revanced/patches/stocard/layout/HideOffersTabPatch;
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V
}
public final class app/revanced/patches/stocard/layout/HideStoryBubblesPatch : app/revanced/patcher/patch/ResourcePatch {
public static final field INSTANCE Lapp/revanced/patches/stocard/layout/HideStoryBubblesPatch;
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V
}
public final class app/revanced/patches/strava/subscription/UnlockSubscriptionPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/strava/subscription/UnlockSubscriptionPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V

View file

@ -0,0 +1,27 @@
package app.revanced.patches.stocard.layout
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.util.childElementsSequence
import app.revanced.util.getNode
@Patch(
name = "Hide offers tab",
compatiblePackages = [CompatiblePackage("de.stocard.stocard")],
)
@Suppress("unused")
object HideOffersTabPatch : ResourcePatch() {
override fun execute(context: ResourceContext) {
context.document["res/menu/bottom_navigation_menu.xml"].use { document ->
document.getNode("menu").apply {
removeChild(
childElementsSequence().first {
it.attributes.getNamedItem("android:id")?.nodeValue?.contains("offer") ?: false
},
)
}
}
}
}

View file

@ -0,0 +1,27 @@
package app.revanced.patches.stocard.layout
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.util.getNode
@Patch(
name = "Hide story bubbles",
compatiblePackages = [CompatiblePackage("de.stocard.stocard")],
)
@Suppress("unused")
object HideStoryBubblesPatch : ResourcePatch() {
override fun execute(context: ResourceContext) {
context.document["res/layout/rv_story_bubbles_list.xml"].use { document ->
document.getNode("androidx.recyclerview.widget.RecyclerView").apply {
arrayOf(
"android:layout_width",
"android:layout_height",
).forEach {
attributes.getNamedItem(it).nodeValue = "0dp"
}
}
}
}
}