
how would i iterate over all of them? I mean i get that i would have to use the
Code: Select all
*ByIdAndIndex...
Moderator: Martin
Code: Select all
*ByIdAndIndex...
Code: Select all
{
"[1] Rotation Control": "Yes",
"[2] SCR Pro": "Yes",
"[3] Skype": "Yes",
"[4] SuperSU": "Yes",
"[5] SWF Player Free": "No",
"[6] TalkBack": "Yes",
"[7] TeamSpeak": "Yes",
"[8] TeamSpeak": "No",
"[9] Telegram X": "No",
"[10] Twitch": "Yes",
"[11] Twitter": "Yes",
"[12] VLC": "No",
"[13] Xbox beta": "No",
"[14] XNotifications": "Yes",
"[15] YouTube Vanced": "No"
}
Code: Select all
//value = existsElementById("android:id/list");
exists = existsElementByIdAndIndex("android:id/title", step);
if (!exists) {
scrollForwardByIdAndIndex("android:id/title", step-1);
sleep(1000);
exists = existsElementByIdAndIndex("android:id/title", step);
if (!exists) return;
}
title = getTextByIdAndIndex("android:id/title", step);
enabled = getTextByIdAndIndex("com.android.settings:id/widget_text1", step);
items = addMapEntry(items, "[{step}] "+title, enabled);
Code: Select all
sleep(500);
list = newList();
scroll = 0;
id = "android:id/title";
while(scroll < 100) //set a max scroll so no infinite loop
{
index = 0; temp = newList();
//loop over the whole index on screen, usually it is 8-15 item per screen
while(getTextByIdAndIndex(id, index) != null)
{
addElement(temp, getTextByIdAndIndex(id, index));
index = index + 1;
}
//if no element found, id must be wrong, stop immediately
if(isEmpty(temp))
break;
//find the next element in previous element index, in reverse
dup = indexOfElement(reverse(copyList(list)), temp[0]);
end = length(temp) - 1; //save the length first, before removing elements
removeElements(temp, 0, dup+1);
if(dup >= 2)
scroll = 100; //stop until this iteration if it reach end of scroll
addAllElements(list, temp);
//add the action to iterate here
for(i in [dup+1 to end])
{
clickByIdAndIndex(id, i);
sleep(100);
clickById("android:id/switch_widget");
sleep(100);
back();
sleep(100);
}
scrollForwardById(id);
scroll = scroll + 1;
sleep(200); //don't set this too low, otherwise the script don't have enough time to capture the text
}
Code: Select all
[
"AdGuard",
"Adobe AIR",
"AndChat",
"Android System WebView",
"App Settings",
"ARP Guard (WiFi Security)",
"Authenticator",
"Automagic Premium",
"Better Open With",
"BoxToGo Pro",
"burning series",
"Caffeine",
"Calculator",
"Calendar",
"Camera"
]
Code: Select all
if(dup >= temp - 1)
scroll = 100; //stop until this iteration if it reach end of scroll