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/amznmusic/misc/skips/UnlimitedSkipsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt similarity index 61% rename from patches/src/main/kotlin/app/revanced/patches/amznmusic/misc/skips/UnlimitedSkipsPatch.kt rename to patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt index e1cda9dd74..8da5de4a6d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/amznmusic/misc/skips/UnlimitedSkipsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/amazonmusic/misc/UnlimitedTrackSkippingPatch.kt @@ -1,19 +1,17 @@ -package app.revanced.patches.amznmusic.misc.skips +package app.revanced.patches.amazonmusic.misc import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.firstMethod import app.revanced.patcher.patch.bytecodePatch @Suppress("unused") -val unlimitedSkipsPatch = bytecodePatch( +val unlimitedTrackSkippingPatch = bytecodePatch( name = "Unlimited track skipping", description = "Unlocks the ability to skip tracks without restriction.", ) { compatibleWith("com.amazon.mp3") apply { - firstMethod { name == "getRule" && definingClass == $$"Lcom/amazon/music/freetier/featuregating/FMPMFeatureGating$STATION_UNLIMITED_SKIPS;" } - .addInstructions(0, + getRuleMethod.addInstructions(0, """ new-instance p0, Lcom/amazon/music/platform/featuregate/rules/TrueRule; invoke-direct {p0}, Lcom/amazon/music/platform/featuregate/rules/TrueRule;->()V