feat(YouTube): Add experimental support for 21.11.480
Co-authored-by: LisoUseInAIKyrios <118716522+lisouseinaikyrios@users.noreply.github.com>
This commit is contained in:
parent
3514039e8a
commit
7b8a3061a2
3 changed files with 24 additions and 10 deletions
|
|
@ -480,6 +480,7 @@ public final class LayoutComponentsFilter extends Filter {
|
|||
* Injection point.
|
||||
*/
|
||||
public static boolean hideFloatingMicrophoneButton(final boolean original) {
|
||||
// FIXME? Is this feature still relevant? When/where does this microphone appear?
|
||||
return original || Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import app.revanced.patches.youtube.misc.litho.lazily.hookTreeNodeResult
|
|||
import app.revanced.patches.youtube.misc.litho.lazily.lazilyConvertedElementHookPatch
|
||||
import app.revanced.patches.youtube.misc.navigation.navigationBarHookPatch
|
||||
import app.revanced.patches.youtube.misc.playservice.is_20_21_or_greater
|
||||
import app.revanced.patches.youtube.misc.playservice.is_21_11_or_greater
|
||||
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||
|
|
@ -157,7 +158,7 @@ val hideLayoutComponentsPatch = hideLayoutComponentsPatch(
|
|||
SwitchPreference("revanced_hide_comments_preview_comment"),
|
||||
SwitchPreference("revanced_hide_comments_thanks_button"),
|
||||
SwitchPreference("revanced_sanitize_comments_category_bar"),
|
||||
),
|
||||
),
|
||||
sorting = Sorting.UNSORTED,
|
||||
),
|
||||
SwitchPreference("revanced_hide_channel_bar"),
|
||||
|
|
@ -247,7 +248,6 @@ val hideLayoutComponentsPatch = hideLayoutComponentsPatch(
|
|||
),
|
||||
)
|
||||
),
|
||||
SwitchPreference("revanced_hide_floating_microphone_button"),
|
||||
SwitchPreference(
|
||||
key = "revanced_hide_horizontal_shelves",
|
||||
tag = "app.revanced.extension.shared.settings.preference.BulletPointSwitchPreference",
|
||||
|
|
@ -275,6 +275,12 @@ val hideLayoutComponentsPatch = hideLayoutComponentsPatch(
|
|||
)
|
||||
}
|
||||
|
||||
if (!is_21_11_or_greater) {
|
||||
PreferenceScreen.FEED.addPreferences(
|
||||
SwitchPreference("revanced_hide_floating_microphone_button")
|
||||
)
|
||||
}
|
||||
|
||||
hookTreeNodeResult("$COMMENTS_FILTER_CLASS_NAME->sanitizeCommentsCategoryBar")
|
||||
|
||||
// region Hide mix playlists
|
||||
|
|
@ -449,18 +455,22 @@ val hideLayoutComponentsPatch = hideLayoutComponentsPatch(
|
|||
|
||||
// region Hide Floating microphone
|
||||
|
||||
showFloatingMicrophoneButtonMethodMatch.let {
|
||||
it.method.apply {
|
||||
val index = it[-1]
|
||||
val register = getInstruction<TwoRegisterInstruction>(index).registerA
|
||||
if (!is_21_11_or_greater) {
|
||||
// Code has moved in 21.11+, but it's not clear when/ where this
|
||||
// floating microphone can show or if this patch is still relevant.
|
||||
showFloatingMicrophoneButtonMethodMatch.let {
|
||||
it.method.apply {
|
||||
val index = it[-1]
|
||||
val register = getInstruction<TwoRegisterInstruction>(index).registerA
|
||||
|
||||
addInstructions(
|
||||
index + 1,
|
||||
"""
|
||||
addInstructions(
|
||||
index + 1,
|
||||
"""
|
||||
invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z
|
||||
move-result v$register
|
||||
""",
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ var is_21_08_or_greater : Boolean by Delegates.notNull()
|
|||
private set
|
||||
var is_21_10_or_greater : Boolean by Delegates.notNull()
|
||||
private set
|
||||
var is_21_11_or_greater : Boolean by Delegates.notNull()
|
||||
private set
|
||||
|
||||
val versionCheckPatch = resourcePatch(
|
||||
description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.",
|
||||
|
|
@ -187,5 +189,6 @@ val versionCheckPatch = resourcePatch(
|
|||
is_21_07_or_greater = 260805000 <= playStoreServicesVersion
|
||||
is_21_08_or_greater = 260905000 <= playStoreServicesVersion
|
||||
is_21_10_or_greater = 261080000 <= playStoreServicesVersion
|
||||
is_21_11_or_greater = 261205000 <= playStoreServicesVersion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue