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
|
package app.revanced.patches.pandora.misc
|
||||||
|
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||||
import app.revanced.util.returnEarly
|
import app.revanced.util.returnEarly
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused", "ObjectPropertyName")
|
||||||
val enableUnlimitedSkipsPatch = bytecodePatch(
|
val `Enable Unlimited Skips` by creatingBytecodePatch(
|
||||||
name = "Enable unlimited skips",
|
description = "Enable unlimited skips"
|
||||||
) {
|
) {
|
||||||
compatibleWith("com.pandora.android")
|
compatibleWith("com.pandora.android")
|
||||||
|
|
||||||
apply {
|
apply {
|
||||||
skipLimitBehaviorFingerprint.method.returnEarly("unlimited")
|
skipLimitBehaviorMethod.returnEarly("unlimited")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package app.revanced.patches.pandora.misc
|
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 {
|
internal val BytecodePatchContext.skipLimitBehaviorMethod by gettingFirstMutableMethodDeclaratively {
|
||||||
custom { method, classDef ->
|
name("getSkipLimitBehavior")
|
||||||
method.name == "getSkipLimitBehavior" && classDef.endsWith("UserData;")
|
definingClass("UserData;"::endsWith)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue