remotedroid 0.5.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/remotedroid.rb +147 -20
- data/lib/remotedroid/client.rb +193 -6
- data/lib/remotedroid/control.rb +201 -4
- data/lib/remotedroid/query.rb +35 -0
- metadata +44 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f464457d6a2b72b862d9f461ce541e65a242c3ed1a0a92c24223c5a6b917969d
|
4
|
+
data.tar.gz: 93e362cc4b51741d7245bd68eaa5dd30fef270b7c92269243bd01bfa93f6e206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c018689e167a3ea7ba58d722b4a7964b7c7696c4f0aa4ba8be583deebd00f80c0353c787be91e2ba6a969d27de80f5a989685be238da808c231b0a0396ccaa
|
7
|
+
data.tar.gz: fe5f330c8958cb4bbe60b97ade143e85b6b2d3139240f0f73dd28ed5d8133222616460124e946a6e627d21681de7fb1a6fddb7ddbff845d3f66307c603a7a032
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/remotedroid.rb
CHANGED
@@ -45,6 +45,7 @@ require 'ruby-macrodroid'
|
|
45
45
|
# ## Camera/Photo
|
46
46
|
#
|
47
47
|
# * Take Picture
|
48
|
+
# * Take Screenshot
|
48
49
|
#
|
49
50
|
# ## Connectivity
|
50
51
|
#
|
@@ -66,7 +67,7 @@ require 'ruby-macrodroid'
|
|
66
67
|
#
|
67
68
|
# ## MacroDroid specific
|
68
69
|
#
|
69
|
-
# * Disable Macro
|
70
|
+
# * Enable/Disable Macro
|
70
71
|
#
|
71
72
|
# ## Media
|
72
73
|
#
|
@@ -79,7 +80,7 @@ require 'ruby-macrodroid'
|
|
79
80
|
# ## Screen
|
80
81
|
#
|
81
82
|
# * Keep Device Awake
|
82
|
-
# * Screen On
|
83
|
+
# * Screen On/Off
|
83
84
|
#
|
84
85
|
|
85
86
|
# Variables which can be queried
|
@@ -197,6 +198,137 @@ m: stay awake off
|
|
197
198
|
t: webhook
|
198
199
|
a: stay awake off
|
199
200
|
|
201
|
+
m: Media Next
|
202
|
+
t: webhook
|
203
|
+
a:
|
204
|
+
Media Next
|
205
|
+
Simulate Audio Button
|
206
|
+
|
207
|
+
m: Media Pause
|
208
|
+
t: webhook
|
209
|
+
a:
|
210
|
+
Media Pause
|
211
|
+
Simulate Audio Button
|
212
|
+
|
213
|
+
m: Media Play
|
214
|
+
t: webhook
|
215
|
+
a:
|
216
|
+
Media Play
|
217
|
+
Simulate Audio Button
|
218
|
+
|
219
|
+
m: Media Play Pause
|
220
|
+
t: webhook
|
221
|
+
a:
|
222
|
+
Media Play/Pause
|
223
|
+
Simulate Audio Button
|
224
|
+
|
225
|
+
m: Media Previous
|
226
|
+
t: webhook
|
227
|
+
a:
|
228
|
+
Media Previous
|
229
|
+
Simulate Audio Button
|
230
|
+
|
231
|
+
m: Media Stop
|
232
|
+
t: webhook
|
233
|
+
a:
|
234
|
+
Media Stop
|
235
|
+
Simulate Audio Button
|
236
|
+
|
237
|
+
m: Open website
|
238
|
+
v: url
|
239
|
+
t: webhook
|
240
|
+
a: goto [lv=url]
|
241
|
+
|
242
|
+
m: Fill clipboard
|
243
|
+
v: clipboard
|
244
|
+
t: webhook
|
245
|
+
a:
|
246
|
+
Fill Clipboard
|
247
|
+
[lv=clipboard]
|
248
|
+
|
249
|
+
m: click text content
|
250
|
+
v: content
|
251
|
+
t: webhook
|
252
|
+
a:
|
253
|
+
UI Interaction
|
254
|
+
Click [[lv=content]]
|
255
|
+
|
256
|
+
m: Launch by package
|
257
|
+
v: package
|
258
|
+
t: webhook
|
259
|
+
a: Launch [lv=package]
|
260
|
+
|
261
|
+
m: Take Screenshot
|
262
|
+
t: webhook
|
263
|
+
a:
|
264
|
+
Take Screenshot
|
265
|
+
Save to device
|
266
|
+
a: wait 2 seconds
|
267
|
+
a: webhook
|
268
|
+
|
269
|
+
m: Voice search
|
270
|
+
t: webhook
|
271
|
+
a: Voice search
|
272
|
+
|
273
|
+
m: Ask Alexa
|
274
|
+
t: webhook
|
275
|
+
a: shortcut Ask Alexa
|
276
|
+
|
277
|
+
m: Set Auto Rotate
|
278
|
+
v: state
|
279
|
+
t: webhook
|
280
|
+
a:
|
281
|
+
if state = 0
|
282
|
+
Auto Rotate On
|
283
|
+
Else If state = 1
|
284
|
+
Auto Rotate Off
|
285
|
+
Else If state = 2
|
286
|
+
Auto Rotate Toggle
|
287
|
+
end if
|
288
|
+
|
289
|
+
m: Set Bluetooth
|
290
|
+
v: state
|
291
|
+
t: webhook
|
292
|
+
a:
|
293
|
+
if state = 0
|
294
|
+
Enable Bluetooth
|
295
|
+
Else If state = 1
|
296
|
+
Disable Bluetooth
|
297
|
+
Else If state = 2
|
298
|
+
Toggle Bluetooth
|
299
|
+
Else If state = 3
|
300
|
+
Connect Audio Device
|
301
|
+
Else If state = 4
|
302
|
+
Disconnect Audio Device
|
303
|
+
end if
|
304
|
+
|
305
|
+
m: Set Airplane Mode
|
306
|
+
v: state
|
307
|
+
t: webhook
|
308
|
+
a:
|
309
|
+
if state = 0
|
310
|
+
Airplane Mode On
|
311
|
+
Else If state = 1
|
312
|
+
Airplane Mode Off
|
313
|
+
Else If state = 2
|
314
|
+
Airplane Mode Toggle
|
315
|
+
end if
|
316
|
+
|
317
|
+
m: Set Wifi
|
318
|
+
v: state
|
319
|
+
t: webhook
|
320
|
+
a:
|
321
|
+
if state = 0
|
322
|
+
Enable Wifi
|
323
|
+
Else If state = 1
|
324
|
+
Disable Wifi
|
325
|
+
Else If state = 2
|
326
|
+
Toggle Wifi
|
327
|
+
Else If state = 3
|
328
|
+
Connect to Network
|
329
|
+
end if
|
330
|
+
|
331
|
+
|
200
332
|
m: Share location
|
201
333
|
t:
|
202
334
|
WebHook
|
@@ -276,9 +408,12 @@ m: Power connected
|
|
276
408
|
t: Power Connected: Any
|
277
409
|
a: webhook
|
278
410
|
|
279
|
-
m:
|
411
|
+
m: Screen on
|
280
412
|
t: screen on
|
281
|
-
a:
|
413
|
+
a:
|
414
|
+
webhook
|
415
|
+
identifier: screen_on_off
|
416
|
+
screen_on: true
|
282
417
|
|
283
418
|
m: Power Button Toggle3
|
284
419
|
t: Power Button Toggle (3)
|
@@ -421,15 +556,8 @@ a:
|
|
421
556
|
identifier: flip_device
|
422
557
|
facedown: false
|
423
558
|
EOF
|
424
|
-
s="
|
425
|
-
|
426
|
-
|
427
559
|
|
428
560
|
|
429
|
-
|
430
|
-
|
431
|
-
"
|
432
|
-
|
433
561
|
module RemoteDroid
|
434
562
|
|
435
563
|
class Server
|
@@ -483,18 +611,17 @@ module RemoteDroid
|
|
483
611
|
context, json = msg.split(/:\s+/,2)
|
484
612
|
category, action = context.split('/',2)
|
485
613
|
|
486
|
-
|
614
|
+
h = JSON.parse(json, symbolize_names: true)
|
615
|
+
|
616
|
+
if action == 'force_macro_run' and h[:serverside] then
|
487
617
|
|
488
|
-
|
489
|
-
a
|
490
|
-
|
491
|
-
a.each do |msg|
|
492
|
-
self.notice 'macrodroid/action: ' + msg
|
493
|
-
end
|
618
|
+
a = @remote.run_macro(h)
|
619
|
+
a.each {|msg| self.notice 'macrodroid/action: ' + msg }
|
494
620
|
|
495
621
|
else
|
496
|
-
|
497
|
-
|
622
|
+
|
623
|
+
@remote.control.method(action.to_sym).call(h)
|
624
|
+
|
498
625
|
end
|
499
626
|
|
500
627
|
end
|
data/lib/remotedroid/client.rb
CHANGED
@@ -52,25 +52,100 @@ module RemoteDroid
|
|
52
52
|
|
53
53
|
# -- helpful methods -----------------
|
54
54
|
|
55
|
+
def ask_alexa()
|
56
|
+
control.ask_alexa
|
57
|
+
end
|
58
|
+
|
55
59
|
def battery()
|
56
60
|
query.battery
|
57
61
|
end
|
58
62
|
|
63
|
+
def bluetooth()
|
64
|
+
control.bluetooth
|
65
|
+
end
|
66
|
+
|
59
67
|
def cell_tower()
|
60
68
|
query.cell_tower
|
61
69
|
end
|
62
70
|
|
63
|
-
def
|
64
|
-
control.
|
71
|
+
def click(s)
|
72
|
+
control.click content: s
|
65
73
|
end
|
66
74
|
|
67
|
-
def
|
68
|
-
control.
|
75
|
+
def control_media(option='Play/Pause')
|
76
|
+
control.control_media({option: option})
|
77
|
+
end
|
78
|
+
|
79
|
+
def disable_airplane_mode()
|
80
|
+
control.disable_airplane_mode
|
81
|
+
end
|
82
|
+
|
83
|
+
def disable_bluetooth()
|
84
|
+
control.disable_bluetooth
|
69
85
|
end
|
70
86
|
|
87
|
+
def disable_macro(macro)
|
88
|
+
control.disable_macro macro
|
89
|
+
end
|
90
|
+
|
91
|
+
def disable_wifi()
|
92
|
+
control.disable_wifi
|
93
|
+
end
|
94
|
+
|
95
|
+
def enable_airplane_mode()
|
96
|
+
control.enable_airplane_mode
|
97
|
+
end
|
98
|
+
|
99
|
+
def enable_bluetooth()
|
100
|
+
control.enable_bluetooth
|
101
|
+
end
|
102
|
+
|
103
|
+
def enable_macro(macro)
|
104
|
+
control.enable_macro macro
|
105
|
+
end
|
106
|
+
|
107
|
+
def enable_wifi()
|
108
|
+
control.enable_wifi
|
109
|
+
end
|
110
|
+
|
111
|
+
def fill_clipboard(text)
|
112
|
+
control.fill_clipboard clipboard: text
|
113
|
+
end
|
114
|
+
|
115
|
+
alias copy fill_clipboard
|
116
|
+
|
71
117
|
def hotspot(state=nil)
|
72
118
|
control.hotspot state
|
119
|
+
end
|
120
|
+
|
121
|
+
def last_loc()
|
122
|
+
query.last_loc
|
123
|
+
end
|
124
|
+
|
125
|
+
def last_loc_link()
|
126
|
+
"<a href='%s' target='_blank'>map link</a>" % last_loc.link
|
73
127
|
end
|
128
|
+
|
129
|
+
def launch_activity(app)
|
130
|
+
|
131
|
+
package = APPS[app]
|
132
|
+
|
133
|
+
if package then
|
134
|
+
control.launch_package package: package
|
135
|
+
else
|
136
|
+
r = APPS.find {|k,v| k =~ /#{app}/i}
|
137
|
+
control.launch_package(package: r[1]) if r
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
def launch_package(name)
|
143
|
+
|
144
|
+
control.launch_package(package: name)
|
145
|
+
|
146
|
+
end
|
147
|
+
|
148
|
+
alias launch launch_activity
|
74
149
|
|
75
150
|
def location()
|
76
151
|
query.location
|
@@ -79,7 +154,6 @@ module RemoteDroid
|
|
79
154
|
def location_watch(refresh: '1 minute', interval: refresh,
|
80
155
|
duration: '30 minutes')
|
81
156
|
|
82
|
-
|
83
157
|
d = ChronicDuration.parse(duration)
|
84
158
|
seconds = ChronicDuration.parse(interval)
|
85
159
|
puts ("monitoring location every %s for %s" % [interval, duration]).info
|
@@ -99,10 +173,41 @@ module RemoteDroid
|
|
99
173
|
|
100
174
|
end
|
101
175
|
|
176
|
+
def open_website(url)
|
177
|
+
control.open_website url: url
|
178
|
+
end
|
179
|
+
|
180
|
+
alias goto open_website
|
181
|
+
alias visit open_website
|
182
|
+
|
183
|
+
def ip()
|
184
|
+
query.ip
|
185
|
+
end
|
186
|
+
|
187
|
+
def next()
|
188
|
+
control_media('Next')
|
189
|
+
end
|
190
|
+
|
191
|
+
def pause()
|
192
|
+
control_media('Pause')
|
193
|
+
end
|
194
|
+
|
195
|
+
def play()
|
196
|
+
control_media('Play')
|
197
|
+
end
|
198
|
+
|
199
|
+
def play_pause()
|
200
|
+
control_media('Play/Pause')
|
201
|
+
end
|
202
|
+
|
102
203
|
def photo()
|
103
204
|
take_picture
|
104
205
|
end
|
105
206
|
|
207
|
+
def previous()
|
208
|
+
control.control_media(option: 'Previous')
|
209
|
+
end
|
210
|
+
|
106
211
|
def say(text)
|
107
212
|
control.speak_text text
|
108
213
|
end
|
@@ -125,6 +230,22 @@ module RemoteDroid
|
|
125
230
|
screen :off
|
126
231
|
end
|
127
232
|
|
233
|
+
def set_auto_rotate(state=nil)
|
234
|
+
control.set_auto_rotate state
|
235
|
+
end
|
236
|
+
|
237
|
+
def set_auto_rotate_on()
|
238
|
+
control.set_auto_rotate 0
|
239
|
+
end
|
240
|
+
|
241
|
+
def set_auto_rotate_off()
|
242
|
+
control.set_auto_rotate 1
|
243
|
+
end
|
244
|
+
|
245
|
+
def set_auto_rotate_toggle()
|
246
|
+
control.set_auto_rotate 2
|
247
|
+
end
|
248
|
+
|
128
249
|
def stay_awake()
|
129
250
|
control.stay_awake
|
130
251
|
end
|
@@ -133,13 +254,20 @@ module RemoteDroid
|
|
133
254
|
control.stay_awake_off
|
134
255
|
end
|
135
256
|
|
257
|
+
alias awake_off stay_awake_off
|
258
|
+
|
259
|
+
def stop()
|
260
|
+
control_media(option: 'Stop')
|
261
|
+
end
|
262
|
+
|
136
263
|
def take_picture(ftp_src: nil, fileout: '.')
|
137
264
|
|
138
265
|
#screen.on
|
139
|
-
|
266
|
+
#launch 'camera'
|
140
267
|
|
141
268
|
if ftp_src then
|
142
269
|
|
270
|
+
r = query.take_picture
|
143
271
|
# give the device a second to write the image to file
|
144
272
|
sleep 1
|
145
273
|
|
@@ -149,12 +277,49 @@ module RemoteDroid
|
|
149
277
|
filename = ftp.ls.sort_by {|x| x[:ctime]}.last[:name]
|
150
278
|
ftp.cp filename, fileout
|
151
279
|
|
280
|
+
else
|
281
|
+
|
282
|
+
contro.take_picture
|
283
|
+
|
152
284
|
end
|
153
285
|
|
154
286
|
end
|
155
287
|
|
156
288
|
alias take_photo take_picture
|
157
289
|
|
290
|
+
def take_screenshot(ftp_src: nil, fileout: '.')
|
291
|
+
|
292
|
+
#screen.on
|
293
|
+
|
294
|
+
|
295
|
+
if ftp_src then
|
296
|
+
|
297
|
+
r = query.take_screenshot
|
298
|
+
# give the device a second to write the image to file
|
299
|
+
sleep 1
|
300
|
+
|
301
|
+
credentials, dir = ftp_src.match(/(ftp:\/\/[^\/]+)\/([^$]+)/).captures
|
302
|
+
ftp = MyMediaFTP.new(credentials)
|
303
|
+
ftp.cd dir
|
304
|
+
filename = ftp.ls.sort_by {|x| x[:ctime]}.last[:name]
|
305
|
+
ftp.cp filename, fileout
|
306
|
+
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
310
|
+
|
311
|
+
def toggle_airplane_mode()
|
312
|
+
control.toggle_airplane_mode
|
313
|
+
end
|
314
|
+
|
315
|
+
def toggle_bluetooth()
|
316
|
+
control.toggle_bluetooth
|
317
|
+
end
|
318
|
+
|
319
|
+
def toggle_wifi()
|
320
|
+
control.toggle_wifi
|
321
|
+
end
|
322
|
+
|
158
323
|
def torch()
|
159
324
|
control.torch
|
160
325
|
end
|
@@ -162,6 +327,28 @@ module RemoteDroid
|
|
162
327
|
def vibrate
|
163
328
|
control.vibrate
|
164
329
|
end
|
330
|
+
|
331
|
+
def voice_search
|
332
|
+
control.voice_search
|
333
|
+
end
|
334
|
+
|
335
|
+
def volume(context=nil)
|
336
|
+
query.volume context
|
337
|
+
end
|
338
|
+
|
339
|
+
def vol()
|
340
|
+
volume.music
|
341
|
+
end
|
165
342
|
|
166
343
|
end
|
344
|
+
|
345
|
+
|
346
|
+
class WebServer < AppHttp
|
347
|
+
|
348
|
+
def initialize(port: 9292)
|
349
|
+
super(RemoteDroid::Client.new, port: port)
|
350
|
+
end
|
351
|
+
|
352
|
+
end
|
353
|
+
|
167
354
|
end
|
data/lib/remotedroid/control.rb
CHANGED
@@ -8,22 +8,137 @@ module RemoteDroid
|
|
8
8
|
|
9
9
|
end
|
10
10
|
|
11
|
+
def airplane_mode()
|
12
|
+
|
13
|
+
def self.enable()
|
14
|
+
http_exec 'set-airplane-mode', {state: 0}
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.on()
|
18
|
+
self.enable
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.disable()
|
22
|
+
http_exec 'set-airplane-mode', {state: 1}
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.off()
|
26
|
+
self.disable
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.toggle()
|
30
|
+
http_exec 'set-airplane-mode', {state: 2}
|
31
|
+
end
|
32
|
+
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
def ask_alexa(options={})
|
37
|
+
http_exec 'ask-alexa', options
|
38
|
+
end
|
39
|
+
|
40
|
+
def autorotate()
|
41
|
+
|
42
|
+
def self.enable()
|
43
|
+
http_exec 'set-auto-rotate', {state: 0}
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.on()
|
47
|
+
self.enable
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.disable()
|
51
|
+
http_exec 'set-auto-rotate', {state: 1}
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.off()
|
55
|
+
self.disable
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.toggle()
|
59
|
+
http_exec 'set-auto-rotate', {state: 2}
|
60
|
+
end
|
61
|
+
|
62
|
+
self
|
63
|
+
end
|
64
|
+
|
11
65
|
def bluetooth()
|
12
|
-
|
66
|
+
|
67
|
+
def self.enable()
|
68
|
+
http_exec 'set-bluetooth', {state: 0}
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.on()
|
72
|
+
self.enable
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.disable()
|
76
|
+
http_exec 'set-bluetooth', {state: 1}
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.off()
|
80
|
+
self.disable
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.toggle()
|
84
|
+
http_exec 'set-bluetooth', {state: 2}
|
85
|
+
end
|
86
|
+
|
87
|
+
self
|
13
88
|
end
|
14
89
|
|
15
90
|
def camera_flash_light(options={})
|
16
91
|
http_exec 'camera-flash-light', options
|
17
92
|
end
|
18
93
|
|
19
|
-
def
|
94
|
+
def click(options={content: ''})
|
95
|
+
http_exec 'click-text-content', options
|
96
|
+
end
|
97
|
+
|
98
|
+
def control_media(options={})
|
99
|
+
http_exec 'media-' + options[:option].downcase.gsub(/\W/,'-')
|
100
|
+
end
|
101
|
+
|
102
|
+
def disable_airplane_mode()
|
103
|
+
http_exec 'set-airplane-mode', {state: 1}
|
104
|
+
end
|
105
|
+
|
106
|
+
def disable_bluetooth()
|
107
|
+
http_exec 'set-bluetooth', {state: 1}
|
108
|
+
end
|
109
|
+
|
110
|
+
def disable_macro(macro)
|
20
111
|
http_exec 'disable-macro', {name: macro}
|
21
112
|
end
|
22
113
|
|
23
|
-
def
|
114
|
+
def disable_wifi()
|
115
|
+
http_exec 'set-wifi', {state: 1}
|
116
|
+
end
|
117
|
+
|
118
|
+
def enable_airplane_mode()
|
119
|
+
http_exec 'set-airplane-mode', {state: 0}
|
120
|
+
end
|
121
|
+
|
122
|
+
def enable_bluetooth()
|
123
|
+
http_exec 'set-bluetooth', {state: 0}
|
124
|
+
end
|
125
|
+
|
126
|
+
def enable_macro(macro)
|
24
127
|
http_exec 'enable-macro', {name: macro}
|
128
|
+
end
|
129
|
+
|
130
|
+
def enable_wifi()
|
131
|
+
http_exec 'set-wifi', {state: 0}
|
132
|
+
end
|
133
|
+
|
134
|
+
def fill_clipboard(options={})
|
135
|
+
http_exec 'fill-clipboard', options
|
25
136
|
end
|
26
137
|
|
138
|
+
def force_macro_run(options={})
|
139
|
+
http_exec option[:macro_name].downcase.gsub(/ /,'-')
|
140
|
+
end
|
141
|
+
|
27
142
|
def hotspot(state=nil)
|
28
143
|
|
29
144
|
if state then
|
@@ -65,10 +180,38 @@ module RemoteDroid
|
|
65
180
|
|
66
181
|
end
|
67
182
|
|
183
|
+
def launch_activity(options={app: ''})
|
184
|
+
|
185
|
+
return if options[:app].empty?
|
186
|
+
|
187
|
+
app = options[:app]
|
188
|
+
|
189
|
+
package = APPS[app]
|
190
|
+
|
191
|
+
if package then
|
192
|
+
launch_package package: package
|
193
|
+
else
|
194
|
+
r = APPS.find {|k,v| k =~ /#{app}/i}
|
195
|
+
launch_package(package: r[1]) if r
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
def launch_package(options={package: 'com.google.android.chrome'})
|
201
|
+
http_exec 'launch-by-package', options
|
202
|
+
end
|
203
|
+
|
68
204
|
def location(options={})
|
69
205
|
http_exec 'location'
|
70
206
|
end
|
71
207
|
|
208
|
+
def open_website(options={url: ''})
|
209
|
+
http_exec 'open-website', options
|
210
|
+
end
|
211
|
+
|
212
|
+
alias goto open_website
|
213
|
+
alias visit open_website
|
214
|
+
|
72
215
|
def say_current_time(options={})
|
73
216
|
http_exec 'say-current-time'
|
74
217
|
end
|
@@ -94,6 +237,29 @@ module RemoteDroid
|
|
94
237
|
end
|
95
238
|
end
|
96
239
|
|
240
|
+
def set_auto_rotate(state=nil)
|
241
|
+
|
242
|
+
if state then
|
243
|
+
http_exec 'set-auto-rotate', {state: state}
|
244
|
+
else
|
245
|
+
|
246
|
+
def self.on()
|
247
|
+
http_exec 'set-auto-rotate', {state: 0}
|
248
|
+
end
|
249
|
+
|
250
|
+
def self.off()
|
251
|
+
http_exec 'set-auto-rotate', {state: 1}
|
252
|
+
end
|
253
|
+
|
254
|
+
def self.toggle()
|
255
|
+
http_exec 'set-auto-rotate', {state: 2}
|
256
|
+
end
|
257
|
+
|
258
|
+
self
|
259
|
+
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
97
263
|
def share_location(options={})
|
98
264
|
http_exec 'share-location'
|
99
265
|
end
|
@@ -126,6 +292,9 @@ module RemoteDroid
|
|
126
292
|
|
127
293
|
alias take_photo take_picture
|
128
294
|
|
295
|
+
def take_screenshot(options={})
|
296
|
+
http_exec 'take-screenshot', options
|
297
|
+
end
|
129
298
|
|
130
299
|
def toast(options={})
|
131
300
|
http_exec :toast, options
|
@@ -138,8 +307,36 @@ module RemoteDroid
|
|
138
307
|
def vibrate(options={})
|
139
308
|
http_exec :vibrate
|
140
309
|
end
|
310
|
+
|
311
|
+
def voice_search(options={})
|
312
|
+
http_exec 'voice-search'
|
313
|
+
end
|
141
314
|
|
142
|
-
|
315
|
+
def wifi()
|
316
|
+
|
317
|
+
def self.enable()
|
318
|
+
http_exec 'set-wifi', {state: 0}
|
319
|
+
end
|
320
|
+
|
321
|
+
def self.on()
|
322
|
+
self.enable
|
323
|
+
end
|
324
|
+
|
325
|
+
def self.disable()
|
326
|
+
http_exec 'set-wifi', {state: 1}
|
327
|
+
end
|
328
|
+
|
329
|
+
def self.off()
|
330
|
+
self.disable
|
331
|
+
end
|
332
|
+
|
333
|
+
def self.toggle()
|
334
|
+
http_exec 'set-wifi', {state: 2}
|
335
|
+
end
|
336
|
+
|
337
|
+
self
|
338
|
+
end
|
339
|
+
|
143
340
|
def write(s)
|
144
341
|
|
145
342
|
d = MacroDroid.new(RD_MACROS, deviceid: @deviceid,
|
data/lib/remotedroid/query.rb
CHANGED
@@ -33,6 +33,16 @@ module RemoteDroid
|
|
33
33
|
q(:ip)
|
34
34
|
end
|
35
35
|
|
36
|
+
def last_loc()
|
37
|
+
|
38
|
+
def self.alt() q(:last_loc_alt) end
|
39
|
+
def self.latlon() q(:last_latlong) end
|
40
|
+
def self.link() q(:last_loc_link) end
|
41
|
+
def self.time() q(:last_loc_age_timestamp) end
|
42
|
+
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
36
46
|
def location()
|
37
47
|
|
38
48
|
r = @callback.query(:location)
|
@@ -50,6 +60,31 @@ module RemoteDroid
|
|
50
60
|
@callback.query(:'take-picture')
|
51
61
|
end
|
52
62
|
|
63
|
+
def take_screenshot()
|
64
|
+
@callback.query(:'take-screenshot')
|
65
|
+
end
|
66
|
+
|
67
|
+
def volume(context=nil)
|
68
|
+
|
69
|
+
if context then
|
70
|
+
q(context)
|
71
|
+
else
|
72
|
+
|
73
|
+
def self.alarm() q(:vol_alarm) end
|
74
|
+
def self.bt_voice() q(:vol_bt_voice) end
|
75
|
+
def self.call() q(:vol_call) end
|
76
|
+
def self.music() q(:vol_music) end
|
77
|
+
def self.notify() q(:vol_notif) end
|
78
|
+
def self.system() q(:vol_system) end
|
79
|
+
|
80
|
+
self
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
alias vol volume
|
86
|
+
|
87
|
+
|
53
88
|
private
|
54
89
|
|
55
90
|
def q(id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remotedroid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
io3WPRDjULC924M5S8wbrus31v2AUjqFBPvmHr7caf/VHErWypV482xcDhWt1eif
|
36
36
|
0G2k2ptozXcBS9odsqGUTb5N
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-10-
|
38
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: onedrb
|
@@ -97,6 +97,46 @@ dependencies:
|
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: 0.3.7
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: sps-pub
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0.5'
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.5.5
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.5'
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 0.5.5
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: apphttp
|
122
|
+
requirement: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 0.2.0
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0.2'
|
130
|
+
type: :runtime
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 0.2.0
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0.2'
|
100
140
|
- !ruby/object:Gem::Dependency
|
101
141
|
name: ruby-macrodroid
|
102
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,7 +146,7 @@ dependencies:
|
|
106
146
|
version: '0.9'
|
107
147
|
- - ">="
|
108
148
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.9.
|
149
|
+
version: 0.9.17
|
110
150
|
type: :runtime
|
111
151
|
prerelease: false
|
112
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -116,7 +156,7 @@ dependencies:
|
|
116
156
|
version: '0.9'
|
117
157
|
- - ">="
|
118
158
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.9.
|
159
|
+
version: 0.9.17
|
120
160
|
description:
|
121
161
|
email: james@jamesrobertson.eu
|
122
162
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|