XposedModulets icon indicating copy to clipboard operation
XposedModulets copied to clipboard

FreeNotifications doesn't work on OOS/COS

Open Xynonners opened this issue 1 year ago • 18 comments

verbose logs don't seem to indicate something is wrong, but the notification sliders of SystemUI are still greyed out.

Xynonners avatar Oct 05 '24 12:10 Xynonners

Please share the verbose logs with me then.

binarynoise avatar Oct 05 '24 13:10 binarynoise

here are the logs.

LSPosed_2024-10-05T07_23_33.882353.zip

Xynonners avatar Oct 05 '24 14:10 Xynonners

FreeNotifications-debug.apk.zip Here is a debug apk (just remove the .zip after downloading) with logging. It looks like the module doesn't find anything to hook and just skips it.

binarynoise avatar Oct 05 '24 16:10 binarynoise

LSPosed_2024-10-05T20_26_34.285136.zip

still looks like nothing is happening?

Xynonners avatar Oct 06 '24 03:10 Xynonners

Yeah, the build only added logging. Unfortunately, the LSPosed logs don't seem to contain the logcat output of my module, can you capture a logcat for FreeNotifications? Or do you want an apk that makes logs appear in the lsposed logs?

binarynoise avatar Oct 06 '24 17:10 binarynoise

Sorry if I'm being dumb but how would I do that exactly? (I think the main issue is by the time I run logcat freeNotifications would have already done its thing -- I'm assuming the correct way is to adb shell run-as de.binarynoise.freeNotifications)

My logcat is super messy by the way (oplus dumps a bunch of sensor data there for some reason). Might have to use a lower loglevel.

Xynonners avatar Oct 08 '24 03:10 Xynonners

FreeNotifications-debug.apk.zip Here the log messages should go into the LSPosed logs.

To use logcat instead, the command should be adb logcat FreeNotifications:D

binarynoise avatar Oct 08 '24 09:10 binarynoise

I did logcat freeNotifications:* *:S, here is the output

--------- beginning of main
[ 10-08 08:17:05.987  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:05.987  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:05.988  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:07.945  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:07.945  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:07.945  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:08.021  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:08.021  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:08.021  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:08.038  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:08.038  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:08.038  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:08.104  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:08.104  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:08.104  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:09.860  4712: 4712 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:09.867  4712: 4712 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:09.867  4712: 4712 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:11.370  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:11.370  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:11.370  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:11.386  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:11.386  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:11.386  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:11.398  5120: 5120 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:11.398  5120: 5120 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:11.399  5120: 5120 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:11.416  3142: 3142 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:11.416  3142: 3142 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:11.416  3142: 3142 I/FreeNotifications ]
hooked isBlockable

[ 10-08 08:17:23.433  9004: 9004 I/FreeNotifications ]
hooked constructors: 2

[ 10-08 08:17:23.435  9004: 9004 I/FreeNotifications ]
hooked setBlockable

[ 10-08 08:17:23.435  9004: 9004 I/FreeNotifications ]
hooked isBlockable

Xynonners avatar Oct 08 '24 15:10 Xynonners

That looks how it should look like. Can you send me your framework.jar (in /system/framework/) for further analysis?

binarynoise avatar Oct 08 '24 16:10 binarynoise

https://mega.nz/file/6Bs3BBLT#N3H5IwNsAwSy_2nO-eDPI3ujt-07Lv0lqNRIhTPMP_A

(file too big so I put it on mega)

Xynonners avatar Oct 08 '24 18:10 Xynonners

Also looks like it should look like. I don't know why it doesn't work for you. One thing to check though, do you have the option to disable an unwanted notification when you long press it in the notification drawer?

binarynoise avatar Oct 09 '24 07:10 binarynoise

yes, but only on user notifications

on system notifications the button is replaced by "These notifications cannot be modified".

Xynonners avatar Oct 09 '24 16:10 Xynonners

maybe it's in the other files in /system/framework?

I have oplus-framework.jar which seems to be OEM

Xynonners avatar Oct 09 '24 16:10 Xynonners

on system notifications the button is replaced by "These notifications cannot be modified".

That means it neither works in the Settings app nor in SystemUI

maybe it's in the other files in /system/framework?

I had a look, it does contain a related class that seems to extend NotificationChannel but it doesn't look like it modifies the isBlockable behaviour.

One last resort would be looking at SystemUI to see if they override the behaviour there

binarynoise avatar Oct 09 '24 16:10 binarynoise

tell me the files you need and I'll get them for you

https://mega.nz/file/uBVnWIrS#5Lmw3gdcvlu6AmX7ZjRulCxdUTtL8jQtBtcqNXL7ROw

Xynonners avatar Oct 09 '24 18:10 Xynonners

there's also this com.oplus.notificationmanager in system_ext.

NotificationCenter.apk.zip

Xynonners avatar Oct 09 '24 18:10 Xynonners

In SystemUI I could see why it doesn't work. They added another property, isImportanceLockedByCriticalDeviceFunction, for "critical" device functions. I'll add it this weekend or so and send you another build.

binarynoise avatar Oct 09 '24 18:10 binarynoise

oh okay, thanks a lot!

Xynonners avatar Oct 11 '24 16:10 Xynonners

FreeNotifications-debug.apk.zip Here is a version with importanceLockedByCriticalDeviceFunction

binarynoise avatar Oct 13 '24 21:10 binarynoise

Does it work now? Or is it still doing nothing?

binarynoise avatar Oct 16 '24 10:10 binarynoise

Ah, I'm so sorry, I've been pretty busy the past few days and forgot to read my notifications.

It still seems to be greyed out sadly...

Xynonners avatar Oct 17 '24 07:10 Xynonners

I will take another look at the issue eventually, however I'm currently busy too.

binarynoise avatar Oct 25 '24 21:10 binarynoise

Turns out, isImportanceLockedByCriticalDeviceFunction is AOSP, but they don't trust it (?) so they have a list of packages they block. FreeNotifications-debug.apk.zip Here is a version with mNonBlockablePkgs cleared.

binarynoise avatar Nov 16 '24 16:11 binarynoise

lmao, it seems they really don't want to let people turn off notifications

tried the new version and it's still grey sadly (shows allow notifications slider as greyed out, all channels greyed out and "these notifications cannot be modified" when hold-tapped on in notification drawer)

Xynonners avatar Nov 17 '24 10:11 Xynonners

Screenshot_2024-11-17-02-17-17-92_8142442b4340f41fb3bd44535ad8f76b

Xynonners avatar Nov 17 '24 10:11 Xynonners

This is the settings app. What about directly editing the notifications in the notification drawer? If that works, can you send me the settings apk so I can figure out what :hankey: they did there? Also, can you give me the logs so I can see whether anything I added works?

binarynoise avatar Nov 17 '24 11:11 binarynoise

Notification drawer still "cannot modify" too :( LSPosed_2024-11-17T02_15_48.351576.zip

Settings: https://mega.nz/file/DFNRUIIA#PB1fl6ppcQPArrawzGSvXhbHmHCmsuGBMdRz2Q_iPvo

Xynonners avatar Nov 17 '24 11:11 Xynonners

My hooks are applied and don't throw Exceptions, so :man_shrugging:.

Settings apk is obfuscated. There seems to be some additional logic similar to SystemUI, but I won't go deeper into that as it would be too brittle and too exhausting.

So all I can say is, I'm sorry, it won't work on OnePlus.

binarynoise avatar Nov 17 '24 11:11 binarynoise