wasdennnoch / AndroidN-ify

[Discontinued] An Xposed module to use features introduced in Android N on your LP+ Device
265 stars 93 forks source link

OGYouTube is crashing when posting a notification #1376

Closed FaySmash closed 6 years ago

FaySmash commented 6 years ago

Description OGYouTube is crashing since N-ify version 839 when posting a notification. E.g., when I try to switch to background playback mode or try to download something, the app crashes. The change which caused this was commit #1357. The biggest problem here is, that the whitelisting function of N-ify seems to doesn't apply to OGYouTubes notification style.

Module version (build version) Issue appears on version >838

Xposed log / logcat

de.robv.android.xposed.XposedHelpers$InvocationTargetError: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at de.robv.android.xposed.XposedHelpers.callMethod(XposedHelpers.java:1225) at tk.wasdennnoch.androidn_ify.systemui.notifications.NotificationHooks$9.replaceHookedMethod(NotificationHooks.java:568) at de.robv.android.xposed.XC_MethodReplacement.beforeHookedMethod(XC_MethodReplacement.java:29) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:314) at android.app.Notification$Builder.processSmallIconAsLarge() at android.app.Notification$Builder.applyStandardTemplate(Notification.java:3014) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334) at android.app.Notification$Builder.applyStandardTemplate() at android.app.Notification$Builder.applyStandardTemplate(Notification.java:2990) at android.app.Notification$Builder.makeContentView(Notification.java:3186) at android.app.Notification$Builder.buildUnstyled(Notification.java:3361) at android.app.Notification$Builder.build(Notification.java:3686) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334) at android.app.Notification$Builder.build() at net.ogmods.youtube.remotecontrols.Lollipop.buildNotification(Lollipop.java:194) at net.ogmods.youtube.remotecontrols.Lollipop.onPlayerChange(Lollipop.java:296) at net.ogmods.youtube.remotecontrols.Lollipop.init(Lollipop.java:113) at net.ogmods.youtube.remotecontrols.Lollipop.buildNotification(Lollipop.java:172) at net.ogmods.youtube.remotecontrols.Lollipop.onTimeChange(Lollipop.java:310) at net.ogmods.youtube.remotecontrols.Notification.onTimeChange(Notification.java:36) at net.ogmods.youtube.OG.setTime(OG.java:504) at net.ogmods.youtube.remotecontrols.Lollipop$Updater.run(Lollipop.java:63) at java.util.Timer$TimerImpl.run(Timer.java:284) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference at tk.wasdennnoch.androidn_ify.utils.ResourceUtils.getColor(ResourceUtils.java:61) at tk.wasdennnoch.androidn_ify.utils.NotificationColorUtil.resolveContrastColor(NotificationColorUtil.java:332) at tk.wasdennnoch.androidn_ify.systemui.notifications.NotificationHooks$13.replaceHookedMethod(NotificationHooks.java:635) at de.robv.android.xposed.XC_MethodReplacement.beforeHookedMethod(XC_MethodReplacement.java:29) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:314) at android.app.Notification$Builder.resolveColor() at java.lang.reflect.Method.invoke(Native Method) at de.robv.android.xposed.XposedHelpers.callMethod(XposedHelpers.java:1217) ... 24 more

android.app.RemoteServiceException: Bad notification posted from package com.google.android.youtube: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.google.android.youtube user=UserHandle{0} id=-1 tag=null score=0 key=0|com.google.android.youtube|-1|null|10242: Notification(pri=0 contentView=com.google.android.youtube/0x1090087 vibrate=default sound=null tick defaults=0x6 flags=0x6b color=0x00000000 vis=PRIVATE)) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1526) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5471) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)

rvictorr commented 6 years ago

Android version?

FaySmash commented 6 years ago

@numeprenume oh, sorry for not mentioning it. I'm on android 6.0.1_r74-MOB31K. to be exact, I'm running resurrection remix os 5.7.4-2016-1117 on my LG G3 D855.

rvictorr commented 6 years ago

The first issue should be fixed. I'm not sure if the download crash is fixed, as I couldn't test it (OGYoutube would just load infinitely when choosing the download location)

FaySmash commented 6 years ago

I'm afraid to report that the problem still appears :/ May we investigate further, but if it would cause a to huge inconvenience I could settle with original YouTube + XPosed modules instead. (Side notes: I use OGYouTube 3.5 as XPosed version. YouTube Background playback XPosed modul works fine with original YouTube app but crashes with OGYouTube. So OGYR still crashes when posting any notification)

rvictorr commented 6 years ago

Does this work? (rename to .apk and install)

FaySmash commented 6 years ago

@numeprenume no, sadly not... only difference I see in the crash log are the missing \ flags in the log and a few changed line numbers. but thank you for your effort, I really appreciate it!

rvictorr commented 6 years ago

Well that's weird...now I can't reproduce the crash anymore, so maybe wait for the next automated build and report back?

FaySmash commented 6 years ago

@numeprenume I will. Maybe I should reinstall OGYT..? Do you use the XPosed or MicroG version? And does this mean you were able to reproduce the crash in the beginning? Also I updated the module, not reinstalled our last build from scratch..will try this now and report back.

rvictorr commented 6 years ago

Yeah, I used the Xposed version and I was actually able to reproduce the crash, but now I can't get anything. You should wait until the commit is merged and then update.

FaySmash commented 6 years ago

@numeprenume okay, I'll keep waiting. reinstallation of OGYT and the module didn't fix it. Ty again

rvictorr commented 6 years ago

Still can't reproduce it. How's the latest build working for you? Can you list the specific options that you have activated in N-ify?

FaySmash commented 6 years ago

@numeprenume I'm very sorry for the late reply :[ Installed build 847 this afternoon. I was very glad at first because it worked. tested it multiple times. but later the day it stopped working again. I now did quite a lot of testing, all xposed modules except n-ify and ogxposed are deactivated. I uploaded a video here , showing what's going on.

also the N-ify settings: ![screenshot_20170728-004302](https://user-images.githubusercontent.com/30392780/28695358-e6f643d6-732e-11e7-8d90-7ba38252d445.png) ![screenshot_20170728-004254](https://user-images.githubusercontent.com/30392780/28695351-e625e880-732e-11e7-9efa-1881f97c1dcd.png) ![screenshot_20170728-004243](https://user-images.githubusercontent.com/30392780/28695357-e6c2f012-732e-11e7-9b93-5fc547de0a2a.png) ![screenshot_20170728-004224](https://user-images.githubusercontent.com/30392780/28695361-e7561b30-732e-11e7-86e3-54537f676199.png) ![screenshot_20170728-004207](https://user-images.githubusercontent.com/30392780/28695350-e61fdb0c-732e-11e7-9bf0-f7c809fc6765.png) ![screenshot_20170728-004203](https://user-images.githubusercontent.com/30392780/28695352-e6393aac-732e-11e7-851f-de0676d94764.png) ![screenshot_20170728-004156](https://user-images.githubusercontent.com/30392780/28695353-e63c77bc-732e-11e7-88c4-20106e9680d1.png) ![screenshot_20170728-004136](https://user-images.githubusercontent.com/30392780/28695354-e650a458-732e-11e7-8165-b7f679feef2c.png) ![screenshot_20170728-004126](https://user-images.githubusercontent.com/30392780/28695355-e65b4f2a-732e-11e7-92c7-0f2b1bd8d4a3.png) ![screenshot_20170728-004117](https://user-images.githubusercontent.com/30392780/28695356-e66f2054-732e-11e7-86dd-cf1334b48664.png)
FaySmash commented 6 years ago

@numeprenume MAN I LOVE YOU! (nohomo). Also a very big thank you to @paphonb, seems like he helped. Now the important question: how to donate? :D

rvictorr commented 6 years ago

Haha, I'm glad that it finally works! Well, most of the work on this module was done by @paphonb and @wasdennnoch and I'm just here polishing the rougher parts and adding some minor features, so I don't really feel like I should take the credit for this, but if you really, really want to I can set something up :D

FaySmash commented 6 years ago

@well, the final commits which fixed it finally were mostly yours :p +you were the one handling my issue report. so mostly a appreciation for the brilliant support ^^ afaik n-ify doesn't have a donation possibility for the contributors, so @wasdennnoch and @paphonb would have to pass me donation endpoints too x) but this issue is now finally for the archives :D