diff --git a/patches/api/patches.api b/patches/api/patches.api index be251e84a5..87c662b6ba 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -153,6 +153,10 @@ public final class app/revanced/patches/amazon/DeepLinkingPatchKt { public static final fun getAlwaysAllowDeepLinkingPatch ()Lapp/revanced/patcher/patch/Patch; } +public final class app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatchKt { + public static final fun getUnlimitedTrackSkippingPatch ()Lapp/revanced/patcher/patch/Patch; +} + public final class app/revanced/patches/angulus/ads/RemoveAdsPatchKt { public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/Patch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/Fingerprints.kt new file mode 100644 index 0000000000..730701cada --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/Fingerprints.kt @@ -0,0 +1,11 @@ +package app.revanced.patches.amazonmusic.misc + +import app.revanced.patcher.gettingFirstMethodDeclaratively +import app.revanced.patcher.type +import app.revanced.patcher.name +import app.revanced.patcher.patch.BytecodePatchContext + +internal val BytecodePatchContext.getRuleMethod by gettingFirstMethodDeclaratively { + type($$"Lcom/amazon/music/freetier/featuregating/FMPMFeatureGating$STATION_UNLIMITED_SKIPS;") + name("getRule") +} diff --git a/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt new file mode 100644 index 0000000000..8da5de4a6d --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt @@ -0,0 +1,21 @@ +package app.revanced.patches.amazonmusic.misc + +import app.revanced.patcher.extensions.addInstructions +import app.revanced.patcher.patch.bytecodePatch + +@Suppress("unused") +val unlimitedTrackSkippingPatch = bytecodePatch( + name = "Unlimited track skipping", + description = "Unlocks the ability to skip tracks without restriction.", +) { + compatibleWith("com.amazon.mp3") + + apply { + getRuleMethod.addInstructions(0, + """ + new-instance p0, Lcom/amazon/music/platform/featuregate/rules/TrueRule; + invoke-direct {p0}, Lcom/amazon/music/platform/featuregate/rules/TrueRule;->()V + return-object p0 + """) + } +}