-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADBDroid.json
134 lines (132 loc) · 10.3 KB
/
ADBDroid.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{ "name":"ADBdroid",
"manufacturer":"TonO",
"type":"TV",
"version":8,
"variables": {"MYRESULT":""},
"discover":{
"welcomeheadertext":"Choose your Android Instance",
"welcomedescription":"Developed by TonO",
"initcommandset": [
{
"type": "mDNS",
"command": "",
"queryresult": ["$.*[?(@property === 'ip')]^"],
"evalwrite":[
{"variable":"MYRESULT","value":"DYNAMIK (\"$Result\")"}]
}
],
"command": {"type":"static", "command":"DYNAMIK var Discovered = $MYRESULT;for (var i=0;i<Discovered.length;i++) if (Discovered[i].ip==undefined) Discovered.splice(i, 1);Discovered.sort((a, b) => {return a.ip.split('.')[0] - b.ip.split('.')[0] || a.ip.split('.')[1] - b.ip.split('.')[1] || a.ip.split('.')[2] - b.ip.split('.')[2] || a.ip.split('.')[3] - b.ip.split('.')[3]}) ;var LastIP = Discovered[0].ip;for (i=1;i<Discovered.length;i++) if (Discovered[i].ip==LastIP) {Discovered.splice(i, 1);i--} else LastIP = Discovered[i].ip;Discovered",
"queryresult":[""]
}
},
"template" : {
"name": "ADBdroid",
"type":"TV",
"dynamicname": "DYNAMIK_INST_START DYNAMIK \"ADB \"+ JSON.parse(\"$Result\").ip DYNAMIK_INST_END",
"dynamicid": "DYNAMIK_INST_START DYNAMIK JSON.parse(\"$Result\").ip DYNAMIK_INST_END",
"manufacturer": "TonO",
"version": 7,
"listeners" : {
},
"variables":{
"ADBTarget":"DYNAMIK_INST_START DYNAMIK \"/adb?host=\"+ JSON.parse(\"$Result\").ip DYNAMIK_INST_END",
"ADBDisconnect":"DYNAMIK_INST_START DYNAMIK \"/disconnectadb?host=\"+ JSON.parse(\"$Result\").ip DYNAMIK_INST_END",
"ADBTargetMAC":"DYNAMIK_INST_START DYNAMIK JSON.parse(\"$Result\").mac DYNAMIK_INST_END",
"PythonDriver":"http://localhost:5384",
"ADBTargetPORT":"5555",
"MyStatus":"",
"ADBKeyCMD": "&command=input keyevent ",
"ADBAPPCMD": "&command=",
"ADBRunAsRoot":"&runasroot=yes",
"INTENT_LAUNCH" : "android.intent.category.LAUNCHER",
"App_Start": "monkey -p $MyAPP -c android.intent.category.LAUNCHER 1",
"App_Stop" : "am force-stop",
"KODI-start": "monkey -p org.xbmc.kodi -c android.intent.category.LAUNCHER 1",
"KODI-stop": "am force-stop org.xbmc.kodi",
"Status":"",
"ActionStatus":"",
"Power": 26,
"Sleep": 223,
"Play Pause": 85,
"Play": 126,
"Pause": 127,
"ChannelUp":166,
"ChannelDown":167,
"VolumeUp": 24,
"VolumeDown": 25,
"Home": 3,
"MuteToggle":91,
"Back":4,
"Menu": 1,
"KEY": "input keyevent ",
"FunctionGreen":184,
"FunctionRed":183,
"FunctionBlue":186,
"FunctionYellow":185,
"Digit0":7,
"Digit1":8,
"Digit2": 9,
"Digit3": 10,
"Digit4": 11,
"Digit5": 12,
"Digit6": 13,
"Digit7": 14,
"Digit8": 15,
"Digit9": 16,
"CursorDown": 20,
"CursorUp":19,
"CursorLeft": 21,
"CursorRight": 22,
"CursorEnter": 66,
"CURRENT_APP_CMD" : "dumpsys window windows | grep mCurrentFocus"
},
"labels":{
"Status" : {"label":"ActionStatus", "listen":"ActionStatus", "actionlisten":"ActionStatus"}
},
"buttons":{
"Wake up": {"tpe": "wol","command":"$ADBTargetMAC"},
"POWER ON": {"type":"static","command":"","evaldo":[{"test":true,"then": "__INITIALISE"}]},
"POWER OFF": {"type":"static","command":"",
"evaldo":[
{"test":true,"then": "Disconnect"},
{"test":true,"then": "__CLEANUP"}]},
"__INITIALISE": {"type":"static","command":""},
"Power Toggle": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Power", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CURSOR UP": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$CursorUp", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CURSOR DOWN": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$CursorDown", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CURSOR LEFT": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$CursorLeft", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CURSOR RIGHT": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$CursorRight", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CURSOR ENTER": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$CursorEnter", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CHANNEL UP": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$ChannelUp", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"CHANNEL DOWN": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$ChannelDown", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"HOME": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Home", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"VOLUME UP": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$VolumeUp", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"VOLUME DOWN": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$VolumeDown", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"PLAY": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Play", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"PAUSE": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Pause", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"STOP": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Stop", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"MENU": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Menu", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"BACK": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Back", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"FUNCTION RED": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$FunctionRed", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"FUNCTION GREEN": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$FunctionGreen", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"FUNCTION BLUE": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$FunctionBlue", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"FUNCTION YELLOW": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$FunctionYellow","queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"MUTE TOGGLE": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Mute", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 0": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit0", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 1": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit1", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 2": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit2", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 3": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit3", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 4": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit4", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 5": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit5", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 6": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit6", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 7": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit7", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 8": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit8", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"DIGIT 9": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Digit9", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"Sleep": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBKeyCMD$Sleep", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"Current APP": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBAPPCMD$CURRENT_APP_CMD","queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"Start KODI": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBAPPCMD$KODI-start", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"Stop KODI": {"type":"http-get", "command":"$PythonDriver/$ADBTarget$ADBAPPCMD$KODI-stop", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]},
"Disconnect": {"type":"http-get", "command":"$PythonDriver/$ADBDisconnect", "queryresult":"", "evalwrite":[{"variable": "ActionStatus","value": "$Result"}]}
}
}
}