Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
},
)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Loading