Skip to content

Conversation

@LisoUseInAIKyrios
Copy link
Contributor

Initial usage of Patcher v22 method instruction filters.

ReVanced/revanced-patcher#329

…tion_filters

# Conflicts:
#	patches/api/patches.api
#	patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt
#	patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofClientPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt
…tion_filters

# Conflicts:
#	patches/api/patches.api
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt
…tion_filters

# Conflicts:
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/requests/StreamingDataRequest.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/LicenseActivityHook.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java
#	patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/theme/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/extension/hooks/ApplicationInitHook.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/shared/Fingerprints.kt
…tion_filters

# Conflicts:
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/spoof/requests/StreamingDataRequest.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LithoFilterPatch.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/ReturnYouTubeDislikeFilter.java
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/viber/ads/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
…tion_filters

# Conflicts:
#	patches/api/patches.api
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt
…tion_filters

# Conflicts:
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/ButtonsFilter.java
#	patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/FixBackToExitGesturePatch.kt
…tion_filters

# Conflicts:
#	extensions/music/src/main/java/app/revanced/extension/music/settings/GoogleApiActivityHook.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/Utils.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/checks/Check.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/BaseActivityHook.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ColorPickerPreference.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/CustomDialogListPreference.java
#	extensions/shared/library/src/main/java/app/revanced/extension/shared/settings/preference/ToolbarPreferenceFragment.java
#	extensions/twitch/src/main/java/app/revanced/extension/twitch/settings/TwitchActivityHook.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/AlternativeThumbnailsPatch.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/HidePlayerOverlayButtonsPatch.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/theme/SeekbarColorPatch.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/SearchViewController.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/YouTubeActivityHook.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ExternalDownloaderPreference.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/objects/SegmentCategoryListPreference.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/ui/NewSegmentLayout.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/ui/SkipSponsorButton.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/ui/SponsorBlockViewController.java
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/videoplayer/VideoQualityDialogButton.java
#	patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt
#	patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/HideUpgradeButtonPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/music/misc/settings/SettingsPatch.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt
…tion_filters

# Conflicts:
#	extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/RemoveTrackingQueryParameterPatch.java
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
…tion_filters

# Conflicts:
#	patches/src/main/kotlin/app/revanced/patches/youtube/shared/Fingerprints.kt
…tion_filters

# Conflicts:
#	patches/src/main/kotlin/app/revanced/patches/shared/misc/settings/SettingsPatch.kt
…tion_filters

# Conflicts:
#	patches/src/main/kotlin/app/revanced/patches/instagram/hide/navigation/Fingerprints.kt
#	patches/src/main/kotlin/app/revanced/patches/music/misc/extension/hooks/ApplicationInitHook.kt
#	patches/src/main/kotlin/app/revanced/patches/youtube/video/quality/Fingerprints.kt
@LisoUseInAIKyrios
Copy link
Contributor Author

That doesn't mater. .eml-fe is still filtered because filtering is now done on just .e

I added some temporary logging. Clear the logs, open a regular video, then check the logs for RYD conversion context:
Currently it is looking for segmented_like_dislike_button.e, but maybe that has changed. If you find a different string that might be the dislikes, then try changing it here:

if (conversionContextString.contains("segmented_like_dislike_button.e")) {

@cyberboh
Copy link
Contributor

cyberboh commented Oct 30, 2025

I am not compiling yet for new commits, but This log might the culprit

10-30 17:59:10.607 26516 26516 D revanced: LithoFilterPatch: Searching ID: video_action_bar.eml-fe|aae8f39ea7433c49 Path: video_action_bar.eml-fe|aae8f39ea7433c49|CellType|CollectionType|CellType|video_action_button_with_vm_input.eml-fe|72eb31a6206f1df3|ContainerType|segmented_like_dislike_button.eml-fe|520f2f5c726d355b|ContainerType|segmented_like_dislike_button_inner.eml-fe|8edaca561ccd9730|video_action_button_pill.eml-fe|79da9c5d561c6a6a|ContainerType|ContainerType|ContainerType|animated_like_icon.eml-fe|16f480c2325d6faf|ContainerType|AnimatedVectorType|

segmented_like_dislike_button_inner.eml-fe

@LisoUseInAIKyrios
Copy link
Contributor Author

segmented_like_dislike_button.e is still present.

Pull the latest and check the logs for RYD conversion context:. RYD is not exactly the same as litho filtering.

@cyberboh
Copy link
Contributor

segmented_like_dislike_button.e is still present.

Pull the latest and check the logs for RYD conversion context:. RYD is not exactly the same as litho filtering.

There is no log for "RYD conversion context:" I tried many times, even on full logcat adb logcat > log.txt, I can not find it also ini adb logcat | findstr "RYD conversion context:" > log.txt

@cyberboh
Copy link
Contributor

I only got these

10-30 20:42:37.023 25406 30864 D revanced: ReturnYouTubeDislikePatch: Prefetching RYD for video: EumFMAaCTrA 10-30 20:42:37.268 25406 30919 D revanced: ReturnYouTubeDislikeApi: Voting data fetched: RYDVoteData{videoId=EumFMAaCTrA, viewCount=8426, likeCount=125, dislikeCount=4, likePercentage=0.96899223, dislikePercentage=0.031007752} 10-30 20:42:49.994 25406 30944 D revanced: ReturnYouTubeDislikePatch: Prefetching RYD for video: hwKDBNUNdks 10-30 20:42:50.221 25406 30919 D revanced: ReturnYouTubeDislikeApi: Voting data fetched: RYDVoteData{videoId=hwKDBNUNdks, viewCount=2458, likeCount=92, dislikeCount=4, likePercentage=0.9583333, dislikePercentage=0.041666668}

@LisoUseInAIKyrios
Copy link
Contributor Author

Modify this method:

public static boolean isBooleanFeatureFlagEnabled(boolean value, Long flag) {

Change the first line to:
if (true) return false;

@cyberboh
Copy link
Contributor

cyberboh commented Oct 30, 2025

Like this?:

public static boolean isBooleanFeatureFlagEnabled(boolean value, Long flag) {
    if (true) return false;

    if (LOG_FEATURE_FLAGS && value) {
        if (featureFlags.putIfAbsent(flag, true) == null) {
            Logger.printDebug(() -> "boolean feature is enabled: " + flag);
        }
    }

    return value;
}

@MarcaDian
Copy link
Contributor

Or if you have enough knowledge, you can make these changes, or cherry pick this commit, and manually check the block flags you get, and find the one that is causing this problem.

To get a sorted list of flags, enable debugging in the ReVanced settings, clear the logs, restart the app, export the logs to txt file. Then, open any AI chat, and give it the task of sorting boolean flags from your logs.

@LisoUseInAIKyrios
Copy link
Contributor Author

Like this?:

Yes.

Also try version spoofing.

@cyberboh
Copy link
Contributor

Or if you have enough knowledge, you can make these changes, or cherry pick this commit, and manually check the block flags you get, and find the one that is causing this problem.

To get a sorted list of flags, enable debugging in the ReVanced settings, clear the logs, restart the app, export the logs to txt file. Then, open any AI chat, and give it the task of sorting boolean flags from your logs.

Done, cherry-picked and built patches. So many flags inside
flags-originale.txt
flags-sorted.txt

Like this?:

Yes.

Also try version spoofing.

Done built, and also version spoofed, all did not work.

@MarcaDian
Copy link
Contributor

Custom speed is not set above 2.0 on 20.43

@MarcaDian
Copy link
Contributor

Implemented a "raw" version of the boolean flag blocking dialog.
There are still some problems with parsing saved flags from the settings.
Maybe you have any comments about the interface?

Screenshot_2025-10-31-13-18-55-723_app.revancede.android.youtube.jpg

@cyberboh
Copy link
Contributor

Implemented a "raw" version of the boolean flag blocking dialog. There are still some problems with parsing saved flags from the settings. Maybe you have any comments about the interface?

Screenshot_2025-10-31-13-18-55-723_app.revancede.android.youtube.jpg

Did you import hundreds flags in "flags manager" manually? 300+ flags is heavy, the interface should wider then.
For my RYD issue, I still can not find the match flag, it's complicated 😄

@MarcaDian
Copy link
Contributor

MarcaDian commented Oct 31, 2025

They are added to the list automatically through the debugging patch.

@LisoUseInAIKyrios
Copy link
Contributor Author

Implemented a "raw" version of the boolean flag blocking dialog. There are still some problems with parsing saved flags from the settings. Maybe you have any comments about the interface?

If possible, the dialog can be larger (or use a full view that's fullscreen, I think that's even better).

Maybe have a way to select multiple flags at once? Like tap one flag, then tap and hold another flag and it'll select all flags between the last flag and the currently tapped.

Whatever flag enables the settings menu should be hard coded as always on, otherwise the user can turn off all flags and then it's impossible to change the settings again until they clear the app data.

An automatic binary search feature could be useful, I previously described how it could work. But if the flags are selectable in large numbers then that may not be needed since the user can manually do their own binary search with a little more work.

Optionally we could add a map of flags to descriptions for all known flags, and accept PR's to add more descriptions. Then show the description in the flags settings. But maybe that's not needed because any useful flags are already exposed as patches and any unknown flags can be added as patches.

@LisoUseInAIKyrios
Copy link
Contributor Author

For my RYD issue, I still can not find the match flag, it's complicated 😄

You turned off all boolean flags and it wasn't fixed. It's either a flag not hooked, or it's a layout change not controlled client side. It's most likely a server side layout change.

@MarcaDian
Copy link
Contributor

MarcaDian commented Oct 31, 2025

I don't know how to inform the user about a short description of the flag (if available), I wanted to add a small pop-up window, but long pressing is used to select checkboxes between flags. Maybe add some kind of field at the bottom.

Also, probably at the bottom of each column need to add button to copy flags to the clipboard.

Added a whitelist for flags that will not be displayed in the list.

Screenshot_2025-10-31-17-09-31-949_app.revancede.android.youtube.jpg

@LisoUseInAIKyrios
Copy link
Contributor Author

Feel free to make a pull request if you want. It's an advanced feature but it's still useful, especially if users want to fiddle and find a/b flags.

I don't think text descriptions are needed in the app. Any flags found that are useful can be added as a patch.

@0xrxL
Copy link

0xrxL commented Nov 7, 2025

@LisoUseInAIKyrios There's a problem with 20.45. Seems that Android_VR can't fetch av1 codec and/or high resolutions. After 2 skips or less, the video fetching fall to 18-avc1 🤷‍♂️

Screenshot_20251107_035559

@0xrxL
Copy link

0xrxL commented Nov 7, 2025

Hope it's just a mistake in my code or a new A/B flag.

@LisoUseInAIKyrios
Copy link
Contributor Author

YT 20.45, VR 1.61 works with AV1 and has high resolution, at least for me.

@MarcaDian
Copy link
Contributor

MarcaDian commented Nov 7, 2025

Seems that Android_VR can't fetch av1 codec and/or high resolutions

Please give the link to the video.
All the videos I play have 1.61 and vp9.
AV1 is enabled in the settings.

Edit: After 20+, I finally found a video that enables the AV1 codec, so everything works.
Screenshot_2025-11-07-10-51-42-520_app.revanced22.android.youtube-edit.jpg

@MarcaDian
Copy link
Contributor

I've always wondered why VPN (or VPN service for bypassing DPI (Deep Packet Inspection)) affects Spoof video streams, and then either the video quality setting doesn't turn on, or the spoof client always resets to Android Studio.

This problem is now very common in countries where the government is slowing down YouTube servers.

@oSumAtrIX
Copy link
Member

oSumAtrIX commented Nov 7, 2025

Rate limits based on IP. YouTube blocks playback on VPNs unspecific to DPI bypass

@MarcaDian
Copy link
Contributor

MarcaDian commented Nov 7, 2025

If disable Spoof video streams everything works, but logically playback does not work after 0:59

@oSumAtrIX
Copy link
Member

Server side heuristics such as the platform impact the rate limit. If you have an unusual fingerprint, it raises the score to flag you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants