refactor: reformat code and optimize imports

This commit is contained in:
inotia00 2023-06-20 18:27:17 +09:00
parent 0f820822cf
commit bf643c23c5
252 changed files with 1292 additions and 725 deletions

View File

@ -4,9 +4,11 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.MicroGCompatibility import app.revanced.patches.microg.utils.annotations.MicroGCompatibility
import app.revanced.util.resources.MicroGResourceUtils.copyFiles import app.revanced.util.resources.MicroGResourceUtils.copyFiles
@Patch(false) @Patch(false)

View File

@ -4,9 +4,11 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.MicroGCompatibility import app.revanced.patches.microg.utils.annotations.MicroGCompatibility
import app.revanced.util.resources.MicroGResourceUtils.copyFiles import app.revanced.util.resources.MicroGResourceUtils.copyFiles
@Patch @Patch

View File

@ -5,9 +5,14 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.OptionsContainer
import app.revanced.patcher.patch.PatchOption
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.MicroGCompatibility import app.revanced.patches.microg.utils.annotations.MicroGCompatibility
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch @Patch
@ -25,7 +30,8 @@ class CustomBrandingNamePatch : ResourcePatch {
if (!it.name.startsWithAny(*resourceFileNames)) return@forEach if (!it.name.startsWithAny(*resourceFileNames)) return@forEach
context.xmlEditor[it.absolutePath].use { editor -> context.xmlEditor[it.absolutePath].use { editor ->
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element val resourcesNode =
editor.file.getElementsByTagName("resources").item(0) as Element
var label = "" var label = ""
for (i in 0 until resourcesNode.childNodes.length) { for (i in 0 until resourcesNode.childNodes.length) {
@ -66,6 +72,7 @@ class CustomBrandingNamePatch : ResourcePatch {
return PatchResultSuccess() return PatchResultSuccess()
} }
companion object : OptionsContainer() { companion object : OptionsContainer() {
var MicroGAppName: String? by option( var MicroGAppName: String? by option(
PatchOption.StringOption( PatchOption.StringOption(

View File

@ -9,7 +9,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.MicroGCompatibility import app.revanced.patches.microg.utils.annotations.MicroGCompatibility
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch(false) @Patch(false)

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.annotation package app.revanced.patches.microg.utils.annotations
import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package
@ -6,4 +6,3 @@ import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.mgoogle.android.gms")]) @Compatibility([Package("com.mgoogle.android.gms")])
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)
internal annotation class MicroGCompatibility internal annotation class MicroGCompatibility

View File

@ -8,9 +8,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.videoads.AbstractVideoAdsPatch import app.revanced.patches.shared.patch.videoads.AbstractVideoAdsPatch
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
@ -24,7 +24,7 @@ import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicVideoAdsPatch : AbstractVideoAdsPatch( class MusicVideoAdsPatch : AbstractVideoAdsPatch(
"$MUSIC_ADS_PATH/HideMusicAdsPatch;->hideMusicAds()Z" "$MUSIC_ADS_PATH/HideMusicAdsPatch;->hideMusicAds()Z"

View File

@ -8,13 +8,13 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch @Patch
@Name("amoled") @Name("amoled")
@Description("Applies pure black theme in flyout panels.") @Description("Applies pure black theme in flyout panels.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class AmoledPatch : ResourcePatch { class AmoledPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -12,9 +12,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint
import app.revanced.patches.shared.fingerprints.SubtitleTrackFingerprint
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("disable-auto-captions") @Name("disable-auto-captions")
@Description("Disable forced captions from automatically enabling in video player.") @Description("Disable forced captions from automatically enabling in video player.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class DisableAutoCaptionsPatch : BytecodePatch( class DisableAutoCaptionsPatch : BytecodePatch(
listOf(SubtitleTrackFingerprint) listOf(SubtitleTrackFingerprint)
@ -44,7 +44,11 @@ class DisableAutoCaptionsPatch : BytecodePatch(
} }
} ?: return SubtitleTrackFingerprint.toErrorResult() } ?: return SubtitleTrackFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_disable_auto_captions", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_disable_auto_captions",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,10 +12,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.blacknavbar.fingerprints.TabLayoutFingerprint import app.revanced.patches.music.layout.blacknavbar.fingerprints.TabLayoutFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -29,7 +29,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class BlackNavbarPatch : BytecodePatch( class BlackNavbarPatch : BytecodePatch(
listOf(TabLayoutFingerprint) listOf(TabLayoutFingerprint)
@ -50,7 +50,11 @@ class BlackNavbarPatch : BytecodePatch(
} }
} ?: return TabLayoutFingerprint.toErrorResult() } ?: return TabLayoutFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_black_navbar", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_black_navbar",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -4,16 +4,18 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.util.resources.IconHelper.customIconMusic import app.revanced.util.resources.IconHelper.customIconMusic
import app.revanced.util.resources.IconHelper.customIconMusicAdditional import app.revanced.util.resources.IconHelper.customIconMusicAdditional
@Patch(false) @Patch(false)
@Name("custom-branding-music-mmt") @Name("custom-branding-music-mmt")
@Description("Changes the YouTube Music launcher icon to MMT.") @Description("Changes the YouTube Music launcher icon to MMT.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CustomBrandingMusicIconMMTPatch : ResourcePatch { class CustomBrandingMusicIconMMTPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -4,15 +4,17 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.util.resources.IconHelper.customIconMusic import app.revanced.util.resources.IconHelper.customIconMusic
@Patch @Patch
@Name("custom-branding-music-revancify-blue") @Name("custom-branding-music-revancify-blue")
@Description("Changes the YouTube Music launcher icon to Revancify Blue.") @Description("Changes the YouTube Music launcher icon to Revancify Blue.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CustomBrandingMusicIconRevancifyBluePatch : ResourcePatch { class CustomBrandingMusicIconRevancifyBluePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -4,15 +4,17 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.util.resources.IconHelper.customIconMusic import app.revanced.util.resources.IconHelper.customIconMusic
@Patch(false) @Patch(false)
@Name("custom-branding-music-revancify-red") @Name("custom-branding-music-revancify-red")
@Description("Changes the YouTube Music launcher icon to Revancify Red.") @Description("Changes the YouTube Music launcher icon to Revancify Red.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CustomBrandingMusicIconRevancifyRedPatch : ResourcePatch { class CustomBrandingMusicIconRevancifyRedPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -5,15 +5,19 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.OptionsContainer
import app.revanced.patcher.patch.PatchOption
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import org.w3c.dom.Element import org.w3c.dom.Element
@Patch(false) @Patch(false)
@Name("custom-branding-music-name") @Name("custom-branding-music-name")
@Description("Changes the Music launcher name to your choice (defaults to YTM Extended, ReVanced Music Extended).") @Description("Changes the Music launcher name to your choice (defaults to YTM Extended, ReVanced Music Extended).")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CustomBrandingMusicNamePatch : ResourcePatch { class CustomBrandingMusicNamePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
@ -45,6 +49,7 @@ class CustomBrandingMusicNamePatch : ResourcePatch {
return PatchResultSuccess() return PatchResultSuccess()
} }
companion object : OptionsContainer() { companion object : OptionsContainer() {
var MusicLongName: String? by option( var MusicLongName: String? by option(
PatchOption.StringOption( PatchOption.StringOption(

View File

@ -9,9 +9,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
@Patch @Patch
@ -23,12 +23,16 @@ import app.revanced.util.enum.CategoryType
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideButtonShelfPatch : BytecodePatch() { class HideButtonShelfPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_button_shelf", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_button_shelf",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -9,9 +9,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
@Patch @Patch
@ -23,12 +23,16 @@ import app.revanced.util.enum.CategoryType
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideCarouselShelfPatch : BytecodePatch() { class HideCarouselShelfPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_carousel_shelf", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_carousel_shelf",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,17 +12,18 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonFingerprint import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonFingerprint
import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonParentFingerprint import app.revanced.patches.music.layout.castbutton.fingerprints.HideCastButtonParentFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
@Patch @Patch
@Name("hide-music-cast-button") @Name("hide-music-cast-button")
@Description("Hides the cast button in the video player and header.") @Description("Hides the cast button in the video player and header.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideCastButtonPatch : BytecodePatch( class HideCastButtonPatch : BytecodePatch(
listOf(HideCastButtonParentFingerprint) listOf(HideCastButtonParentFingerprint)
@ -30,7 +31,12 @@ class HideCastButtonPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
HideCastButtonParentFingerprint.result?.let { parentResult -> HideCastButtonParentFingerprint.result?.let { parentResult ->
HideCastButtonFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.mutableMethod?.addInstructions( HideCastButtonFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.mutableMethod?.addInstructions(
0, """ 0, """
invoke-static {p1}, $MUSIC_LAYOUT->hideCastButton(I)I invoke-static {p1}, $MUSIC_LAYOUT->hideCastButton(I)I
move-result p1 move-result p1
@ -38,7 +44,11 @@ class HideCastButtonPatch : BytecodePatch(
) ?: return HideCastButtonFingerprint.toErrorResult() ) ?: return HideCastButtonFingerprint.toErrorResult()
} ?: return HideCastButtonParentFingerprint.toErrorResult() } ?: return HideCastButtonParentFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_cast_button", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_cast_button",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,10 +12,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.categorybar.fingerprints.ChipCloudFingerprint import app.revanced.patches.music.layout.categorybar.fingerprints.ChipCloudFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -29,7 +29,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CategoryBarPatch : BytecodePatch( class CategoryBarPatch : BytecodePatch(
listOf(ChipCloudFingerprint) listOf(ChipCloudFingerprint)
@ -47,7 +47,11 @@ class CategoryBarPatch : BytecodePatch(
} }
} ?: return ChipCloudFingerprint.toErrorResult() } ?: return ChipCloudFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_category_bar", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_category_bar",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -16,10 +16,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.colormatchplayer.fingerprints.ColorMatchPlayerFingerprint import app.revanced.patches.music.layout.colormatchplayer.fingerprints.ColorMatchPlayerFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.patches.shared.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.Instruction import org.jf.dexlib2.iface.instruction.Instruction
@ -29,7 +29,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
@Name("enable-color-match-player") @Name("enable-color-match-player")
@Description("Matches the fullscreen player color with the minimized one.") @Description("Matches the fullscreen player color with the minimized one.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class ColorMatchPlayerPatch : BytecodePatch( class ColorMatchPlayerPatch : BytecodePatch(
listOf(ColorMatchPlayerParentFingerprint) listOf(ColorMatchPlayerParentFingerprint)
@ -37,7 +37,12 @@ class ColorMatchPlayerPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
ColorMatchPlayerParentFingerprint.result?.let { parentResult -> ColorMatchPlayerParentFingerprint.result?.let { parentResult ->
ColorMatchPlayerFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let { ColorMatchPlayerFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
targetMethod = parentResult.mutableMethod targetMethod = parentResult.mutableMethod
@ -72,10 +77,15 @@ class ColorMatchPlayerPatch : BytecodePatch(
} ?: return ColorMatchPlayerFingerprint.toErrorResult() } ?: return ColorMatchPlayerFingerprint.toErrorResult()
} ?: return ColorMatchPlayerParentFingerprint.toErrorResult() } ?: return ColorMatchPlayerParentFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_color_match_player", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_color_match_player",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
private lateinit var targetMethod: MutableMethod private lateinit var targetMethod: MutableMethod

View File

@ -13,10 +13,10 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.compactdialog.fingerprints.DialogSolidFingerprint import app.revanced.patches.music.layout.compactdialog.fingerprints.DialogSolidFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
@ -30,14 +30,15 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CompactDialogPatch : BytecodePatch( class CompactDialogPatch : BytecodePatch(
listOf(DialogSolidFingerprint) listOf(DialogSolidFingerprint)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
DialogSolidFingerprint.result?.let { DialogSolidFingerprint.result?.let {
with(context with(
context
.toMethodWalker(it.method) .toMethodWalker(it.method)
.nextMethod(it.scanResult.patternScanResult!!.endIndex, true) .nextMethod(it.scanResult.patternScanResult!!.endIndex, true)
.getMethod() as MutableMethod .getMethod() as MutableMethod
@ -51,7 +52,11 @@ class CompactDialogPatch : BytecodePatch(
} }
} ?: return DialogSolidFingerprint.toErrorResult() } ?: return DialogSolidFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_compact_dialog", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_compact_dialog",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,9 +12,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.dismissqueue.fingerprints.DismissQueueFingerprint import app.revanced.patches.music.layout.dismissqueue.fingerprints.DismissQueueFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("enable-dismiss-queue") @Name("enable-dismiss-queue")
@Description("Add dismiss queue to flyout menu. (YT Music v6.04.51+)") @Description("Add dismiss queue to flyout menu. (YT Music v6.04.51+)")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class DismissQueuePatch : BytecodePatch( class DismissQueuePatch : BytecodePatch(
listOf(DismissQueueFingerprint) listOf(DismissQueueFingerprint)
@ -44,7 +44,11 @@ class DismissQueuePatch : BytecodePatch(
} }
} ?: return DismissQueueFingerprint.toErrorResult() } ?: return DismissQueueFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_dismiss_queue", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_dismiss_queue",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -14,11 +14,11 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonFingerprint import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonFingerprint
import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonParentFingerprint import app.revanced.patches.music.layout.floatingbutton.fingerprints.FloatingButtonParentFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
@ -31,7 +31,7 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class NewPlaylistButtonPatch : BytecodePatch( class NewPlaylistButtonPatch : BytecodePatch(
listOf(FloatingButtonParentFingerprint) listOf(FloatingButtonParentFingerprint)
@ -39,7 +39,12 @@ class NewPlaylistButtonPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
FloatingButtonParentFingerprint.result?.let { parentResult -> FloatingButtonParentFingerprint.result?.let { parentResult ->
FloatingButtonFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let { FloatingButtonFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
1, """ 1, """
@ -53,7 +58,11 @@ class NewPlaylistButtonPatch : BytecodePatch(
} ?: return FloatingButtonFingerprint.toErrorResult() } ?: return FloatingButtonFingerprint.toErrorResult()
} ?: return FloatingButtonParentFingerprint.toErrorResult() } ?: return FloatingButtonParentFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_new_playlist_button", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_new_playlist_button",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -11,10 +11,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.landscapemode.fingerprints.TabletIdentifierFingerprint import app.revanced.patches.music.layout.landscapemode.fingerprints.TabletIdentifierFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
@ -27,7 +27,7 @@ import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class LandScapeModePatch : BytecodePatch( class LandScapeModePatch : BytecodePatch(
listOf(TabletIdentifierFingerprint) listOf(TabletIdentifierFingerprint)
@ -42,7 +42,11 @@ class LandScapeModePatch : BytecodePatch(
) )
} ?: return TabletIdentifierFingerprint.toErrorResult() } ?: return TabletIdentifierFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_landscape_mode", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_landscape_mode",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -11,9 +11,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.minimizedplayer.fingerprints.MinimizedPlayerFingerprint import app.revanced.patches.music.layout.minimizedplayer.fingerprints.MinimizedPlayerFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("enable-force-minimized-player") @Name("enable-force-minimized-player")
@Description("Permanently keep player minimized even if another track is played.") @Description("Permanently keep player minimized even if another track is played.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MinimizedPlayerPatch : BytecodePatch( class MinimizedPlayerPatch : BytecodePatch(
listOf(MinimizedPlayerFingerprint) listOf(MinimizedPlayerFingerprint)
@ -32,7 +32,8 @@ class MinimizedPlayerPatch : BytecodePatch(
MinimizedPlayerFingerprint.result?.let { MinimizedPlayerFingerprint.result?.let {
with(it.mutableMethod) { with(it.mutableMethod) {
val index = it.scanResult.patternScanResult!!.endIndex val index = it.scanResult.patternScanResult!!.endIndex
val register = (implementation!!.instructions[index] as OneRegisterInstruction).registerA val register =
(implementation!!.instructions[index] as OneRegisterInstruction).registerA
addInstructions( addInstructions(
index, """ index, """
@ -43,7 +44,11 @@ class MinimizedPlayerPatch : BytecodePatch(
} }
} ?: return MinimizedPlayerFingerprint.toErrorResult() } ?: return MinimizedPlayerFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_force_minimized_player", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_force_minimized_player",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -13,12 +13,12 @@ import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.navigationlabel.fingerprints.TabLayoutTextFingerprint import app.revanced.patches.music.layout.navigationlabel.fingerprints.TabLayoutTextFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.Text1 import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.Text1
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch.Companion.contexts import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch.Companion.contexts
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.bytecode.getWideLiteralIndex import app.revanced.util.bytecode.getWideLiteralIndex
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
@ -34,7 +34,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class NavigationLabelPatch : BytecodePatch( class NavigationLabelPatch : BytecodePatch(
listOf(TabLayoutTextFingerprint) listOf(TabLayoutTextFingerprint)
@ -68,10 +68,15 @@ class NavigationLabelPatch : BytecodePatch(
} }
} }
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_navigation_label", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_navigation_label",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
const val FLAG = "android:layout_weight" const val FLAG = "android:layout_weight"
const val RESOURCE_FILE_PATH = "res/layout/image_with_text_tab.xml" const val RESOURCE_FILE_PATH = "res/layout/image_with_text_tab.xml"

View File

@ -12,9 +12,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.newlayout.fingerprints.NewLayoutFingerprint import app.revanced.patches.music.layout.newlayout.fingerprints.NewLayoutFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("enable-new-layout") @Name("enable-new-layout")
@Description("Enable new player layouts. (YT Music v5.47.51+)") @Description("Enable new player layouts. (YT Music v5.47.51+)")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class NewLayoutPatch : BytecodePatch( class NewLayoutPatch : BytecodePatch(
listOf(NewLayoutFingerprint) listOf(NewLayoutFingerprint)
@ -44,7 +44,11 @@ class NewLayoutPatch : BytecodePatch(
} }
} ?: return NewLayoutFingerprint.toErrorResult() } ?: return NewLayoutFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_new_layout", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_new_layout",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -4,6 +4,7 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
object NextButtonVisibilityFingerprint : MethodFingerprint( object NextButtonVisibilityFingerprint : MethodFingerprint(
returnType = "V", returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,

View File

@ -13,11 +13,11 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.NextButtonVisibilityFingerprint import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.NextButtonVisibilityFingerprint
import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.SwipeToCloseFingerprint import app.revanced.patches.music.layout.oldstyleminiplayer.fingerprints.SwipeToCloseFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.patches.shared.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -26,7 +26,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("enable-old-style-miniplayer") @Name("enable-old-style-miniplayer")
@Description("Return the miniplayers to old style. (for YT Music v5.55.53+)") @Description("Return the miniplayers to old style. (for YT Music v5.55.53+)")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class OldStyleMiniPlayerPatch : BytecodePatch( class OldStyleMiniPlayerPatch : BytecodePatch(
listOf( listOf(
@ -37,10 +37,16 @@ class OldStyleMiniPlayerPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
ColorMatchPlayerParentFingerprint.result?.let { parentResult -> ColorMatchPlayerParentFingerprint.result?.let { parentResult ->
NextButtonVisibilityFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let { NextButtonVisibilityFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val targetIndex = it.scanResult.patternScanResult!!.startIndex + 1 val targetIndex = it.scanResult.patternScanResult!!.startIndex + 1
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA val targetRegister =
getInstruction<OneRegisterInstruction>(targetIndex).registerA
addInstructions( addInstructions(
targetIndex + 1, """ targetIndex + 1, """
@ -66,7 +72,11 @@ class OldStyleMiniPlayerPatch : BytecodePatch(
} }
} ?: return SwipeToCloseFingerprint.toErrorResult() } ?: return SwipeToCloseFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_old_style_mini_player", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_old_style_mini_player",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -9,9 +9,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch import app.revanced.patches.music.utils.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
@Patch @Patch
@ -23,12 +23,16 @@ import app.revanced.util.enum.CategoryType
MusicSettingsPatch::class MusicSettingsPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class HidePlaylistCardPatch : BytecodePatch() { class HidePlaylistCardPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_playlist_card", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_hide_playlist_card",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,9 +12,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.sleeptimer.fingerprints.SleepTimerFingerprint import app.revanced.patches.music.layout.sleeptimer.fingerprints.SleepTimerFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("enable-sleep-timer") @Name("enable-sleep-timer")
@Description("Add sleep timer to flyout menu.") @Description("Add sleep timer to flyout menu.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class SleepTimerPatch : BytecodePatch( class SleepTimerPatch : BytecodePatch(
listOf(SleepTimerFingerprint) listOf(SleepTimerFingerprint)
@ -44,7 +44,11 @@ class SleepTimerPatch : BytecodePatch(
} }
} ?: return SleepTimerFingerprint.toErrorResult() } ?: return SleepTimerFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_sleep_timer", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_sleep_timer",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -14,10 +14,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.layout.zenmode.fingerprints.ZenModeFingerprint import app.revanced.patches.music.layout.zenmode.fingerprints.ZenModeFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.patches.shared.fingerprints.ColorMatchPlayerParentFingerprint
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_LAYOUT import app.revanced.util.integrations.Constants.MUSIC_LAYOUT
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -27,7 +27,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
@Name("enable-zen-mode") @Name("enable-zen-mode")
@Description("Adds a grey tint to the video player to reduce eye strain.") @Description("Adds a grey tint to the video player to reduce eye strain.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class ZenModePatch : BytecodePatch( class ZenModePatch : BytecodePatch(
listOf(ColorMatchPlayerParentFingerprint) listOf(ColorMatchPlayerParentFingerprint)
@ -40,11 +40,13 @@ class ZenModePatch : BytecodePatch(
val startIndex = it.scanResult.patternScanResult!!.startIndex val startIndex = it.scanResult.patternScanResult!!.startIndex
val firstRegister = getInstruction<OneRegisterInstruction>(startIndex).registerA val firstRegister = getInstruction<OneRegisterInstruction>(startIndex).registerA
val secondRegister = getInstruction<OneRegisterInstruction>(startIndex + 2).registerA val secondRegister =
getInstruction<OneRegisterInstruction>(startIndex + 2).registerA
val dummyRegister = secondRegister + 1 val dummyRegister = secondRegister + 1
val referenceIndex = it.scanResult.patternScanResult!!.endIndex + 1 val referenceIndex = it.scanResult.patternScanResult!!.endIndex + 1
val targetReference = getInstruction<ReferenceInstruction>(referenceIndex).reference.toString() val targetReference =
getInstruction<ReferenceInstruction>(referenceIndex).reference.toString()
val insertIndex = referenceIndex + 1 val insertIndex = referenceIndex + 1
@ -66,7 +68,11 @@ class ZenModePatch : BytecodePatch(
} ?: return ZenModeFingerprint.toErrorResult() } ?: return ZenModeFingerprint.toErrorResult()
} ?: return ColorMatchPlayerParentFingerprint.toErrorResult() } ?: return ColorMatchPlayerParentFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_enable_zen_mode", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.LAYOUT,
"revanced_enable_zen_mode",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -12,23 +12,22 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.backgroundplay.fingerprints.BackgroundPlaybackParentFingerprint import app.revanced.patches.music.misc.backgroundplay.fingerprints.BackgroundPlaybackParentFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
@Patch @Patch
@Name("background-play") @Name("background-play")
@Description("Enables playing music in the background.") @Description("Enables playing music in the background.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class BackgroundPlayPatch : BytecodePatch( class BackgroundPlayPatch : BytecodePatch(
listOf( listOf(BackgroundPlaybackParentFingerprint)
BackgroundPlaybackParentFingerprint
)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
BackgroundPlaybackParentFingerprint.result?.let { BackgroundPlaybackParentFingerprint.result?.let {
with(context with(
context
.toMethodWalker(it.method) .toMethodWalker(it.method)
.nextMethod(it.scanResult.patternScanResult!!.startIndex, true) .nextMethod(it.scanResult.patternScanResult!!.startIndex, true)
.getMethod() as MutableMethod .getMethod() as MutableMethod

View File

@ -8,17 +8,18 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
@Patch @Patch
@Name("bitrate-default-value") @Name("bitrate-default-value")
@Description("Set the audio quality to 'Always High' when you first install the app.") @Description("Set the audio quality to 'Always High' when you first install the app.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class BitrateDefaultValuePatch : ResourcePatch { class BitrateDefaultValuePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
context.xmlEditor[RESOURCE_FILE_PATH].use { editor -> context.xmlEditor[RESOURCE_FILE_PATH].use { editor ->
editor.file.getElementsByTagName("com.google.android.apps.youtube.music.ui.preference.PreferenceCategoryCompat").item(0).childNodes.apply { editor.file.getElementsByTagName("com.google.android.apps.youtube.music.ui.preference.PreferenceCategoryCompat")
.item(0).childNodes.apply {
arrayOf("BitrateAudioMobile", "BitrateAudioWiFi").forEach { arrayOf("BitrateAudioMobile", "BitrateAudioWiFi").forEach {
for (i in 1 until length) { for (i in 1 until length) {
val view = item(i) val view = item(i)
@ -26,7 +27,8 @@ class BitrateDefaultValuePatch : ResourcePatch {
view.hasAttributes() && view.hasAttributes() &&
view.attributes.getNamedItem("android:key").nodeValue.endsWith(it) view.attributes.getNamedItem("android:key").nodeValue.endsWith(it)
) { ) {
view.attributes.getNamedItem("android:defaultValue").nodeValue = "Always High" view.attributes.getNamedItem("android:defaultValue").nodeValue =
"Always High"
break break
} }
} }

View File

@ -8,8 +8,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.opus.AbstractOpusCodecsPatch import app.revanced.patches.shared.patch.opus.AbstractOpusCodecsPatch
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
@ -18,7 +18,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
@Name("enable-opus-codec") @Name("enable-opus-codec")
@Description("Enable opus codec when playing audio.") @Description("Enable opus codec when playing audio.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class CodecsUnlockPatch : AbstractOpusCodecsPatch( class CodecsUnlockPatch : AbstractOpusCodecsPatch(
"$MUSIC_MISC_PATH/OpusCodecPatch;->enableOpusCodec()Z" "$MUSIC_MISC_PATH/OpusCodecPatch;->enableOpusCodec()Z"
@ -26,7 +26,11 @@ class CodecsUnlockPatch : AbstractOpusCodecsPatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
super.execute(context) super.execute(context)
MusicSettingsPatch.addMusicPreference(CategoryType.MISC, "revanced_enable_opus_codec", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.MISC,
"revanced_enable_opus_codec",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -11,13 +11,13 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint import app.revanced.patches.music.misc.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
@Patch @Patch
@Name("exclusive-audio-playback") @Name("exclusive-audio-playback")
@Description("Enables the option to play music without video.") @Description("Enables the option to play music without video.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class ExclusiveAudioPatch : BytecodePatch( class ExclusiveAudioPatch : BytecodePatch(
listOf(AudioOnlyEnablerFingerprint) listOf(AudioOnlyEnablerFingerprint)

View File

@ -10,13 +10,13 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint import app.revanced.patches.music.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
@Patch @Patch
@Name("minimized-playback-music") @Name("minimized-playback-music")
@Description("Enables minimized playback on Kids music.") @Description("Enables minimized playback on Kids music.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MinimizedPlaybackPatch : BytecodePatch( class MinimizedPlaybackPatch : BytecodePatch(
listOf(MinimizedPlaybackManagerFingerprint) listOf(MinimizedPlaybackManagerFingerprint)

View File

@ -8,14 +8,14 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.StandardCopyOption import java.nio.file.StandardCopyOption
@Patch @Patch
@Name("optimize-resource-music") @Name("optimize-resource-music")
@Description("Remove unnecessary resources.") @Description("Remove unnecessary resources.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class OptimizeResourcePatch : ResourcePatch { class OptimizeResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -14,11 +14,11 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.premium.fingerprints.AccountMenuFooterFingerprint import app.revanced.patches.music.misc.premium.fingerprints.AccountMenuFooterFingerprint
import app.revanced.patches.music.misc.premium.fingerprints.HideGetPremiumFingerprint import app.revanced.patches.music.misc.premium.fingerprints.HideGetPremiumFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.PrivacyTosFooter import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.PrivacyTosFooter
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.bytecode.getWideLiteralIndex import app.revanced.util.bytecode.getWideLiteralIndex
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -30,7 +30,7 @@ import org.jf.dexlib2.iface.reference.Reference
@Name("hide-get-premium") @Name("hide-get-premium")
@Description("Removes all \"Get Premium\" evidences from the avatar menu.") @Description("Removes all \"Get Premium\" evidences from the avatar menu.")
@DependsOn([SharedResourceIdPatch::class]) @DependsOn([SharedResourceIdPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideGetPremiumPatch : BytecodePatch( class HideGetPremiumPatch : BytecodePatch(
listOf( listOf(
@ -58,7 +58,8 @@ class HideGetPremiumPatch : BytecodePatch(
val targetIndex = getWideLiteralIndex(PrivacyTosFooter) + 4 val targetIndex = getWideLiteralIndex(PrivacyTosFooter) + 4
targetReference = getInstruction<ReferenceInstruction>(targetIndex + 1).reference targetReference = getInstruction<ReferenceInstruction>(targetIndex + 1).reference
with (context with(
context
.toMethodWalker(this) .toMethodWalker(this)
.nextMethod(targetIndex, true) .nextMethod(targetIndex, true)
.getMethod() as MutableMethod .getMethod() as MutableMethod
@ -68,7 +69,8 @@ class HideGetPremiumPatch : BytecodePatch(
if (instruction.opcode != Opcode.IGET_OBJECT) continue if (instruction.opcode != Opcode.IGET_OBJECT) continue
if (getInstruction<ReferenceInstruction>(index).reference == targetReference) { if (getInstruction<ReferenceInstruction>(index).reference == targetReference) {
val targetRegister = getInstruction<OneRegisterInstruction>(index + 2).registerA val targetRegister =
getInstruction<OneRegisterInstruction>(index + 2).registerA
addInstruction( addInstruction(
index, index,
@ -85,6 +87,7 @@ class HideGetPremiumPatch : BytecodePatch(
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
lateinit var targetReference: Reference lateinit var targetReference: Reference
} }

View File

@ -15,13 +15,13 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySettingsFingerprint import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySettingsFingerprint
import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySettingsParentFingerprint import app.revanced.patches.music.misc.quality.fingerprints.MusicVideoQualitySettingsParentFingerprint
import app.revanced.patches.music.misc.quality.fingerprints.UserQualityChangeFingerprint import app.revanced.patches.music.misc.quality.fingerprints.UserQualityChangeFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
@ -41,7 +41,7 @@ import org.jf.dexlib2.iface.reference.Reference
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class VideoQualityPatch : BytecodePatch( class VideoQualityPatch : BytecodePatch(
listOf( listOf(
@ -55,8 +55,10 @@ class VideoQualityPatch : BytecodePatch(
it.mutableMethod.apply { it.mutableMethod.apply {
val endIndex = it.scanResult.patternScanResult!!.endIndex val endIndex = it.scanResult.patternScanResult!!.endIndex
val qualityChangedClass = val qualityChangedClass =
context.findClass((getInstruction<BuilderInstruction21c>(endIndex)) context.findClass(
.reference.toString())!! (getInstruction<BuilderInstruction21c>(endIndex))
.reference.toString()
)!!
.mutableClass .mutableClass
for (method in qualityChangedClass.methods) { for (method in qualityChangedClass.methods) {
@ -65,8 +67,10 @@ class VideoQualityPatch : BytecodePatch(
for ((index, instruction) in implementation!!.instructions.withIndex()) { for ((index, instruction) in implementation!!.instructions.withIndex()) {
if (instruction.opcode != Opcode.INVOKE_INTERFACE) continue if (instruction.opcode != Opcode.INVOKE_INTERFACE) continue
qualityReference = getInstruction<ReferenceInstruction>(index - 1).reference qualityReference =
qIndexMethodName = ((getInstruction<Instruction35c>(index).reference) as MethodReference).name getInstruction<ReferenceInstruction>(index - 1).reference
qIndexMethodName =
((getInstruction<Instruction35c>(index).reference) as MethodReference).name
addInstruction( addInstruction(
0, 0,
@ -81,7 +85,12 @@ class VideoQualityPatch : BytecodePatch(
} ?: return UserQualityChangeFingerprint.toErrorResult() } ?: return UserQualityChangeFingerprint.toErrorResult()
MusicVideoQualitySettingsParentFingerprint.result?.let { parentResult -> MusicVideoQualitySettingsParentFingerprint.result?.let { parentResult ->
MusicVideoQualitySettingsFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.mutableMethod?.addInstructions( MusicVideoQualitySettingsFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.mutableMethod?.addInstructions(
0, """ 0, """
const-string v0, "$qIndexMethodName" const-string v0, "$qIndexMethodName"
sput-object v0, $INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->qIndexMethod:Ljava/lang/String; sput-object v0, $INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->qIndexMethod:Ljava/lang/String;
@ -93,10 +102,15 @@ class VideoQualityPatch : BytecodePatch(
} ?: return MusicVideoQualitySettingsParentFingerprint.toErrorResult() } ?: return MusicVideoQualitySettingsParentFingerprint.toErrorResult()
MusicVideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V") MusicVideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V")
MusicSettingsPatch.addMusicPreference(CategoryType.MISC, "revanced_enable_save_video_quality", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.MISC,
"revanced_enable_save_video_quality",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
const val INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR = const val INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR =
"$MUSIC_MISC_PATH/MusicVideoQualityPatch;" "$MUSIC_MISC_PATH/MusicVideoQualityPatch;"

View File

@ -15,10 +15,13 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.ConnectionTrackerFingerprint
import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.FullStackTraceActivityFingerprint
import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.SharePanelFingerprint
import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.ShowToastFingerprint
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.music.misc.sharebuttonhook.fingerprints.*
import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch import app.revanced.patches.music.utils.videoid.patch.MusicVideoIdPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH
import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
@ -32,7 +35,7 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
MusicVideoIdPatch::class MusicVideoIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class ShareButtonHookPatch : BytecodePatch( class ShareButtonHookPatch : BytecodePatch(
listOf( listOf(
@ -77,11 +80,20 @@ class ShareButtonHookPatch : BytecodePatch(
""" """
) ?: return FullStackTraceActivityFingerprint.toErrorResult() ) ?: return FullStackTraceActivityFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.MISC, "revanced_hook_share_button", "false") MusicSettingsPatch.addMusicPreference(
MusicSettingsPatch.addMusicPreferenceWithIntent(CategoryType.MISC, "revanced_default_downloader", "revanced_hook_share_button") CategoryType.MISC,
"revanced_hook_share_button",
"false"
)
MusicSettingsPatch.addMusicPreferenceWithIntent(
CategoryType.MISC,
"revanced_default_downloader",
"revanced_hook_share_button"
)
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR = "$MUSIC_MISC_PATH/HookShareButtonPatch;" const val INTEGRATIONS_CLASS_DESCRIPTOR = "$MUSIC_MISC_PATH/HookShareButtonPatch;"
} }

View File

@ -19,10 +19,12 @@ import app.revanced.patcher.util.TypeUtil.traverseClassHierarchy
import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patcher.util.smali.toInstructions import app.revanced.patcher.util.smali.toInstructions
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.shuffle.fingerprints.MusicPlaybackControlsFingerprint
import app.revanced.patches.music.misc.shuffle.fingerprints.ShuffleClassFingerprint
import app.revanced.patches.music.misc.shuffle.fingerprints.ShuffleClassReferenceFingerprint
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.music.misc.shuffle.fingerprints.*
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
@ -44,7 +46,7 @@ import org.jf.dexlib2.immutable.ImmutableMethodParameter
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class EnforceShufflePatch : BytecodePatch( class EnforceShufflePatch : BytecodePatch(
listOf( listOf(
@ -163,7 +165,11 @@ class EnforceShufflePatch : BytecodePatch(
} }
} ?: return MusicPlaybackControlsFingerprint.toErrorResult() } ?: return MusicPlaybackControlsFingerprint.toErrorResult()
MusicSettingsPatch.addMusicPreference(CategoryType.MISC, "revanced_enable_force_shuffle", "true") MusicSettingsPatch.addMusicPreference(
CategoryType.MISC,
"revanced_enable_force_shuffle",
"true"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -11,14 +11,14 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint import app.revanced.patches.music.misc.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch @Patch
@Name("hide-taste-builder") @Name("hide-taste-builder")
@Description("Removes the \"Tell us which artists you like\" card from the home screen.") @Description("Removes the \"Tell us which artists you like\" card from the home screen.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class RemoveTasteBuilderPatch : BytecodePatch( class RemoveTasteBuilderPatch : BytecodePatch(
listOf(TasteBuilderConstructorFingerprint) listOf(TasteBuilderConstructorFingerprint)

View File

@ -9,15 +9,15 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.resources.ResourceHelper.addTranslations import app.revanced.util.resources.ResourceHelper.addTranslations
@Patch @Patch
@Name("translations-music") @Name("translations-music")
@Description("Add Crowdin translations for YouTube Music.") @Description("Add Crowdin translations for YouTube Music.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicTranslationsPatch : ResourcePatch { class MusicTranslationsPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -14,11 +14,11 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.misc.upgradebutton.fingerprints.NotifierShelfFingerprint
import app.revanced.patches.music.misc.upgradebutton.fingerprints.PivotBarConstructorFingerprint
import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.misc.upgradebutton.fingerprints.*
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@ -32,7 +32,7 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
SharedResourceIdPatch::class SharedResourceIdPatch::class
] ]
) )
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class RemoveUpgradeButtonPatch : BytecodePatch( class RemoveUpgradeButtonPatch : BytecodePatch(
listOf( listOf(
@ -47,7 +47,8 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
val targetRegisterA = getInstruction<TwoRegisterInstruction>(targetIndex).registerA val targetRegisterA = getInstruction<TwoRegisterInstruction>(targetIndex).registerA
val targetRegisterB = getInstruction<TwoRegisterInstruction>(targetIndex).registerB val targetRegisterB = getInstruction<TwoRegisterInstruction>(targetIndex).registerB
val replaceReference = getInstruction<ReferenceInstruction>(targetIndex).reference.toString() val replaceReference =
getInstruction<ReferenceInstruction>(targetIndex).reference.toString()
replaceInstruction( replaceInstruction(
targetIndex, targetIndex,

View File

@ -8,8 +8,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch import app.revanced.patches.music.utils.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.versionspoof.AbstractVersionSpoofPatch import app.revanced.patches.shared.patch.versionspoof.AbstractVersionSpoofPatch
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
@ -18,14 +18,18 @@ import app.revanced.util.integrations.Constants.MUSIC_MISC_PATH
@Name("spoof-app-version") @Name("spoof-app-version")
@Description("Spoof the YouTube Music client version.") @Description("Spoof the YouTube Music client version.")
@DependsOn([MusicSettingsPatch::class]) @DependsOn([MusicSettingsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class SpoofAppVersionPatch : AbstractVersionSpoofPatch( class SpoofAppVersionPatch : AbstractVersionSpoofPatch(
"$MUSIC_MISC_PATH/SpoofAppVersionPatch;->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;" "$MUSIC_MISC_PATH/SpoofAppVersionPatch;->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;"
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.MISC, "revanced_spoof_app_version", "false") MusicSettingsPatch.addMusicPreference(
CategoryType.MISC,
"revanced_spoof_app_version",
"false"
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -1,9 +1,8 @@
package app.revanced.patches.shared.annotation package app.revanced.patches.music.utils.annotations
import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.google.android.apps.youtube.music")]) @Compatibility([Package("com.google.android.apps.youtube.music")])
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)
internal annotation class YouTubeMusicCompatibility internal annotation class MusicCompatibility

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.music.utils.fingerprints
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -10,13 +10,13 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.androidauto.fingerprints.CertificateCheckFingerprint import app.revanced.patches.music.utils.fix.androidauto.fingerprints.CertificateCheckFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
@Patch @Patch
@Name("certificate-spoof") @Name("certificate-spoof")
@Description("Spoofs the YouTube Music certificate for Android Auto.") @Description("Spoofs the YouTube Music certificate for Android Auto.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class AndroidAutoCertificatePatch : BytecodePatch( class AndroidAutoCertificatePatch : BytecodePatch(
listOf(CertificateCheckFingerprint) listOf(CertificateCheckFingerprint)

View File

@ -10,14 +10,14 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.clientspoof.fingerprints.UserAgentHeaderBuilderFingerprint import app.revanced.patches.music.utils.fix.clientspoof.fingerprints.UserAgentHeaderBuilderFingerprint
import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Name("client-spoof-music") @Name("client-spoof-music")
@Description("Spoofs the YouTube Music client.") @Description("Spoofs the YouTube Music client.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class ClientSpoofMusicPatch : BytecodePatch( class ClientSpoofMusicPatch : BytecodePatch(
listOf(UserAgentHeaderBuilderFingerprint) listOf(UserAgentHeaderBuilderFingerprint)
@ -27,7 +27,8 @@ class ClientSpoofMusicPatch : BytecodePatch(
UserAgentHeaderBuilderFingerprint.result?.let { UserAgentHeaderBuilderFingerprint.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val insertIndex = it.scanResult.patternScanResult!!.endIndex - 1 val insertIndex = it.scanResult.patternScanResult!!.endIndex - 1
val packageNameRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerD val packageNameRegister =
getInstruction<FiveRegisterInstruction>(insertIndex).registerD
addInstruction( addInstruction(
insertIndex, insertIndex,

View File

@ -2,13 +2,13 @@ package app.revanced.patches.music.utils.integrations.patch
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.patch.annotations.RequiresIntegrations import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.integrations.fingerprints.InitFingerprint import app.revanced.patches.music.utils.integrations.fingerprints.InitFingerprint
import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH
@Name("music-integrations") @Name("music-integrations")
@YouTubeMusicCompatibility @MusicCompatibility
@RequiresIntegrations @RequiresIntegrations
class MusicIntegrationsPatch : AbstractIntegrationsPatch( class MusicIntegrationsPatch : AbstractIntegrationsPatch(
"$MUSIC_INTEGRATIONS_PATH/utils/ReVancedUtils;", "$MUSIC_INTEGRATIONS_PATH/utils/ReVancedUtils;",

View File

@ -6,14 +6,14 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.shared.fingerprints.IdentifierFingerprint import app.revanced.patches.shared.fingerprints.litho.IdentifierFingerprint
import app.revanced.patches.shared.patch.litho.ComponentParserPatch import app.revanced.patches.shared.patch.litho.ComponentParserPatch
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.Companion.identifierHook import app.revanced.patches.shared.patch.litho.ComponentParserPatch.Companion.identifierHook
import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH import app.revanced.util.integrations.Constants.MUSIC_ADS_PATH
@DependsOn([ComponentParserPatch::class]) @DependsOn([ComponentParserPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicLithoFilterPatch : BytecodePatch( class MusicLithoFilterPatch : BytecodePatch(
listOf(IdentifierFingerprint) listOf(IdentifierFingerprint)

View File

@ -1,4 +1,4 @@
package app.revanced.patches.music.misc.microg.bytecode.patch package app.revanced.patches.music.utils.microg.bytecode.patch
import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
@ -9,17 +9,17 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.clientspoof.patch.ClientSpoofMusicPatch import app.revanced.patches.music.utils.fix.clientspoof.patch.ClientSpoofMusicPatch
import app.revanced.patches.music.utils.microg.resource.patch.MusicMicroGResourcePatch
import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME
import app.revanced.patches.music.utils.microg.shared.Constants.YOUTUBE_PACKAGE_NAME
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastContextFetchFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastContextFetchFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleV2Fingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleV2Fingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.GooglePlayUtilityFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.GooglePlayUtilityFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.PrimeFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.PrimeFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.ServiceCheckFingerprint import app.revanced.patches.music.utils.microg.bytecode.fingerprints.ServiceCheckFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.microg.resource.patch.MusicMicroGResourcePatch
import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME
import app.revanced.patches.music.utils.microg.shared.Constants.YOUTUBE_PACKAGE_NAME
import app.revanced.patches.shared.patch.packagename.PackageNamePatch import app.revanced.patches.shared.patch.packagename.PackageNamePatch
import app.revanced.util.microg.MicroGBytecodeHelper import app.revanced.util.microg.MicroGBytecodeHelper
@ -33,7 +33,7 @@ import app.revanced.util.microg.MicroGBytecodeHelper
) )
@Name("music-microg-support") @Name("music-microg-support")
@Description("Allows ReVanced Music to run without root and under a different package name with MicroG.") @Description("Allows ReVanced Music to run without root and under a different package name with MicroG.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.2") @Version("0.0.2")
class MusicMicroGBytecodePatch : BytecodePatch( class MusicMicroGBytecodePatch : BytecodePatch(
listOf( listOf(

View File

@ -8,10 +8,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME import app.revanced.patches.music.utils.microg.shared.Constants.MUSIC_PACKAGE_NAME
import app.revanced.patches.music.utils.microg.shared.Constants.SPOOFED_PACKAGE_NAME import app.revanced.patches.music.utils.microg.shared.Constants.SPOOFED_PACKAGE_NAME
import app.revanced.patches.music.utils.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE import app.revanced.patches.music.utils.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.packagename.PackageNamePatch import app.revanced.patches.shared.patch.packagename.PackageNamePatch
import app.revanced.util.microg.MicroGManifestHelper.addSpoofingMetadata import app.revanced.util.microg.MicroGManifestHelper.addSpoofingMetadata
import app.revanced.util.microg.MicroGResourceHelper.patchManifest import app.revanced.util.microg.MicroGResourceHelper.patchManifest
@ -20,7 +20,7 @@ import app.revanced.util.resources.MusicResourceHelper.setMicroG
@Name("music-microg-resource-patch") @Name("music-microg-resource-patch")
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.") @Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
@DependsOn([PackageNamePatch::class]) @DependsOn([PackageNamePatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.2") @Version("0.0.2")
class MusicMicroGResourcePatch : ResourcePatch { class MusicMicroGResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

@ -8,14 +8,20 @@ import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch
import app.revanced.util.enum.ResourceType import app.revanced.util.enum.ResourceType
import app.revanced.util.enum.ResourceType.* import app.revanced.util.enum.ResourceType.BOOL
import app.revanced.util.enum.ResourceType.COLOR
import app.revanced.util.enum.ResourceType.DIMEN
import app.revanced.util.enum.ResourceType.ID
import app.revanced.util.enum.ResourceType.LAYOUT
import app.revanced.util.enum.ResourceType.STRING
import app.revanced.util.enum.ResourceType.STYLE
@Name("music-resource-id") @Name("music-resource-id")
@DependsOn([ResourceMappingPatch::class]) @DependsOn([ResourceMappingPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class SharedResourceIdPatch : ResourcePatch { class SharedResourceIdPatch : ResourcePatch {
internal companion object { internal companion object {

View File

@ -10,17 +10,17 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch import app.revanced.patches.music.utils.integrations.patch.MusicIntegrationsPatch
import app.revanced.patches.music.utils.settings.bytecode.fingerprints.PreferenceFingerprint import app.revanced.patches.music.utils.settings.bytecode.fingerprints.PreferenceFingerprint
import app.revanced.patches.music.utils.settings.bytecode.fingerprints.SettingsHeadersFragmentFingerprint import app.revanced.patches.music.utils.settings.bytecode.fingerprints.SettingsHeadersFragmentFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH import app.revanced.util.integrations.Constants.MUSIC_INTEGRATIONS_PATH
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("music-settings-bytecode-patch") @Name("music-settings-bytecode-patch")
@DependsOn([MusicIntegrationsPatch::class]) @DependsOn([MusicIntegrationsPatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicSettingsBytecodePatch : BytecodePatch( class MusicSettingsBytecodePatch : BytecodePatch(
listOf( listOf(
@ -57,6 +57,7 @@ class MusicSettingsBytecodePatch : BytecodePatch(
return PatchResultSuccess() return PatchResultSuccess()
} }
companion object { companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR = const val INTEGRATIONS_CLASS_DESCRIPTOR =
"$MUSIC_INTEGRATIONS_PATH/settingsmenu/SharedPreferenceChangeListener;" "$MUSIC_INTEGRATIONS_PATH/settingsmenu/SharedPreferenceChangeListener;"

View File

@ -8,8 +8,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.settings.bytecode.patch.MusicSettingsBytecodePatch import app.revanced.patches.music.utils.settings.bytecode.patch.MusicSettingsBytecodePatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch
import app.revanced.util.enum.CategoryType import app.revanced.util.enum.CategoryType
import app.revanced.util.resources.IconHelper import app.revanced.util.resources.IconHelper
@ -29,7 +29,7 @@ import java.nio.file.Paths
@Name("music-settings") @Name("music-settings")
@Description("Adds settings for ReVanced to YouTube Music.") @Description("Adds settings for ReVanced to YouTube Music.")
@DependsOn([MusicSettingsBytecodePatch::class]) @DependsOn([MusicSettingsBytecodePatch::class])
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicSettingsPatch : AbstractSettingsResourcePatch( class MusicSettingsPatch : AbstractSettingsResourcePatch(
"music/settings", "music/settings",
@ -67,8 +67,11 @@ class MusicSettingsPatch : AbstractSettingsResourcePatch(
if (File(targetDirectory).exists()) { if (File(targetDirectory).exists()) {
fun copyResources(resourceGroups: List<ResourceUtils.ResourceGroup>) { fun copyResources(resourceGroups: List<ResourceUtils.ResourceGroup>) {
try { context.copyFiles(resourceGroups, iconPath) } try {
catch (_: Exception) { context.makeDirectoryAndCopyFiles(resourceGroups, iconPath) } context.copyFiles(resourceGroups, iconPath)
} catch (_: Exception) {
context.makeDirectoryAndCopyFiles(resourceGroups, iconPath)
}
} }
val iconResourceFileNames = val iconResourceFileNames =
@ -88,6 +91,7 @@ class MusicSettingsPatch : AbstractSettingsResourcePatch(
return PatchResultSuccess() return PatchResultSuccess()
} }
companion object { companion object {
lateinit var contexts: ResourceContext lateinit var contexts: ResourceContext

View File

@ -11,14 +11,14 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.videoid.fingerprint.MusicVideoIdFingerprint import app.revanced.patches.music.utils.videoid.fingerprint.MusicVideoIdFingerprint
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH import app.revanced.util.integrations.Constants.MUSIC_UTILS_PATH
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("music-video-id-hook") @Name("music-video-id-hook")
@Description("Hook to detect when the video id changes.") @Description("Hook to detect when the video id changes.")
@YouTubeMusicCompatibility @MusicCompatibility
@Version("0.0.1") @Version("0.0.1")
class MusicVideoIdPatch : BytecodePatch( class MusicVideoIdPatch : BytecodePatch(
listOf(MusicVideoIdFingerprint) listOf(MusicVideoIdFingerprint)

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.captions
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.litho
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.litho
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.litho
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.opus
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.opus
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.versionspoof
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.versionspoof
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.videoads
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints package app.revanced.patches.shared.fingerprints.videoads
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -10,6 +10,7 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.shared.patch.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint.RegisterResolver
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.ClassDef import org.jf.dexlib2.iface.ClassDef
import org.jf.dexlib2.iface.Method import org.jf.dexlib2.iface.Method

View File

@ -16,9 +16,9 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMut
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.RVXCompatibility import app.revanced.patches.shared.annotation.RVXCompatibility
import app.revanced.patches.shared.fingerprints.ByteBufferHookFingerprint import app.revanced.patches.shared.fingerprints.litho.ByteBufferHookFingerprint
import app.revanced.patches.shared.fingerprints.EmptyComponentBuilderFingerprint import app.revanced.patches.shared.fingerprints.litho.EmptyComponentBuilderFingerprint
import app.revanced.patches.shared.fingerprints.IdentifierFingerprint import app.revanced.patches.shared.fingerprints.litho.IdentifierFingerprint
import app.revanced.util.bytecode.getStringIndex import app.revanced.util.bytecode.getStringIndex
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
@ -45,8 +45,10 @@ class ComponentParserPatch : BytecodePatch(
EmptyComponentBuilderFingerprint.result?.let { EmptyComponentBuilderFingerprint.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val targetIndex = getStringIndex("Failed to convert Element to Flatbuffers: %s") + 2 val targetIndex = getStringIndex("Failed to convert Element to Flatbuffers: %s") + 2
val builderMethodDescriptor = getInstruction<ReferenceInstruction>(targetIndex).reference val builderMethodDescriptor =
val emptyComponentFieldDescriptor = getInstruction<ReferenceInstruction>(targetIndex + 2).reference getInstruction<ReferenceInstruction>(targetIndex).reference
val emptyComponentFieldDescriptor =
getInstruction<ReferenceInstruction>(targetIndex + 2).reference
emptyComponentLabel = """ emptyComponentLabel = """
move-object/from16 v0, p1 move-object/from16 v0, p1
@ -76,7 +78,8 @@ class ComponentParserPatch : BytecodePatch(
.nextMethod(it.scanResult.patternScanResult!!.endIndex, true) .nextMethod(it.scanResult.patternScanResult!!.endIndex, true)
.getMethod() as MutableMethod .getMethod() as MutableMethod
).apply { ).apply {
val methodName = EmptyComponentBuilderFingerprint.result!!.mutableMethod.definingClass val methodName =
EmptyComponentBuilderFingerprint.result!!.mutableMethod.definingClass
addInstruction( addInstruction(
0, 0,
@ -91,7 +94,8 @@ class ComponentParserPatch : BytecodePatch(
val stringBuilderIndex = val stringBuilderIndex =
implementation!!.instructions.indexOfFirst { instruction -> implementation!!.instructions.indexOfFirst { instruction ->
val fieldReference = (instruction as? ReferenceInstruction)?.reference as? FieldReference val fieldReference =
(instruction as? ReferenceInstruction)?.reference as? FieldReference
fieldReference?.let { reference -> reference.type == "Ljava/lang/StringBuilder;" } == true fieldReference?.let { reference -> reference.type == "Ljava/lang/StringBuilder;" } == true
} }
@ -101,8 +105,10 @@ class ComponentParserPatch : BytecodePatch(
instruction.opcode == Opcode.CONST instruction.opcode == Opcode.CONST
} }
stringBuilderRegister = getInstruction<TwoRegisterInstruction>(stringBuilderIndex).registerA stringBuilderRegister =
identifierRegister = getInstruction<OneRegisterInstruction>(identifierIndex).registerA getInstruction<TwoRegisterInstruction>(stringBuilderIndex).registerA
identifierRegister =
getInstruction<OneRegisterInstruction>(identifierIndex).registerA
objectRegister = getInstruction<BuilderInstruction35c>(objectIndex).registerC objectRegister = getInstruction<BuilderInstruction35c>(objectIndex).registerC
freeRegister = getInstruction<OneRegisterInstruction>(freeIndex).registerA freeRegister = getInstruction<OneRegisterInstruction>(freeIndex).registerA
@ -129,12 +135,14 @@ class ComponentParserPatch : BytecodePatch(
) { ) {
insertMethod.apply { insertMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
insertIndex, """ insertIndex,
"""
sget-object v$freeRegister, $definingClass->buffer:Ljava/nio/ByteBuffer; sget-object v$freeRegister, $definingClass->buffer:Ljava/nio/ByteBuffer;
invoke-static {v$stringBuilderRegister, v$identifierRegister, v$objectRegister, v$freeRegister}, $descriptor(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/Object;Ljava/nio/ByteBuffer;)Z invoke-static {v$stringBuilderRegister, v$identifierRegister, v$objectRegister, v$freeRegister}, $descriptor(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/Object;Ljava/nio/ByteBuffer;)Z
move-result v$freeRegister move-result v$freeRegister
if-eqz v$freeRegister, :not_an_ad if-eqz v$freeRegister, :not_an_ad
""" + emptyComponentLabel, ExternalLabel("not_an_ad", getInstruction(insertIndex)) """ + emptyComponentLabel,
ExternalLabel("not_an_ad", getInstruction(insertIndex))
) )
} }
} }
@ -144,11 +152,13 @@ class ComponentParserPatch : BytecodePatch(
) { ) {
insertMethod.apply { insertMethod.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
insertIndex, """ insertIndex,
"""
invoke-static {v$stringBuilderRegister, v$identifierRegister}, $descriptor(Ljava/lang/StringBuilder;Ljava/lang/String;)Z invoke-static {v$stringBuilderRegister, v$identifierRegister}, $descriptor(Ljava/lang/StringBuilder;Ljava/lang/String;)Z
move-result v$freeRegister move-result v$freeRegister
if-eqz v$freeRegister, :not_an_ad if-eqz v$freeRegister, :not_an_ad
""" + emptyComponentLabel, ExternalLabel("not_an_ad", getInstruction(insertIndex)) """ + emptyComponentLabel,
ExternalLabel("not_an_ad", getInstruction(insertIndex))
) )
} }
} }

View File

@ -8,7 +8,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import org.w3c.dom.Element import org.w3c.dom.Element
import java.util.* import java.util.Collections
import java.util.concurrent.Executors import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit

View File

@ -11,8 +11,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.fingerprints.CodecReferenceFingerprint import app.revanced.patches.shared.fingerprints.opus.CodecReferenceFingerprint
import app.revanced.patches.shared.fingerprints.CodecSelectorFingerprint import app.revanced.patches.shared.fingerprints.opus.CodecSelectorFingerprint
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction import org.jf.dexlib2.iface.instruction.ReferenceInstruction

View File

@ -4,8 +4,12 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.OptionsContainer
import app.revanced.patcher.patch.PatchOption
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.*
import app.revanced.patches.shared.annotation.RVXCompatibility import app.revanced.patches.shared.annotation.RVXCompatibility
@Patch @Patch

View File

@ -27,7 +27,10 @@ abstract class AbstractSettingsResourcePatch(
/* initialize ReVanced Settings */ /* initialize ReVanced Settings */
if (isYouTube) if (isYouTube)
context.copyResources(sourceDirectory, ResourceUtils.ResourceGroup("xml", "revanced_prefs.xml")) context.copyResources(
sourceDirectory,
ResourceUtils.ResourceGroup("xml", "revanced_prefs.xml")
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@ -9,8 +9,8 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.
import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.shared.fingerprints.ClientInfoFingerprint import app.revanced.patches.shared.fingerprints.versionspoof.ClientInfoFingerprint
import app.revanced.patches.shared.fingerprints.ClientInfoParentFingerprint import app.revanced.patches.shared.fingerprints.versionspoof.ClientInfoParentFingerprint
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
import org.jf.dexlib2.dexbacked.reference.DexBackedFieldReference import org.jf.dexlib2.dexbacked.reference.DexBackedFieldReference
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -26,7 +26,12 @@ abstract class AbstractVersionSpoofPatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
ClientInfoParentFingerprint.result?.let { parentResult -> ClientInfoParentFingerprint.result?.let { parentResult ->
ClientInfoFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.mutableMethod?.let { ClientInfoFingerprint.also {
it.resolve(
context,
parentResult.classDef
)
}.result?.mutableMethod?.let {
it.apply { it.apply {
var insertIndex = 0 var insertIndex = 0
val insertInstructions = implementation!!.instructions val insertInstructions = implementation!!.instructions
@ -35,7 +40,8 @@ abstract class AbstractVersionSpoofPatch(
for ((index, instruction) in insertInstructions.withIndex()) { for ((index, instruction) in insertInstructions.withIndex()) {
if (instruction.opcode != Opcode.SGET_OBJECT) continue if (instruction.opcode != Opcode.SGET_OBJECT) continue
val indexString = ((instruction as? ReferenceInstruction)?.reference as? DexBackedFieldReference).toString() val indexString =
((instruction as? ReferenceInstruction)?.reference as? DexBackedFieldReference).toString()
if (indexString != targetString) continue if (indexString != targetString) continue

View File

@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.fingerprints.LegacyVideoAdsFingerprint import app.revanced.patches.shared.fingerprints.videoads.LegacyVideoAdsFingerprint
import app.revanced.patches.shared.fingerprints.MainstreamVideoAdsFingerprint import app.revanced.patches.shared.fingerprints.videoads.MainstreamVideoAdsFingerprint
@Name("abstract-video-ads-patch") @Name("abstract-video-ads-patch")
@Version("0.0.1") @Version("0.0.1")

View File

@ -38,7 +38,12 @@ class GeneralAdsBytecodePatch : BytecodePatch() {
val viewRegister = getInstruction<Instruction35c>(insertIndex).registerC val viewRegister = getInstruction<Instruction35c>(insertIndex).registerC
this.implementation!!.injectHideCall(insertIndex, viewRegister, "ads/AdsFilter", "hideAdAttributionView") this.implementation!!.injectHideCall(
insertIndex,
viewRegister,
"ads/AdsFilter",
"hideAdAttributionView"
)
} }
} }
} }

View File

@ -11,9 +11,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch
import app.revanced.patches.youtube.ads.getpremium.patch.HideGetPremiumPatch import app.revanced.patches.youtube.ads.getpremium.patch.HideGetPremiumPatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils.copyXmlNode import app.revanced.util.resources.ResourceUtils.copyXmlNode

View File

@ -24,8 +24,10 @@ class HideGetPremiumPatch : BytecodePatch(
CompactYpcOfferModuleViewFingerprint.result?.let { CompactYpcOfferModuleViewFingerprint.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val startIndex = it.scanResult.patternScanResult!!.startIndex val startIndex = it.scanResult.patternScanResult!!.startIndex
val measuredWidthRegister = getInstruction<TwoRegisterInstruction>(startIndex).registerA val measuredWidthRegister =
val measuredHeightInstruction = getInstruction<TwoRegisterInstruction>(startIndex + 1) getInstruction<TwoRegisterInstruction>(startIndex).registerA
val measuredHeightInstruction =
getInstruction<TwoRegisterInstruction>(startIndex + 1)
val measuredHeightRegister = measuredHeightInstruction.registerA val measuredHeightRegister = measuredHeightInstruction.registerA
val tempRegister = measuredHeightInstruction.registerB val tempRegister = measuredHeightInstruction.registerB

View File

@ -8,8 +8,8 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.shared.patch.videoads.AbstractVideoAdsPatch import app.revanced.patches.shared.patch.videoads.AbstractVideoAdsPatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.ADS_PATH import app.revanced.util.integrations.Constants.ADS_PATH

View File

@ -9,8 +9,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.shared.patch.litho.ComponentParserPatch.Companion.objectHook import app.revanced.patches.shared.patch.litho.ComponentParserPatch.Companion.objectHook
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.BOTTOM_PLAYER import app.revanced.util.integrations.Constants.BOTTOM_PLAYER

View File

@ -9,8 +9,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@Patch @Patch

View File

@ -9,8 +9,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.ads.general.resource.patch.GeneralAdsPatch import app.revanced.patches.youtube.ads.general.resource.patch.GeneralAdsPatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@Patch @Patch

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.flyoutpanel.oldqualitylayout.fingerprints.QualityMenuViewInflateFingerprint import app.revanced.patches.youtube.flyoutpanel.oldqualitylayout.fingerprints.QualityMenuViewInflateFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -13,8 +13,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.AutoNavPreviewStub import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.AutoNavPreviewStub
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@ -45,10 +45,13 @@ class HideAutoplayPreviewPatch : BytecodePatch(
it.mutableMethod.apply { it.mutableMethod.apply {
val insertInstruction = implementation!!.instructions val insertInstruction = implementation!!.instructions
val dummyRegister = getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA val dummyRegister =
getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA
val insertIndex = getWideLiteralIndex(AutoNavPreviewStub) val insertIndex = getWideLiteralIndex(AutoNavPreviewStub)
val branchIndex = insertInstruction.subList(insertIndex + 1, insertInstruction.size - 1).indexOfFirst { instruction -> val branchIndex =
insertInstruction.subList(insertIndex + 1, insertInstruction.size - 1)
.indexOfFirst { instruction ->
((instruction as? ReferenceInstruction)?.reference as? FieldReference)?.type == "Lcom/google/android/apps/youtube/app/player/autonav/AutonavToggleController;" ((instruction as? ReferenceInstruction)?.reference as? FieldReference)?.type == "Lcom/google/android/apps/youtube/app/player/autonav/AutonavToggleController;"
} + 1 } + 1

View File

@ -12,5 +12,9 @@ object YouTubeControlsOverlayFingerprint : MethodFingerprint(
Opcode.MOVE_RESULT, Opcode.MOVE_RESULT,
Opcode.IF_EQZ Opcode.IF_EQZ
), ),
customFingerprint = { it, _ -> it.definingClass.endsWith("YouTubeControlsOverlay;") && it.isWideLiteralExists(YoutubeControlsOverlay) } customFingerprint = { it, _ ->
it.definingClass.endsWith("YouTubeControlsOverlay;") && it.isWideLiteralExists(
YoutubeControlsOverlay
)
}
) )

View File

@ -14,7 +14,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.fullscreen.compactcontrolsoverlay.fingerprints.YouTubeControlsOverlayFingerprint import app.revanced.patches.youtube.fullscreen.compactcontrolsoverlay.fingerprints.YouTubeControlsOverlayFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@ -38,7 +38,8 @@ class CompactControlsOverlayPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
YouTubeControlsOverlayFingerprint.result?.let { YouTubeControlsOverlayFingerprint.result?.let {
with (context with(
context
.toMethodWalker(it.method) .toMethodWalker(it.method)
.nextMethod(it.scanResult.patternScanResult!!.startIndex, true) .nextMethod(it.scanResult.patternScanResult!!.startIndex, true)
.getMethod() as MutableMethod .getMethod() as MutableMethod

View File

@ -13,7 +13,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsFingerprint import app.revanced.patches.youtube.fullscreen.endscreenoverlay.fingerprints.EndScreenResultsFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -6,5 +6,9 @@ import app.revanced.util.bytecode.isWideLiteralExists
object FullscreenEngagementPanelFingerprint : MethodFingerprint( object FullscreenEngagementPanelFingerprint : MethodFingerprint(
returnType = "L", returnType = "L",
customFingerprint = { it, _ -> it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") && it.isWideLiteralExists(FullScreenEngagementPanel) } customFingerprint = { it, _ ->
it.definingClass.endsWith("FullscreenEngagementPanelOverlay;") && it.isWideLiteralExists(
FullScreenEngagementPanel
)
}
) )

View File

@ -16,8 +16,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenEngagementPanelFingerprint import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenEngagementPanelFingerprint
import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint import app.revanced.patches.youtube.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint
import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch
@ -83,7 +83,8 @@ class HideFullscreenPanelsPatch : BytecodePatch(
LayoutConstructorFingerprint.result?.let { LayoutConstructorFingerprint.result?.let {
it.mutableMethod.apply { it.mutableMethod.apply {
val dummyRegister = getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA val dummyRegister =
getInstruction<OneRegisterInstruction>(getStringIndex("1.0x")).registerA
val invokeIndex = implementation!!.instructions.indexOfFirst { instruction -> val invokeIndex = implementation!!.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.INVOKE_VIRTUAL && instruction.opcode == Opcode.INVOKE_VIRTUAL &&

View File

@ -14,8 +14,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.* import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationParentFingerprint
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationPrimaryFingerprint
import app.revanced.patches.youtube.fullscreen.landscapemode.fingerprints.OrientationSecondaryFingerprint
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@ -35,7 +37,8 @@ class LandScapeModePatch : BytecodePatch(
OrientationPrimaryFingerprint, OrientationPrimaryFingerprint,
OrientationSecondaryFingerprint OrientationSecondaryFingerprint
).forEach { ).forEach {
it.also { it.resolve(context, classDef) }.result?.injectOverride() ?: return it.toErrorResult() it.also { it.resolve(context, classDef) }.result?.injectOverride()
?: return it.toErrorResult()
} }
} ?: return OrientationParentFingerprint.toErrorResult() } ?: return OrientationParentFingerprint.toErrorResult()

View File

@ -9,8 +9,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.ads.general.resource.patch.GeneralAdsPatch import app.revanced.patches.youtube.ads.general.resource.patch.GeneralAdsPatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch import app.revanced.patches.youtube.utils.quickactionscontainer.patch.HideQuickActionsContainerPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -13,7 +13,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuFingerprint import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuFingerprint
import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuParentFingerprint import app.revanced.patches.youtube.general.accountmenu.fingerprints.AccountMenuParentFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch

View File

@ -15,9 +15,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.fingerprints.SubtitleButtonControllerFingerprint
import app.revanced.patches.shared.fingerprints.SubtitleButtonControllerFingerprint import app.revanced.patches.shared.fingerprints.captions.SubtitleTrackFingerprint
import app.revanced.patches.shared.fingerprints.SubtitleTrackFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.autocaptions.fingerprints.StartVideoInformerFingerprint import app.revanced.patches.youtube.general.autocaptions.fingerprints.StartVideoInformerFingerprint
import app.revanced.patches.youtube.utils.playertype.patch.PlayerTypeHookPatch import app.revanced.patches.youtube.utils.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -13,7 +13,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.autopopuppanels.fingerprints.EngagementPanelControllerFingerprint import app.revanced.patches.youtube.general.autopopuppanels.fingerprints.EngagementPanelControllerFingerprint
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.GENERAL import app.revanced.util.integrations.Constants.GENERAL

View File

@ -13,7 +13,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.categorybar.fingerprints.FilterBarHeightFingerprint import app.revanced.patches.youtube.general.categorybar.fingerprints.FilterBarHeightFingerprint
import app.revanced.patches.youtube.general.categorybar.fingerprints.RelatedChipCloudFingerprint import app.revanced.patches.youtube.general.categorybar.fingerprints.RelatedChipCloudFingerprint
import app.revanced.patches.youtube.general.categorybar.fingerprints.SearchResultsChipBarFingerprint import app.revanced.patches.youtube.general.categorybar.fingerprints.SearchResultsChipBarFingerprint
@ -76,6 +76,7 @@ class CategoryBarPatch : BytecodePatch(
return PatchResultSuccess() return PatchResultSuccess()
} }
private companion object { private companion object {
private fun <RegisterInstruction : OneRegisterInstruction> MethodFingerprint.patch( private fun <RegisterInstruction : OneRegisterInstruction> MethodFingerprint.patch(
insertIndexOffset: Int = 0, insertIndexOffset: Int = 0,
@ -87,7 +88,8 @@ class CategoryBarPatch : BytecodePatch(
val endIndex = it.scanResult.patternScanResult!!.endIndex val endIndex = it.scanResult.patternScanResult!!.endIndex
val insertIndex = endIndex + insertIndexOffset val insertIndex = endIndex + insertIndexOffset
val register = getInstruction<RegisterInstruction>(endIndex + hookRegisterOffset).registerA val register =
getInstruction<RegisterInstruction>(endIndex + hookRegisterOffset).registerA
addInstructions(insertIndex, instructions(register)) addInstructions(insertIndex, instructions(register))
} }

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.channellistsubmenu.fingerprints.ChannelListSubMenuFingerprint import app.revanced.patches.youtube.general.channellistsubmenu.fingerprints.ChannelListSubMenuFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.crowdfundingbox.fingerprints.CrowdfundingBoxFingerprint import app.revanced.patches.youtube.general.crowdfundingbox.fingerprints.CrowdfundingBoxFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.floatingmicrophone.fingerprints.FloatingMicrophoneFingerprint import app.revanced.patches.youtube.general.floatingmicrophone.fingerprints.FloatingMicrophoneFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.WordMarkHeader import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.WordMarkHeader
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@ -45,7 +45,8 @@ class HeaderSwitchPatch : BytecodePatch() {
.findMutableMethodOf(method) .findMutableMethodOf(method)
.apply { .apply {
val targetIndex = getWideLiteralIndex(WordMarkHeader) val targetIndex = getWideLiteralIndex(WordMarkHeader)
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA val targetRegister =
getInstruction<OneRegisterInstruction>(targetIndex).registerA
addInstructions( addInstructions(
targetIndex + 1, """ targetIndex + 1, """

View File

@ -12,7 +12,7 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint import app.revanced.patches.youtube.general.loadmorebutton.fingerprints.LoadMoreButtonFingerprint
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
@ -31,7 +31,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@YouTubeCompatibility @YouTubeCompatibility
@Version("0.0.1") @Version("0.0.1")
class LoadMoreButtonPatch : BytecodePatch( class LoadMoreButtonPatch : BytecodePatch(
listOf(LoadMoreButtonFingerprint,) listOf(LoadMoreButtonFingerprint)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
LoadMoreButtonFingerprint.result?.let { LoadMoreButtonFingerprint.result?.let {

View File

@ -14,8 +14,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.shared.fingerprints.litho.EmptyComponentBuilderFingerprint
import app.revanced.patches.shared.fingerprints.EmptyComponentBuilderFingerprint import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.general.mixplaylists.fingerprints.BottomPanelOverlayTextFingerprint import app.revanced.patches.youtube.general.mixplaylists.fingerprints.BottomPanelOverlayTextFingerprint
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
import app.revanced.util.bytecode.getStringIndex import app.revanced.util.bytecode.getStringIndex

Some files were not shown because too many files have changed in this diff Show More