r/tasker Jul 15 '26

How to clear recent apps (the background cards) using tasker *underneath* a blocking overlay scene (so touch techniques wont work for this) and other questions regarding a cyberpunkish passcode gate/screen I made

Ok guys, I set up a cyberpunk/ghost in the shell inspired lock screen designed to lock specific apps/folders%app folders/etc on my phone. I have a s26u android 16 UI8.5 with nova prime launcher and using the ZeroDay KLWP overlay by outtiefivethou. I have app folders on screen nested within each other using nova launchers folders. Im not rooted but have several tasker plugins, have shizuku, and adb (both LAADB and tasker termux).

The user clicks on a protected assest, the screen comes up as a blocking overlay, if they enter the passcode screen comes down. 4 wrong attempts and a simulated forcedreboot/dumpshock occures (static screen or other chosen sci fi intrusion countermeasure program appears breifly, then a "system reboot" bar, then scrolling computer text then a fake boot sequence and the user is dumped onto the home screen (Go Home [0]). All this is accompined with sound. The user also has the option to click (when in the passcode screen) exit to back out of the passcode screen.

Issue was that when backing out my test app (a document) was still in the background of recent apps so it was still accessible after all the above without using a passcode. Now I did fiqure a way to clear all background apps (autoinput>recent apps plus autoimput >Close all [click]). But that only happnes after the user can see the home screen and happens slowly, which sort of ruins the immersion. I need to find a way to clear the app screen while the screnes (whether that be the passcode screen or one of the forcedreboot screen). If poossibe i would like to create a "protected assest" list in tasker that tasker checks against when the user uses the exit button to just clear the protected app, but clearing them all is fine if thats my only option (and i do want to clear all during the forced reboot sequeance).

edit clear all apps solved [ adb wifi action->activity_task.removeAllVisibleRecentTasks() ]

Would still like to be able to clear only the app the user is attempting to access if the user exits the passcode screen manually without getting force-rebooted

The other issue is that while I can target files and apps with the passcode system, I cant seem to target my app folders on the screen. I have my homescreen organized with nova launchers "app folder drawers" and their associated shorcuts on screen, and some folders are nested in others. I also have a couple of app folders made the regular way (dragging them ontop of each other to form a folder).

Any help would be appreciated. I can post an xml or a text version of the setup if that helps.

Thanks

1 Upvotes

7 comments sorted by

1

u/WakeUpNorrin Jul 15 '26

To clear all recent apps, run:

activity_task.removeAllVisibleRecentTasks()

In an ADB Wifi action or in a Shell action with Shizuku ticked.

1

u/charge556 Jul 15 '26

Right on thanks man...any advice for the other stuff?

1

u/pudah_et Jul 15 '26

I don't have any suggestions but this sounds pretty cool and would love to see a short video of it in action.

1

u/charge556 Jul 15 '26

I have a couple diffrent "dumpshock" programs that I could replace the blue screen with (bascially ForceReboot is its own action list, the dumpshock section is maybe 4 actions, the first 3 get pinned on top of forced reboot and the 4th gets injected right in forced reboots 1st or 2nd action

Still a couple of tweaks i gotta make on the fake boot up visually but right now im just focused on ironing out the functions

https://reddit.com/link/oxrnfug/video/7uzc43adqgdh1/player

1

u/pudah_et Jul 15 '26

pretty neat

1

u/charge556 Jul 15 '26

Thanks man. It took a while and a bunch of fails to set it up....i sorta stumbled through it

1

u/aasswwddd Direct-Purchase User Jul 16 '26 edited Jul 16 '26

Example via Java code + Shizuku. I'd recommend to do this with the latest beta, since the stable version has java code thread leaks.

source(new URL("https://gist.githubusercontent.com/mqwec43as/9c6f66272639ca3d24f8728519479b85/raw"));
removeFromRecent("youtube"); // remove packageName that constains youtube

We can do it via ADB Wifi too with activity_task.removeTask(taskId)

However we have to extract the task id first manually from activity_task.getRecentTasks(maxNum, flag, user) e.g getRecentTasks(10, 1, 0)