refactor(amazonmusic): use Fingerprints.kt file for matching

This commit is contained in:
obXfuse 2026-03-21 03:39:04 -04:00
parent b44ac9b26f
commit 37ac390a2e
3 changed files with 18 additions and 5 deletions

View file

@ -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;
}

View file

@ -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")
}

View file

@ -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;-><init>()V