refactor(pandora): EnableUnlimitedSkipsPatch
This commit is contained in:
parent
b174421e2b
commit
043cae5db6
2 changed files with 13 additions and 11 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue