Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(YouTube - Theme): Custom seekbar color startup crashes #4387

Closed
3 tasks done
XxAcielxX opened this issue Jan 31, 2025 · 26 comments · Fixed by #4399 or #4388
Closed
3 tasks done

bug(YouTube - Theme): Custom seekbar color startup crashes #4387

XxAcielxX opened this issue Jan 31, 2025 · 26 comments · Fixed by #4399 or #4388
Labels
Bug report Something isn't working

Comments

@XxAcielxX
Copy link

XxAcielxX commented Jan 31, 2025

Bug description

After updating to Patched v5.9.0 from old version, enabling Custom Seekbar Colour will make the YT app crash multiple times before finally opening.

Here is a video showing this,
https://youtu.be/SmvP8k-m_2o

When the YT finally opens, some app settings resets to default values, like Feeds start to auto play.

Error logs

Solution

No response

Additional context

Phone: OnePlus 5
Android 10.0.1

Acknowledgements

  • I have checked all open and closed bug reports and this is not a duplicate.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@XxAcielxX XxAcielxX added the Bug report Something isn't working label Jan 31, 2025
@LisoUseInAIKyrios
Copy link
Contributor

Try patching 5.10 that was just released

@XxAcielxX
Copy link
Author

Tried Patches v5.10.0 and the issue persists.

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Jan 31, 2025

Use adb and collect the logs after it crashes:

  • Install adb (Google how to)
  • Enable debugging in ReVanced settings > Miscellaneous > Debugging (but do not turn on 'log protocol buffer')
  • Force stop ReVanced in app info
  • open command prompt
  • clear the logs by running: adb logcat -c
  • launch app and reproduce the crash
  • run adb logcat -d | grep 'AndroidRuntime\|revanced:' > log.txt
  • post the log.txt file here

If you are using Windows you may need to replace grep with findstr

@RotesMonsti
Copy link

I have the same problem, so I did those steps and here's my log.txt:

log.txt

@LisoUseInAIKyrios
Copy link
Contributor

@RotesMonsti Are you using 19.47.53?

@RotesMonsti
Copy link

Yes, with 5.10.0 patches

@LisoUseInAIKyrios
Copy link
Contributor

@RotesMonsti Post your ReVanced settings text from Miscellaneous > import/export (remove your SponsorBlock id if present).

@RotesMonsti
Copy link

"auto_captions": true,
"copy_video_url": true,
"copy_video_url_timestamp": false,
"debug": true,
"disable_suggested_video_end_screen": true,
"disable_zoom_haptics": false,
"external_downloader_action_button": true,
"force_original_audio": true,
"gradient_loading_screen": true,
"hide_chapters_section": false,
"hide_endscreen_cards": true,
"hide_info_cards": true,
"hide_latest_posts_ads": false,
"hide_player_previous_next_buttons": true,
"hide_search_result_recommendations": false,
"language": "en",
"miniplayer_type": "minimal",
"player_overlay_opacity": 30,
"remember_playback_speed_last_selected": true,
"remember_video_quality_last_selected": true,
"remove_viewer_discretion_dialog": true,
"seekbar_custom_color_accent": "#D186A9",
"seekbar_custom_color_primary": "#D700D3",
"seekbar_tapping": true,
"spoof_video_streams_client_type": "ios_unplugged",
"switch_create_with_notifications_button": false,
"video_quality_default_mobile": 1080,
"video_quality_default_wifi": 1080,
"sb_local_time_saved_milliseconds": 1116877,
"sb_local_time_saved_number_segments": 40,
"sb_video_length_without_segments": false

@LisoUseInAIKyrios
Copy link
Contributor

The seekbar custom color setting is turned off. Is that to avoid crashing?

@RotesMonsti
Copy link

Exactly

@LisoUseInAIKyrios
Copy link
Contributor

Using the same A/B flags and your settings, I could reproduce the crash exactly once and now it's not crashing anymore.

Did you patch using the default set of patches?

@RotesMonsti
Copy link

No, I have every patch except the following:
Disable rolling number animations
Enable slide to seek
Hide seekbar
Hide timestamp
Spoof app version
Spoof app dimensions
Wide searchbar

@LisoUseInAIKyrios
Copy link
Contributor

I think I see the issue.

The patched method does not decompile correctly (it's a mess), and there is an extra check that seems to load the Lottie animation view (which should not be used), using some variations of the the animation (60fps, different dark/light mode, etc).

@RotesMonsti
Copy link

If it helps, additionally when I turn the custom colored seekbar on, my video quality menu changes to the new one, even though (as you see) I have the setting on, that reverts to the old menu. And the setting revert to an older design:

Custom colored turned off:

Image

Image

Custom color turned on:

Image

Image

@LisoUseInAIKyrios
Copy link
Contributor

You mean the settings menu (not the video quality menu).

On a new install (or after a crash), the old settings menu can be present until a the app has launched a few times. If upgrading from an old version of YouTube (where it did not have the new settings menu), the old menus can be present for a long time and the only way to force the new style is clearing the app data.

@RotesMonsti
Copy link

I also meant the video quality menu, I just didn't include the screenshots.

Custom color off:

Image

On:

Image

@XxAcielxX
Copy link
Author

Settings menu design does go back to old style after it crashes. I have noticed that too and it can be seen in my OP video.

@LisoUseInAIKyrios
Copy link
Contributor

After a crash the settings menu goes back to the old style because the app is resetting some of it's feature flags. It happens for many types of crashes.

I still cannot reproduce this issue. aside from once where it did occur but my logs were cleared before I could check if it was the same crash.

I've spent 2 hours digging thru the bytecode trying to find a condition where LottieAnimationView.h(int) can be reached but I cannot find a way (the starting conditional check is patched out). The method does not decompile correctly which makes it more difficult since the bytecode itself must be manually traced by hand.

20.04+ has additional changes to the splash screen code and it decompiles almost entirely correct. May have to wait until the recommended target is bumped and see if this issue is still present.

@LisoUseInAIKyrios
Copy link
Contributor

To anyone having this issue, you can try patching slightly older versions of YouTube and see if the issue is still present (start with version 19.34.42)

@LisoUseInAIKyrios
Copy link
Contributor

A more complicated fix, is figure out how to selectively change the colors in a LottieAnimation file so newer splash screen animation is also changed. Then the splash animation logic won't need any changes and both old and new animations will show the custom color.

@XxAcielxX
Copy link
Author

To anyone having this issue, you can try patching slightly older versions of YouTube and see if the issue is still present (start with version 19.34.42)

Just tested it and the issue is still there.

@LisoUseInAIKyrios
Copy link
Contributor

Modifying the colors of a Lottie animation JSON is much easier than I expected.

I have a patch nearly done, except it seems the method to load a Lottie JSON string is not present and was removed during obfuscation (likely because it's not used by the app).

So, this will need a bit more work.

@oSumAtrIX
Copy link
Member

Maybe you could use the Lottie library in an extension

@LisoUseInAIKyrios
Copy link
Contributor

Yeah, and can display the animation from extensions code.

Some of the Lottie classes are not obfuscated, which means pulling in a non obfuscated version will collide with the classes bundled with YouTube. Could fork Lottie and change the class package, but that's getting kind of complicated just to fix a splash screen animation.

I will try modifying the data after LottieView has loaded the JSON, instead of modifying it before loading.

@LisoUseInAIKyrios
Copy link
Contributor

Success. Was able to restore the missing method. Just needs a lot of cleanup.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title bug: Custom Seekbar Colour crashes YT App majority of the time bug(YouTube - Theme): Custom seekbar color startup crashes Feb 1, 2025
@XxAcielxX
Copy link
Author

Just tested v5.10.1-dev.1 and it has fixed the issue for me. No more crashing on startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug report Something isn't working
Projects
None yet
4 participants