Skip to content

Commit

Permalink
feat(music/amoled): patch now applies the amoled theme to the comment…
Browse files Browse the repository at this point in the history
… input box as well
  • Loading branch information
inotia00 committed Sep 5, 2023
1 parent 6abfa67 commit f0dfbd2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
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.utils.annotations.MusicCompatibility
import app.revanced.patches.shared.patch.litho.LithoThemePatch
import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH
import org.w3c.dom.Element

@Patch
@Name("Amoled")
@Description("Applies pure black theme in flyout panels.")
@Description("Applies pure black theme on some components.")
@DependsOn([LithoThemePatch::class])
@MusicCompatibility
class AmoledPatch : ResourcePatch {
override fun execute(context: ResourceContext) {

LithoThemePatch.injectCall("$MUSIC_UTILS_PATH/LithoThemePatch;->applyLithoTheme(I)I")

context.xmlEditor["res/values/colors.xml"].use { editor ->
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.utils.litho.fingerprints
package app.revanced.patches.shared.fingerprints.litho

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package app.revanced.patches.youtube.utils.litho.patch
package app.revanced.patches.shared.patch.litho

import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.utils.litho.fingerprints.LithoThemeFingerprint
import app.revanced.patches.shared.fingerprints.litho.LithoThemeFingerprint
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
import com.android.tools.smali.dexlib2.iface.reference.MethodReference

class LithoThemePatch : BytecodePatch(
listOf(
LithoThemeFingerprint
)
listOf(LithoThemeFingerprint)
) {
override fun execute(context: BytecodeContext) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.theme.patch
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.youtube.utils.litho.patch.LithoThemePatch
import app.revanced.patches.shared.patch.litho.LithoThemePatch
import app.revanced.util.integrations.Constants.UTILS_PATH
import org.w3c.dom.Element

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.patch.litho.LithoThemePatch
import app.revanced.patches.youtube.seekbar.seekbarcolor.fingerprints.ControlsOverlayStyleFingerprint
import app.revanced.patches.youtube.seekbar.seekbarcolor.fingerprints.PlayerSeekbarColorFingerprint
import app.revanced.patches.youtube.seekbar.seekbarcolor.fingerprints.ShortsSeekbarColorFingerprint
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.litho.patch.LithoThemePatch
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.InlineTimeBarColorizedBarPlayedColorDark
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.InlineTimeBarPlayedNotHighlightedColor
Expand Down

0 comments on commit f0dfbd2

Please sign in to comment.