From 38675144dcb616474a047bcf8f7e1bf1f668ea46 Mon Sep 17 00:00:00 2001 From: OxrxL <108184954+OxrxL@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:21:56 +0100 Subject: [PATCH] feat(youtube): bump patches compatibility to v17.43.36 (#924) --- .../annotation/GeneralAdsCompatibility.kt | 2 +- .../HideInfocardSuggestionsCompatibility.kt | 2 +- .../annotations/VideoAdsCompatibility.kt | 2 +- .../annotation/DownloadsCompatibility.kt | 2 +- .../annotation/SeekbarTappingCompatibility.kt | 2 +- .../annotation/SwipeControlsCompatibility.kt | 2 +- .../annotations/AutoCaptionsCompatibility.kt | 2 +- .../AutoplayButtonCompatibility.kt | 2 +- .../annotations/HideButtonsCompatibility.kt | 2 +- .../annotations/CommentsCompatibility.kt | 2 +- .../FullscreenPanelsCompatibility.kt | 2 +- .../annotations/AlbumCardsCompatibility.kt | 2 +- .../fingerprints/AlbumCardsFingerprint.kt | 22 +++--- .../bytecode/patch/AlbumCardsPatch.kt | 45 ++++++++++++ .../hidealbumcards/patch/AlbumCardsPatch.kt | 59 --------------- .../resource/patch/AlbumCardsResourcePatch.kt | 42 +++++++++++ .../HideArtistCardCompatibility.kt | 2 +- .../CrowdfundingBoxCompatibility.kt | 2 +- .../CrowdfundingBoxFingerprint.kt | 29 ++++++++ .../patch/CrowdfundingBoxPatch.kt | 29 ++------ .../CrowdfundingBoxFingerprint.kt | 37 ---------- .../patch/CrowdfundingBoxResourcePatch.kt | 42 +++++++++++ .../MixPlaylistsPatchCompatibility.kt | 2 +- .../HideTimeAndSeekbarCompatibility.kt | 2 +- .../OldQualityLayoutCompatibility.kt | 2 +- .../HideEmailAddressCompatibility.kt | 2 +- ...ntSwitcherAccessibilityLabelFingerprint.kt | 30 ++++++++ .../bytecode/patch/HideEmailAddressPatch.kt | 53 ++++++++++++++ ...ntSwitcherAccessibilityLabelFingerprint.kt | 44 ----------- .../patch/HideEmailAddressPatch.kt | 73 ------------------- .../patch/HideEmailAddressResourcePatch.kt | 42 +++++++++++ .../annotations/CreateButtonCompatibility.kt | 2 +- .../annotations/ShortsButtonCompatibility.kt | 2 +- .../PlayerPopupPanelsCompatibility.kt | 2 +- .../annotations/HideReelsCompatibility.kt | 2 +- .../ReturnYouTubeDislikeCompatibility.kt | 2 +- .../annotations/SponsorBlockCompatibility.kt | 2 +- .../ShortsPlayerConstructorFingerprint.kt | 1 + .../StartupShortsResetCompatibility.kt | 2 +- .../TabletMiniPlayerCompatibility.kt | 2 +- ...PlayerResponseModelSizeCheckFingerprint.kt | 8 +- .../annotations/WatchinVRCompatibility.kt | 2 +- .../annotations/HideWaterwarkCompatibility.kt | 2 +- .../annotations/WideSearchbarCompatibility.kt | 2 +- .../annotations/AutoRepeatCompatibility.kt | 2 +- .../CustomPlaybackSpeedCompatibility.kt | 2 +- .../annotations/HDRBrightnessCompatibility.kt | 2 +- .../annotations/IntegrationsCompatibility.kt | 2 +- .../annotations/MicroGPatchCompatibility.kt | 2 +- .../MinimizedPlaybackCompatibility.kt | 2 +- .../annotation/PlayerControlsCompatibility.kt | 2 +- .../BottomControlsInflateFingerprint.kt | 1 + .../PlayerOverlaysHookCompatibility.kt | 2 +- .../annotation/PlayerTypeHookCompatibility.kt | 2 +- .../DefaultVideoQualityCompatibility.kt | 2 +- .../CustomVideoBufferCompatibility.kt | 2 +- .../annotation/VideoIdCompatibility.kt | 2 +- 57 files changed, 346 insertions(+), 293 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/{ => bytecode}/fingerprints/AlbumCardsFingerprint.kt (50%) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/patch/AlbumCardsPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/patch/AlbumCardsPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/resource/patch/AlbumCardsResourcePatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/fingerprints/CrowdfundingBoxFingerprint.kt rename src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/{ => bytecode}/patch/CrowdfundingBoxPatch.kt (56%) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/resource/patch/CrowdfundingBoxResourcePatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/patch/HideEmailAddressPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/patch/HideEmailAddressPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/resource/patch/HideEmailAddressResourcePatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/annotation/GeneralAdsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/annotation/GeneralAdsCompatibility.kt index a25cb99dd..19995e9cf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/annotation/GeneralAdsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/annotation/GeneralAdsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/annotations/HideInfocardSuggestionsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/annotations/HideInfocardSuggestionsCompatibility.kt index 5f6c165ad..0ec47f8af 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/annotations/HideInfocardSuggestionsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/annotations/HideInfocardSuggestionsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/annotations/VideoAdsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/annotations/VideoAdsCompatibility.kt index e7f227492..a5c72537a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/annotations/VideoAdsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/annotations/VideoAdsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/annotation/DownloadsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/annotation/DownloadsCompatibility.kt index ded2d43c7..a5a53d108 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/annotation/DownloadsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/annotation/DownloadsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.27.39", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/annotation/SeekbarTappingCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/annotation/SeekbarTappingCompatibility.kt index a08bd4618..277c9eeac 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/annotation/SeekbarTappingCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/annotation/SeekbarTappingCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/annotation/SwipeControlsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/annotation/SwipeControlsCompatibility.kt index 5070020f5..c50b2f589 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/annotation/SwipeControlsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/annotation/SwipeControlsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/annotations/AutoCaptionsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/annotations/AutoCaptionsCompatibility.kt index ed50c6b7d..9b1b17c82 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/annotations/AutoCaptionsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/annotations/AutoCaptionsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autoplaybutton/annotations/AutoplayButtonCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autoplaybutton/annotations/AutoplayButtonCompatibility.kt index 8433de3ba..1b689cdb8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autoplaybutton/annotations/AutoplayButtonCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autoplaybutton/annotations/AutoplayButtonCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/annotations/HideButtonsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/annotations/HideButtonsCompatibility.kt index df082dcbd..7d17a04e4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/annotations/HideButtonsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/annotations/HideButtonsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/comments/annotations/CommentsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/comments/annotations/CommentsCompatibility.kt index 8323ac9c4..fa104ef4c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/comments/annotations/CommentsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/comments/annotations/CommentsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/annotations/FullscreenPanelsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/annotations/FullscreenPanelsCompatibility.kt index b7dff764a..5504a05c8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/annotations/FullscreenPanelsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/fullscreenpanels/annotations/FullscreenPanelsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/annotations/AlbumCardsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/annotations/AlbumCardsCompatibility.kt index 4902d532f..207ceea01 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/annotations/AlbumCardsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/annotations/AlbumCardsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/fingerprints/AlbumCardsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/fingerprints/AlbumCardsFingerprint.kt similarity index 50% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/fingerprints/AlbumCardsFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/fingerprints/AlbumCardsFingerprint.kt index 077404ddd..695a7996f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/fingerprints/AlbumCardsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/fingerprints/AlbumCardsFingerprint.kt @@ -1,29 +1,29 @@ -package app.revanced.patches.youtube.layout.hidealbumcards.fingerprints +package app.revanced.patches.youtube.layout.hidealbumcards.bytecode.fingerprints import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility -import org.jf.dexlib2.AccessFlags +import app.revanced.patches.youtube.layout.hidealbumcards.resource.patch.AlbumCardsResourcePatch import org.jf.dexlib2.Opcode +import org.jf.dexlib2.iface.instruction.WideLiteralInstruction @Name("album-cards-view-fingerprint") @AlbumCardsCompatibility @Version("0.0.1") object AlbumCardsFingerprint : MethodFingerprint( - "V", - AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - listOf("L", "L", "L", "L", "L", "L", "[B"), - listOf( - Opcode.INVOKE_DIRECT, - Opcode.IPUT_OBJECT, - Opcode.INVOKE_STATIC, + opcodes = listOf( Opcode.MOVE_RESULT_OBJECT, Opcode.CONST, Opcode.CONST_4, Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, - ) + ), + customFingerprint = { methodDef -> + methodDef.implementation?.instructions?.any { instruction -> + instruction.opcode.ordinal == Opcode.CONST.ordinal && + (instruction as? WideLiteralInstruction)?.wideLiteral == AlbumCardsResourcePatch.albumCardId + } == true + } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/patch/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/patch/AlbumCardsPatch.kt new file mode 100644 index 000000000..9d7593d9a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/bytecode/patch/AlbumCardsPatch.kt @@ -0,0 +1,45 @@ +package app.revanced.patches.youtube.layout.hidealbumcards.bytecode.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.addInstruction +import app.revanced.patcher.extensions.instruction +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility +import app.revanced.patches.youtube.layout.hidealbumcards.bytecode.fingerprints.AlbumCardsFingerprint +import app.revanced.patches.youtube.layout.hidealbumcards.resource.patch.AlbumCardsResourcePatch +import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch +import org.jf.dexlib2.iface.instruction.OneRegisterInstruction + +@Patch +@DependsOn([IntegrationsPatch::class, AlbumCardsResourcePatch::class]) +@Name("hide-album-cards") +@Description("Hides the album cards below the artist description.") +@AlbumCardsCompatibility +@Version("0.0.1") +class AlbumCardsPatch : BytecodePatch( + listOf( + AlbumCardsFingerprint, + ) +) { + override fun execute(context: BytecodeContext): PatchResult { + val albumCardsResult = AlbumCardsFingerprint.result!! + val albumCardsMethod = albumCardsResult.mutableMethod + + val checkCastAnchorIndex = albumCardsResult.scanResult.patternScanResult!!.endIndex + + albumCardsMethod.addInstruction( + checkCastAnchorIndex + 1, """ + invoke-static {v${(albumCardsMethod.instruction(checkCastAnchorIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideAlbumCardsPatch;->hideAlbumCards(Landroid/view/View;)V + """ + ) + + return PatchResultSuccess() + } +} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/patch/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/patch/AlbumCardsPatch.kt deleted file mode 100644 index cd01e9f19..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/patch/AlbumCardsPatch.kt +++ /dev/null @@ -1,59 +0,0 @@ -package app.revanced.patches.youtube.layout.hidealbumcards.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.extensions.instruction -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility -import app.revanced.patches.youtube.layout.hidealbumcards.fingerprints.AlbumCardsFingerprint -import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch -import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch -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.SwitchPreference -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction - -@Patch -@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class]) -@Name("hide-album-cards") -@Description("Hides the album cards below the artist description.") -@AlbumCardsCompatibility -@Version("0.0.1") -class AlbumCardsPatch : BytecodePatch( - listOf( - AlbumCardsFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( - SwitchPreference( - "revanced_hide_album_cards", - StringResource("revanced_hide_album_cards_title", "Hide the album cards"), - false, - StringResource("revanced_hide_album_cards_summary_on", "Album cards is hidden"), - StringResource("revanced_hide_album_cards_summary_off", "Album cards is visible") - ) - ) - - val albumCardsResult = AlbumCardsFingerprint.result!! - val albumCardsMethod = albumCardsResult.mutableMethod - - val checkCastIndex = albumCardsResult.scanResult.patternScanResult!!.endIndex - val patchIndex = checkCastIndex + 1 - - albumCardsMethod.addInstruction( - patchIndex, """ - invoke-static {v${(albumCardsMethod.instruction(checkCastIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideAlbumCardsPatch;->hideAlbumCards(Landroid/view/View;)V - """ - ) - - return PatchResultSuccess() - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/resource/patch/AlbumCardsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/resource/patch/AlbumCardsResourcePatch.kt new file mode 100644 index 000000000..26ab6bdbd --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidealbumcards/resource/patch/AlbumCardsResourcePatch.kt @@ -0,0 +1,42 @@ +package app.revanced.patches.youtube.layout.hidealbumcards.resource.patch + +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patches.youtube.layout.hidealbumcards.annotations.AlbumCardsCompatibility +import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch +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.SwitchPreference + +@Name("hide-album-cards-resource-patch") +@AlbumCardsCompatibility +@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class]) +@Version("0.0.1") +class AlbumCardsResourcePatch : ResourcePatch { + companion object { + internal var albumCardId: Long = -1 + } + + override fun execute(context: ResourceContext): PatchResult { + SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( + SwitchPreference( + "revanced_hide_album_cards", + StringResource("revanced_hide_album_cards_title", "Hide the album cards"), + false, + StringResource("revanced_hide_album_cards_summary_on", "Album cards is hidden"), + StringResource("revanced_hide_album_cards_summary_off", "Album cards is visible") + ) + ) + + albumCardId = ResourceMappingResourcePatch.resourceMappings.single { + it.type == "layout" && it.name == "album_card" + }.id + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hideartistcard/annotations/HideArtistCardCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hideartistcard/annotations/HideArtistCardCompatibility.kt index 786b0939e..264ee2b06 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hideartistcard/annotations/HideArtistCardCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hideartistcard/annotations/HideArtistCardCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/annotations/CrowdfundingBoxCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/annotations/CrowdfundingBoxCompatibility.kt index 4daf702fb..60c9681d8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/annotations/CrowdfundingBoxCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/annotations/CrowdfundingBoxCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/fingerprints/CrowdfundingBoxFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/fingerprints/CrowdfundingBoxFingerprint.kt new file mode 100644 index 000000000..1f34bcb6f --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/fingerprints/CrowdfundingBoxFingerprint.kt @@ -0,0 +1,29 @@ +package app.revanced.patches.youtube.layout.hidecrowdfundingbox.bytecode.fingerprints + +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility +import app.revanced.patches.youtube.layout.hidecrowdfundingbox.resource.patch.CrowdfundingBoxResourcePatch +import org.jf.dexlib2.Opcode +import org.jf.dexlib2.iface.instruction.WideLiteralInstruction + +@Name("crowdfunding-box-view-parent-fingerprint") +@CrowdfundingBoxCompatibility +@Version("0.0.1") +object CrowdfundingBoxFingerprint : MethodFingerprint( + opcodes = listOf( + Opcode.CONST_4, + Opcode.CONST, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IPUT_OBJECT, + Opcode.CONST, + ), + customFingerprint = { methodDef -> + methodDef.implementation?.instructions?.any { instruction -> + instruction.opcode.ordinal == Opcode.CONST.ordinal && + (instruction as? WideLiteralInstruction)?.wideLiteral == CrowdfundingBoxResourcePatch.crowdfundingBoxId + } == true + } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/patch/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/patch/CrowdfundingBoxPatch.kt similarity index 56% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/patch/CrowdfundingBoxPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/patch/CrowdfundingBoxPatch.kt index ddc2a977f..00583184c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/patch/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/bytecode/patch/CrowdfundingBoxPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.hidecrowdfundingbox.patch +package app.revanced.patches.youtube.layout.hidecrowdfundingbox.bytecode.patch import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name @@ -11,45 +11,32 @@ import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.youtube.layout.hidecrowdfundingbox.resource.patch.CrowdfundingBoxResourcePatch import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility -import app.revanced.patches.youtube.layout.hidecrowdfundingbox.fingerprints.CrowdfundingBoxFingerprint +import app.revanced.patches.youtube.layout.hidecrowdfundingbox.bytecode.fingerprints.CrowdfundingBoxFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch -import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch -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.SwitchPreference import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @Patch -@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class]) +@DependsOn([IntegrationsPatch::class, CrowdfundingBoxResourcePatch::class]) @Name("hide-crowdfunding-box") @Description("Hides the crowdfunding box between the player and video description.") @CrowdfundingBoxCompatibility @Version("0.0.1") class CrowdfundingBoxPatch : BytecodePatch( listOf( - CrowdfundingBoxFingerprint + CrowdfundingBoxFingerprint, ) ) { override fun execute(context: BytecodeContext): PatchResult { - SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( - SwitchPreference( - "revanced_hide_crowdfunding_box", - StringResource("revanced_hide_crowdfunding_box_title", "Hide the crowdfunding box"), - false, - StringResource("revanced_hide_crowdfunding_box_summary_on", "Crowdfunding box is hidden"), - StringResource("revanced_hide_crowdfunding_box_summary_off", "Crowdfunding box is visible") - ) - ) - val crowdfundingBoxResult = CrowdfundingBoxFingerprint.result!! val crowdfundingBoxMethod = crowdfundingBoxResult.mutableMethod - val moveResultObjectIndex = crowdfundingBoxResult.scanResult.patternScanResult!!.endIndex - val patchIndex = moveResultObjectIndex + 1 + val moveResultObjectIndex = + crowdfundingBoxResult.scanResult.patternScanResult!!.endIndex - 2 crowdfundingBoxMethod.addInstruction( - patchIndex, """ + moveResultObjectIndex + 1, """ invoke-static {v${(crowdfundingBoxMethod.instruction(moveResultObjectIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideCrowdfundingBoxPatch;->hideCrowdfundingBox(Landroid/view/View;)V """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt deleted file mode 100644 index 2f8f48790..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/fingerprints/CrowdfundingBoxFingerprint.kt +++ /dev/null @@ -1,37 +0,0 @@ -package app.revanced.patches.youtube.layout.hidecrowdfundingbox.fingerprints - -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -@Name("crowdfunding-box-view-fingerprint") -@FuzzyPatternScanMethod(3) -@CrowdfundingBoxCompatibility -@Version("0.0.1") -object CrowdfundingBoxFingerprint : MethodFingerprint( - "V", - AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - listOf("L", "L", "L", "L", "L", "L", "L", "[B", "[B"), - listOf( - Opcode.MOVE_OBJECT, - Opcode.MOVE_OBJECT_FROM16, - Opcode.INVOKE_DIRECT, - Opcode.MOVE_OBJECT_FROM16, - Opcode.IPUT_OBJECT, - Opcode.MOVE_OBJECT_FROM16, - Opcode.IPUT_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CONST_4, - Opcode.CONST_4, - Opcode.CONST, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - ) -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/resource/patch/CrowdfundingBoxResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/resource/patch/CrowdfundingBoxResourcePatch.kt new file mode 100644 index 000000000..784b31a11 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidecrowdfundingbox/resource/patch/CrowdfundingBoxResourcePatch.kt @@ -0,0 +1,42 @@ +package app.revanced.patches.youtube.layout.hidecrowdfundingbox.resource.patch + +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patches.youtube.layout.hidecrowdfundingbox.annotations.CrowdfundingBoxCompatibility +import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch +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.SwitchPreference + +@Name("crowdfunding-box-resource-patch") +@CrowdfundingBoxCompatibility +@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class]) +@Version("0.0.1") +class CrowdfundingBoxResourcePatch : ResourcePatch { + companion object { + internal var crowdfundingBoxId: Long = -1 + } + + override fun execute(context: ResourceContext): PatchResult { + SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( + SwitchPreference( + "revanced_hide_crowdfunding_box", + StringResource("revanced_hide_crowdfunding_box_title", "Hide the crowdfunding box"), + false, + StringResource("revanced_hide_crowdfunding_box_summary_on", "Crowdfunding box is hidden"), + StringResource("revanced_hide_crowdfunding_box_summary_off", "Crowdfunding box is visible") + ) + ) + + crowdfundingBoxId = ResourceMappingResourcePatch.resourceMappings.single { + it.type == "layout" && it.name == "donation_companion" + }.id + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidemixplaylists/annotations/MixPlaylistsPatchCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidemixplaylists/annotations/MixPlaylistsPatchCompatibility.kt index 9bc6ea097..fde52ac7b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidemixplaylists/annotations/MixPlaylistsPatchCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidemixplaylists/annotations/MixPlaylistsPatchCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.32.39", "17.34.36", "17.36.37", "17.36.39", "17.37.35", "17.38.36", "17.39.35", "17.40.41", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.36.39", "17.37.35", "17.38.36", "17.39.35", "17.40.41", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hidetimeandseekbar/annotations/HideTimeAndSeekbarCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hidetimeandseekbar/annotations/HideTimeAndSeekbarCompatibility.kt index d2b10df83..0285726d4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hidetimeandseekbar/annotations/HideTimeAndSeekbarCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hidetimeandseekbar/annotations/HideTimeAndSeekbarCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/annotations/OldQualityLayoutCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/annotations/OldQualityLayoutCompatibility.kt index bed3c5a94..0c831a75a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/annotations/OldQualityLayoutCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/annotations/OldQualityLayoutCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/annotations/HideEmailAddressCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/annotations/HideEmailAddressCompatibility.kt index 5a77c2556..a163f00b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/annotations/HideEmailAddressCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/annotations/HideEmailAddressCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt new file mode 100644 index 000000000..bda32dd4a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt @@ -0,0 +1,30 @@ +package app.revanced.patches.youtube.layout.personalinformation.bytecode.fingerprints + +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility +import app.revanced.patches.youtube.layout.personalinformation.resource.patch.HideEmailAddressResourcePatch +import org.jf.dexlib2.Opcode +import org.jf.dexlib2.iface.instruction.WideLiteralInstruction + +@Name("account-switcher-accessibility-label-fingerprint") +@HideEmailAddressCompatibility +@Version("0.0.1") +object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint( + opcodes = listOf( + Opcode.INVOKE_VIRTUAL, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.NEW_ARRAY, + Opcode.CONST_4, + Opcode.APUT_OBJECT, + Opcode.CONST, + ), + customFingerprint = { methodDef -> + methodDef.implementation?.instructions?.any { instruction -> + instruction.opcode.ordinal == Opcode.CONST.ordinal && + (instruction as? WideLiteralInstruction)?.wideLiteral == HideEmailAddressResourcePatch.accountSwitcherAccessibilityLabelId + } == true + } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/patch/HideEmailAddressPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/patch/HideEmailAddressPatch.kt new file mode 100644 index 000000000..46234db58 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/bytecode/patch/HideEmailAddressPatch.kt @@ -0,0 +1,53 @@ +package app.revanced.patches.youtube.layout.personalinformation.bytecode.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.addInstructions +import app.revanced.patcher.extensions.instruction +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility +import app.revanced.patches.youtube.layout.personalinformation.bytecode.fingerprints.AccountSwitcherAccessibilityLabelFingerprint +import app.revanced.patches.youtube.layout.personalinformation.resource.patch.HideEmailAddressResourcePatch +import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch +import org.jf.dexlib2.iface.instruction.OneRegisterInstruction + +@Patch +@DependsOn([IntegrationsPatch::class, HideEmailAddressResourcePatch::class]) +@Name("hide-email-address") +@Description("Hides the email address in the account switcher.") +@HideEmailAddressCompatibility +@Version("0.0.1") +class HideEmailAddressPatch : BytecodePatch( + listOf( + AccountSwitcherAccessibilityLabelFingerprint + ) +) { + override fun execute(context: BytecodeContext): PatchResult { + val accountSwitcherAccessibilityLabelResult = AccountSwitcherAccessibilityLabelFingerprint.result!! + val accountSwitcherAccessibilityLabelMethod = accountSwitcherAccessibilityLabelResult.mutableMethod + + val setVisibilityConstIndex = + accountSwitcherAccessibilityLabelResult.scanResult.patternScanResult!!.endIndex + + val setVisibilityConstRegister = ( + accountSwitcherAccessibilityLabelMethod.instruction + (setVisibilityConstIndex - 2) as OneRegisterInstruction + ).registerA + + accountSwitcherAccessibilityLabelMethod.addInstructions( + setVisibilityConstIndex, """ + invoke-static {v$setVisibilityConstRegister}, Lapp/revanced/integrations/patches/HideEmailAddressPatch;->hideEmailAddress(I)I + move-result v$setVisibilityConstRegister + """ + ) + + return PatchResultSuccess() + } +} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt deleted file mode 100644 index dc680d960..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/fingerprints/AccountSwitcherAccessibilityLabelFingerprint.kt +++ /dev/null @@ -1,44 +0,0 @@ -package app.revanced.patches.youtube.layout.personalinformation.fingerprints - -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -@Name("account-switcher-accessibility-label-fingerprint") -@FuzzyPatternScanMethod(3) -@HideEmailAddressCompatibility -@Version("0.0.1") -object AccountSwitcherAccessibilityLabelFingerprint : MethodFingerprint( - "V", - AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC, - listOf("L", "L"), - listOf( - Opcode.CHECK_CAST, - Opcode.IGET_OBJECT, - Opcode.NEW_INSTANCE, - Opcode.IGET_OBJECT, - Opcode.INVOKE_DIRECT, - Opcode.CONST_4, - Opcode.INVOKE_INTERFACE, - Opcode.IGET, - Opcode.CONST_4, - Opcode.ADD_INT_2ADDR, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.SGET_OBJECT, - Opcode.GOTO, - Opcode.MOVE_OBJECT, - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - ) -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/patch/HideEmailAddressPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/patch/HideEmailAddressPatch.kt deleted file mode 100644 index 26a0e362d..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/patch/HideEmailAddressPatch.kt +++ /dev/null @@ -1,73 +0,0 @@ -package app.revanced.patches.youtube.layout.personalinformation.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility -import app.revanced.patches.youtube.layout.personalinformation.fingerprints.AccountSwitcherAccessibilityLabelFingerprint -import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch -import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch -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.SwitchPreference -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -import org.jf.dexlib2.iface.instruction.WideLiteralInstruction - -@Patch -@DependsOn([IntegrationsPatch::class, SettingsPatch::class, ResourceMappingResourcePatch::class]) -@Name("hide-email-address") -@Description("Hides the email address in the account switcher.") -@HideEmailAddressCompatibility -@Version("0.0.1") -class HideEmailAddressPatch : BytecodePatch( - listOf( - AccountSwitcherAccessibilityLabelFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( - SwitchPreference( - "revanced_hide_email_address", - StringResource("revanced_hide_email_address_title", "Hide the email address"), - false, - StringResource("revanced_hide_email_address_summary_on", "Email address is hidden"), - StringResource("revanced_hide_email_address_summary_off", "Email address is visible") - ) - ) - - val accountSwitcherAccessibilityLabelId = - ResourceMappingResourcePatch.resourceMappings.single { - it.type == "string" && it.name == "account_switcher_accessibility_label" - }.id - - val accountSwitcherAccessibilityLabelMethod = AccountSwitcherAccessibilityLabelFingerprint.result!!.mutableMethod - val accountSwitcherAccessibilityLabelInstruction = accountSwitcherAccessibilityLabelMethod.implementation!!.instructions - - val setVisibilityConstIndex = accountSwitcherAccessibilityLabelInstruction.indexOfFirst { - (it as? WideLiteralInstruction)?.wideLiteral == accountSwitcherAccessibilityLabelId - } - 1 - - val setVisibilityConstRegister = (accountSwitcherAccessibilityLabelInstruction[setVisibilityConstIndex] as OneRegisterInstruction).registerA - val toggleRegister = (setVisibilityConstRegister + 1) - - accountSwitcherAccessibilityLabelMethod.addInstructions( - setVisibilityConstIndex + 1, """ - invoke-static {}, Lapp/revanced/integrations/patches/HideEmailAddressPatch;->hideEmailAddress()Z - move-result v$toggleRegister - if-eqz v$toggleRegister, :hide - const/16 v$setVisibilityConstRegister, 0x8 - :hide - nop - """ - ) - - return PatchResultSuccess() - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/resource/patch/HideEmailAddressResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/resource/patch/HideEmailAddressResourcePatch.kt new file mode 100644 index 000000000..bb56bb0cc --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/personalinformation/resource/patch/HideEmailAddressResourcePatch.kt @@ -0,0 +1,42 @@ +package app.revanced.patches.youtube.layout.personalinformation.resource.patch + +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patches.youtube.layout.personalinformation.annotations.HideEmailAddressCompatibility +import app.revanced.patches.youtube.misc.mapping.patch.ResourceMappingResourcePatch +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.SwitchPreference + +@Name("hide-email-address-resource-patch") +@HideEmailAddressCompatibility +@DependsOn([SettingsPatch::class, ResourceMappingResourcePatch::class]) +@Version("0.0.1") +class HideEmailAddressResourcePatch : ResourcePatch { + companion object { + internal var accountSwitcherAccessibilityLabelId: Long = -1 + } + + override fun execute(context: ResourceContext): PatchResult { + SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( + SwitchPreference( + "revanced_hide_email_address", + StringResource("revanced_hide_email_address_title", "Hide the email address"), + false, + StringResource("revanced_hide_email_address_summary_on", "Email address is hidden"), + StringResource("revanced_hide_email_address_summary_off", "Email address is visible") + ) + ) + + accountSwitcherAccessibilityLabelId = ResourceMappingResourcePatch.resourceMappings.single { + it.type == "string" && it.name == "account_switcher_accessibility_label" + }.id + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/createbutton/annotations/CreateButtonCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/createbutton/annotations/CreateButtonCompatibility.kt index 3f6113682..64adf4ced 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/createbutton/annotations/CreateButtonCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/createbutton/annotations/CreateButtonCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/shortsbutton/annotations/ShortsButtonCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/shortsbutton/annotations/ShortsButtonCompatibility.kt index 26244dae4..edf4d36e7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/shortsbutton/annotations/ShortsButtonCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/pivotbar/shortsbutton/annotations/ShortsButtonCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/playerpopuppanels/annotations/PlayerPopupPanelsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/playerpopuppanels/annotations/PlayerPopupPanelsCompatibility.kt index 12fb4f51e..fb47ef4fb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/playerpopuppanels/annotations/PlayerPopupPanelsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/playerpopuppanels/annotations/PlayerPopupPanelsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/annotations/HideReelsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/reels/annotations/HideReelsCompatibility.kt index 48164c5f6..b05aef01d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/reels/annotations/HideReelsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/reels/annotations/HideReelsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/annotations/ReturnYouTubeDislikeCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/annotations/ReturnYouTubeDislikeCompatibility.kt index 4c0329225..08f4faadf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/annotations/ReturnYouTubeDislikeCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/annotations/ReturnYouTubeDislikeCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/annotations/SponsorBlockCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/annotations/SponsorBlockCompatibility.kt index 8729150e8..4d5297a27 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/annotations/SponsorBlockCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/annotations/SponsorBlockCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.22.36", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/ShortsPlayerConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/ShortsPlayerConstructorFingerprint.kt index ccb39c5b5..8058b9b16 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/ShortsPlayerConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/bytecode/fingerprints/ShortsPlayerConstructorFingerprint.kt @@ -39,6 +39,7 @@ object ShortsPlayerConstructorFingerprint : MethodFingerprint( ), customFingerprint = { methodDef -> methodDef.implementation?.instructions?.any { instruction -> + instruction.opcode.ordinal == Opcode.CONST.ordinal && (instruction as? WideLiteralInstruction)?.wideLiteral == SponsorBlockResourcePatch.reelButtonGroupResourceId } == true } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/annotations/StartupShortsResetCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/annotations/StartupShortsResetCompatibility.kt index c9231c7a0..5ceff3c96 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/annotations/StartupShortsResetCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/annotations/StartupShortsResetCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/annotations/TabletMiniPlayerCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/annotations/TabletMiniPlayerCompatibility.kt index d46e15d69..cb8ed7155 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/annotations/TabletMiniPlayerCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/annotations/TabletMiniPlayerCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.26.35", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/fingerprints/MiniPlayerResponseModelSizeCheckFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/fingerprints/MiniPlayerResponseModelSizeCheckFingerprint.kt index ee88adaeb..afec65f1b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/fingerprints/MiniPlayerResponseModelSizeCheckFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/fingerprints/MiniPlayerResponseModelSizeCheckFingerprint.kt @@ -16,17 +16,11 @@ object MiniPlayerResponseModelSizeCheckFingerprint : MethodFingerprint( AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"), listOf( - Opcode.OR_INT_LIT8, - Opcode.IPUT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CHECK_CAST, - Opcode.RETURN_OBJECT, Opcode.RETURN_OBJECT, Opcode.CHECK_CAST, Opcode.CHECK_CAST, Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT, Opcode.IF_NEZ, - ) + ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/annotations/WatchinVRCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/annotations/WatchinVRCompatibility.kt index 9f6fd4f55..a4db6600b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/annotations/WatchinVRCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/watchinvr/annotations/WatchinVRCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/watermark/annotations/HideWaterwarkCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/watermark/annotations/HideWaterwarkCompatibility.kt index 7675633c0..bd6e3563d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/watermark/annotations/HideWaterwarkCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/watermark/annotations/HideWaterwarkCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/annotations/WideSearchbarCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/annotations/WideSearchbarCompatibility.kt index aa685fc90..b70a46e2a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/annotations/WideSearchbarCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/annotations/WideSearchbarCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/annotations/AutoRepeatCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/annotations/AutoRepeatCompatibility.kt index 10f13771a..583e07cc9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/annotations/AutoRepeatCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/annotations/AutoRepeatCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/annotations/CustomPlaybackSpeedCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/annotations/CustomPlaybackSpeedCompatibility.kt index d30cc8a88..23c462267 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/annotations/CustomPlaybackSpeedCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/annotations/CustomPlaybackSpeedCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/annotations/HDRBrightnessCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/annotations/HDRBrightnessCompatibility.kt index 0728f8959..a95e127b1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/annotations/HDRBrightnessCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/annotations/HDRBrightnessCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/annotations/IntegrationsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/annotations/IntegrationsCompatibility.kt index 080d9cca5..cff3b4d7a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/annotations/IntegrationsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/annotations/IntegrationsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/annotations/MicroGPatchCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/annotations/MicroGPatchCompatibility.kt index e5720d39a..0ee4735ed 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/microg/annotations/MicroGPatchCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/microg/annotations/MicroGPatchCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/annotations/MinimizedPlaybackCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/annotations/MinimizedPlaybackCompatibility.kt index 47ef55519..652143758 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/annotations/MinimizedPlaybackCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/annotations/MinimizedPlaybackCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34", "17.24.35", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/annotation/PlayerControlsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/annotation/PlayerControlsCompatibility.kt index 5f9e181a1..72232ac69 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/annotation/PlayerControlsCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/annotation/PlayerControlsCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.27.39", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt index 08cd78ab0..fc6337865 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt @@ -20,6 +20,7 @@ object BottomControlsInflateFingerprint : MethodFingerprint( ), customFingerprint = { methodDef -> methodDef.implementation?.instructions?.any { instruction -> + instruction.opcode.ordinal == Opcode.CONST.ordinal && (instruction as? WideLiteralInstruction)?.wideLiteral == PlayerControlsBytecodePatch.bottomUiContainerResourceId } == true } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/annotation/PlayerOverlaysHookCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/annotation/PlayerOverlaysHookCompatibility.kt index ffdaa6e72..6a0896fc5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/annotation/PlayerOverlaysHookCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/annotation/PlayerOverlaysHookCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/annotation/PlayerTypeHookCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/annotation/PlayerTypeHookCompatibility.kt index a0f8249fd..e54de73cf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/annotation/PlayerTypeHookCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/annotation/PlayerTypeHookCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/quality/annotations/DefaultVideoQualityCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/quality/annotations/DefaultVideoQualityCompatibility.kt index f8d42a1f9..04a7edfdb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/quality/annotations/DefaultVideoQualityCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/quality/annotations/DefaultVideoQualityCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.22.36", "17.24.35", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/videobuffer/annotations/CustomVideoBufferCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/videobuffer/annotations/CustomVideoBufferCompatibility.kt index d978744a1..72caa0d54 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/videobuffer/annotations/CustomVideoBufferCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/videobuffer/annotations/CustomVideoBufferCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.25.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/videoid/annotation/VideoIdCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/videoid/annotation/VideoIdCompatibility.kt index e4834e4ff..ef65b52da 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/videoid/annotation/VideoIdCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/videoid/annotation/VideoIdCompatibility.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package @Compatibility( [Package( - "com.google.android.youtube", arrayOf("17.14.35", "17.22.36", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37", "17.41.37") + "com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36") )] ) @Target(AnnotationTarget.CLASS)