Skip to content

Commit

Permalink
feat(Bandcamp): Add Remove play limits patch (#3366)
Browse files Browse the repository at this point in the history
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
xob0t and oSumAtrIX committed Jul 10, 2024
1 parent 1028627 commit ad8d3bb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ public final class app/revanced/patches/backdrops/misc/pro/ProUnlockPatch : app/
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/candylinkvpn/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/candylinkvpn/UnlockProPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package app.revanced.patches.bandcamp.limitations

import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.bandcamp.limitations.fingerprints.HandlePlaybackLimitsPatch
import app.revanced.util.exception

@Patch(
name = "Remove play limits",
description = "Disables purchase nagging and playback limits of not purchased tracks.",
compatiblePackages = [CompatiblePackage("com.bandcamp.android")],
)
@Suppress("unused")
object RemovePlayLimitsPatch : BytecodePatch(
setOf(HandlePlaybackLimitsPatch),
) {
override fun execute(context: BytecodeContext) =
HandlePlaybackLimitsPatch.result?.mutableMethod?.addInstructions(0, "return-void")
?: throw HandlePlaybackLimitsPatch.exception
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app.revanced.patches.bandcamp.limitations.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint

internal object HandlePlaybackLimitsPatch : MethodFingerprint(
strings = listOf("play limits processing track", "found play_count"),
)

0 comments on commit ad8d3bb

Please sign in to comment.