Few open questions:
1) Does anyone know how one might go about converting some of the existing hook definitions to a stand alone xsposed/magisk module?
I had searched for years unsuccessfully to find an xposed module to a) ungroup notifications, b) expand notifications. There's a number of old xposed modules (ex. XNotifications)that had this feature that no longer work in modern android.
Specifically looking at FIF Group Notifications and Intika SystemUI Mods, unexpand all notifs.
2) Is there a way for a hook module to know which application/module is calling the function we are hooking? Unsure if there's a stack or way for me to get that info.
3) If we want to replace part of a function via XPrivacy, that would require us to rewrite the existing java code into lua, correct?
4) Can someone explain the constructor part of the docs for me? It seems to be saying that if we wanted to modify a constant it may not work because the compiler might statically inline the variable?
5) Is there a better way to modify a static variable? I've done it before, but with a lot of manual work.
I'm trying to modify MAX_PACKAGE_NOTIFICATIONS, TOAST_RATE_LIMITS DEFAULT_MAX_NOTIFICATION_ENQUEUE_RATE, and a few others in
https://android.googlesource.com/pl.../notification/NotificationManagerService.java
I've in the past been able to accomplish this goals by
1) exporting the services.jar file,
2) disassembling/decompiling the NotificationManager service
3) Modifying the smali bytecode
4) repacking it into a xposed module that replaces the services.jar
1) "bin\adb.exe" pull "/system/framework/services.jar" "adb/services.jar"
2) java-Xmx256m -jar .\apktool.jar d -o .\services.jar-decompiled .\adb\services.jar
2) Can also use JDKGui to view the java source
4) Pack/Create XPosedModule via SmaliPatcher
ps: If it helps anyone, small hook to change how many notifications android will bundle together in the notification area.
JSON:
{
"script": [
{
"name": "Jolly.Notification Bundling Count",
"code": "function after(hook, param)\r\n\tlocal result = param:getResult()\r\n\tif result == nil then\r\n\t\treturn false\r\n\tend\r\n\n\nlocal maxChildren = param:getSetting(\"Max Children For Grouping\")\n\r\n\tparam:setResult(maxChildren)\r\n\treturn true\r\nend\r\n"
}
],
"definition": [
{
"builtin": false,
"collection": "Jolly",
"group": "ShowMoreChildren",
"name": "Notification Bundling Count",
"author": "Jolly",
"version": 0,
"description": "Changes the number of notifications android bundles together in the notification area",
"className": "com.android.systemui.statusbar.notification.stack.NotificationChildrenContainer",
"methodName": "getMaxAllowedVisibleChildren",
"parameterTypes": [
"boolean"
],
"returnType": "int",
"minSdk": 1,
"maxSdk": 319,
"minApk": 0,
"maxApk": 2147483647,
"enabled": true,
"optional": false,
"usage": true,
"notify": false,
"luaScript": "@Jolly.Notification Bundling Count",
"settings": [
"Max Children For Grouping"
]
}
]
}