binarynoise / XposedModulets

A collection of small Xposed Modules.
European Union Public License 1.2
58 stars 2 forks source link

FreeNotifications doesn't work on OOS/COS #9

Closed Xynonners closed 1 week ago

Xynonners commented 1 month ago

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

binarynoise commented 1 month ago

Please share the verbose logs with me then.

Xynonners commented 1 month ago

here are the logs.

LSPosed_2024-10-05T07_23_33.882353.zip

binarynoise commented 1 month ago

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.

Xynonners commented 1 month ago

LSPosed_2024-10-05T20_26_34.285136.zip

still looks like nothing is happening?

binarynoise commented 1 month ago

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?

Xynonners commented 1 month ago

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.

binarynoise commented 1 month ago

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

Xynonners commented 1 month ago

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
binarynoise commented 1 month ago

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

Xynonners commented 1 month ago

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

(file too big so I put it on mega)

binarynoise commented 1 month ago

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?

Xynonners commented 1 month ago

yes, but only on user notifications

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

Xynonners commented 1 month ago

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

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

Xynonners commented 1 month ago

oplus-framework.jar.zip

binarynoise commented 1 month ago

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

Xynonners commented 1 month ago

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

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

Xynonners commented 1 month ago

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

NotificationCenter.apk.zip

binarynoise commented 1 month ago

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.

Xynonners commented 1 month ago

oh okay, thanks a lot!

binarynoise commented 1 month ago

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

binarynoise commented 1 month ago

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

Xynonners commented 1 month ago

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...

binarynoise commented 1 month ago

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

binarynoise commented 2 weeks ago

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.

Xynonners commented 1 week ago

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 commented 1 week ago

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

binarynoise commented 1 week ago

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?

Xynonners commented 1 week ago

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

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

binarynoise commented 1 week ago

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.