Skip to content

Commit f0fb2fa

Browse files
xob0toSumAtrIX
andauthored
feat(Bandcamp): Add Remove play limits patch (#3366)
Co-authored-by: oSumAtrIX <[email protected]>
1 parent 4885d4e commit f0fb2fa

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

api/revanced-patches.api

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ public final class app/revanced/patches/backdrops/misc/pro/ProUnlockPatch : app/
181181
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
182182
}
183183

184+
public final class app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch : app/revanced/patcher/patch/BytecodePatch {
185+
public static final field INSTANCE Lapp/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch;
186+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
187+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
188+
}
189+
184190
public final class app/revanced/patches/candylinkvpn/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch {
185191
public static final field INSTANCE Lapp/revanced/patches/candylinkvpn/UnlockProPatch;
186192
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package app.revanced.patches.bandcamp.limitations
2+
3+
import app.revanced.patcher.data.BytecodeContext
4+
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
5+
import app.revanced.patcher.patch.BytecodePatch
6+
import app.revanced.patcher.patch.annotation.CompatiblePackage
7+
import app.revanced.patcher.patch.annotation.Patch
8+
import app.revanced.patches.bandcamp.limitations.fingerprints.HandlePlaybackLimitsPatch
9+
import app.revanced.util.exception
10+
11+
@Patch(
12+
name = "Remove play limits",
13+
description = "Disables purchase nagging and playback limits of not purchased tracks.",
14+
compatiblePackages = [CompatiblePackage("com.bandcamp.android")],
15+
)
16+
@Suppress("unused")
17+
object RemovePlayLimitsPatch : BytecodePatch(
18+
setOf(HandlePlaybackLimitsPatch),
19+
) {
20+
override fun execute(context: BytecodeContext) =
21+
HandlePlaybackLimitsPatch.result?.mutableMethod?.addInstructions(0, "return-void")
22+
?: throw HandlePlaybackLimitsPatch.exception
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package app.revanced.patches.bandcamp.limitations.fingerprints
2+
3+
import app.revanced.patcher.fingerprint.MethodFingerprint
4+
5+
internal object HandlePlaybackLimitsPatch : MethodFingerprint(
6+
strings = listOf("play limits processing track", "found play_count"),
7+
)

0 commit comments

Comments
 (0)