Skip to content

Commit

Permalink
feat(youtube-music): remove version compatibility constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jun 19, 2023
1 parent e860920 commit 276af14
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ 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.music.ad.video.annotations.MusicVideoAdsCompatibility
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
import app.revanced.patches.music.annotations.MusicCompatibility

@Patch
@Name("music-video-ads")
@Description("Removes ads in the music player.")
@MusicVideoAdsCompatibility
@MusicCompatibility
@Version("0.0.1")
class MusicVideoAdsPatch : BytecodePatch(
listOf(
ShowMusicVideoAdsConstructorFingerprint
)
listOf(ShowMusicVideoAdsConstructorFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
ShowMusicVideoAdsFingerprint.resolve(context, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package app.revanced.patches.music.ad.video.annotations
package app.revanced.patches.music.annotations

import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package

@Compatibility([Package("com.google.android.apps.youtube.music")])
@Target(AnnotationTarget.CLASS)
internal annotation class MusicVideoAdsCompatibility
internal annotation class MusicCompatibility

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.toInstruction
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
import org.jf.dexlib2.Opcode

@Patch
@Name("codecs-unlock")
@Description("Adds more audio codec options. The new audio codecs usually result in better audio quality.")
@CodecsUnlockCompatibility
@MusicCompatibility
@Version("0.0.1")
class CodecsUnlockPatch : BytecodePatch(
listOf(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ 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.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint

@Patch
@Name("exclusive-audio-playback")
@Description("Enables the option to play music without video.")
@ExclusiveAudioCompatibility
@MusicCompatibility
@Version("0.0.1")
class ExclusiveAudioPatch : BytecodePatch(
listOf(
AudioOnlyEnablerFingerprint
)
listOf(AudioOnlyEnablerFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ 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.music.layout.compactheader.annotations.CompactHeaderCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x

@Patch(false)
@Name("compact-header")
@Description("Hides the music category bar at the top of the homepage.")
@CompactHeaderCompatibility
@MusicCompatibility
@Version("0.0.1")
class CompactHeaderPatch : BytecodePatch(
listOf(
CompactHeaderConstructorFingerprint
)
listOf(CompactHeaderConstructorFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val result = CompactHeaderConstructorFingerprint.result!!
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ 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.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint

@Patch
@Name("minimized-playback-music")
@Description("Enables minimized playback on Kids music.")
@MinimizedPlaybackCompatibility
@MusicCompatibility
@Version("0.0.1")
class MinimizedPlaybackPatch : BytecodePatch(
listOf(
MinimizedPlaybackManagerFingerprint
)
listOf(MinimizedPlaybackManagerFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstruction(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ 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.music.layout.premium.annotations.HideGetPremiumCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint

@Patch
@Name("hide-get-premium")
@Description("Removes all \"Get Premium\" evidences from the avatar menu.")
@HideGetPremiumCompatibility
@MusicCompatibility
@Version("0.0.1")
class HideGetPremiumPatch : BytecodePatch(
listOf(
HideGetPremiumParentFingerprint
)
listOf(HideGetPremiumParentFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val parentResult = HideGetPremiumParentFingerprint.result!!
Expand All @@ -33,9 +31,10 @@ class HideGetPremiumPatch : BytecodePatch(

val parentMethod = parentResult.mutableMethod
parentMethod.replaceInstruction(
startIndex, """
const/4 v1, 0x0
"""
startIndex,
"""
const/4 v1, 0x0
"""
)

val result = HideGetPremiumFingerprint.result!!
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.toInstructions
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
import app.revanced.patches.music.annotations.MusicCompatibility
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction22t
Expand All @@ -21,12 +21,10 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Name("upgrade-button-remover")
@Description("Removes the upgrade tab from the pivot bar.")
@RemoveUpgradeButtonCompatibility
@MusicCompatibility
@Version("0.0.1")
class RemoveUpgradeButtonPatch : BytecodePatch(
listOf(
PivotBarConstructorFingerprint
)
listOf(PivotBarConstructorFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val result = PivotBarConstructorFingerprint.result!!
Expand Down

This file was deleted.

Loading

0 comments on commit 276af14

Please sign in to comment.