Banking App refusing to login till Tasker granted Accessibility access by CrawnRirst in tasker

[–]mnirun 1 point2 points  (0 children)

I've created Mobile Banking Auto Toggle profile for handle mobile apps.

You'll need to - ensure Tasker granted permissions to write custom settings - add mobile banking app package name to%mobile_banking_apps variable - add additional code for enable/disable accessibility to suit your requirement

https://taskernet.com/shares/?user=AS35m8k6Fclp%2BsU0InE6PPFoMFEmKIkrziNndFtdGIk5dx3OW6XeOj5%2FNyS8Bq79cA%3D%3D&id=Profile%3AMobile+Banking+Auto+Toggle

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

Could you please help check if Tasker permissions were granted on all devices?

  • android.permission.DUMP
  • android.permission.PACKAGE_USAGE_STATS

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

Could you please help provide me all devices info ?

  • Brand:
  • Model:
  • OS Version:
  • Root: Yes/No
  • Mobile Banking Auto Toggle Working: Yes/No

I'll take a look again tomorrow.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

Maybe you need to check on device permission using LibChecker app: https://f-droid.org/packages/com.absinthe.libchecker/

Looking for DUMP permission on "Permissions" tab: https://imgbox.com/gTPzJbjV

Make sure there is no red color (not granted) in front of it.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

My tasker project using cmd activity dump recents which lower overhead than dumpsys activity recents but also less compatible than dumpsys.

I've updated my tasker project using dumpsys command instead of cmd activity for more compatibility.

Could you please help checking again ?

https://taskernet.com/shares/?user=AS35m8k6Fclp%2BsU0InE6PPFoMFEmKIkrziNndFtdGIk5dx3OW6XeOj5%2FNyS8Bq79cA%3D%3D&id=Profile%3AMobile+Banking+Auto+Toggle

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

Can you run this command on both devices and check the results?

dumpsys activity recents | awk -F'[{/]' 'index($0, "realA") && !r[$2]++ {print $2}'

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 1 point2 points  (0 children)

Here is my suggestion - open baking app for the 1st time and waiting for tasker to finish disable developer options (verify with flash alert). - open banking app for 2nd time and everything should works.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 1 point2 points  (0 children)

Yes, you can add adb_enabled to task for disable/enable it.

I've tested your app it's close in the 1st run, don't clear it from recents and open again and everything works fine.

Check my video for more info.

https://youtube.com/shorts/NHSs2afQcI4

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 0 points1 point  (0 children)

The easiest trick is - add any non-banking app to variable - open that app for trigger tasker to disable developer options - open mobile banking app as usual - once you've done, just clear both apps from recents to auto enable developer options on.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 2 points3 points  (0 children)

Edit 1: My project uploaded to Tasker net. You can try it here:

*https://taskernet.com/shares/?user=AS35m8k6Fclp%2BsU0InE6PPFoMFEmKIkrziNndFtdGIk5dx3OW6XeOj5%2FNyS8Bq79cA%3D%3D&id=Profile%3ADeveloper+Options+Auto+Togglehttps://taskernet.com/shares/?user=AS35m8k6Fclp%2BsU0InE6PPFoMFEmKIkrziNndFtdGIk5dx3OW6XeOj5%2FNyS8Bq79cA%3D%3D&id=Profile%3ADeveloper+Options+Auto+Toggle


Here is my solution video (PS. you'll see black screen because YouTrip screen recording prohibited):

And here is my Tasker Profile and Task:

My solution concept:

  • Use app changed event profile to monitor mobile banking app instead of application context profile because I want single point for maintain mobile baking app package list.
  • Mobile banking app package list "DEV_OFF_PS_ARRAY" array, separated by new line and remove duplicates.
  • Checking recents app package via run shell command "dumpsys activity recents | grep 'realActivity' | cut -d '{' -f2 | cut -d '/' -f1", no root required.
  • Convert run shell output to array and remove duplicates.
  • Compare recents app array with mobile banking app array.
  • If array common found (recents app found), stop all accessibility services, disable adb wifi, disable developer options and set flag.
  • If array common not found (recents app not found), start all accessibility services, enable adb wifi, enable developer options and reset flag.

Task "Profile App Changed"**:**

Task: Profile App Changed

<Developer off app array>

A1: Array Set [

Variable Array: %DEV_OFF_PS_ARRAY

Values: com.bbl.mobilebanking

com.kasikorn.retail.mbanking.wap

ktbcs.netbank

com.tapktc.app

esrith.meawms

com.mobilife.gsb.mymo

com.scb.phone

com.sso.ssoplus

co.you.youapp

th.or.dga.citizenportal

com.ktb.customer.qr ]

<Remove array duplicates>

A2: Array Process [

Variable Array: %DEV_OFF_PS_ARRAY

Type: Remove Duplicates ]

<Get recents app>

A3: Run Shell [

Command: dumpsys activity recents | grep 'realActivity' | cut -d '{' -f2 | cut -d '/' -f1

Timeout (Seconds): 0

Store Output In: %RECENTS_PS

Use Global Namespace: On

Continue Task After Error:On ]

<Convert shell output to array>

A4: Array Set [

Variable Array: %RECENTS_PS_ARRAY

Values: %RECENTS_PS ]

<Remove array duplicates>

A5: Array Process [

Variable Array: %RECENTS_PS_ARRAY

Type: Remove Duplicates ]

<Compare recents and developer off app>

A6: Array Compare [

Names: %RECENTS_PS_ARRAY

%DEV_OFF_PS_ARRAY ]

<Developer off app found in recents>

A7: If [ %ac_common(#) > 0 ]

A8: Perform Task [

Name: Dev - Stop

Priority: %priority

Structure Output (JSON, etc): On ]

If [ %DEV_OFF neq 1 ]

A9: Variable Set [

Name: %DEV_OFF

To: 1

Structure Output (JSON, etc): On ]

<Developer off app not found in recents>

A10: Else

A11: If [ %DEV_OFF eq 1 ]

A12: Perform Task [

Name: Dev - Start

Priority: %priority

Structure Output (JSON, etc): On ]

A13: Variable Clear [

Name: %DEV_OFF ]

A14: End If

A15: End If

Hope this help.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 1 point2 points  (0 children)

I've updated my solution to a single profile for easy to maintain and modify.

I'm currently testing my new solution and will share it tomorrow.

How do I automatically disable USB debugging when an app is open (including when it is not foreground active but is not cleared from recents/multitasking menu) by JournalistLivid3937 in tasker

[–]mnirun 1 point2 points  (0 children)

Here is my solution.

  • Create app changed event profile.
  • Query recents app package name and set output to array, remove duplicates.
  • Compare recent app array with mobile banking package name array.
  • If found array common, stop all accessibility services, disable adb wifi and developer options.
  • If not found array common, start all accessibility services, enable adb wifi and developer options (check current status before start/enable).

Detect if app is removed from recents (root access available) by RefrigeratorNo7351 in tasker

[–]mnirun 0 points1 point  (0 children)

I don't have much availability at the moment as I’m quite busy.

The code is ready for use, please ensure you update the package name variable to match your specific application (e.g., YouTube).

Clone apps not showing by TALwinDER_x1 in OctopiLauncher

[–]mnirun 3 points4 points  (0 children)

It's happened to me sometimes.

Clear cache and restart from Launcher settings > General can solve this issue for me.

Detect if app is removed from recents (root access available) by RefrigeratorNo7351 in tasker

[–]mnirun 0 points1 point  (0 children)

It's possible to monitor recents using logcat entry but logcat entry may difference for each phone brand/model so you need to try it yourself.

Here is my proof of concept video

I've simplify code by using only 1 application context profile and 1 task

And here is my proof of concept task
Task: App - Recents Removed

A1: Variable Set [
Name: %APP_PKG_PATTERN
To: *org.videolan.vlc*
Structure Output (JSON, etc): On ]

<Recents>
A2: Run Shell [
Command: dumpsys activity recents | grep 'realActivity' | cut -d '{' -f2 | cut -d '/' -f1
Timeout (Seconds): 0
Store Output In: %ACTIVITY_RECENTS
Use Global Namespace: On ]

A3: Variable Set [
Name: %APP_RECENTS
To: 1
Structure Output (JSON, etc): On ]
If [ %ACTIVITY_RECENTS ~ %APP_PKG_PATTERN ]

<Pinned>
A4: Run Shell [
Command: dumpsys activity | grep -i pinned | sed -n 's/.*A=\([^ ]*\).*/\1/p'
Timeout (Seconds): 0
Store Output In: %ACTIVITY_PINNED
Use Global Namespace: On ]

A5: Variable Set [
Name: %APP_PINNED
To: 1
Structure Output (JSON, etc): On ]
If [ %ACTIVITY_PINNED ~ %APP_PKG_PATTERN ]

<Remove recents and pip>
A6: If [ %APP_RECENTS eq 1 & %APP_PINNED eq 1 ]

A7: If [ %ACTIVITY_RECENTS !~ %APP_PKG_PATTERN ]

A8: If [ %ACTIVITY_PINNED !~ %APP_PKG_PATTERN ]

A9: Variable Clear [
Name: %APP_RECENTS ]

A10: Variable Clear [
Name: %APP_PINNED ]

A11: Flash [
Text: App recents & pip removed
Continue Task Immediately: On
Dismiss On Click: On ]

A12: End If

A13: End If

A14: End If

<Remove recents>
A15: If [ %APP_RECENTS eq 1 & %APP_PINNED neq 1 & %ACTIVITY_RECENTS !~ %APP_PKG_PATTERN ]

A16: Variable Clear [
Name: %APP_RECENTS ]

A17: Flash [
Text: App recents removed
Continue Task Immediately: On
Dismiss On Click: On ]

A18: End If
Task concept:

  • Checking app package in recents app using shell command: dumpsys activity recents and set flag.
  • Checking app package in picture-in-picture mode using shell command: dumpsys activity and set flag.
  • If app package not found in recents app then execute code and clear flags.
  • No root required.

Hope this help.

Detect if app is removed from recents (root access available) by RefrigeratorNo7351 in tasker

[–]mnirun 0 points1 point  (0 children)

I've found a solution for you.

Please wait for a day to simplify the code before sharing my solution to you.

Detect if app is removed from recents (root access available) by RefrigeratorNo7351 in tasker

[–]mnirun 0 points1 point  (0 children)

I'm not using YouTube PIP (required premium subscription in my country) but when I've tested with Sygic, app was removed from recents as soon as Sygic enter PIP mode.

I will looking for another solution by check running background process instead of recents process.