From a6264daf765e2f0ae3b525c222469dff38daf489 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Tue, 27 Jun 2023 01:44:14 +0900 Subject: [PATCH] feat(youtube/settings): moved some settings to the appropriate category --- .../comment/patch/CommentComponentPatch.kt | 1 - .../quickactions/patch/QuickActionsPatch.kt | 2 +- .../layout/patch/LayoutComponentsPatch.kt | 8 +- .../NavigationEndpointFingerprint.kt | 14 -- .../ReelWatchEndpointFingerprint.kt | 8 -- .../ReelWatchEndpointParentFingerprint.kt | 8 -- .../shortsnavbar/patch/ShortsNavBarPatch.kt | 126 ------------------ .../fingerprints/ShortsCommentFingerprint.kt | 2 + .../fingerprints/ShortsRemixFingerprint.kt | 2 + .../patch/ShortsComponentPatch.kt | 2 + .../BottomNavigationBarFingerprint.kt | 18 +++ .../RenderBottomNavigationBarFingerprint.kt} | 4 +- .../fingerprints/SetPivotBarFingerprint.kt | 2 +- .../patch/ShortsNavigationBarPatch.kt | 81 +++++++++++ .../youtube/settings/host/values/strings.xml | 97 +++++++------- .../youtube/settings/values-v21/strings.xml | 4 +- .../youtube/settings/xml/revanced_prefs.xml | 112 ++++++---------- 17 files changed, 203 insertions(+), 288 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/NavigationEndpointFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointParentFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/patch/ShortsNavBarPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/BottomNavigationBarFingerprint.kt rename src/main/kotlin/app/revanced/patches/youtube/{navigation/shortsnavbar/fingerprints/ReelWatchBundleFingerprint.kt => shorts/shortsnavigationbar/fingerprints/RenderBottomNavigationBarFingerprint.kt} (67%) rename src/main/kotlin/app/revanced/patches/youtube/{navigation/shortsnavbar => shorts/shortsnavigationbar}/fingerprints/SetPivotBarFingerprint.kt (84%) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/patch/ShortsNavigationBarPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/patch/CommentComponentPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/patch/CommentComponentPatch.kt index d03d26aa7..c5ec732ee 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/patch/CommentComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/buttomplayer/comment/patch/CommentComponentPatch.kt @@ -36,7 +36,6 @@ class CommentComponentPatch : ResourcePatch { SettingsPatch.addPreference( arrayOf( "PREFERENCE: BOTTOM_PLAYER_SETTINGS", - "SETTINGS: COMMENT_COMPONENT_PARENT", "SETTINGS: COMMENT_COMPONENTS" ) ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/patch/QuickActionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/patch/QuickActionsPatch.kt index c834f1be3..58e1ac3d6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/patch/QuickActionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/fullscreen/quickactions/patch/QuickActionsPatch.kt @@ -29,7 +29,7 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH @Version("0.0.1") class QuickActionsPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { - LithoFilterPatch.addFilter("$PATCHES_PATH/ads/QuickActionButtonsFilter;") + LithoFilterPatch.addFilter("$PATCHES_PATH/ads/QuickActionFilter;") /** * Add settings diff --git a/src/main/kotlin/app/revanced/patches/youtube/general/layout/patch/LayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/general/layout/patch/LayoutComponentsPatch.kt index c2c0f5345..5e679225f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/general/layout/patch/LayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/general/layout/patch/LayoutComponentsPatch.kt @@ -35,15 +35,11 @@ class LayoutComponentsPatch : ResourcePatch { */ SettingsPatch.addPreference( arrayOf( - "PREFERENCE: BOTTOM_PLAYER_SETTINGS", "PREFERENCE: GENERAL_SETTINGS", - "PREFERENCE: PLAYER", - - "SETTINGS: COMMENT_COMPONENT_PARENT", + "PREFERENCE: PLAYER_SETTINGS", "SETTINGS: HIDE_AUDIO_TRACK_BUTTON", - "SETTINGS: HIDE_LAYOUT_COMPONENTS", - "SETTINGS: HIDE_VIEW_PRODUCT" + "SETTINGS: HIDE_LAYOUT_COMPONENTS" ) ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/NavigationEndpointFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/NavigationEndpointFingerprint.kt deleted file mode 100644 index 688032dc0..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/NavigationEndpointFingerprint.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.Opcode - -object NavigationEndpointFingerprint : MethodFingerprint( - returnType = "V", - opcodes = listOf( - Opcode.RETURN_VOID, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT - ), - strings = listOf("r_pfvc", "navigation_endpoint_interaction_logging_extension") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointFingerprint.kt deleted file mode 100644 index d6fc75442..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint - -object ReelWatchEndpointFingerprint : MethodFingerprint( - returnType = "V", - customFingerprint = { methodDef, _ -> methodDef.name == "" } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointParentFingerprint.kt deleted file mode 100644 index a45953992..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchEndpointParentFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints - -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint - -object ReelWatchEndpointParentFingerprint : MethodFingerprint( - returnType = "V", - strings = listOf("Error parsing bytes for updated ReelWatchEndpoint.", "r_aoc") -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/patch/ShortsNavBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/patch/ShortsNavBarPatch.kt deleted file mode 100644 index 957be77e9..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/patch/ShortsNavBarPatch.kt +++ /dev/null @@ -1,126 +0,0 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.patch - -import app.revanced.extensions.toErrorResult -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.data.toMethodWalker -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve -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.proxy.mutableTypes.MutableMethod -import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.NavigationEndpointFingerprint -import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchBundleFingerprint -import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchEndpointFingerprint -import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.ReelWatchEndpointParentFingerprint -import app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints.SetPivotBarFingerprint -import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility -import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint -import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch -import app.revanced.util.integrations.Constants.NAVIGATION -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -import org.jf.dexlib2.iface.instruction.ReferenceInstruction -import org.jf.dexlib2.iface.reference.FieldReference - -@Patch -@Name("hide-shorts-navbar") -@Description("Hide navigation bar when playing shorts.") -@DependsOn([SettingsPatch::class]) -@YouTubeCompatibility -@Version("0.0.1") -class ShortsNavBarPatch : BytecodePatch( - listOf( - NavigationEndpointFingerprint, - PivotBarCreateButtonViewFingerprint, - ReelWatchBundleFingerprint, - ReelWatchEndpointParentFingerprint - ) -) { - override fun execute(context: BytecodeContext): PatchResult { - - PivotBarCreateButtonViewFingerprint.result?.let { parentResult -> - SetPivotBarFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let { - it.mutableMethod.apply { - val startIndex = it.scanResult.patternScanResult!!.startIndex - val register = getInstruction(startIndex).registerA - - addInstruction( - startIndex + 1, - "sput-object v$register, $NAVIGATION->pivotBar:Ljava/lang/Object;" - ) - } - } ?: return SetPivotBarFingerprint.toErrorResult() - } ?: return PivotBarCreateButtonViewFingerprint.toErrorResult() - - ReelWatchBundleFingerprint.result?.let { - (context - .toMethodWalker(it.method) - .nextMethod(it.scanResult.patternScanResult!!.endIndex, true) - .getMethod() as MutableMethod - ).apply { - addInstruction( - 0, - "invoke-static {}, $NAVIGATION->hideShortsPlayerNavBar()V" - ) - } - } ?: return ReelWatchBundleFingerprint.toErrorResult() - - ReelWatchEndpointParentFingerprint.result?.let { parentResult -> - ReelWatchEndpointFingerprint.also { - it.resolve( - context, - parentResult.classDef - ) - }.result?.mutableMethod?.addInstruction( - 0, - "sput-object p1, $NAVIGATION->shortsContext:Landroid/content/Context;" - ) ?: return ReelWatchEndpointFingerprint.toErrorResult() - } ?: return ReelWatchEndpointParentFingerprint.toErrorResult() - - NavigationEndpointFingerprint.result?.let { result -> - val navigationEndpointMethod = result.mutableMethod - - with(navigationEndpointMethod.implementation!!.instructions) { - filter { instruction -> - val fieldReference = - (instruction as? ReferenceInstruction)?.reference as? FieldReference - fieldReference?.let { it.type == "Lcom/google/android/apps/youtube/app/extensions/reel/watch/player/ReelObscuredPlaybackSuspender;" } == true - }.forEach { instruction -> - val insertIndex = indexOf(instruction) + 4 - val targetRegister = - navigationEndpointMethod.getInstruction(insertIndex).registerA - - navigationEndpointMethod.addInstructions( - insertIndex, - """ - invoke-static {v$targetRegister}, $NAVIGATION->hideShortsPlayerNavBar(Landroid/view/View;)Landroid/view/View; - move-result-object v$targetRegister - """ - ) - } - } - - } ?: return NavigationEndpointFingerprint.toErrorResult() - - /** - * Add settings - */ - SettingsPatch.addPreference( - arrayOf( - "PREFERENCE: NAVIGATION_SETTINGS", - "SETTINGS: HIDE_SHORTS_NAVIGATION_BAR" - ) - ) - - SettingsPatch.updatePatchStatus("hide-shorts-navbar") - - return PatchResultSuccess() - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt index 08d1cd482..fcc8a3683 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsCommentFingerprint.kt @@ -5,5 +5,7 @@ import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.util.bytecode.isWideLiteralExists object ShortsCommentFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("Z", "Z", "L"), customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(RightComment) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt index 0c6d1bb02..4ce349cee 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/fingerprints/ShortsRemixFingerprint.kt @@ -5,5 +5,7 @@ import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch import app.revanced.util.bytecode.isWideLiteralExists object ShortsRemixFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("Z", "Z", "L"), customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(ReelDynRemix) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsComponentPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsComponentPatch.kt index 1009d70cb..ced0de565 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsComponentPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortscomponent/patch/ShortsComponentPatch.kt @@ -9,6 +9,7 @@ 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.shorts.shortsnavigationbar.patch.ShortsNavigationBarPatch import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility import app.revanced.patches.youtube.utils.litho.patch.LithoFilterPatch import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch @@ -26,6 +27,7 @@ import app.revanced.util.integrations.Constants.PATCHES_PATH SharedResourceIdPatch::class, ShortsCommentButtonPatch::class, ShortsInfoPanelPatch::class, + ShortsNavigationBarPatch::class, ShortsPaidContentBannerPatch::class, ShortsRemixButtonPatch::class, ShortsSubscriptionsButtonPatch::class diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/BottomNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/BottomNavigationBarFingerprint.kt new file mode 100644 index 000000000..ccc7bde5a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/BottomNavigationBarFingerprint.kt @@ -0,0 +1,18 @@ +package app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints + +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint +import org.jf.dexlib2.Opcode + +object BottomNavigationBarFingerprint : MethodFingerprint( + returnType = "V", + opcodes = listOf( + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IF_EQZ + ), + strings = listOf("r_pfvc", "navigation_endpoint_interaction_logging_extension") +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchBundleFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/RenderBottomNavigationBarFingerprint.kt similarity index 67% rename from src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchBundleFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/RenderBottomNavigationBarFingerprint.kt index 0a0031ccb..9f100aa50 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/ReelWatchBundleFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/RenderBottomNavigationBarFingerprint.kt @@ -1,9 +1,9 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints +package app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import org.jf.dexlib2.Opcode -object ReelWatchBundleFingerprint : MethodFingerprint( +object RenderBottomNavigationBarFingerprint : MethodFingerprint( returnType = "V", opcodes = listOf( Opcode.CHECK_CAST, diff --git a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/SetPivotBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/SetPivotBarFingerprint.kt similarity index 84% rename from src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/SetPivotBarFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/SetPivotBarFingerprint.kt index 7064e8cf7..27d358552 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/navigation/shortsnavbar/fingerprints/SetPivotBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/fingerprints/SetPivotBarFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.navigation.shortsnavbar.fingerprints +package app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint diff --git a/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/patch/ShortsNavigationBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/patch/ShortsNavigationBarPatch.kt new file mode 100644 index 000000000..d6b510aed --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/shorts/shortsnavigationbar/patch/ShortsNavigationBarPatch.kt @@ -0,0 +1,81 @@ +package app.revanced.patches.youtube.shorts.shortsnavigationbar.patch + +import app.revanced.extensions.toErrorResult +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.data.toMethodWalker +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints.BottomNavigationBarFingerprint +import app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints.RenderBottomNavigationBarFingerprint +import app.revanced.patches.youtube.shorts.shortsnavigationbar.fingerprints.SetPivotBarFingerprint +import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility +import app.revanced.patches.youtube.utils.fingerprints.PivotBarCreateButtonViewFingerprint +import app.revanced.util.integrations.Constants.SHORTS +import org.jf.dexlib2.iface.instruction.OneRegisterInstruction + +@Name("hide-shorts-navigation-bar") +@Description("Hide navigation bar when playing shorts.") +@YouTubeCompatibility +@Version("0.0.1") +class ShortsNavigationBarPatch : BytecodePatch( + listOf( + BottomNavigationBarFingerprint, + PivotBarCreateButtonViewFingerprint, + RenderBottomNavigationBarFingerprint + ) +) { + override fun execute(context: BytecodeContext): PatchResult { + + PivotBarCreateButtonViewFingerprint.result?.let { parentResult -> + SetPivotBarFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.let { + it.mutableMethod.apply { + val startIndex = it.scanResult.patternScanResult!!.startIndex + val register = getInstruction(startIndex).registerA + + addInstruction( + startIndex + 1, + "sput-object v$register, $SHORTS->pivotBar:Ljava/lang/Object;" + ) + } + } ?: return SetPivotBarFingerprint.toErrorResult() + } ?: return PivotBarCreateButtonViewFingerprint.toErrorResult() + + RenderBottomNavigationBarFingerprint.result?.let { + (context + .toMethodWalker(it.method) + .nextMethod(it.scanResult.patternScanResult!!.endIndex, true) + .getMethod() as MutableMethod + ).apply { + addInstruction( + 0, + "invoke-static {}, $SHORTS->hideShortsPlayerNavigationBar()V" + ) + } + } ?: return RenderBottomNavigationBarFingerprint.toErrorResult() + + BottomNavigationBarFingerprint.result?.let { + it.mutableMethod.apply { + val insertIndex = it.scanResult.patternScanResult!!.endIndex + val insertRegister = getInstruction(insertIndex).registerA + + addInstructions( + insertIndex, """ + invoke-static {v$insertRegister}, $SHORTS->hideShortsPlayerNavigationBar(Landroid/view/View;)Landroid/view/View; + move-result-object v$insertRegister + """ + ) + } + } ?: return BottomNavigationBarFingerprint.toErrorResult() + + return PatchResultSuccess() + } +} \ No newline at end of file diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 7b9bc8ba2..c02f8e58d 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -6,18 +6,6 @@ Enable cloud messaging settings to receive notifications Open MicroG Ads - General ads are shown - General ads are hidden - Hide general ads - YouTube Premium promotion are shown - YouTube Premium promotion are hidden - Hide YouTube Premium promotion - Paid promotion label is shown - Paid promotion label is hidden - Hide paid promotion - Self sponsored cards are shown - Self sponsored cards are hidden - Hide self sponsored cards Import ReVanced settings from file or export ReVanced settings to file Bottom player Button container @@ -30,7 +18,7 @@ Comments Time Stamp copied to clipboard Filter components by line-separated names - Custom filter + Edit custom filter Custom filter is disabled Custom filter is enabled Enable custom filter @@ -40,7 +28,7 @@ Custom speed overlay value Playing at %sx speed Add or change the video speeds available - Custom video speeds + Edit custom video speeds To open RVX in an external browser, turn on \'Open supported links\' and enable supported web addresses Open default app settings Default video quality on Mobile network @@ -172,11 +160,10 @@ Account menus are shown Account menus are hidden Hide account menu + Edit account menu filter Action buttons are shown Action buttons are hidden Hide action buttons - "These features are outdated. So, even if a issue exists, there are no plans to fix it. -Please do not report any issues you encounter while using this feature." Album cards are shown Album cards are hidden Hide album cards @@ -210,15 +197,15 @@ Please do not report any issues you encounter while using this feature."Playlist button is shown Playlist button is hidden Hide playlist button - Rewards button is shown - Rewards button is hidden - Hide rewards button Remix button is shown Remix button is hidden Hide remix button Report button is shown Report button is hidden Hide report button + Rewards button is shown + Rewards button is hidden + Hide rewards button Share button is shown Share button is hidden Hide share button @@ -239,9 +226,6 @@ Please do not report any issues you encounter while using this feature."Hide category bar in search results Category bar is shown Category bar is hidden - Channelbar join button is shown - Channelbar join button is hidden - Hide channelbar join button Channel guidelines are shown Channel guidelines are hidden Hide channel guidelines @@ -281,15 +265,18 @@ Please do not report any issues you encounter while using this feature."Emoji picker is shown Emoji picker is hidden Hide emoji picker - Expandable chips are shown - Expandable chips are hidden - Hide expandable chip under videos End screen cards are shown End screen cards are hidden Hide end screen cards End screen overlay are shown End screen overlay are hidden Hide end screen overlay + Expandable chips are shown + Expandable chips are hidden + Hide expandable chip under videos + Feed surveys are shown + Feed surveys are hidden + Hide feed surveys Film strip overlay are shown Film strip overlay are hidden Hide film strip overlay @@ -299,6 +286,12 @@ Please do not report any issues you encounter while using this feature."Fullscreen panels are shown Fullscreen panels are hidden Hide fullscreen panels + General ads are shown + General ads are hidden + Hide general ads + YouTube Premium promotion are shown + YouTube Premium promotion are hidden + Hide YouTube Premium promotion Gray description is shown Gray description is hidden Hide gray description @@ -314,9 +307,9 @@ Please do not report any issues you encounter while using this feature."Info panels are shown Info panels are hidden Hide info panels - Feed surveys are shown - Feed surveys are hidden - Hide feed surveys + Join button is shown + Join button is hidden + Hide join button Latest posts are shown Latest posts are hidden Hide latest posts @@ -326,9 +319,6 @@ Please do not report any issues you encounter while using this feature."Load more button is shown Load more button is hidden Hide load more button - Navigation label is shown - Navigation label is hidden - Hide navigation label Medical panels are shown Medical panels are hidden Hide medical panels @@ -377,9 +367,15 @@ Please do not report any issues you encounter while using this feature."Movies shelves are shown Movies shelves are hidden Hide movies shelf + Navigation label is shown + Navigation label is hidden + Hide navigation label Official header is shown Official header is hidden Hide official header + Paid promotion label is shown + Paid promotion label is hidden + Hide paid promotion Player button background is shown Player button background is hidden Hide player button background @@ -392,9 +388,6 @@ Please do not report any issues you encounter while using this feature."Buttons are shown Buttons are hidden Hide previous & next button - Quick actions container is shown - Quick actions container is hidden - Hide quick actions container Comment button is shown Comment button is hidden Hide comment button @@ -404,15 +397,24 @@ Please do not report any issues you encounter while using this feature."Related videos are shown Related videos are hidden Hide related videos in quick actions + Quick actions container is shown + Quick actions container is hidden + Hide quick actions container + Trending searches & search history are shown + Trending searches & search history are hidden + Hide search term suggestions Video player seekbar is shown Video player seekbar is hidden - Hide seekbar in video player Thumbnail seekbar is shown Thumbnail seekbar is hidden Hide seekbar in video thumbnails + Hide seekbar in video player Seek message is shown Seek message is hidden Hide seek message + Self sponsored cards are shown + Self sponsored cards are hidden + Hide self sponsored cards Gray separators are shown Gray separators are hidden Hide gray separator @@ -421,15 +423,12 @@ Please do not report any issues you encounter while using this feature."Hide shorts button Hides Shorts section or the Shorts player component Hide shorts component - Navigation bar is shown - Navigation bar is hidden - Hide navigation bar in shorts + Navigation bar is shown + Navigation bar is hidden + Hide navigation bar Comments button is shown Comments button is hidden Hide comments button - Join button is shown - Join button is hidden - Hide join button Subscriptions button is shown Subscriptions button is hidden Hide subscriptions button @@ -460,12 +459,12 @@ Please do not report any issues you encounter while using this feature."Time stamp is shown Time stamp is hidden Hide time stamp - Trending searches & search history are shown - Trending searches & search history are hidden - Hide search term suggestions + Video ads are shown + Video ads are hidden + Hide video ads View products banner is shown View products banner is hidden - Hide view products banner (in player) + Hide view products banner Web search panels are shown Web search panels are hidden Hide web search panels @@ -474,6 +473,7 @@ Please do not report any issues you encounter while using this feature."Hide youtube music button Fetch ReVanced settings from saved file Import settings + Layout Miscellaneous Navigation Library is not opened at app startup @@ -504,7 +504,7 @@ Please do not report any issues you encounter while using this feature."Information about applied patches Player flyout panel Player - Quick actions components + Quick actions Restart to load the layout normally "As this is still an experimental feature, there may be other unknown issues. Are you sure you want to continue though?" @@ -557,7 +557,7 @@ If later turned off, the old UI may remain until clear the app data" 17.06.35 - Enable sorting videos by oldest 16.08.35 - Restore explore tab Type the spoof app version target - Spoof app version target + Edit spoof app version Spoofed player parameters to fix playback issue Please reload the video "Player parameters of Shorts @@ -588,9 +588,6 @@ Known issues Switch create with notifications button Tool used Video - Video ads are shown - Video ads are hidden - Hide video ads Enable SponsorBlock SponsorBlock is a crowd-sourced system for skipping annoying parts of YouTube videos diff --git a/src/main/resources/youtube/settings/values-v21/strings.xml b/src/main/resources/youtube/settings/values-v21/strings.xml index c1409fc2c..310170b27 100644 --- a/src/main/resources/youtube/settings/values-v21/strings.xml +++ b/src/main/resources/youtube/settings/values-v21/strings.xml @@ -10,7 +10,6 @@ ReVanced Extended @string/revanced_custom_filter_strings_summary - @string/revanced_custom_filter_strings_title @string/revanced_hide_button_thanks_summary_off @string/revanced_hide_button_thanks_summary_on @@ -40,6 +39,9 @@ @string/revanced_hide_info_panel_summary_off @string/revanced_hide_info_panel_summary_on @string/revanced_hide_info_panel_title + @string/revanced_hide_join_button_summary_off + @string/revanced_hide_join_button_summary_on + @string/revanced_hide_join_button_title @string/revanced_ad_remover_paid_content_summary_off @string/revanced_ad_remover_paid_content_summary_on @string/revanced_ad_remover_paid_content_title diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 814596444..0c1aea7ef 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -7,15 +7,19 @@ PREFERENCE: ADS_SETTINGS --> + + + + + + + SETTINGS: HIDE_GENERAL_ADS --> + SETTINGS: HIDE_VIDEO_ADS --> + SETTINGS: HIDE_GENERAL_ADS --> @@ -39,16 +43,11 @@ - - SETTINGS: BUTTON_CONTAINER --> - - - - + SETTINGS: BUTTON_CONTAINER --> - - - - - - @@ -156,71 +145,58 @@ SETTINGS: HIDE_CATEGORY_BAR --> - - - - - - - - - - - - - - - - + + @@ -277,7 +253,7 @@ - - - @@ -580,7 +550,9 @@ - SETTINGS: HIDE_SHORTS_COMPONENTS --> + + + SETTINGS: HIDE_SHORTS_COMPONENTS --> @@ -630,10 +602,10 @@ SETTINGS: CUSTOM_VIDEO_SPEED --> + SETTINGS: DEFAULT_VIDEO_QUALITY --> + SETTINGS: DEFAULT_VIDEO_SPEED -->