Notification.Ranker.onNotificationPosted

This hook has nothing to do with privacy. It prevents notifications from being grouped by Android Nougat for a set of apps. Instructions: 1. Download both hooks: - Notification.Ranker.onNotificationPosted - Notification.Ranker.onNotificationRemoved 2. Make sure that the Fif collection is enabled in XPL Pro. 3. In XPL, navigate to the "Android Services Library" (com.google.android.ext.services) app (you may have to change the filter to "Show all apps" first), and expand the restriction categories. 4.a. Check the "Utility" category. 4.b. Or, alternately, enable both Notification.Ranker.onNotificationPosted and Notification.Ranker.onNotificationRemoved hooks for "Android Services Library" (com.google.android.ext.services) in XPL Pro. 5. Configure a list of apps whose notifications should not be grouped with XPrivacyLua Pro, under "Custom Values", "Ungrouped notification package names". List items are whitespace separated, and must match exactly, eg. "com.android.chrome". Notes: It is recommended not to force stop the system app, but reboot between changes to the hook or its configuration/settings. Changelog: v3 - 2018-08-29 Change Max. SDK to 25, the hooks do not work on Oreo. Expanded documentation.

CollectionFif
GroupUtilities
NameNotification.Ranker.onNotificationPosted
AuthorFif_
Version3
Updated (UTC)2018-08-30 01:14:41
Created (UTC)2018-03-12 21:38:32
Downloads992
Class nameandroid.ext.services.notification.Ranker
Method nameonNotificationPosted
Parameter typesandroid.service.notification.StatusBarNotification
Return type-
Min SDK24
Max SDK25
Min APK0
Max APK2147483647
Excluded packages^(?!com\.google\.android\.ext\.services).*
EnabledYes
OptionalNo
UsageYes
NotifyNo
SettingsUngrouped notification package names
-- Fif.Notification.Ranker is a Lua hook set designed to work with XPrivacyLua.
-- Copyright (C) 2018 Philippe Troin (Fif_ on XDA)

-- Fif.Notification.Ranker is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.

-- Fif.Notification.Ranker is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.

-- You should have received a copy of the GNU General Public License
-- along with XPrivacyLua.  If not, see <http://www.gnu.org/licenses/>.

function before(hook, param)
    local notif = param:getArgument(0)
    if notif == nil then
        return false
    end

    local context = param:getApplicationContext()
    local UngroupedApps = param:getValue('Fif.Notification.Ranker.UngroupedApps', context)

    if UngroupedApps == nil then
        local packages = param:getSetting("Ungrouped notification package names")
        UngroupedApps = {}
        local ungroupedAppsLog = {}
        if packages ~= nil then
            packages:gsub('[%S]+', function(x) UngroupedApps[x] = true table.insert(ungroupedAppsLog, x) end)
        end
        param:putValue('Fif.Notification.Ranker.UngroupedApps', UngroupedApps, context)
        log('Apps with ungrouped notifications: ' .. table.concat(ungroupedAppsLog, ', '))
    end

    local package = notif:getPackageName()
    
    if UngroupedApps[package] then
        log('Deny ' .. package)
        param:setResult(nil)
        return true, package
    else
        log('Allow ' .. package)
        return false
    end
end