remotedroid 0.5.4 → 0.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 667844020454a5bcfa4e47c7db865a9e1cfc70364da42840c8f6d4d1a6d4b021
4
- data.tar.gz: 9058f9b6b4206cbf42e8c10ebdba4825bab4c1dcc9da477120bd6e09758af97c
3
+ metadata.gz: a86c870441f3c62f297cbcfc00422258f19d0061d0f4379c825f8abfb1d37f4b
4
+ data.tar.gz: 71f5eef47bf451ea91cbbd0b0cf2d45d4c1f656505d97bc65287bf673e7e0416
5
5
  SHA512:
6
- metadata.gz: 116782fbe0c6da9a938e3eeb59961189893fe6221bbdf7fd77d626ab374ab786480c977e0c6b847652e1f1e47b9300c160275cdec8241686209c7a10e190a7ea
7
- data.tar.gz: 3521f559ef0febc0f37ce17aa174900ed8697dea131cbfec68db40fa6841d075930c972dfb33f2f4b8cd951d24054a3c7660c5daea5e54d0f38978444872630b
6
+ metadata.gz: f018dbb7e614a4555a658a8723dacbfff6127388b80d5b78a161af07076438b214ad30ed7d09d97f23ce178ccf32ee533b55e4b3fe84444c4d4c73c1d0adde96
7
+ data.tar.gz: e373a0b5a31d9e6648376bf8a17e1745dc041658f7250767da2f6ab063b7a1ea621ad4cbc66cf7cdad2e467e048b5e7f8365f3597bf63d69d6635e47d093af33
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -249,14 +249,27 @@ t: webhook
249
249
  a:
250
250
  Fill Clipboard
251
251
  [lv=clipboard]
252
-
252
+
253
253
  m: click text content
254
254
  v: content
255
255
  t: webhook
256
256
  a:
257
257
  UI Interaction
258
- Click [[lv=content]]
258
+ Click [[lv=content]]
259
+
260
+ m: Launch by package
261
+ v: package
262
+ t: webhook
263
+ a: Launch [lv=package]
259
264
 
265
+ m: Take Screenshot
266
+ t: webhook
267
+ a:
268
+ Take Screenshot
269
+ Save to device
270
+ a: wait 2 seconds
271
+ a: webhook
272
+
260
273
  m: Share location
261
274
  t:
262
275
  WebHook
@@ -484,7 +497,15 @@ a:
484
497
  identifier: flip_device
485
498
  facedown: false
486
499
  EOF
487
-
500
+ s='
501
+
502
+ m: click text content
503
+ v: content
504
+ t: webhook
505
+ a:
506
+ UI Interaction
507
+ Click [[[lv=content]]]
508
+ '
488
509
 
489
510
  module RemoteDroid
490
511
 
@@ -60,6 +60,10 @@ module RemoteDroid
60
60
  query.cell_tower
61
61
  end
62
62
 
63
+ def click(s)
64
+ control.click content: s
65
+ end
66
+
63
67
  def control_media(option='Play/Pause')
64
68
  control.control_media({option: option})
65
69
  end
@@ -83,9 +87,24 @@ module RemoteDroid
83
87
  end
84
88
 
85
89
  def launch_activity(app='')
86
- control.launch_activity(app)
90
+
91
+ package = APPS[app]
92
+
93
+ if package then
94
+ control.launch_package package: package
95
+ else
96
+ r = APPS.find {|k,v| k =~ /#{app}/i}
97
+ control.launch_package(package: r[1]) if r
98
+ end
99
+
87
100
  end
88
101
 
102
+ def launch_package(name='')
103
+
104
+ control.launch_package(package: name)
105
+
106
+ end
107
+
89
108
  alias launch launch_activity
90
109
 
91
110
  def location()
@@ -95,7 +114,6 @@ module RemoteDroid
95
114
  def location_watch(refresh: '1 minute', interval: refresh,
96
115
  duration: '30 minutes')
97
116
 
98
-
99
117
  d = ChronicDuration.parse(duration)
100
118
  seconds = ChronicDuration.parse(interval)
101
119
  puts ("monitoring location every %s for %s" % [interval, duration]).info
@@ -115,6 +133,13 @@ module RemoteDroid
115
133
 
116
134
  end
117
135
 
136
+ def open_website(url)
137
+ control.open_website url: url
138
+ end
139
+
140
+ alias goto open_website
141
+ alias visit open_website
142
+
118
143
  def ip()
119
144
  query.ip
120
145
  end
@@ -199,6 +224,26 @@ module RemoteDroid
199
224
 
200
225
  alias take_photo take_picture
201
226
 
227
+ def take_screenshot(ftp_src: nil, fileout: '.')
228
+
229
+ #screen.on
230
+ r = query.take_screenshot
231
+
232
+ if ftp_src then
233
+
234
+ # give the device a second to write the image to file
235
+ sleep 1
236
+
237
+ credentials, dir = ftp_src.match(/(ftp:\/\/[^\/]+)\/([^$]+)/).captures
238
+ ftp = MyMediaFTP.new(credentials)
239
+ ftp.cd dir
240
+ filename = ftp.ls.sort_by {|x| x[:ctime]}.last[:name]
241
+ ftp.cp filename, fileout
242
+
243
+ end
244
+
245
+ end
246
+
202
247
  def torch()
203
248
  control.torch
204
249
  end
@@ -16,6 +16,10 @@ module RemoteDroid
16
16
  http_exec 'camera-flash-light', options
17
17
  end
18
18
 
19
+ def click(options={content: ''})
20
+ http_exec 'click-text-content', options
21
+ end
22
+
19
23
  def control_media(options={})
20
24
  http_exec 'media-' + options[:option].downcase.gsub(/\W/,'-')
21
25
  end
@@ -77,15 +81,38 @@ module RemoteDroid
77
81
 
78
82
  end
79
83
 
80
- def launch_activity(options={})
81
- app = options[:app].downcase.gsub(/ /,'-')
82
- http_exec 'launch-' + app
84
+ def launch_activity(options={app: ''})
85
+
86
+ return if options[:app].empty?
87
+
88
+ app = options[:app]
89
+
90
+ package = APPS[app]
91
+
92
+ if package then
93
+ launch_package package: package
94
+ else
95
+ r = APPS.find {|k,v| k =~ /#{app}/i}
96
+ launch_package(package: r[1]) if r
97
+ end
98
+
83
99
  end
84
100
 
101
+ def launch_package(options={package: 'com.google.android.chrome'})
102
+ http_exec 'launch-by-package', options
103
+ end
104
+
85
105
  def location(options={})
86
106
  http_exec 'location'
87
107
  end
88
108
 
109
+ def open_website(options={url: ''})
110
+ http_exec 'open-website', options
111
+ end
112
+
113
+ alias goto open_website
114
+ alias visit open_website
115
+
89
116
  def say_current_time(options={})
90
117
  http_exec 'say-current-time'
91
118
  end
@@ -50,6 +50,10 @@ module RemoteDroid
50
50
  @callback.query(:'take-picture')
51
51
  end
52
52
 
53
+ def take_screenshot()
54
+ @callback.query(:'take-screenshot')
55
+ end
56
+
53
57
  private
54
58
 
55
59
  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.5.4
4
+ version: 0.5.5
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-23 00:00:00.000000000 Z
38
+ date: 2020-10-24 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: onedrb
metadata.gz.sig CHANGED
Binary file