File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
FreeNotifications/src/main/java/de/binarynoise/freeNotifications Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 11package de.binarynoise.freeNotifications
22
33import android.app.NotificationChannel
4- import android.app.NotificationChannelGroup
54import android.os.Build
65import de.binarynoise.logger.Logger.log
76import de.binarynoise.reflection.findDeclaredField
@@ -40,12 +39,21 @@ class Hook : IXposedHookLoadPackage {
4039 )
4140 }
4241
43- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .P ) {
44- hookVariable(
45- NotificationChannelGroup ::class .java,
46- " mBlocked" ,
47- false ,
48- )
42+ if (lpparam.packageName == " android" && Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
43+ tryAndLog(" PreferencesHelperClass lockChannelsForOEM" ) {
44+ val PreferencesHelperClass = Class .forName(" com.android.server.notification.PreferencesHelper" , false , lpparam.classLoader)
45+ XposedHelpers .findAndHookMethod(
46+ PreferencesHelperClass ,
47+ " lockChannelsForOEM" ,
48+ Array <String >::class .java,
49+ DO_NOTHING ,
50+ )
51+ }
52+ tryAndLog(" NotificationManagerService NON_BLOCKABLE_DEFAULT_ROLES" ) {
53+ val NotificationManagerService =
54+ Class .forName(" com.android.server.notification.NotificationManagerService" , false , lpparam.classLoader)
55+ XposedHelpers .setStaticObjectField(NotificationManagerService , " NON_BLOCKABLE_DEFAULT_ROLES" , emptyArray<String >())
56+ }
4957 }
5058 }
5159
You can’t perform that action at this time.
0 commit comments