Autotools Accessibility toggle per service.

Discussion in 'App/Feature Suggestion' started by aillez, Dec 12, 2018.

  1. aillez

    aillez New Member

    Joined:
    May 15, 2017
    Messages:
    7
    Likes Received:
    0
    Hi Dev,
    I've posted this on Google+ community (here) but not get a response from you. So, I assumed you don't regularly check that anymore.

    Is it possible to implement Enable/Disable accessibility per app.
    I know that Autotools Secure setting can enable/disable accessibility service but it should select all of the services that need to be enable/disable but Secure setting (old tasker plugin) can do that.

    Please see screenshot.

    [​IMG]

    [​IMG]

    Best regards,
    Watcharin L.
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,721
    Likes Received:
    737
    Hi there. You could use the Custom Setting action to change the value of those directly. That way you can add or remove the ones you want.
     
  3. aillez

    aillez New Member

    Joined:
    May 15, 2017
    Messages:
    7
    Likes Received:
    0
    Thank you for your reply but like I said in Custom Setting it will show all enabled service but if I want to just toggle one accessibility service event though in that time what already enabled.

    for example.

    2 scenario and I want to enable AutoInput Accessibility.
    1st scenario.
    All enable accessibility are Tasker, Nova Launcher, Greenify, LastPass

    enabled_accessibility_services will be

    com.oasisfeng.greenify/com.oasisfeng.greenify.AccessibilityDispatcher:net.dinglisch.android.taskerm/net.dinglisch.android.taskerm.MyAccessibilityService:com.lastpass.lpandroid/com.lastpass.lpandroid.service.LPAccessibilityService:com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaAccessibilityService:com.joaomgcd.autoinput/com.joaomgcd.autoinput.service.ServiceAccessibility


    2nd scenario
    All enable accessibility are Tasker, Nova Launcher

    net.dinglisch.android.taskerm/net.dinglisch.android.taskerm.MyAccessibilityService:com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaAccessibilityService:com.joaomgcd.autoinput/com.joaomgcd.autoinput.service.ServiceAccessibility

    So, I need to specify all service in Tasker.

    I hope you understand what I trying to say.

    Thank you.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,721
    Likes Received:
    737
    What you need to do is read the current services, then if they don't include the one you want, add it to the list and then re-set the services :)
     
  5. aillez

    aillez New Member

    Joined:
    May 15, 2017
    Messages:
    7
    Likes Received:
    0
    Oh..Thank you for guiding me.
    I've successfully done this.

    Finally, I can deleted old secure setting plugin.



    Sent from my ONEPLUS A5010 using Tapatalk
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,721
    Likes Received:
    737
  7. K-J

    K-J New Member

    Joined:
    Aug 7, 2019
    Messages:
    1
    Likes Received:
    0
    Would you @aillez mind telling me how you made this work? I think I got a task running that has the values for the toggle enable but cannot figure out how to read it to reset it.
     
  8. aillez

    aillez New Member

    Joined:
    May 15, 2017
    Messages:
    7
    Likes Received:
    0
    Here you can try to look at this.
    This is the task I use to enable AutoInput Accessibility Service.

    Code (Text):

        Autoinput_Accessibilty--On (238)
            A1: [X] Flash [ Text:Enabling AutoInput Long:Off ]
            A2: Perform Task [ Name:Accessibility__Set_Variable Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
            <Read Accessibility Service>
            A3: Custom Setting [ Type:Secure Name:enabled_accessibility_services Value: Use Root:Off Read Setting To:%Enabled_Accessibility_Services ]
            A4: [X] Flash [ Text:%Enabled_Accessibility_Services Long:Off ]
            A5: [X] Set Clipboard [ Text:%Enabled_Accessibility_Services Add:Off ]
            <Set "BEFORE" Variable>
            A6: Variable Set [ Name:%Enabled_Accessibility_Services_Before To:%Enabled_Accessibility_Services Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
            A7: [X] Popup [ Title: Text:%Enabled_Accessibility_Services_Before Background Image: Layout:popup Timeout (Seconds):5 Show Over Keyguard:On ]
            <Set "AFTER" Variable: DEPEND ON SERVICE NEED TO ENABLE>
            A8: Variable Set [ Name:%Enabled_Accessibility_Services_After To:%Enabled_Accessibility_Services:%Accessibility_Name_Autoinput Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
            A9: [X] Popup [ Title: Text:%Enabled_Accessibility_Services_After Background Image: Layout:popup Timeout (Seconds):5 Show Over Keyguard:On ]
            <Write Accessibility Service>
            A10: Custom Setting [ Type:Secure Name:enabled_accessibility_services Value:%Enabled_Accessibility_Services_After Use Root:Off Read Setting To: ]
            <Clear variable>
            A11: [X] Variable Clear [ Name:%Enabled_Accessibility_Se* Pattern Matching:On Local Variables Only:Off ]
            A12: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
            A13: Variable Set [ Name:%AutoinputServiceStatus To:eek:n Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:0 ]
     
    and when I want to disable AutoInput Accessibility Service.
    I run another task here.

    Code (Text):

        Autoinput_Accessibilty--Off (241)
            A1: [X] Flash [ Text:Disabling AutoInput Long:Off ]
            A2: Perform Task [ Name:Accessibility__Set_Variable Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
            <Read Accessibility Service>
            A3: Custom Setting [ Type:Secure Name:enabled_accessibility_services Value: Use Root:Off Read Setting To:%Enabled_Accessibility_Services ]
            <Set "BEFORE" Variable>
            A4: Variable Set [ Name:%Enabled_Accessibility_Services_Before To:%Enabled_Accessibility_Services Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:0 ]
            <Search for AutoInput service.>
            A5: Variable Search Replace [ Variable:%Enabled_Accessibility_Services_Before Search:%Accessibility_Name_Autoinput Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array:%Match Replace Matches:Off Replace With: ]
            <Set "AFTER" Variable: DEPEND ON SERVICE NEED TO ENABLE>
            A6: Variable Set [ Name:%Enabled_Accessibility_Services_After To:%Enabled_Accessibility_Services_Before Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:0 ]
            A7: If [ %Match1 Set ]
            <Remove AutoInput service>
            A8: Variable Search Replace [ Variable:%Enabled_Accessibility_Services_After Search:%Accessibility_Name_Autoinput Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With: ]
            <Remove Left over :>
            A9: Variable Search Replace [ Variable:%Enabled_Accessibility_Services_After Search:\:{2,10} Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With: ]
            A10: [X] Set Clipboard [ Text:Before
     
        %Enabled_Accessibility_Services_Before
     
     
        after
     
        %Enabled_Accessibility_Services_After Add:Off ]
            A11: [X] Stop [ With Error:Off Task: ]
            A12: [X] Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
            A13: End If
            <Write Accessibility Service>
            A14: Custom Setting [ Type:Secure Name:enabled_accessibility_services Value:%Enabled_Accessibility_Services_After Use Root:Off Read Setting To: ]
            <Clear variable>
            A15: Variable Clear [ Name:%Enabled_Accessibility_Se* Pattern Matching:On Local Variables Only:Off ]
            A16: Array Clear [ Variable Array:%Match ]
            A17: Variable Set [ Name:%AutoinputServiceStatus To:eek:ff Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:0 ]
     
    hopes this help.
     

Share This Page