mirror of
https://github.com/revanced/revanced-patches
synced 2025-02-12 00:16:51 +01:00
style(youtube/resource-mapping): use shorter name for class
This commit is contained in:
parent
2d94b3beff
commit
aca35227d4
@ -14,7 +14,7 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
import app.revanced.patches.spotify.premium_navbar_tab.annotations.PremiumNavbarTabCompatibility
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabFingerprint
|
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabFingerprint
|
||||||
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabParentFingerprint
|
import app.revanced.patches.spotify.premium_navbar_tab.fingerprints.AddPremiumNavbarTabParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
@Description("Removes the premium tab from the navbar.")
|
@Description("Removes the premium tab from the navbar.")
|
||||||
@PremiumNavbarTabCompatibility
|
@PremiumNavbarTabCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
@DependsOn([ResourceMappingResourcePatch::class])
|
@DependsOn([ResourceMappingPatch::class])
|
||||||
class PremiumNavbarTabPatch : BytecodePatch(
|
class PremiumNavbarTabPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
AddPremiumNavbarTabParentFingerprint
|
AddPremiumNavbarTabParentFingerprint
|
||||||
@ -40,7 +40,7 @@ class PremiumNavbarTabPatch : BytecodePatch(
|
|||||||
val lastInstructionIdx = methodInstructions.size - 1
|
val lastInstructionIdx = methodInstructions.size - 1
|
||||||
|
|
||||||
val premiumTabId =
|
val premiumTabId =
|
||||||
ResourceMappingResourcePatch.resourceMappings.single { it.type == "id" && it.name == "premium_tab" }.id
|
ResourceMappingPatch.resourceMappings.single { it.type == "id" && it.name == "premium_tab" }.id
|
||||||
|
|
||||||
var removeAmount = 2
|
var removeAmount = 2
|
||||||
// 2nd const remove method
|
// 2nd const remove method
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.youtube.ad.general.bytecode.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
||||||
|
|
||||||
|
@DependsOn()
|
||||||
|
@GeneralAdsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class GeneralAdsBytecodePatch : BytecodePatch() {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.P
|
|||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.*
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn(dependencies = [FixLocaleConfigErrorPatch::class, LithoFilterPatch::class, SettingsPatch::class])
|
@DependsOn(dependencies = [FixLocaleConfigErrorPatch::class, LithoFilterPatch::class, SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Name("general-ads")
|
@Name("general-ads")
|
||||||
@Description("Removes general ads.")
|
@Description("Removes general ads.")
|
||||||
@GeneralAdsCompatibility
|
@GeneralAdsCompatibility
|
@ -15,7 +15,7 @@ import app.revanced.patches.youtube.layout.autoplaybutton.annotations.AutoplayBu
|
|||||||
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.AutoNavInformerFingerprint
|
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.AutoNavInformerFingerprint
|
||||||
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.LayoutConstructorFingerprint
|
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.LayoutConstructorFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
import org.jf.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Name("hide-autoplay-button")
|
@Name("hide-autoplay-button")
|
||||||
@Description("Hides the autoplay button in the video player.")
|
@Description("Hides the autoplay button in the video player.")
|
||||||
@AutoplayButtonCompatibility
|
@AutoplayButtonCompatibility
|
||||||
@ -53,7 +53,7 @@ class HideAutoplayButtonPatch : BytecodePatch(
|
|||||||
val layoutGenMethodInstructions = layoutGenMethod.implementation!!.instructions
|
val layoutGenMethodInstructions = layoutGenMethod.implementation!!.instructions
|
||||||
|
|
||||||
// resolve the offsets such as ...
|
// resolve the offsets such as ...
|
||||||
val autoNavPreviewStubId = ResourceMappingResourcePatch.resourceMappings.single {
|
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.name == "autonav_preview_stub"
|
it.name == "autonav_preview_stub"
|
||||||
}.id
|
}.id
|
||||||
// where to insert the branch instructions and ...
|
// where to insert the branch instructions and ...
|
||||||
|
@ -11,14 +11,14 @@ 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.youtube.misc.litho.filter.patch.LithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
import app.revanced.patches.youtube.layout.buttons.annotations.HideButtonsCompatibility
|
import app.revanced.patches.youtube.layout.buttons.annotations.HideButtonsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([ResourceMappingResourcePatch::class, LithoFilterPatch::class])
|
@DependsOn([ResourceMappingPatch::class, LithoFilterPatch::class])
|
||||||
@Name("hide-video-buttons")
|
@Name("hide-video-buttons")
|
||||||
@Description("Adds options to hide action buttons under a video.")
|
@Description("Adds options to hide action buttons under a video.")
|
||||||
@HideButtonsCompatibility
|
@HideButtonsCompatibility
|
||||||
|
@ -8,7 +8,7 @@ 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.youtube.layout.comments.annotations.CommentsCompatibility
|
import app.revanced.patches.youtube.layout.comments.annotations.CommentsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
@ -16,7 +16,7 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.Swit
|
|||||||
|
|
||||||
@Name("comments-resource-patch")
|
@Name("comments-resource-patch")
|
||||||
@CommentsCompatibility
|
@CommentsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CommentsResourcePatch : ResourcePatch {
|
class CommentsResourcePatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
@ -55,7 +55,7 @@ class CommentsResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
shortsCommentsButtonId = ResourceMappingResourcePatch.resourceMappings.single {
|
shortsCommentsButtonId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "drawable" && it.name == "ic_right_comment_32c"
|
it.type == "drawable" && it.name == "ic_right_comment_32c"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ 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.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility
|
import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Name("hide-album-cards-resource-patch")
|
@Name("hide-album-cards-resource-patch")
|
||||||
@AlbumCardsCompatibility
|
@AlbumCardsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class AlbumCardsResourcePatch : ResourcePatch {
|
class AlbumCardsResourcePatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
@ -33,7 +33,7 @@ class AlbumCardsResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
albumCardId = ResourceMappingResourcePatch.resourceMappings.single {
|
albumCardId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "layout" && it.name == "album_card"
|
it.type == "layout" && it.name == "album_card"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -11,13 +11,13 @@ 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.youtube.misc.litho.filter.patch.LithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||||
import app.revanced.patches.youtube.layout.buttons.annotations.HideArtistCardCompatibility
|
import app.revanced.patches.youtube.layout.buttons.annotations.HideArtistCardCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([ResourceMappingResourcePatch::class, LithoFilterPatch::class])
|
@DependsOn([ResourceMappingPatch::class, LithoFilterPatch::class])
|
||||||
@Name("hide-artist-card")
|
@Name("hide-artist-card")
|
||||||
@Description("Hides the artist card below the searchbar.")
|
@Description("Hides the artist card below the searchbar.")
|
||||||
@HideArtistCardCompatibility
|
@HideArtistCardCompatibility
|
||||||
|
@ -8,14 +8,14 @@ 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.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility
|
import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Name("crowdfunding-box-resource-patch")
|
@Name("crowdfunding-box-resource-patch")
|
||||||
@CrowdfundingBoxCompatibility
|
@CrowdfundingBoxCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CrowdfundingBoxResourcePatch : ResourcePatch {
|
class CrowdfundingBoxResourcePatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
@ -33,7 +33,7 @@ class CrowdfundingBoxResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
crowdfundingBoxId = ResourceMappingResourcePatch.resourceMappings.single {
|
crowdfundingBoxId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "layout" && it.name == "donation_companion"
|
it.type == "layout" && it.name == "donation_companion"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ 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.youtube.layout.hideendscreencards.annotations.HideEndscreenCardsCompatibility
|
import app.revanced.patches.youtube.layout.hideendscreencards.annotations.HideEndscreenCardsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Name("hide-endscreen-cards-resource-patch")
|
@Name("hide-endscreen-cards-resource-patch")
|
||||||
@HideEndscreenCardsCompatibility
|
@HideEndscreenCardsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideEndscreenCardsResourcePatch : ResourcePatch {
|
class HideEndscreenCardsResourcePatch : ResourcePatch {
|
||||||
internal companion object {
|
internal companion object {
|
||||||
@ -35,7 +35,7 @@ class HideEndscreenCardsResourcePatch : ResourcePatch {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
fun findEndscreenResourceId(name: String) = ResourceMappingResourcePatch.resourceMappings.single {
|
fun findEndscreenResourceId(name: String) = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "layout" && it.name == "endscreen_element_layout_$name"
|
it.type == "layout" && it.name == "endscreen_element_layout_$name"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -7,13 +7,13 @@ 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.youtube.layout.hideinfocards.annotations.HideInfocardsCompatibility
|
import app.revanced.patches.youtube.layout.hideinfocards.annotations.HideInfocardsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@HideInfocardsCompatibility
|
@HideInfocardsCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideInfocardsResourcePatch : ResourcePatch {
|
class HideInfocardsResourcePatch : ResourcePatch {
|
||||||
internal companion object {
|
internal companion object {
|
||||||
@ -31,7 +31,7 @@ class HideInfocardsResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
drawerResourceId = ResourceMappingResourcePatch.resourceMappings.single {
|
drawerResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "id" && it.name == "info_cards_drawer_header"
|
it.type == "id" && it.name == "info_cards_drawer_header"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ 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.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility
|
import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Name("hide-email-address-resource-patch")
|
@Name("hide-email-address-resource-patch")
|
||||||
@HideEmailAddressCompatibility
|
@HideEmailAddressCompatibility
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideEmailAddressResourcePatch : ResourcePatch {
|
class HideEmailAddressResourcePatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
@ -33,7 +33,7 @@ class HideEmailAddressResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
accountSwitcherAccessibilityLabelId = ResourceMappingResourcePatch.resourceMappings.single {
|
accountSwitcherAccessibilityLabelId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "string" && it.name == "account_switcher_accessibility_label"
|
it.type == "string" && it.name == "account_switcher_accessibility_label"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ import app.revanced.patches.youtube.layout.pivotbar.fingerprints.PivotBarFingerp
|
|||||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT
|
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT
|
||||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
|
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, ResourceMappingResourcePatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, ResourceMappingPatch::class, SettingsPatch::class])
|
||||||
@Name("hide-create-button")
|
@Name("hide-create-button")
|
||||||
@Description("Hides the create button in the navigation bar.")
|
@Description("Hides the create button in the navigation bar.")
|
||||||
@CreateButtonCompatibility
|
@CreateButtonCompatibility
|
||||||
|
@ -21,7 +21,7 @@ import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlock
|
|||||||
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
|
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
|
||||||
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
|
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
|
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
|
||||||
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
|
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
|
||||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
||||||
@ -158,9 +158,9 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
|||||||
val controlsMethodResult = PlayerControlsBytecodePatch.showPlayerControlsFingerprintResult
|
val controlsMethodResult = PlayerControlsBytecodePatch.showPlayerControlsFingerprintResult
|
||||||
|
|
||||||
val controlsLayoutStubResourceId =
|
val controlsLayoutStubResourceId =
|
||||||
ResourceMappingResourcePatch.resourceMappings.single { it.type == "id" && it.name == "controls_layout_stub" }.id
|
ResourceMappingPatch.resourceMappings.single { it.type == "id" && it.name == "controls_layout_stub" }.id
|
||||||
val zoomOverlayResourceId =
|
val zoomOverlayResourceId =
|
||||||
ResourceMappingResourcePatch.resourceMappings.single { it.type == "id" && it.name == "video_zoom_overlay_stub" }.id
|
ResourceMappingPatch.resourceMappings.single { it.type == "id" && it.name == "video_zoom_overlay_stub" }.id
|
||||||
|
|
||||||
methods@ for (method in controlsMethodResult.mutableClass.methods) {
|
methods@ for (method in controlsMethodResult.mutableClass.methods) {
|
||||||
val instructions = method.implementation?.instructions!!
|
val instructions = method.implementation?.instructions!!
|
||||||
|
@ -9,7 +9,7 @@ import app.revanced.patcher.patch.ResourcePatch
|
|||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
|
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.Preference
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.Preference
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
@ -20,7 +20,7 @@ import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
|||||||
|
|
||||||
@Name("sponsorblock-resource-patch")
|
@Name("sponsorblock-resource-patch")
|
||||||
@SponsorBlockCompatibility
|
@SponsorBlockCompatibility
|
||||||
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class SponsorBlockResourcePatch : ResourcePatch {
|
class SponsorBlockResourcePatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
@ -107,7 +107,7 @@ class SponsorBlockResourcePatch : ResourcePatch {
|
|||||||
}
|
}
|
||||||
}.close() // close afterwards
|
}.close() // close afterwards
|
||||||
|
|
||||||
reelButtonGroupResourceId = ResourceMappingResourcePatch.resourceMappings.single {
|
reelButtonGroupResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||||
it.type == "id" && it.name == "reel_persistent_edu_button_group"
|
it.type == "id" && it.name == "reel_persistent_edu_button_group"
|
||||||
}.id
|
}.id
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import java.util.concurrent.TimeUnit
|
|||||||
@Name("resource-mapping")
|
@Name("resource-mapping")
|
||||||
@Description("Creates a map of public resources.")
|
@Description("Creates a map of public resources.")
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ResourceMappingResourcePatch : ResourcePatch {
|
class ResourceMappingPatch : ResourcePatch {
|
||||||
companion object {
|
companion object {
|
||||||
internal lateinit var resourceMappings: List<ResourceElement>
|
internal lateinit var resourceMappings: List<ResourceElement>
|
||||||
private set
|
private set
|
@ -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.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.annotation.PlayerControlsCompatibility
|
import app.revanced.patches.youtube.misc.playercontrols.annotation.PlayerControlsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.BottomControlsInflateFingerprint
|
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.BottomControlsInflateFingerprint
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.PlayerControlsVisibilityFingerprint
|
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.PlayerControlsVisibilityFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Name("player-controls-bytecode-patch")
|
@Name("player-controls-bytecode-patch")
|
||||||
@DependsOn([ResourceMappingResourcePatch::class])
|
@DependsOn([ResourceMappingPatch::class])
|
||||||
@Description("Manages the code for the player controls of the YouTube player.")
|
@Description("Manages the code for the player controls of the YouTube player.")
|
||||||
@PlayerControlsCompatibility
|
@PlayerControlsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
@ -28,7 +28,7 @@ class PlayerControlsBytecodePatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
showPlayerControlsFingerprintResult = PlayerControlsVisibilityFingerprint.result!!
|
showPlayerControlsFingerprintResult = PlayerControlsVisibilityFingerprint.result!!
|
||||||
|
|
||||||
bottomUiContainerResourceId = ResourceMappingResourcePatch
|
bottomUiContainerResourceId = ResourceMappingPatch
|
||||||
.resourceMappings
|
.resourceMappings
|
||||||
.single { it.type == "id" && it.name == "bottom_ui_container_stub" }.id
|
.single { it.type == "id" && it.name == "bottom_ui_container_stub" }.id
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ 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.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.BasePreference
|
import app.revanced.patches.youtube.misc.settings.framework.components.BasePreference
|
||||||
@ -21,14 +21,14 @@ import org.w3c.dom.Node
|
|||||||
|
|
||||||
@Name("settings-resource-patch")
|
@Name("settings-resource-patch")
|
||||||
@SettingsCompatibility
|
@SettingsCompatibility
|
||||||
@DependsOn([FixLocaleConfigErrorPatch::class, ResourceMappingResourcePatch::class])
|
@DependsOn([FixLocaleConfigErrorPatch::class, ResourceMappingPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class SettingsResourcePatch : ResourcePatch {
|
class SettingsResourcePatch : ResourcePatch {
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
/*
|
/*
|
||||||
* used by a fingerprint of SettingsPatch
|
* used by a fingerprint of SettingsPatch
|
||||||
*/
|
*/
|
||||||
appearanceStringId = ResourceMappingResourcePatch.resourceMappings.find {
|
appearanceStringId = ResourceMappingPatch.resourceMappings.find {
|
||||||
it.type == "string" && it.name == "app_theme_appearance_dark"
|
it.type == "string" && it.name == "app_theme_appearance_dark"
|
||||||
}!!.id
|
}!!.id
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user