revanced-integrations icon indicating copy to clipboard operation
revanced-integrations copied to clipboard

bug: Missing Intent functionality?

Open tillnelown opened this issue 3 years ago • 11 comments

Type

Other

Bug description

Using Reddit Sync and opening a post that links to Youtube causes Revanced Youtube to crash, Bogdan on Discord says this was cause of a missing Intent.

Steps to reproduce

  1. Download Reddit Sync (There's probably other apps that cause this too)
  2. Search for a post that links to Youtube
  3. click it and see the crash popup

Relevant log output

7-27 18:03:21.160  1392  1392 E revanced: ReVancedUtils: Context is null!
07-27 18:03:21.160  1392  1392 E revanced: ReVancedUtils: Context is null, returning null!
07-27 18:03:21.160  1392  1392 E revanced: SettingsEnum: Context returned null! Setings NOT initialized
07-27 18:03:21.175  1392  1392 E AndroidRuntime: FATAL EXCEPTION: main
07-27 18:03:21.175  1392  1392 E AndroidRuntime: Process: com.google.android.youtube.player, PID: 1392
07-27 18:03:21.175  1392  1392 E AndroidRuntime: java.lang.ExceptionInInitializerError
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at xlr.<init>(PG:7)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at wsh.c(PG:15)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at wsh.a(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at apoe.a(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at apod.a(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at aamj.a(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at apoe.a(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at apod.a(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at kyw.p(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at zfy.d(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at kyt.a(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at kyj.<init>(PG:10)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at kyj.M(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerService.<init>(PG:35)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerFactoryService$1.run(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:247)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8676)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
07-27 18:03:21.175  1392  1392 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at app.revanced.integrations.settings.SettingsEnum.getBoolean(SettingsEnum.java:227)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at app.revanced.integrations.utils.LogHelper.debug(LogHelper.java:12)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at app.revanced.integrations.sponsorblock.PlayerController.setCurrentVideoTime(PlayerController.java:135)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at app.revanced.integrations.sponsorblock.PlayerController.setCurrentVideoTimeHighPrecision(PlayerController.java:227)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at xfm.<init>(Unknown Source:0)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at xfm.a(PG:1)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        at xfm.<clinit>(PG:2)
07-27 18:03:21.175  1392  1392 E AndroidRuntime:        ... 22 more

Screenshots or videos

No response

Solution

Make it not crash? The subtext of this field says "If applicable" but it's non optional therefore i have to write something here.

Additional context

It works fine if i uninstall ReVanced and use the normal Youtube app.

tillnelown avatar Jul 27 '22 16:07 tillnelown

The subtext of this field says "If applicable" but it's non optional therefore i have to write something here.

Please open an issue for this too

oSumAtrIX avatar Jul 27 '22 16:07 oSumAtrIX

Please update to the latest versions of everything. This issue should be fixed already.

TheJeterLP avatar Jul 28 '22 14:07 TheJeterLP

Please update to the latest versions of everything. This issue should be fixed already.

It isn't fixed, The newest version built from source still has this on the latest supported Youtube version (17.29.34).

07-28 20:28:21.100  2398  2398 E revanced: ReVancedUtils: Context is null, returning null!
07-28 20:28:21.100  2398  2398 E revanced: SettingsEnum: Context returned null! Setings NOT initialized
07-28 20:28:21.101  2398  2398 E AndroidRuntime: FATAL EXCEPTION: main
07-28 20:28:21.101  2398  2398 E AndroidRuntime: Process: com.google.android.youtube.player, PID: 2398
07-28 20:28:21.101  2398  2398 E AndroidRuntime: java.lang.ExceptionInInitializerError
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at xon.<init>(PG:7)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at wvg.c(PG:11)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at wvg.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at apuo.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at apun.a(PG:2)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at aaqd.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at apuo.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at apun.a(PG:2)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at lbl.p(PG:2)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at zjr.d(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at lbi.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at lay.<init>(PG:10)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at lay.M(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerService.<init>(PG:35)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerFactoryService$1.run(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:247)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8676)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
07-28 20:28:21.101  2398  2398 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at app.revanced.integrations.settings.SettingsEnum.getBoolean(SettingsEnum.java:227)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at app.revanced.integrations.utils.LogHelper.debug(LogHelper.java:12)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at app.revanced.integrations.sponsorblock.PlayerController.setCurrentVideoTime(PlayerController.java:135)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at app.revanced.integrations.sponsorblock.PlayerController.setCurrentVideoTimeHighPrecision(PlayerController.java:227)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at xil.<init>(Unknown Source:0)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at xil.a(PG:1)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        at xil.<clinit>(PG:2)
07-28 20:28:21.101  2398  2398 E AndroidRuntime:        ... 22 more
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI: Error creating YouTubePlayerView
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI: com.google.android.youtube.player.internal.w$a: Exception thrown by invoked constructor in com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.w.a(Unknown Source:131)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.w.b(Unknown Source:4)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.w.c(Unknown Source:36)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.ac.d(Unknown Source:4)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.YouTubePlayerView.f(Unknown Source:8)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.YouTubePlayerView$1.e(Unknown Source:12)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.r.u(Unknown Source:73)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.r$c.b(Unknown Source:64)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.r$b.a(Unknown Source:4)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.r$a.handleMessage(Unknown Source:92)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at android.os.Handler.dispatchMessage(Handler.java:106)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at android.os.Looper.loop(Looper.java:247)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at android.app.ActivityThread.main(ActivityThread.java:8676)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at java.lang.reflect.Method.invoke(Native Method)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI: Caused by: java.lang.reflect.InvocationTargetException
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at java.lang.reflect.Constructor.newInstance0(Native Method)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.player.internal.w.a(Unknown Source:41)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       ... 15 more
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI: Caused by: android.os.DeadObjectException
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at android.os.BinderProxy.transactNative(Native Method)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at android.os.BinderProxy.transact(BinderProxy.java:605)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at efv.qt(PG:2)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.apps.youtube.embeddedplayer.service.service.jar.IApiPlayerFactoryService$Stub$Proxy.a(PG:19)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.<init>(PG:24)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       at com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.<init>(PG:46)
07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI:       ... 18 more

tillnelown avatar Jul 28 '22 18:07 tillnelown

Alright I will fix this tomorrow, thanks for the report.

TheJeterLP avatar Jul 28 '22 19:07 TheJeterLP

This is because the settings is not initialized in this specific intent.

oSumAtrIX avatar Jul 28 '22 19:07 oSumAtrIX

This is because the settings is not initialized in this specific intent.

Yes, because getContext returns null. So we need to set the context in this intent therefore modifying the integrations patch to add another call to setContext

TheJeterLP avatar Jul 28 '22 19:07 TheJeterLP

This should be done for each intent in YouTube too.

oSumAtrIX avatar Jul 28 '22 19:07 oSumAtrIX

com.google.android.youtube.api.jar.client.RemoteEmbeddedPlayer.(PG:46) 07-28 20:28:21.235 31803 31803 E YouTubeAndroidPlayerAPI: ... 18 more

So I had a look at the Manifest, and its around 30 intents. So i absolutely don't have time for that currently.

TheJeterLP avatar Jul 29 '22 12:07 TheJeterLP

@oSumAtrIX So I had a look at the Manifest, and its around 30 intents. So i absolutely don't have time for that currently.

TheJeterLP avatar Jul 29 '22 12:07 TheJeterLP

I am currently working on the download patch and settings patch for that reason this issue will be stale for now.

oSumAtrIX avatar Jul 29 '22 12:07 oSumAtrIX

Additionally not all intentes have to be covered, fixing this one suffices for the current issue.

oSumAtrIX avatar Jul 29 '22 13:07 oSumAtrIX

fixed:https://github.com/revanced/revanced-patches/commit/b2b6a3d1492bc2d5a6e27c68c74e3904764dda4b

Canny1913 avatar Nov 17 '22 11:11 Canny1913