Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<String>::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<String>())
}
}
}

Expand Down