[Magisk] fOmey:
Still using the method I posted a while back, still works great... I'm using a Galaxy S6..

I also made a root switch tasker script that I use to toggle root & xposed status.. I've included three tasker actions, "Toggle xposed", "Toogle root" & "Root switch - which simply runs both actions toggle root & toggle xposed at once..

I thought I would share my tasker XML & descriptions if anyone was interested.. if you intend on using tasker to toggle your root status, I highly recommend you do not use root switch app at the same time. There is a chance they will be become unsynced and you will be attempting to turn off root when its already disabled for example.. tasker only tracks root status using variables, its a pretty stupid script.. may consider coding a standalone app. although for my use this works just fine.

<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task4">
<cdate>1477899181357</cdate>
<edate>1479165374128</edate>
<id>4</id>
<nme>Toggle Xposed</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%XposedStatus</lhs>
<op>0</op>
<rhs>true</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%XposedStatus</Str>
<Str sr="arg1" ve="3">false</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act10" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>true</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act11" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">su -c "/data/user/0/com.corner23.android.rootswitch/files/enableXposed.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act12" ve="7">
<code>43</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>false</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act13" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/enableXposed.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act14" ve="7">
<code>38</code>
</Action>
<Action sr="act15" ve="7">
<code>38</code>
</Action>
<Action sr="act2" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>true</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act3" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">su -c "/data/user/0/com.corner23.android.rootswitch/files/disableXposed.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act4" ve="7">
<code>43</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>false</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act5" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/disableXposed.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act6" ve="7">
<code>38</code>
</Action>
<Action sr="act7" ve="7">
<code>38</code>
</Action>
<Action sr="act8" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%XposedStatus</lhs>
<op>0</op>
<rhs>false</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act9" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%XposedStatus</Str>
<Str sr="arg1" ve="3">true</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Img sr="icn" ve="2">
<cls>com.zavukodlak.candycons.HomeActivity</cls>
<pkg>com.zavukodlak.candycons</pkg>
</Img>
</Task>
</TaskerData>

<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task5">
<cdate>1477899181357</cdate>
<edate>1479165379816</edate>
<id>5</id>
<nme>Toggle Root</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>false</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%RootStatus</Str>
<Str sr="arg1" ve="3">true</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/enable.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act3" ve="7">
<code>43</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%RootStatus</lhs>
<op>0</op>
<rhs>true</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act4" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%RootStatus</Str>
<Str sr="arg1" ve="3">false</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act5" ve="7">
<code>123</code>
<Str sr="arg0" ve="3">su sh "/data/user/0/com.corner23.android.rootswitch/files/disable.sh"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act6" ve="7">
<code>38</code>
</Action>
<Img sr="icn" ve="2">
<cls>com.zavukodlak.candycons.HomeActivity</cls>
<pkg>com.zavukodlak.candycons</pkg>
</Img>
</Task>
</TaskerData>

<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task6">
<cdate>1479090983198</cdate>
<edate>1479165158110</edate>
<id>6</id>
<nme>Root Switch</nme>
<Action sr="act0" ve="7">
<code>130</code>
<Str sr="arg0" ve="3">Toggle Root</Str>
<Int sr="arg1">
<var>%priority</var>
</Int>
<Str sr="arg2" ve="3"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Int sr="arg5" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>130</code>
<Str sr="arg0" ve="3">Toggle Xposed</Str>
<Int sr="arg1">
<var>%priority</var>
</Int>
<Str sr="arg2" ve="3"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Int sr="arg5" val="0"/>
</Action>
<Img sr="icn" ve="2">
<cls>com.zavukodlak.candycons.HomeActivity</cls>
<pkg>com.zavukodlak.candycons</pkg>
</Img>
</Task>
</TaskerData>

Toggle Xposed (4)
A1: If [ %XposedStatus eq true ]
A2: Variable Set [ Name:%XposedStatus To:false Do Maths:eek:ff Append:eek:ff ]
A3: If [ %RootStatus eq true ]
A4: Run Shell [ Command:su -c "/data/user/0/com.corner23.android.rootswitch/files/disableXposed.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A5: Else If [ %RootStatus eq false ]
A6: Run Shell [ Command:/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/disableXposed.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A7: End If
A8: End If
A9: If [ %XposedStatus eq false ]
A10: Variable Set [ Name:%XposedStatus To:true Do Maths:eek:ff Append:eek:ff ]
A11: If [ %RootStatus eq true ]
A12: Run Shell [ Command:su -c "/data/user/0/com.corner23.android.rootswitch/files/enableXposed.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A13: Else If [ %RootStatus eq false ]
A14: Run Shell [ Command:/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/enableXposed.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A15: End If
A16: End If

Toggle Root (5)
A1: If [ %RootStatus eq false ]
A2: Variable Set [ Name:%RootStatus To:true Do Maths:eek:ff Append:eek:ff ]
A3: Run Shell [ Command:/oem/bin/su -c "/data/data/com.corner23.android.rootswitch/files/enable.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A4: Else If [ %RootStatus eq true ]
A5: Variable Set [ Name:%RootStatus To:false Do Maths:eek:ff Append:eek:ff ]
A6: Run Shell [ Command:su sh "/data/user/0/com.corner23.android.rootswitch/files/disable.sh" Timeout (Seconds):0 Use Root:eek:ff Store Output In: Store Errors In: Store Result In: ]
A7: End If

Root Switch (6)
A1: Perform Task [ Name:Toggle Root Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:eek:ff ]
A2: Perform Task [ Name:Toggle Xposed Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:eek:ff ]