diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt similarity index 84% rename from src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt index 779a7755f..62289c471 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/fingerprints/DisableShortsPiPFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.general.bytecode.fingerprints +package app.revanced.patches.youtube.extended.shortspip.bytecode.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/layout/general/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt similarity index 89% rename from src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt index 50a92527d..0ff43486d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/bytecode/patch/DisableShortsPiPBytecodePatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.general.bytecode.patch +package app.revanced.patches.youtube.extended.shortspip.bytecode.patch import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -12,11 +12,11 @@ import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.util.smali.ExternalLabel -import app.revanced.patches.youtube.layout.general.bytecode.fingerprints.DisableShortsPiPFingerprint +import app.revanced.patches.youtube.extended.shortspip.bytecode.fingerprints.DisableShortsPiPFingerprint import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch import app.revanced.shared.annotation.YouTubeCompatibility import app.revanced.shared.extensions.toErrorResult -import app.revanced.shared.util.integrations.Constants.GENERAL_LAYOUT +import app.revanced.shared.util.integrations.Constants.EXTENDED_PATH import org.jf.dexlib2.Opcode import org.jf.dexlib2.builder.instruction.BuilderInstruction35c import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -51,7 +51,7 @@ class DisableShortsPiPBytecodePatch : BytecodePatch( method.addInstructions( invokeIndex + 1,""" - invoke-static {}, $GENERAL_LAYOUT->disableShortsPlayerPiP()Z + invoke-static {}, $EXTENDED_PATH/DisableShortsPiPPatch;->disableShortsPlayerPiP()Z move-result v$registerA if-eqz v$registerA, :pip goto :disablepip diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/resource/patch/DisableShortsPiPPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/resource/patch/DisableShortsPiPPatch.kt similarity index 74% rename from src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/resource/patch/DisableShortsPiPPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/resource/patch/DisableShortsPiPPatch.kt index ebd4eac8c..5c1afedee 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/general/shortspip/resource/patch/DisableShortsPiPPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/extended/shortspip/resource/patch/DisableShortsPiPPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.general.resource.patch +package app.revanced.patches.youtube.extended.shortspip.resource.patch import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name @@ -9,7 +9,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patches.youtube.layout.general.bytecode.patch.DisableShortsPiPBytecodePatch +import app.revanced.patches.youtube.extended.shortspip.bytecode.patch.DisableShortsPiPBytecodePatch import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch import app.revanced.shared.annotation.YouTubeCompatibility import app.revanced.shared.util.resources.ResourceHelper @@ -31,13 +31,11 @@ class DisableShortsPiPPatch : ResourcePatch { /* add settings */ - ResourceHelper.addSettings4( + ResourceHelper.addSettings2( context, - "PREFERENCE_CATEGORY: REVANCED_SETTINGS", - "PREFERENCE: LAYOUT_SETTINGS", - "PREFERENCE_HEADER: GENERAL", - "SETTINGS: SHORTS_COMPONENT.PARENT", - "SETTINGS: SHORTS_COMPONENT_PARENT.B", + "PREFERENCE_CATEGORY: REVANCED_EXTENDED_SETTINGS", + "PREFERENCE: EXTENDED_SETTINGS", + "SETTINGS: EXPERIMENTAL_FLAGS", "SETTINGS: DISABLE_SHORTS_PLAYER_PIP" ) diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 2d6a65465..6ba0ff3d0 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -464,6 +464,9 @@ Are you sure you want to continue though?" "Tricks the YouTube client version to v17.28.35 to load the old layout In the app settings, the YouTube version may be marked as v17.28.35" + "Disable pip mode on shorts players + +This option is not valid on certain Android versions or certain OS" "Tricks the dpi to change some layouts to phone layouts. If you enable this setting, the following features are available: diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index bc0e69956..083cdd1a5 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -106,9 +106,6 @@ - - @@ -345,6 +342,8 @@ SETTINGS: LAYOUT_SWITCH --> +