Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Accessibility service stop/start tasks when opening/closing an app issue - help wanted.

86 views
Skip to first unread message

Tiến Đức Nguyễn

unread,
Oct 31, 2024, 5:37:28 AM10/31/24
to Tasker
Hi
With the rising amount of scam apps abusing accessibility services, banking apps in Vietnam will refuse you to use it if the accessibility is enabled.

Tasker helps quite a bit with the stop/start accessibility services task with the app profile, but there's an issue with some banking apps: The accessibility services checking script is active at ALL TIMES if the app is opened and not closed in the app switcher (or "recents") menu. This means if I'm making a bank transfer and have to copy and paste the recipient's bank account number in another app by going back to the home menu and copy the code from another app while the banking app isn't fully closed, the accessibility checker will detect it, since Tasker's exit task is enabled when the app is no longer the main active app on display. The banking app has to be closed from the recents menu if I wish to continue using it, so pretty much wasted time so I have to start over.

Is there any way to mitigate this, like is there a mechanism to detect if an app is active in the app switcher/"recent" so the exit task is triggered only when the app is fully closed?

aa6vh

unread,
Oct 31, 2024, 11:25:19 AM10/31/24
to Tasker
I don't have a direct answer for you, but couldn't you have a manual way to turn on and off the accessibility (say through a Widget or a Notification), and then you could only turn it back on only after you have fully closed the bank app.

Tiến Đức Nguyễn

unread,
Oct 31, 2024, 12:50:45 PM10/31/24
to tas...@googlegroups.com
That probably works also, but I'd like some automation. Turning stuff off and on everytime feels like a PITA for me and some others.

Vào 22:25, Th 5, 31 thg 10, 2024 aa6vh <aa6...@gmail.com> đã viết:
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Ql4LtI7JVxU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tasker/a162992f-17a6-4e04-9b97-1d790107dd6cn%40googlegroups.com.

Brenden M

unread,
Oct 31, 2024, 9:06:54 PM10/31/24
to Tasker
Can something in the "Accessibility Services" action serve your purpose?

Tiến Đức Nguyễn

unread,
Oct 31, 2024, 11:03:23 PM10/31/24
to tas...@googlegroups.com
That's exactly what I was describing. The banking app will detect the accessibility service if I just go back to home menu, when the accessibility enable exit task is triggered.

Sometimes when I open the app when it's fully closed, it even detects the accessibility service before tasker could fully turn it off 

This is a video where I try fiddling with it.

Vào 8:07, Th 6, 1 thg 11, 2024 Brenden M <nedne...@gmail.com> đã viết:

Tiến Đức Nguyễn

unread,
Oct 31, 2024, 11:05:01 PM10/31/24
to tas...@googlegroups.com
Here's the banking app if someone wants to test it out:

Vào 10:02, Th 6, 1 thg 11, 2024 Tiến Đức Nguyễn <bolabo...@gmail.com> đã viết:

Rich D

unread,
Nov 1, 2024, 4:55:52 AM11/1/24
to Tasker Google Groups Post
That's exactly what I was describing. The banking app will detect the accessibility service if I just go back to home menu, when the accessibility enable exit task is triggered.

Sometimes when I open the app when it's fully closed, it even detects the accessibility service before tasker could fully turn it off 

Unfortunately I believe any approach will require ADB WiFi.(Which you can now have automatically enabled on reboot).  

There are these methods..


You can also use your own Tasker home screen short cut to kill accessibility and launch app to avoid the early detection issue. 

Another option is to just make a easy hot button like "Long Press Back Button"  that will both kill the Bank app and restore accessibility.  Of course killing the app will require ADB WiFi as well.


Tiến Đức Nguyễn

unread,
Nov 1, 2024, 9:31:00 AM11/1/24
to tas...@googlegroups.com
Can I have a more detailed guide? It seems intriguing, but I don't know how to apply to my case and how do I get adb wifi enabled automatically?

Vào Th 6, 1 thg 11, 2024 vào lúc 15:55 Rich D <ricp...@gmail.com> đã viết:
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Ql4LtI7JVxU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Rich D

unread,
Nov 2, 2024, 1:55:42 PM11/2/24
to Tasker Google Groups Post


Can I have a more detailed guide? It seems intriguing, but I don't know how to apply to my case 


There might be a way without ADB WiFi although it does require extra permissions that can only be granted through ADB.   You need to use a PC and download the Tasker Permissions Utility  here...    


After running that utility try using this in a Tasker Action > Code > Run Shell.

dumpsys activity processes | grep -E 'APP.*ProcessRecord\{' | sed -E 's/^.*\{[^:]+:([^:/ ]+).*$/\1/g' | sed 's/^[ ]+|[ ]+$//' | sort | uniq


This will return a list of all background apps.  Then you just need to test to see if your apps package name is in the list


Here is a example of how to test for Google Maps in the background..


    Task: get background
    
    A1: Variable Set [
         Name: %package_name
         To: com.google.android.apps.maps
         Structure Output (JSON, etc): On ]
    
    A2: Run Shell [
         Command: dumpsys activity processes | grep -E 'APP.*ProcessRecord\{' | sed -E 's/^.*\{[^:]+:([^:/ ]+).*$/\1/g' | sed 's/^[ ]+|[ ]+$//' | sort | uniq
         Timeout (Seconds): 0
         Store Output In: %background_apps
         Use Global Namespace: On ]
    
    A3: Flash [
         Text: maps
         Tasker Layout: On
         Dismiss On Click: On ]
        If  [ %background_apps ~ *%package_name* ]
    
    




how do I get adb wifi enabled automatically?


ADB WIFI is extremely useful with Tasker and well worth the effort.  Here is a link to get it enabled on e reboot.


Tiến Đức Nguyễn

unread,
Nov 3, 2024, 9:01:19 AM11/3/24
to tas...@googlegroups.com
https://www.reddit.com/r/tasker/comments/w3dnp1/noobs_guide_to_what_i_prefer_the_proper_way_of/
I have found this guide, seemingly fits what I needed
I have an Android 13 device so ADB Wifi and ADB Wifi logcat option in tasker preference is enabled so tasker could properly read logcat (if not then that grant log permission once popup will appear all the time)
The RStart profile seems to work, but the RKill profile doesn't. I have tried disabling and re enabling tasker but to no avail. Can you help?
Thanks

Vào CN, 3 thg 11, 2024 vào lúc 00:55 Rich D <ricp...@gmail.com> đã viết:
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Ql4LtI7JVxU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Rich D

unread,
Nov 3, 2024, 3:01:38 PM11/3/24
to Tasker Google Groups Post
I assume you were able to get ADB wifi enabled at boot for logcat to be working?


That seems like nice approach. The logcat entries can be different on different devices. This is working on my pixel 7 pro.


    Profile: Logcat Start
     Event: Logcat Entry [ Output Variables:* Component:ActivityManager Filter:~RKilling(.*?)com.google.android.calculator Grep Filter (Check Help):Off ]
    
    
    
    Enter Task: Logcat Context
    
    
    A2: Vibrate [
         Time: 200 ]
    
    
    Profile: Logcat Start
     Event: Logcat Entry [ Output Variables:* Component:ActivityManager Filter:~RStart(.*?)com.google.android.calculator Grep Filter (Check Help):Off ]
    
    
    
    Enter Task: Logcat Context
   
  
    A2: Vibrate [
         Time: 200 ]
    
    

You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tasker/CACWc-9%3DcJQZMgNS6TZ3xdnnc_%3DrN_gvLc8Fs49T7Ktj%2Bdt9A6g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages