From 6e16c8df3c5f5004c9efc204e40b3bc1bfb66134 Mon Sep 17 00:00:00 2001 From: programminghoch10 <16062290+programminghoch10@users.noreply.github.com> Date: Wed, 10 Dec 2025 23:33:38 +0100 Subject: [PATCH] fix FreeNotifications for the second time --- .../de/binarynoise/freeNotifications/Hook.kt | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/FreeNotifications/src/main/java/de/binarynoise/freeNotifications/Hook.kt b/FreeNotifications/src/main/java/de/binarynoise/freeNotifications/Hook.kt index ca661d7..1b6f4fd 100644 --- a/FreeNotifications/src/main/java/de/binarynoise/freeNotifications/Hook.kt +++ b/FreeNotifications/src/main/java/de/binarynoise/freeNotifications/Hook.kt @@ -1,7 +1,6 @@ package de.binarynoise.freeNotifications import android.app.NotificationChannel -import android.app.NotificationChannelGroup import android.os.Build import de.binarynoise.logger.Logger.log import de.binarynoise.reflection.findDeclaredField @@ -40,12 +39,21 @@ class Hook : IXposedHookLoadPackage { ) } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - hookVariable( - NotificationChannelGroup::class.java, - "mBlocked", - false, - ) + if (lpparam.packageName == "android" && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + tryAndLog("PreferencesHelperClass lockChannelsForOEM") { + val PreferencesHelperClass = Class.forName("com.android.server.notification.PreferencesHelper", false, lpparam.classLoader) + XposedHelpers.findAndHookMethod( + PreferencesHelperClass, + "lockChannelsForOEM", + Array::class.java, + DO_NOTHING, + ) + } + tryAndLog("NotificationManagerService NON_BLOCKABLE_DEFAULT_ROLES") { + val NotificationManagerService = + Class.forName("com.android.server.notification.NotificationManagerService", false, lpparam.classLoader) + XposedHelpers.setStaticObjectField(NotificationManagerService, "NON_BLOCKABLE_DEFAULT_ROLES", emptyArray()) + } } }