refactor(pandora): EnableUnlimitedSkipsPatch

This commit is contained in:
Pun Butrach
2026-01-11 23:45:28 +07:00
parent b174421e2b
commit 043cae5db6
2 changed files with 13 additions and 11 deletions

View File

@@ -1,15 +1,15 @@
package app.revanced.patches.pandora.misc
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.creatingBytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val enableUnlimitedSkipsPatch = bytecodePatch(
name = "Enable unlimited skips",
@Suppress("unused", "ObjectPropertyName")
val `Enable Unlimited Skips` by creatingBytecodePatch(
description = "Enable unlimited skips"
) {
compatibleWith("com.pandora.android")
apply {
skipLimitBehaviorFingerprint.method.returnEarly("unlimited")
skipLimitBehaviorMethod.returnEarly("unlimited")
}
}

View File

@@ -1,9 +1,11 @@
package app.revanced.patches.pandora.misc
import app.revanced.patcher.fingerprint
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val skipLimitBehaviorFingerprint = fingerprint {
custom { method, classDef ->
method.name == "getSkipLimitBehavior" && classDef.endsWith("UserData;")
}
}
internal val BytecodePatchContext.skipLimitBehaviorMethod by gettingFirstMutableMethodDeclaratively {
name("getSkipLimitBehavior")
definingClass("UserData;"::endsWith)
}