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 - Restore old video quality menu): App crashes if Shorts flyout menu quality is opened #3134

Closed
3 tasks done
LisoUseInAIKyrios opened this issue May 7, 2024 · 3 comments · Fixed by #3155 or #3053
Closed
3 tasks done
Labels
Bug report Something isn't working

Comments

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented May 7, 2024

Bug description

Some accounts now show a quality menu in the Shorts flyout menu.

Selecting this menu crashes the app, as it's using the old video quality menu hook.

Error logs

RestoreOldVideoQualityMenuPatch: Added listener to old type of quality menu
RestoreOldVideoQualityMenuPatch: Added listener to old type of quality menu
RestoreOldVideoQualityMenuPatch: Added listener to old type of quality menu
RestoreOldVideoQualityMenuPatch: Added listener to old type of quality menu
RestoreOldVideoQualityMenuPatch: Added listener to old type of quality menu
RestoreOldVideoQualityMenuPatch: Found advanced menu item in old type of quality menu
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: app.revanced.android.youtube, PID: 14805
AndroidRuntime: java.lang.IndexOutOfBoundsException: Index 3 out of bounds for length 3
AndroidRuntime: 	at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
AndroidRuntime: 	at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
AndroidRuntime: 	at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
AndroidRuntime: 	at java.util.Objects.checkIndex(Objects.java:359)
AndroidRuntime: 	at java.util.ArrayList.get(ArrayList.java:434)
AndroidRuntime: 	at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:394)
AndroidRuntime: 	at mqd.onItemClick(PG:1)
AndroidRuntime: 	at android.widget.AdapterView.performItemClick(AdapterView.java:376)
AndroidRuntime: 	at android.widget.AbsListView.performItemClick(AbsListView.java:1360)
AndroidRuntime: 	at app.revanced.integrations.youtube.patches.playback.quality.RestoreOldVideoQualityMenuPatch$1.onChildViewAdded(RestoreOldVideoQualityMenuPatch.java:65)
AndroidRuntime: 	at android.view.ViewGroup.dispatchViewAdded(ViewGroup.java:5379)

Acknowledgements

  • This issue is not a duplicate of an existing bug report.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
@LisoUseInAIKyrios LisoUseInAIKyrios added the Bug report Something isn't working label May 7, 2024
@LisoUseInAIKyrios
Copy link
Contributor Author

The simplest solution to prevent the crash, is to modify the old video quality hook so it does nothing if not spoofing to an old version.

It's probably also possible to modify the injected code slightly so it still opens the old quality menu, if not spoofing to an old app version.

I can't try any of this right now, as after the app crashed the menu option is no longer shown (it's common for the app to rollback a/b features after crashing).

@oSumAtrIX
Copy link
Member

The advanced menu is the last item in the list, so an OOB can be prevented by using the last index

@LisoUseInAIKyrios
Copy link
Contributor Author

Using upatched app I get the Shorts quality menu.

For the Shorts quality the only options are Auto, High quality, and Data saver. So that explains the OOB exception, since there is no advanced quality menu.

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
2 participants