mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-01 20:15:45 +02:00
feat(crunchyroll): remove enable-downloads
patch
This commit is contained in:
parent
c4a3099c1c
commit
2ac15460f5
@ -1,13 +0,0 @@
|
||||
package app.revanced.patches.crunchyroll.downloads.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.crunchyroll.crunchyroid")
|
||||
]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class DownloadsCompatibility
|
@ -1,23 +0,0 @@
|
||||
package app.revanced.patches.crunchyroll.downloads.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.crunchyroll.downloads.annotations.DownloadsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("downloads-fingerprint")
|
||||
@DownloadsCompatibility
|
||||
@Version("0.0.1")
|
||||
object DownloadsFingerprint : MethodFingerprint(
|
||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, null,
|
||||
opcodes = listOf(
|
||||
Opcode.CONST_STRING,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.RETURN
|
||||
),
|
||||
strings = listOf("offline_viewing"),
|
||||
)
|
@ -1,37 +0,0 @@
|
||||
package app.revanced.patches.crunchyroll.downloads.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.crunchyroll.downloads.annotations.DownloadsCompatibility
|
||||
import app.revanced.patches.crunchyroll.downloads.fingerprints.DownloadsFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("enable-downloads")
|
||||
@Description("Enables downloads for Crunchyroll.")
|
||||
@DownloadsCompatibility
|
||||
@Version("0.0.1")
|
||||
class DownloadsPatch : BytecodePatch(
|
||||
listOf(
|
||||
DownloadsFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
with(DownloadsFingerprint.result!!.mutableMethod) {
|
||||
val index = implementation!!.instructions.lastIndex
|
||||
replaceInstruction(
|
||||
index - 1,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
"""
|
||||
)
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user