ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.36k stars 270 forks source link

bug(YouTube): Spoof app signature - various side effects #1257

Closed JUANHDA-CX closed 1 year ago

JUANHDA-CX commented 1 year ago

Type

Cosmetic

Description

oSumAtrIX commented 1 year ago

Try with stock YouTube.

ghost commented 1 year ago

It was removed from the stock app also

But if somehow, revanced team can reproduce it, it would be great

SodaWithoutSparkles commented 1 year ago

Cannot reproduce, I still have it in revanced. Maybe google is doing A/B testing?

Screenshot_app.revanced.android.youtube-edit.jpg

kazimmt commented 1 year ago

@oSumAtrIX It's also related to ReVanced/revanced-patches#1749 I mean when spoof-signature-verification patch selected

Add a settings (with warning) If someone toggle it on,, above features will not work If toggle it off, above feature will work but buffer issue will not be fixed.

oSumAtrIX commented 1 year ago

No, if you include microg-support patch, the spoof-signature-verification also gets included.

kazimmt commented 1 year ago

This issue arrived after this spoof-signature-verification patch inotia00 also discussed about it on his group. He add a settings to toggle it on/off

oSumAtrIX commented 1 year ago

Not really a good solution, ideally the patch works around the playback as cleanly as possible

kazimmt commented 1 year ago

It works to fix buffer issue, But see already 3 issue arrived after this patch

Ya it's not a good solution. But maybe temporary

Settings for this patch, Refer to: https://github.com/inotia00/revanced-patches/commit/18747410769cd7723616d2155474e06850305024 https://github.com/inotia00/revanced-integrations/commit/781dd894571c2ded94e60b651cabb9fa35bd800a

oSumAtrIX commented 1 year ago

Settings won't close these issues

SodaWithoutSparkles commented 1 year ago

It's also related to ReVanced/revanced-patches#1749 I mean when spoof-signature-verification patch selected

  • ambient mode doesn't work
  • auto play in homefeed, search feed with sound & few more bugs

I dont have the bugs you mentioned. I patched on v2.165.1 IIRC


Possibily due to the fact that I am using YT version 18.03.36?

LisoUseInAIKyrios commented 1 year ago

I tried moving the patch logic into integrations, and use a different signature spoof based on the video type:

https://github.com/revanced/revanced-patches/pull/1754

Any now the home feed plays correctly (no sound, with subtitles and audio/cc buttons showing). Seek preview still works correctly as it did before.

I am using 18.05.40

oSumAtrIX commented 1 year ago

YouTube builds a VideoStartDescriptor object, every time a video is played. We modify a method, which gets that field and overwrites the value. I have seen closely related code to ads in relation to the VideoStartDescriptor object and since video playback issues always stop after a certain amount of time I assume it does when it tries to load an ad. If that is the case, the field of that object could be modified at the place where the descriptor is built for the ad and playback does not fail.

kazimmt commented 1 year ago

Yes, no-one still mentioned it here

Seek preview Thumbnail also missing after this patch

oSumAtrIX commented 1 year ago

@LisoUseInAIKyrios For now your workaround solves a couple of issues, could you please open a PR for testing?

LisoUseInAIKyrios commented 1 year ago

a short term improvement : Apply the verification spoof only if video playback fails.

basically, use the code from this PR: https://github.com/revanced/revanced-patches/pull/1741 And if a video fails to load (http status code 4xx), then turn on the verification spoof.

In the ReVanced settings, add a new option "Always spoof verification"

This gives no spoofing side effects unless spoofing is absolutely needed.

kazimmt commented 1 year ago

This gives no spoofing side effects unless spoofing is absolutely needed.

But this patch is specially designed for them who facing buffer issue. They have to deal with these bugs or infinity buffering.

LisoUseInAIKyrios commented 1 year ago

But as of now, everyone (except root) gets the patch because microg depends on it.

Verification spoofing could be changed to optional, but then newly effected users would need to figure out they need the patch (which is not intuitive).

That's why an automatic enabling of the spoof would solve both of these. The patch is included by default, and it's turned on automatically only if needed. And to everyone else, they don't experience any side effects.

Ideally the spoof would work correctly in all situations, that's why this would only be a temporary fix until the spoof can be improved.

oSumAtrIX commented 1 year ago

This would definitely minimize the collateral impact of the issues. I agree with @LisoUseInAIKyrios.

johnconner122 commented 1 year ago

To enable ambient mode, just restart the app after toggling ambient mode, it works, at least, for me.

senposage commented 1 year ago

other then some random app crashes it seems like the spoof patch has resolved the video not loading

a reminder to others that You must CLEAN INSTALL Revanced DO NOT UPDATE THE APP In-place or the patches may not work correctly

LisoUseInAIKyrios commented 1 year ago

It appears the automatic detection no longer works (YouTube is no longer returns 4xx status code, or the connection fails somewhere else and not during video playback).

Now that spoofing is enabled by default (and the side effects of the spoof are mostly resolved), the automatic detection could be removed.

oSumAtrIX commented 1 year ago

Is this confirmed? I am able to automatically trigger the detection on some account. I have kept it in case someone disables it when it is required for them but we can remove it if it does not properly work, which is also what others observed

LisoUseInAIKyrios commented 1 year ago

Yes that is true, since the user may turn it off and not realize they need it.

If it still works then it should be kept.

I'm going off users saying they have playback issues, but maybe they need to reboot after enabling spoof or maybe other non-video connections are failing.

The spoof setting should probably be changed to require a reboot, just in case.

oSumAtrIX commented 1 year ago

From my tests merely the video should be just restarted to fix the issue. A restart would be fine in that case.

johnconner122 commented 1 year ago

It appears the automatic detection no longer works (YouTube is no longer returns 4xx status code, or the connection fails somewhere else and not during video playback).

It was automatically triggered for me. I guess it is still working.

muchisx commented 1 year ago

How do it update the app to include the fixes marked as done? or are they not live yet? I'm still getting the infinite buffering after watching for a little while

oSumAtrIX commented 1 year ago

You update by repatching

oSumAtrIX commented 1 year ago

It is possible that offline downloads are not being spoofed correctly, as they fail to download completely, likely a case of the conditions present in integrations. Some people are able to reproduce.

LisoUseInAIKyrios commented 1 year ago

Stock YouTube now turns off ambient mode when battery saver is turned on.

If ambient mode does not work for you, then verify your device is not in battery saver mode.

LisoUseInAIKyrios commented 1 year ago

Some videos still do not show subtitles in the correct location.

The subtitle fix always replaces the default shorts subtitle settings with a default non-shorts subtitle setting.

This works, except when a regular video uses one of these default short settings:

spoof off:

revanced: SpoofSignatureVerificationPatch: video: 3hW1rMNC89o spoof: false ap:34 ah:50 av:100 vs:true sd:false
revanced: SpoofSignatureVerificationPatch: video: 3hW1rMNC89o spoof: false ap:10 ah:50 av:0 vs:true sd:false

spoof on:

revanced: SpoofSignatureVerificationPatch: video: 3hW1rMNC89o spoof: true ap:34 ah:50 av:100 vs:true sd:false
revanced: SpoofSignatureVerificationPatch: video: 3hW1rMNC89o spoof: true ap:10 ah:50 av:0 vs:true sd:false

A partial fix, is if any non default subtitle settings are presented for a video, then allow all subtitles for that video as-is regardless of what the values are. This won't fix a video if it has subtitles fixed to a single default shorts screen location, but it will fix all other videos that use multiple locations on screen.

SodaWithoutSparkles commented 1 year ago

Transfered from #2005

I hereby suggest the description of signiture verification in revanced settings should mention all known side effects.

It could be something like a block (without any switches) under spoof signature verification listing out them in, well, list format:

LisoUseInAIKyrios commented 1 year ago

When the spoofing switch is changed, it gives a dialog popup stating 'side effects may occur' but it doesn't explain what the side effects are. That should be expanded to mention some or all of the side effects.

Although the user will never see the dialog unless they try to change the spoof setting. Maybe a "may cause side effects" could be added to the preference switch summary (so it's viewable all the time).

LisoUseInAIKyrios commented 1 year ago

"Can't zoom to fill"

Any details on this? Pinch to zoom works ok for me.

0xrxL commented 1 year ago

"Can't zoom to fill"

Any details on this? Pinch to zoom works ok for me.

Same:

https://user-images.githubusercontent.com/127248639/235152059-9c15e4df-8e71-4c55-9032-e0f4f0a1a98f.mp4

SodaWithoutSparkles commented 1 year ago

Screenshot_2023-04-29-10-24-56-229_app.revanced.android.youtube.jpg

Pinch to zoom also work for me.

I am screenshoting when pinching to zoom. The white outline is the animation of the pinching process.

SodaWithoutSparkles commented 1 year ago

Ambient mode works. It is just bugged out by default (my observations and https://github.com/revanced/revanced-patches/issues/1752#issuecomment-1471137540). You just need to disable ambient mode, and enable it again, then it works consistently even after a force-stop and restart.

We could do sth similar to spoofing signatures and help the user dis-en-able ambient mode automatically. Or it could just be a tooltip in ReVanced/revanced-patches#2011: "ambient mode needs to be turned off and on again to work".

castdrian commented 1 year ago

The subtitle issue still occurs with the latest version of the patches

SodaWithoutSparkles commented 1 year ago

The subtitle issue still occurs with the latest version of the patches

Known issue. It would be fixed automatically when you watch the second video.

https://github.com/revanced/revanced-patches/issues/2003

https://github.com/SodaWithoutSparkles/revanced-troubleshooting-guide#311-captions-in-the-wrong-place

LisoUseInAIKyrios commented 1 year ago

The subtitle issue still occurs with the latest version of the patches

Known issue. It would be fixed automatically when you watch the second video. https://github.com/SodaWithoutSparkles/revanced-troubleshooting-guide#311-captions-in-the-wrong-place

Subtitles are now fixed in 2.172.0

SodaWithoutSparkles commented 1 year ago

Confirm fixed in 2.172.0

SodaWithoutSparkles commented 1 year ago

It has been reported recently that spoof signature verification and/or client spoof might cause unintended consequences when playing videos in a playlist. They would stop and buffer for no apparent reason even when the aforementioned patch are on and enabled

oSumAtrIX commented 1 year ago

Please include a full recording, starting by restarting ReVanced Manager and ending the recording with showcasing the issue.

SodaWithoutSparkles commented 1 year ago

Unfortunately it might not be easily reproduceable by everyone. This issue was reported by discord and reddit users separately. One of the recent threads in the support channel asked for help for this exact reason.

LisoUseInAIKyrios commented 1 year ago

It has been reported recently that spoof signature verification and/or client spoof might cause unintended consequences when playing videos in a playlist.

The user probably is using an outdated version of the patches. Previously playlists did not work, but the last update to the verification spoof fixed playlist issues.

oSumAtrIX commented 1 year ago

Probably a good thing for the future would be to add an announcement patch to the app. The way it would work is that on app start, it'll check a given API for an announcement and display it in a popup, so that on updates, they can be notified.

LisoUseInAIKyrios commented 1 year ago

@oSumAtrIX Would be very useful, yes.

AMSAMSAMSAMS commented 1 year ago

@oSumAtrIX how to disable this permanently? Coz this always enabled by itself upon app restart....

oSumAtrIX commented 1 year ago

Exclude the patch.

LisoUseInAIKyrios commented 1 year ago

@AMSAMSAMSAMS the spoof turns itself on if a video fails to load (http status 4xx).

If the spoof is turning itself on automatically, that means spoofing is required for video playback.

AMSAMSAMSAMS commented 1 year ago

Exclude the patch.

how? what switches so I need to put in the command line?