diff --git a/README.md b/README.md index a9c31a1..f7c07f3 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,16 @@ If this module saved you time or frustration, consider supporting development: ### ✅ Tested -* **Device:** Viwoods Reader -* **Firmware:** Viwoods software **1.1.0** and **1.2.3** +* **Device:** Viwoods Reader / Viwoods AiPaper +* **Firmware:** Viwoods software **1.1.0**, **1.2.3**, and **1.5.6** ### ⚠️ Untested * Other Viwoods devices * Other firmware versions -> **Important:** This module is verified **only on Viwoods firmware 1.1.0 and 1.2.3**. -> Other versions may have different code paths or offsets. +> **Important:** This branch (`firmware/1.5.6`) ships a `services.jar` patched specifically for firmware **1.5.6**. +> Other versions may have different code paths or offsets — use the matching branch/release for your firmware. --- @@ -63,10 +63,15 @@ This Magisk module **patches `classes2.dex` inside `services.jar` systemlessly** ### Patch Summary -* Disables the notification whitelist check -* Allows all applications to post notifications +On firmware 1.5.6, three separate filter points in `NotificationManagerService` block non-whitelisted apps' notifications; this module neutralizes all three, plus a fourth hardcoded block that specifically drops GMS/Wellbeing notifications: + +* `checkDisqualifyingFeatures()` — removed the XOR inversion that silently suppressed notifications +* `PostNotificationRunnable.postNotification()` — forces the per-app permission check to pass +* `enqueueNotificationInternal()` — bypasses the hardcoded `ALLOWED_PKGS` whitelist +* `enqueueNotificationInternal()` GMS/Wellbeing special case — no longer drops notifications from Google apps * Applied systemlessly via Magisk * Fully reversible by removing the module +* `service.sh` also whitelists all installed apps from battery optimization at boot, so backgrounded apps aren't killed before they can receive push notifications --- @@ -78,11 +83,11 @@ This Magisk module **patches `classes2.dex` inside `services.jar` systemlessly** * **Root access via Magisk** * Root **requires patching `init_boot.img`** using the Magisk app -* Viwoods firmware **1.1.0 or 1.2.3** +* Viwoods firmware **1.1.0, 1.2.3, or 1.5.6** ### Steps -1. Download the module `.zip` from **Releases** Use the correct version for your FW version. +1. Download the module `.zip` from **Releases**, or build it from this branch (`firmware/1.5.6`). Use the correct version for your FW version. 2. Open **Magisk → Modules** 3. Select **Install from storage** 4. Choose the downloaded `.zip` @@ -108,7 +113,7 @@ Since the Viwoods Reader **lacks a native pull-down notification tray**, it is * ## ⚠️ Warnings & Notes -* Designed specifically for the **Viwoods Reader firmware 1.1.0/1.2.3** +* This branch's `services.jar` is designed specifically for **Viwoods AiPaper firmware 1.5.6** — for 1.1.0/1.2.3 use `main` * OTA updates may overwrite or invalidate the patch * Low-level system service modification — proceed at your own risk diff --git a/module.prop b/module.prop index 6b4f841..5d9ebf2 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=eink_notification_unblock name=E-ink Notification Unblock v2 -version=2.0 -versionCode=2 +version=1.5.6 +versionCode=3 author=J -description=Removes notification blocking with proper SELinux context. Allows ALL apps to show notifications on e-ink devices. +description=Removes notification blocking with proper SELinux context. Allows ALL apps to show notifications on Viwoods AiPaper firmware 1.5.6, plus a battery-optimization whitelist so backgrounded apps keep receiving push notifications. diff --git a/post-fs-data.sh b/post-fs-data.sh old mode 100644 new mode 100755 index e2008aa..72ef139 --- a/post-fs-data.sh +++ b/post-fs-data.sh @@ -1,9 +1,16 @@ #!/system/bin/sh -# E-ink Notification Unblock - SELinux Context Fixer -# This ensures the patched services.jar has the correct SELinux context +# E-ink Notification Unblock - Installation Script +# Copies the patched services.jar into place and fixes its SELinux +# context so Magisk's systemless overlay actually takes effect. MODDIR=${0%/*} +# Ensure module directory structure exists +mkdir -p "$MODDIR/system/framework" + +# Copy patched services.jar to the system framework directory +cp "$MODDIR/services.jar" "$MODDIR/system/framework/services.jar" 2>/dev/null + # Set proper SELinux context for services.jar chcon u:object_r:system_file:s0 "$MODDIR/system/framework/services.jar" 2>/dev/null diff --git a/service.sh b/service.sh new file mode 100755 index 0000000..3791184 --- /dev/null +++ b/service.sh @@ -0,0 +1,16 @@ +#!/system/bin/sh +# E-ink Notification Unblock - Boot service +# Disables battery optimization for all installed apps so they can +# receive and process push notifications without being killed in the +# background by Viwoods' aggressive power management. + +# Wait for system to be fully booted +until [ "$(getprop sys.boot_completed)" = "1" ]; do + sleep 2 +done + +# Apply to every installed package (system + user, covers future installs on next boot) +pm list packages | cut -d: -f2 | while read -r pkg; do + cmd deviceidle whitelist "+$pkg" 2>/dev/null + cmd appops set "$pkg" RUN_ANY_IN_BACKGROUND allow 2>/dev/null +done diff --git a/services.jar b/services.jar index cbed8da..866bae9 100644 Binary files a/services.jar and b/services.jar differ