diff --git a/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/fingerprints/LithoThemeFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/fingerprints/LithoThemeFingerprint.kt deleted file mode 100644 index ddd7a2084..000000000 --- a/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/fingerprints/LithoThemeFingerprint.kt +++ /dev/null @@ -1,19 +0,0 @@ -package app.revanced.patches.music.layout.amoled.bytecode.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -object LithoThemeFingerprint : MethodFingerprint( - returnType = "V", - access = AccessFlags.PROTECTED or AccessFlags.FINAL, - parameters = listOf("L"), - opcodes = listOf( - Opcode.IF_NEZ, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.RETURN_VOID - ), - customFingerprint = { it.name == "onBoundsChange" } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/patch/AmoledBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/patch/AmoledBytecodePatch.kt deleted file mode 100644 index baab52f42..000000000 --- a/src/main/kotlin/app/revanced/patches/music/layout/amoled/bytecode/patch/AmoledBytecodePatch.kt +++ /dev/null @@ -1,42 +0,0 @@ -package app.revanced.patches.music.layout.amoled.bytecode.patch - -import app.revanced.extensions.toErrorResult -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility -import app.revanced.patches.music.layout.amoled.bytecode.fingerprints.LithoThemeFingerprint -import app.revanced.util.integrations.Constants.UTILS_PATH -import org.jf.dexlib2.iface.instruction.formats.Instruction35c - -@Name("amoled-bytecode-patch") -@YouTubeMusicCompatibility -@Version("0.0.1") -class AmoledBytecodePatch : BytecodePatch( - listOf( - LithoThemeFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - - LithoThemeFingerprint.result?.let { - with (it.mutableMethod) { - val insertIndex = it.scanResult.patternScanResult!!.endIndex - 1 - val register = (implementation!!.instructions[insertIndex] as Instruction35c).registerD - - addInstructions( - insertIndex, """ - invoke-static { v$register }, $UTILS_PATH/LithoThemePatch;->applyLithoTheme(I)I - move-result v$register - """ - ) - } - } ?: return LithoThemeFingerprint.toErrorResult() - - return PatchResultSuccess() - } -} diff --git a/src/main/kotlin/app/revanced/patches/music/layout/amoled/resource/patch/AmoledPatch.kt b/src/main/kotlin/app/revanced/patches/music/layout/amoled/patch/AmoledPatch.kt similarity index 79% rename from src/main/kotlin/app/revanced/patches/music/layout/amoled/resource/patch/AmoledPatch.kt rename to src/main/kotlin/app/revanced/patches/music/layout/amoled/patch/AmoledPatch.kt index 662bcc4b6..2212e9a93 100644 --- a/src/main/kotlin/app/revanced/patches/music/layout/amoled/resource/patch/AmoledPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/layout/amoled/patch/AmoledPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.music.layout.amoled.resource.patch +package app.revanced.patches.music.layout.amoled.patch import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name @@ -7,22 +7,13 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.music.layout.amoled.bytecode.patch.AmoledBytecodePatch -import app.revanced.patches.music.misc.integrations.patch.MusicIntegrationsPatch import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import org.w3c.dom.Element @Patch @Name("amoled") @Description("Applies pure black theme in flyout panels.") -@DependsOn( - [ - AmoledBytecodePatch::class, - MusicIntegrationsPatch::class - ] -) @YouTubeMusicCompatibility @Version("0.0.1") class AmoledPatch : ResourcePatch {