fix(YouTube Music - Change start page): YouTube Music 6.20.51 does not allow changing the start page to Search (Not implemented)

This commit is contained in:
inotia00 2025-03-14 20:41:15 +09:00
parent 9fd453d64d
commit f0efae5c52
4 changed files with 46 additions and 10 deletions

View File

@ -65,6 +65,7 @@ public class NavigationPatch {
Runnable onClickAction = button.onClickAction;
if (onClickAction != null) {
view.setOnClickListener(v -> onClickAction.run());
Utils.runOnMainThreadDelayed(() -> view.setOnClickListener(v -> onClickAction.run()), 500);
}
}
hideViewUnderCondition(button.hidden, view);

View File

@ -4,13 +4,17 @@ 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.patch.bytecodePatch
import app.revanced.patcher.patch.resourcePatch
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.music.utils.extension.Constants.GENERAL_PATH
import app.revanced.patches.music.utils.patch.PatchList.CHANGE_START_PAGE
import app.revanced.patches.music.utils.playservice.is_6_27_or_greater
import app.revanced.patches.music.utils.playservice.versionCheckPatch
import app.revanced.patches.music.utils.settings.CategoryType
import app.revanced.patches.music.utils.settings.ResourceUtils.updatePatchStatus
import app.revanced.patches.music.utils.settings.addPreferenceWithIntent
import app.revanced.patches.music.utils.settings.settingsPatch
import app.revanced.util.addEntryValues
import app.revanced.util.fingerprint.methodOrThrow
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
@ -22,6 +26,33 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
private const val EXTENSION_CLASS_DESCRIPTOR =
"$GENERAL_PATH/ChangeStartPagePatch;"
private val changeStartPageResourcePatch = resourcePatch(
description = "changeStartPageResourcePatch"
) {
dependsOn(
settingsPatch,
versionCheckPatch,
)
execute {
fun appendStartPage(startPage: String) {
addEntryValues(
"revanced_change_start_page_entries",
"@string/revanced_change_start_page_entry_$startPage",
)
addEntryValues(
"revanced_change_start_page_entry_values",
startPage.uppercase(),
)
}
if (is_6_27_or_greater) {
appendStartPage("search")
}
appendStartPage("subscriptions")
}
}
@Suppress("unused")
val changeStartPagePatch = bytecodePatch(
CHANGE_START_PAGE.title,
@ -29,7 +60,10 @@ val changeStartPagePatch = bytecodePatch(
) {
compatibleWith(COMPATIBLE_PACKAGE)
dependsOn(settingsPatch)
dependsOn(
changeStartPageResourcePatch,
settingsPatch,
)
execute {

View File

@ -10,6 +10,8 @@ import app.revanced.patches.music.general.startpage.changeStartPagePatch
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.music.utils.extension.Constants.NAVIGATION_CLASS_DESCRIPTOR
import app.revanced.patches.music.utils.patch.PatchList.NAVIGATION_BAR_COMPONENTS
import app.revanced.patches.music.utils.playservice.is_6_27_or_greater
import app.revanced.patches.music.utils.playservice.versionCheckPatch
import app.revanced.patches.music.utils.resourceid.colorGrey
import app.revanced.patches.music.utils.resourceid.sharedResourceIdPatch
import app.revanced.patches.music.utils.resourceid.text1
@ -70,6 +72,7 @@ val navigationBarComponentsPatch = bytecodePatch(
navigationBarComponentsResourcePatch,
sharedResourceIdPatch,
settingsPatch,
versionCheckPatch,
)
execute {
@ -228,11 +231,13 @@ val navigationBarComponentsPatch = bytecodePatch(
"revanced_hide_navigation_label",
"false"
)
addSwitchPreference(
CategoryType.NAVIGATION,
"revanced_replace_navigation_samples_button",
"false"
)
if (is_6_27_or_greater) {
addSwitchPreference(
CategoryType.NAVIGATION,
"revanced_replace_navigation_samples_button",
"false"
)
}
addSwitchPreference(
CategoryType.NAVIGATION,
"revanced_replace_navigation_upgrade_button",

View File

@ -10,8 +10,6 @@
<item>@string/revanced_change_start_page_entry_liked_music</item>
<item>@string/revanced_change_start_page_entry_podcasts</item>
<item>@string/revanced_change_start_page_entry_samples</item>
<item>@string/revanced_change_start_page_entry_search</item>
<item>@string/revanced_change_start_page_entry_subscriptions</item>
</string-array>
<string-array name="revanced_change_start_page_entry_values">
<item>ORIGINAL</item>
@ -23,8 +21,6 @@
<item>LIKED_MUSIC</item>
<item>PODCASTS</item>
<item>SAMPLES</item>
<item>SEARCH</item>
<item>SUBSCRIPTIONS</item>
</string-array>
<string-array name="revanced_disable_music_video_in_album_redirect_type_entries">
<item>@string/revanced_disable_music_video_in_album_redirect_type_entry_redirect</item>