forked from ReVanced/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Bandcamp): Add
Remove play limits
patch (ReVanced#3366)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/kotlin/app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
7 changes: 7 additions & 0 deletions
7
...otlin/app/revanced/patches/bandcamp/limitations/fingerprints/HandlePlaybackLimitsPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"), | ||
) |