From 2ac15460f5734fc2c6d2d78d34083a8e6b2f7012 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 18 Dec 2022 01:23:26 +0100 Subject: [PATCH] feat(crunchyroll): remove `enable-downloads` patch --- .../annotations/DownloadsCompatibility.kt | 13 ------- .../fingerprints/DownloadsFingerprint.kt | 23 ------------ .../downloads/patch/DownloadsPatch.kt | 37 ------------------- 3 files changed, 73 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/crunchyroll/downloads/annotations/DownloadsCompatibility.kt delete mode 100644 src/main/kotlin/app/revanced/patches/crunchyroll/downloads/fingerprints/DownloadsFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/crunchyroll/downloads/patch/DownloadsPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/annotations/DownloadsCompatibility.kt b/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/annotations/DownloadsCompatibility.kt deleted file mode 100644 index deb5d785..00000000 --- a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/annotations/DownloadsCompatibility.kt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/fingerprints/DownloadsFingerprint.kt b/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/fingerprints/DownloadsFingerprint.kt deleted file mode 100644 index 12bfec81..00000000 --- a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/fingerprints/DownloadsFingerprint.kt +++ /dev/null @@ -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"), -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/patch/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/patch/DownloadsPatch.kt deleted file mode 100644 index 8b9f5085..00000000 --- a/src/main/kotlin/app/revanced/patches/crunchyroll/downloads/patch/DownloadsPatch.kt +++ /dev/null @@ -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() - } -} \ No newline at end of file