LSPosed module for OneUI 8.5 that adds a Force kill item to the per-task popup menu in Recents, directly below Keep open.
Tapping it swipe-dismisses the task card, closes the menu, force-stops that one app (the tapped task only), and removes its Recents card.
- Samsung device on OneUI 8.5
- Root via one of:
- Magisk + Zygisk + LSPosed
- KernelSU + ZygiskNext + LSPosed
There are no separate Magisk/KernelSU builds. It's a plain LSPosed APK hooking com.android.systemui (and the OneUI launcher), so it works anywhere LSPosed runs.
- Download the APK from Releases and install it.
- In LSPosed Manager, go to Modules and enable ForceKill Focused.
- Set the scope to
com.android.systemuiandcom.sec.android.app.launcher. - Reboot, or restart SystemUI.
- Open Recents, tap a task's icon, then tap Force kill.
Everything lives in one file, MainHook.java.
- Menu injection: OneUI's task menu is a custom DataBinding view (
task_menu_layoutcontainingtask_menu_item_layoutrows), not a frameworkPopupMenu. This was verified via on-device resource and stack-trace inspection. - Hook point:
LayoutInflater.inflate()is hooked. Eachtask_menu_item_layoutinflation schedules apost()that clones the row below the Keep open row, which is matched by itstask_option_dedicated_appstring. A marker tag ensures only one copy is added. - Target resolution, in order:
- The tapped card's
TaskView.getTaskPackageName()(exact) - The view-tag chain (
TaskIconViewargs) - The top non-system recent task
- The tapped card's
- Kill sequence: hidden
ActivityManager.forceStopPackage(), thenkillBackgroundProcesses(), thenremoveTask(). This runs inside the hooked process (SystemUI / launcher), which holds the required permission.
Recents internals change between OneUI builds.
- Button doesn't appear: get the Recents activity name and check that it matches the module's substring filter:
adb shell dumpsys activity activities | grep -i recents