djiedjee schreef op donderdag 13 april 2017 @ 15:21:
Toestel is niet geroot. Voor het doorschakelen van de sim maak ik daarom, naast tasker, gebruik van auto-input voor het op "OK" klikken en zo. Doorschakeling opheffen is ongeveer hetzelfde, alleen dan ##21# bellen.
SetSync scriptje/taak voor synchronisatie aan/uit vond ik op internet. Parameter 0 is uitzetten, vervangen door 1 om aan te zetten.
Alvast sorry voor de grote lap tekst.
<Task sr="task11">
<cdate>1487088436975</cdate>
<edate>1492088177166</edate>
<id>11</id>
<nme>Werkmail Sync Uit</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>130</code>
<Str sr="arg0" ve="3">SetSync</Str>
<Int sr="arg1">
<var>%priority + 1</var>
</Int>
<Str sr="arg2" ve="3">xxxxx<accountnaam>@gmail.com|com.google|0</Str>
<Str sr="arg3" ve="3">gmail-ls</Str>
<Str sr="arg4" ve="3"/>
<Int sr="arg5" val="0"/>
</Action>
<Task sr="task10">
<cdate>1421152249368</cdate>
<edate>1490290714011</edate>
<id>10</id>
<nme>SetSync</nme>
<pri>10</pri>
<Action sr="act0" ve="7">
<code>300</code>
<label>Example:
<br>
%par1: mymail@gmail.com|com.google|1
<br>
%par2: gmail-ls,com.android.calendar,com.android.contacts</label>
</Action>
<Action sr="act1" ve="7">
<code>37</code>
<ConditionList sr="if">
<bool0>And</bool0>
<Condition sr="c0" ve="3">
<lhs>%par1</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%par2</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act10" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">set %auth(%item) to %sync</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act11" ve="7">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%sync</lhs>
<op>2</op>
<rhs>1</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act12" ve="7">
<code>664</code>
<label>make sure it shows up in the accounts screen</label>
<se>false</se>
<Str sr="arg0" ve="3">%sync</Str>
<Str sr="arg1" ve="3">ContentResolver</Str>
<Str sr="arg2" ve="3">setIsSyncable
{} (Account, String, int)</Str>
<Str sr="arg3" ve="3">myaccount</Str>
<Str sr="arg4" ve="3">%auth(%item)</Str>
<Str sr="arg5" ve="3">1</Str>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act13" ve="7">
<code>664</code>
<se>false</se>
<Str sr="arg0" ve="3">%sync</Str>
<Str sr="arg1" ve="3">ContentResolver</Str>
<Str sr="arg2" ve="3">setSyncAutomatically
{} (Account, String, boolean)</Str>
<Str sr="arg3" ve="3">myaccount</Str>
<Str sr="arg4" ve="3">%auth(%item)</Str>
<Str sr="arg5" ve="3">true</Str>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act14" ve="7">
<code>43</code>
</Action>
<Action sr="act15" ve="7">
<code>664</code>
<se>false</se>
<Str sr="arg0" ve="3">%sync</Str>
<Str sr="arg1" ve="3">ContentResolver</Str>
<Str sr="arg2" ve="3">setSyncAutomatically
{} (Account, String, boolean)</Str>
<Str sr="arg3" ve="3">myaccount</Str>
<Str sr="arg4" ve="3">%auth(%item)</Str>
<Str sr="arg5" ve="3">false</Str>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act16" ve="7">
<code>38</code>
</Action>
<Action sr="act17" ve="7">
<code>40</code>
</Action>
<Action sr="act18" ve="7">
<code>38</code>
</Action>
<Action sr="act2" ve="7">
<code>590</code>
<Str sr="arg0" ve="3">%par1</Str>
<Str sr="arg1" ve="3">|</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act3" ve="7">
<code>547</code>
<label>from AccountManager</label>
<Str sr="arg0" ve="3">%name</Str>
<Str sr="arg1" ve="3">%par11</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="7">
<code>547</code>
<label>from AccountManager or SyncAdapterType</label>
<Str sr="arg0" ve="3">%type</Str>
<Str sr="arg1" ve="3">%par12</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act5" ve="7">
<code>547</code>
<label>1 or 0</label>
<Str sr="arg0" ve="3">%sync</Str>
<Str sr="arg1" ve="3">%par13</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act6" ve="7">
<code>547</code>
<label>from SyncAdapterType</label>
<Str sr="arg0" ve="3">%auth</Str>
<Str sr="arg1" ve="3">%par2</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act7" ve="7">
<code>664</code>
<se>false</se>
<Str sr="arg0" ve="3">myaccount</Str>
<Str sr="arg1" ve="3">Account</Str>
<Str sr="arg2" ve="3">new
{Account} (String, String)</Str>
<Str sr="arg3" ve="3">%name</Str>
<Str sr="arg4" ve="3">%type</Str>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act8" ve="7">
<code>590</code>
<Str sr="arg0" ve="3">%auth</Str>
<Str sr="arg1" ve="3">,</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act9" ve="7">
<code>39</code>
<Str sr="arg0" ve="3">%item</Str>
<Str sr="arg1" ve="3">1:%auth(#)</Str>
</Action>
</Task>
<Task sr="task15">
<cdate>1487255104296</cdate>
<edate>1487258422840</edate>
<id>15</id>
<nme>WerkSIM Doorschakelen</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>90</code>
<Str sr="arg0" ve="3">**21*+316<mobielnr>#</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act1" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>1732635924</code>
<Bundle sr="arg0">
<Vals sr="val">
<ActionId>540,891</ActionId>
<ActionId-type>java.lang.String</ActionId-type>
<ActionType>16</ActionType>
<ActionType-type>java.lang.String</ActionType-type>
<FieldSelectionType>5</FieldSelectionType>
<FieldSelectionType-type>java.lang.String</FieldSelectionType-type>
<IsFirstAction>false</IsFirstAction>
<IsFirstAction-type>java.lang.Boolean</IsFirstAction-type>
<IsTaskerAction>false</IsTaskerAction>
<IsTaskerAction-type>java.lang.Boolean</IsTaskerAction-type>
<NearbyText>Werk</NearbyText>
<NearbyText-type>java.lang.String</NearbyText-type>
<StoredAction><null></StoredAction>
<StoredAction-type>java.lang.String</StoredAction-type>
<TextToWrite><null></TextToWrite>
<TextToWrite-type>java.lang.String</TextToWrite-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Type: Point
Value: 540,891
Nearby Text: Werk
Action : Click
Is Tasker Action: false
Check Screen State: false</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%err
Error Code
Only available if you select <b>Continue Task After Error</b> and the action ends in error</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1>%errmsg
Error Message
Only available if you select <b>Continue Task After Error</b> and the action ends in error</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>TextToWrite StoredAction ActionId RecentFieldIds FieldSelectionType ActionType ActionTimeout NearbyText plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<plugininstanceid>5dfa53ec-14fc-4a58-ac14-b9e5f33d06a9</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autoinput.intent.IntentPerformAction</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autoinput</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autoinput.activity.ActivityConfigPerformAction</Str>
<Int sr="arg3" val="20"/>
</Action>
<Action sr="act3" ve="7">
<code>1732635924</code>
<Bundle sr="arg0">
<Vals sr="val">
<ActionId>OK</ActionId>
<ActionId-type>java.lang.String</ActionId-type>
<ActionType>16</ActionType>
<ActionType-type>java.lang.String</ActionType-type>
<FieldSelectionType>0</FieldSelectionType>
<FieldSelectionType-type>java.lang.String</FieldSelectionType-type>
<IsFirstAction>false</IsFirstAction>
<IsFirstAction-type>java.lang.Boolean</IsFirstAction-type>
<IsTaskerAction>false</IsTaskerAction>
<IsTaskerAction-type>java.lang.Boolean</IsTaskerAction-type>
<NearbyText><null></NearbyText>
<NearbyText-type>java.lang.String</NearbyText-type>
<StoredAction><null></StoredAction>
<StoredAction-type>java.lang.String</StoredAction-type>
<TextToWrite><null></TextToWrite>
<TextToWrite-type>java.lang.String</TextToWrite-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Type: Text
Value: OK
Action : Click
Is Tasker Action: false
Check Screen State: false</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES><StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%err
Error Code
Only available if you select <b>Continue Task After Error</b> and the action ends in error</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1>%errmsg
Error Message
Only available if you select <b>Continue Task After Error</b> and the action ends in error</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1></StringArray></net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>TextToWrite StoredAction ActionId RecentFieldIds FieldSelectionType ActionType ActionTimeout NearbyText plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<plugininstanceid>d28a27ce-ed27-4b92-97cf-8453a5ee1cb1</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autoinput.intent.IntentPerformAction</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autoinput</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autoinput.activity.ActivityConfigPerformAction</Str>
<Int sr="arg3" val="20"/>
</Action>