ruby-macrodroid 0.1.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ruby-macrodroid.rb +1120 -0
- metadata +90 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f5ebd24bcf9eaf00297ab7bc09c0a1d55f8f88b85c1299a69d2bb6443fa41583
|
4
|
+
data.tar.gz: 973b4c08b6df73df6698af7f3c1a8ad87bb3e9188fe956aa61c2cabcd4757105
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cdaa9145b35f8ee7f337a00405749336a4a11b5da01711480f1cebcdb0952b511002137fb478267a2a9bdb02ea6492d08893a58d8fc52f97be3c72a482e02ed
|
7
|
+
data.tar.gz: 18e4a33b8356b721a5699b8c5725ee7d8ff4a365787d8c1caed4802fb9f12688e8954c61325ab65d802bc26786c367204c22cc259f2b8188fe0af221252255c0
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,1120 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: ruby-macrodroid.rb
|
4
|
+
|
5
|
+
require 'pp'
|
6
|
+
require 'json'
|
7
|
+
require 'rxfhelper'
|
8
|
+
|
9
|
+
|
10
|
+
module Params
|
11
|
+
|
12
|
+
refine Hash do
|
13
|
+
|
14
|
+
# turns camelCase into snake_case
|
15
|
+
|
16
|
+
def to_params()
|
17
|
+
|
18
|
+
self.inject({}) do |r, x|
|
19
|
+
|
20
|
+
key, value = x
|
21
|
+
r.merge key.sub(/^m_/,'').gsub(/[A-Z][a-z]/){|x| '_' +
|
22
|
+
x.downcase}.gsub(/[a-z][A-Z]/){|x| x[0] + '_' + x[1].downcase}\
|
23
|
+
.downcase.to_sym => value
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
class Macro
|
33
|
+
using ColouredText
|
34
|
+
using Params
|
35
|
+
|
36
|
+
attr_reader :local_variables, :triggers, :actions, :guid
|
37
|
+
|
38
|
+
def initialize(debug: false)
|
39
|
+
|
40
|
+
@debug = debug
|
41
|
+
lv=[], triggers=[], actions=[]
|
42
|
+
@local_variables, @triggers, @actions = lv, triggers, actions
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_h()
|
46
|
+
|
47
|
+
h = {
|
48
|
+
'localVariables' => @local_variables,
|
49
|
+
'm_triggerList' => @triggers.map(&:to_h),
|
50
|
+
'm_actionList' => @actions.map(&:to_h),
|
51
|
+
'm_constraintList' =>[]
|
52
|
+
}
|
53
|
+
|
54
|
+
@h.merge(h)
|
55
|
+
end
|
56
|
+
|
57
|
+
def import_h(h)
|
58
|
+
|
59
|
+
# fetch the local variables
|
60
|
+
@local_variables = h['localVariables']
|
61
|
+
|
62
|
+
# fetch the triggers
|
63
|
+
@triggers = h['m_triggerList'].map do |trigger|
|
64
|
+
|
65
|
+
object(trigger.to_params)
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
@actions = h['m_actionList'].map do |action|
|
70
|
+
object(action.to_params)
|
71
|
+
end
|
72
|
+
|
73
|
+
# fetch the constraints (not yet implemented)
|
74
|
+
|
75
|
+
@h = h
|
76
|
+
|
77
|
+
%w(localVariables m_triggerList m_actionList).each do |x|
|
78
|
+
@h[x] = []
|
79
|
+
end
|
80
|
+
|
81
|
+
@h
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
def object(h={})
|
88
|
+
|
89
|
+
puts ('inside object h:' + h.inspect).debug if @debug
|
90
|
+
klass = Object.const_get h[:class_type]
|
91
|
+
klass.new h
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
class MacroDroid
|
98
|
+
using ColouredText
|
99
|
+
|
100
|
+
attr_reader :macros
|
101
|
+
|
102
|
+
def initialize(obj, debug: false)
|
103
|
+
|
104
|
+
@debug = debug
|
105
|
+
s, _ = RXFHelper.read(obj)
|
106
|
+
import_json(s) if s[0] == '{'
|
107
|
+
end
|
108
|
+
|
109
|
+
def export_json()
|
110
|
+
|
111
|
+
to_h.to_json
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
alias to_json export_json
|
116
|
+
|
117
|
+
def import_json(s)
|
118
|
+
|
119
|
+
@h = JSON.parse s
|
120
|
+
puts ('@h: ' + @h.pretty_inspect).debug if @debug
|
121
|
+
|
122
|
+
@macros = @h["macroList"].map do |macro|
|
123
|
+
|
124
|
+
puts ('macro: ' + macro.pretty_inspect).debug if @debug
|
125
|
+
m = Macro.new(debug: @debug)
|
126
|
+
m.import_h(macro)
|
127
|
+
m
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
@h['macroList'] = []
|
132
|
+
end
|
133
|
+
|
134
|
+
def to_h()
|
135
|
+
|
136
|
+
@h.merge('macroList' => @macros.map(&:to_h))
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
class MacroObject
|
145
|
+
|
146
|
+
def initialize(h={})
|
147
|
+
|
148
|
+
@h = {constraint_list: [], is_or_condition: false,
|
149
|
+
is_disabled: false}.merge(h)
|
150
|
+
@list = []
|
151
|
+
end
|
152
|
+
|
153
|
+
def to_h()
|
154
|
+
|
155
|
+
h = @h
|
156
|
+
|
157
|
+
h.inject({}) do |r,x|
|
158
|
+
puts 'x: ' + x.inspect if @debug
|
159
|
+
key, value = x
|
160
|
+
puts 'key: ' + key.inspect if @debug
|
161
|
+
new_key = key.to_s.gsub(/\w_\w/){|x| x[0] + x[-1].upcase}
|
162
|
+
new_key = new_key.prepend 'm_' unless @list.include? new_key
|
163
|
+
new_key = 'm_SIGUID' if new_key == 'm_siguid'
|
164
|
+
r.merge(new_key => value)
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
class Trigger < MacroObject
|
172
|
+
|
173
|
+
def initialize(h={})
|
174
|
+
super({fakeIcon: 0}.merge(h))
|
175
|
+
@list << 'fakeIcon'
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
class WifiConnectionTrigger < Trigger
|
183
|
+
|
184
|
+
def initialize(h={})
|
185
|
+
super({}.merge(h))
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
class WebHookTrigger < Trigger
|
191
|
+
|
192
|
+
def initialize(h={})
|
193
|
+
super({identifier: ''}.merge(h))
|
194
|
+
@list << 'identifier'
|
195
|
+
end
|
196
|
+
|
197
|
+
def identifier()
|
198
|
+
@h[:identifier]
|
199
|
+
end
|
200
|
+
|
201
|
+
def identifier=(val)
|
202
|
+
@h[:identifier] = val
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
206
|
+
|
207
|
+
class WifiConnectionTrigger < Trigger
|
208
|
+
|
209
|
+
def initialize(h={})
|
210
|
+
super({}.merge h)
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
class ApplicationInstalledRemovedTrigger < Trigger
|
216
|
+
|
217
|
+
def initialize(h={})
|
218
|
+
super({}.merge h)
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
class ApplicationLaunchedTrigger < Trigger
|
224
|
+
|
225
|
+
def initialize(h={})
|
226
|
+
super({}.merge h)
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
class BatteryLevelTrigger < Trigger
|
232
|
+
|
233
|
+
def initialize(h={})
|
234
|
+
super({}.merge h)
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
class BatteryTemperatureTrigger < Trigger
|
240
|
+
|
241
|
+
def initialize(h={})
|
242
|
+
super({}.merge h)
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
246
|
+
|
247
|
+
class PowerButtonToggleTrigger < Trigger
|
248
|
+
|
249
|
+
def initialize(h={})
|
250
|
+
super({}.merge h)
|
251
|
+
end
|
252
|
+
|
253
|
+
end
|
254
|
+
|
255
|
+
class ExternalPowerTrigger < Trigger
|
256
|
+
|
257
|
+
def initialize(h={})
|
258
|
+
super({}.merge h)
|
259
|
+
end
|
260
|
+
|
261
|
+
end
|
262
|
+
|
263
|
+
class CallActiveTrigger < Trigger
|
264
|
+
|
265
|
+
def initialize(h={})
|
266
|
+
super({}.merge h)
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
class IncomingCallTrigger < Trigger
|
272
|
+
|
273
|
+
def initialize(h={})
|
274
|
+
super({}.merge h)
|
275
|
+
end
|
276
|
+
|
277
|
+
end
|
278
|
+
|
279
|
+
class OutgoingCallTrigger < Trigger
|
280
|
+
|
281
|
+
def initialize(h={})
|
282
|
+
super({}.merge h)
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|
286
|
+
|
287
|
+
class CallEndedTrigger < Trigger
|
288
|
+
|
289
|
+
def initialize(h={})
|
290
|
+
super({}.merge h)
|
291
|
+
end
|
292
|
+
|
293
|
+
end
|
294
|
+
|
295
|
+
class CallMissedTrigger < Trigger
|
296
|
+
|
297
|
+
def initialize(h={})
|
298
|
+
super({}.merge h)
|
299
|
+
end
|
300
|
+
|
301
|
+
end
|
302
|
+
|
303
|
+
class IncomingSMSTrigger < Trigger
|
304
|
+
|
305
|
+
def initialize(h={})
|
306
|
+
super({}.merge h)
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
310
|
+
|
311
|
+
class BluetoothTrigger < Trigger
|
312
|
+
|
313
|
+
def initialize(h={})
|
314
|
+
super({}.merge h)
|
315
|
+
end
|
316
|
+
|
317
|
+
end
|
318
|
+
|
319
|
+
class HeadphonesTrigger < Trigger
|
320
|
+
|
321
|
+
def initialize(h={})
|
322
|
+
super({}.merge h)
|
323
|
+
end
|
324
|
+
|
325
|
+
end
|
326
|
+
|
327
|
+
class SignalOnOffTrigger < Trigger
|
328
|
+
|
329
|
+
def initialize(h={})
|
330
|
+
super({}.merge h)
|
331
|
+
end
|
332
|
+
|
333
|
+
end
|
334
|
+
|
335
|
+
class UsbDeviceConnectionTrigger < Trigger
|
336
|
+
|
337
|
+
def initialize(h={})
|
338
|
+
super({}.merge h)
|
339
|
+
end
|
340
|
+
|
341
|
+
end
|
342
|
+
|
343
|
+
class WifiSSIDTrigger < Trigger
|
344
|
+
|
345
|
+
def initialize(h={})
|
346
|
+
super({}.merge h)
|
347
|
+
end
|
348
|
+
|
349
|
+
end
|
350
|
+
|
351
|
+
class CalendarTrigger < Trigger
|
352
|
+
|
353
|
+
def initialize(h={})
|
354
|
+
super({}.merge h)
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
358
|
+
|
359
|
+
class TimerTrigger < Trigger
|
360
|
+
|
361
|
+
def initialize(h={})
|
362
|
+
super({}.merge h)
|
363
|
+
end
|
364
|
+
|
365
|
+
end
|
366
|
+
|
367
|
+
class StopwatchTrigger < Trigger
|
368
|
+
|
369
|
+
def initialize(h={})
|
370
|
+
super({}.merge h)
|
371
|
+
end
|
372
|
+
|
373
|
+
end
|
374
|
+
|
375
|
+
class DayTrigger < Trigger
|
376
|
+
|
377
|
+
def initialize(h={})
|
378
|
+
super({}.merge h)
|
379
|
+
end
|
380
|
+
|
381
|
+
end
|
382
|
+
|
383
|
+
class RegularIntervalTrigger < Trigger
|
384
|
+
|
385
|
+
def initialize(h={})
|
386
|
+
super({}.merge h)
|
387
|
+
end
|
388
|
+
|
389
|
+
end
|
390
|
+
|
391
|
+
class AirplaneModeTrigger < Trigger
|
392
|
+
|
393
|
+
def initialize(h={})
|
394
|
+
super({}.merge h)
|
395
|
+
end
|
396
|
+
|
397
|
+
end
|
398
|
+
|
399
|
+
class AutoSyncChangeTrigger < Trigger
|
400
|
+
|
401
|
+
def initialize(h={})
|
402
|
+
super({}.merge h)
|
403
|
+
end
|
404
|
+
|
405
|
+
end
|
406
|
+
|
407
|
+
class DayDreamTrigger < Trigger
|
408
|
+
|
409
|
+
def initialize(h={})
|
410
|
+
super({}.merge h)
|
411
|
+
end
|
412
|
+
|
413
|
+
end
|
414
|
+
|
415
|
+
class DockTrigger < Trigger
|
416
|
+
|
417
|
+
def initialize(h={})
|
418
|
+
super({}.merge h)
|
419
|
+
end
|
420
|
+
|
421
|
+
end
|
422
|
+
|
423
|
+
class GPSEnabledTrigger < Trigger
|
424
|
+
|
425
|
+
def initialize(h={})
|
426
|
+
super({}.merge h)
|
427
|
+
end
|
428
|
+
|
429
|
+
end
|
430
|
+
|
431
|
+
class MusicPlayingTrigger < Trigger
|
432
|
+
|
433
|
+
def initialize(h={})
|
434
|
+
super({}.merge h)
|
435
|
+
end
|
436
|
+
|
437
|
+
end
|
438
|
+
|
439
|
+
class DeviceUnlockedTrigger < Trigger
|
440
|
+
|
441
|
+
def initialize(h={})
|
442
|
+
super({}.merge h)
|
443
|
+
end
|
444
|
+
|
445
|
+
end
|
446
|
+
|
447
|
+
class AutoRotateChangeTrigger < Trigger
|
448
|
+
|
449
|
+
def initialize(h={})
|
450
|
+
super({}.merge h)
|
451
|
+
end
|
452
|
+
|
453
|
+
end
|
454
|
+
|
455
|
+
class ClipboardChangeTrigger < Trigger
|
456
|
+
|
457
|
+
def initialize(h={})
|
458
|
+
super({}.merge h)
|
459
|
+
end
|
460
|
+
|
461
|
+
end
|
462
|
+
|
463
|
+
class BootTrigger < Trigger
|
464
|
+
|
465
|
+
def initialize(h={})
|
466
|
+
super({}.merge h)
|
467
|
+
end
|
468
|
+
|
469
|
+
end
|
470
|
+
|
471
|
+
class IntentReceivedTrigger < Trigger
|
472
|
+
|
473
|
+
def initialize(h={})
|
474
|
+
super({}.merge h)
|
475
|
+
end
|
476
|
+
|
477
|
+
end
|
478
|
+
|
479
|
+
class NotificationTrigger < Trigger
|
480
|
+
|
481
|
+
def initialize(h={})
|
482
|
+
super({}.merge h)
|
483
|
+
end
|
484
|
+
|
485
|
+
end
|
486
|
+
|
487
|
+
class ScreenOnOffTrigger < Trigger
|
488
|
+
|
489
|
+
def initialize(h={})
|
490
|
+
super({}.merge h)
|
491
|
+
end
|
492
|
+
|
493
|
+
end
|
494
|
+
|
495
|
+
class SilentModeTrigger < Trigger
|
496
|
+
|
497
|
+
def initialize(h={})
|
498
|
+
super({}.merge h)
|
499
|
+
end
|
500
|
+
|
501
|
+
end
|
502
|
+
|
503
|
+
class WeatherTrigger < Trigger
|
504
|
+
|
505
|
+
def initialize(h={})
|
506
|
+
super({}.merge h)
|
507
|
+
end
|
508
|
+
|
509
|
+
end
|
510
|
+
|
511
|
+
class GeofenceTrigger < Trigger
|
512
|
+
|
513
|
+
def initialize(h={})
|
514
|
+
super({}.merge h)
|
515
|
+
end
|
516
|
+
|
517
|
+
end
|
518
|
+
|
519
|
+
class SunriseSunsetTrigger < Trigger
|
520
|
+
|
521
|
+
def initialize(h={})
|
522
|
+
super({}.merge h)
|
523
|
+
end
|
524
|
+
|
525
|
+
end
|
526
|
+
|
527
|
+
class ActivityRecognitionTrigger < Trigger
|
528
|
+
|
529
|
+
def initialize(h={})
|
530
|
+
super({}.merge h)
|
531
|
+
end
|
532
|
+
|
533
|
+
end
|
534
|
+
|
535
|
+
class ProximityTrigger < Trigger
|
536
|
+
|
537
|
+
def initialize(h={})
|
538
|
+
super({}.merge h)
|
539
|
+
end
|
540
|
+
|
541
|
+
end
|
542
|
+
|
543
|
+
class ShakeDeviceTrigger < Trigger
|
544
|
+
|
545
|
+
def initialize(h={})
|
546
|
+
super({}.merge h)
|
547
|
+
end
|
548
|
+
|
549
|
+
end
|
550
|
+
|
551
|
+
class FlipDeviceTrigger < Trigger
|
552
|
+
|
553
|
+
def initialize(h={})
|
554
|
+
super({}.merge h)
|
555
|
+
end
|
556
|
+
|
557
|
+
end
|
558
|
+
|
559
|
+
class OrientationTrigger < Trigger
|
560
|
+
|
561
|
+
def initialize(h={})
|
562
|
+
super({}.merge h)
|
563
|
+
end
|
564
|
+
|
565
|
+
end
|
566
|
+
|
567
|
+
class FloatingButtonTrigger < Trigger
|
568
|
+
|
569
|
+
def initialize(h={})
|
570
|
+
super({}.merge h)
|
571
|
+
end
|
572
|
+
|
573
|
+
end
|
574
|
+
|
575
|
+
class ShortcutTrigger < Trigger
|
576
|
+
|
577
|
+
def initialize(h={})
|
578
|
+
super({}.merge h)
|
579
|
+
end
|
580
|
+
|
581
|
+
end
|
582
|
+
|
583
|
+
class VolumeButtonTrigger < Trigger
|
584
|
+
|
585
|
+
def initialize(h={})
|
586
|
+
super({}.merge h)
|
587
|
+
end
|
588
|
+
|
589
|
+
end
|
590
|
+
|
591
|
+
class MediaButtonPressedTrigger < Trigger
|
592
|
+
|
593
|
+
def initialize(h={})
|
594
|
+
super({}.merge h)
|
595
|
+
end
|
596
|
+
|
597
|
+
end
|
598
|
+
|
599
|
+
class SwipeTrigger < Trigger
|
600
|
+
|
601
|
+
def initialize(h={})
|
602
|
+
super({}.merge h)
|
603
|
+
end
|
604
|
+
|
605
|
+
end
|
606
|
+
|
607
|
+
|
608
|
+
class Action < MacroObject
|
609
|
+
|
610
|
+
def initialize(h={})
|
611
|
+
super(h)
|
612
|
+
end
|
613
|
+
|
614
|
+
end
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
class ShareLocationAction < Action
|
619
|
+
|
620
|
+
def initialize(h={})
|
621
|
+
super({sim_id: 0, output_channel: 5, old_variable_format: true}.merge(h))
|
622
|
+
end
|
623
|
+
|
624
|
+
end
|
625
|
+
|
626
|
+
class UDPCommandAction < Action
|
627
|
+
|
628
|
+
def initialize(h={})
|
629
|
+
super({destination: '', message: '', port: 0}.merge h)
|
630
|
+
end
|
631
|
+
|
632
|
+
end
|
633
|
+
|
634
|
+
class LaunchActivityAction < Action
|
635
|
+
|
636
|
+
def initialize(h={})
|
637
|
+
super({}.merge h)
|
638
|
+
end
|
639
|
+
|
640
|
+
end
|
641
|
+
|
642
|
+
class KillBackgroundAppAction < Action
|
643
|
+
|
644
|
+
def initialize(h={})
|
645
|
+
super({}.merge h)
|
646
|
+
end
|
647
|
+
|
648
|
+
end
|
649
|
+
|
650
|
+
class OpenWebPageAction < Action
|
651
|
+
|
652
|
+
def initialize(h={})
|
653
|
+
super({}.merge h)
|
654
|
+
end
|
655
|
+
|
656
|
+
end
|
657
|
+
|
658
|
+
class UploadPhotoAction < Action
|
659
|
+
|
660
|
+
def initialize(h={})
|
661
|
+
super({}.merge h)
|
662
|
+
end
|
663
|
+
|
664
|
+
end
|
665
|
+
|
666
|
+
class TakePictureAction < Action
|
667
|
+
|
668
|
+
def initialize(h={})
|
669
|
+
super({}.merge h)
|
670
|
+
end
|
671
|
+
|
672
|
+
end
|
673
|
+
|
674
|
+
class SetWifiAction < Action
|
675
|
+
|
676
|
+
def initialize(h={})
|
677
|
+
super({}.merge h)
|
678
|
+
end
|
679
|
+
|
680
|
+
end
|
681
|
+
|
682
|
+
class SetBluetoothAction < Action
|
683
|
+
|
684
|
+
def initialize(h={})
|
685
|
+
super({}.merge h)
|
686
|
+
end
|
687
|
+
|
688
|
+
end
|
689
|
+
|
690
|
+
class SendIntentAction < Action
|
691
|
+
|
692
|
+
def initialize(h={})
|
693
|
+
super({}.merge h)
|
694
|
+
end
|
695
|
+
|
696
|
+
end
|
697
|
+
|
698
|
+
class SetAlarmClockAction < Action
|
699
|
+
|
700
|
+
def initialize(h={})
|
701
|
+
super({}.merge h)
|
702
|
+
end
|
703
|
+
|
704
|
+
end
|
705
|
+
|
706
|
+
class StopWatchAction < Action
|
707
|
+
|
708
|
+
def initialize(h={})
|
709
|
+
super({}.merge h)
|
710
|
+
end
|
711
|
+
|
712
|
+
end
|
713
|
+
|
714
|
+
class SayTimeAction < Action
|
715
|
+
|
716
|
+
def initialize(h={})
|
717
|
+
super({}.merge h)
|
718
|
+
end
|
719
|
+
|
720
|
+
end
|
721
|
+
|
722
|
+
class AndroidShortcutsAction < Action
|
723
|
+
|
724
|
+
def initialize(h={})
|
725
|
+
super({}.merge h)
|
726
|
+
end
|
727
|
+
|
728
|
+
end
|
729
|
+
|
730
|
+
class ClipboardAction < Action
|
731
|
+
|
732
|
+
def initialize(h={})
|
733
|
+
super({}.merge h)
|
734
|
+
end
|
735
|
+
|
736
|
+
end
|
737
|
+
|
738
|
+
class PressBackAction < Action
|
739
|
+
|
740
|
+
def initialize(h={})
|
741
|
+
super({}.merge h)
|
742
|
+
end
|
743
|
+
|
744
|
+
end
|
745
|
+
|
746
|
+
class SpeakTextAction < Action
|
747
|
+
|
748
|
+
def initialize(h={})
|
749
|
+
super({}.merge h)
|
750
|
+
end
|
751
|
+
|
752
|
+
end
|
753
|
+
|
754
|
+
class UIInteractionAction < Action
|
755
|
+
|
756
|
+
def initialize(h={})
|
757
|
+
super({}.merge h)
|
758
|
+
end
|
759
|
+
|
760
|
+
end
|
761
|
+
|
762
|
+
class VoiceSearchAction < Action
|
763
|
+
|
764
|
+
def initialize(h={})
|
765
|
+
super({}.merge h)
|
766
|
+
end
|
767
|
+
|
768
|
+
end
|
769
|
+
|
770
|
+
class ExpandCollapseStatusBarAction < Action
|
771
|
+
|
772
|
+
def initialize(h={})
|
773
|
+
super({}.merge h)
|
774
|
+
end
|
775
|
+
|
776
|
+
end
|
777
|
+
|
778
|
+
class LaunchHomeScreenAction < Action
|
779
|
+
|
780
|
+
def initialize(h={})
|
781
|
+
super({}.merge h)
|
782
|
+
end
|
783
|
+
|
784
|
+
end
|
785
|
+
|
786
|
+
class CameraFlashLightAction < Action
|
787
|
+
|
788
|
+
def initialize(h={})
|
789
|
+
super({}.merge h)
|
790
|
+
end
|
791
|
+
|
792
|
+
end
|
793
|
+
|
794
|
+
class VibrateAction < Action
|
795
|
+
|
796
|
+
def initialize(h={})
|
797
|
+
super({}.merge h)
|
798
|
+
end
|
799
|
+
|
800
|
+
end
|
801
|
+
|
802
|
+
class SetAutoRotateAction < Action
|
803
|
+
|
804
|
+
def initialize(h={})
|
805
|
+
super({}.merge h)
|
806
|
+
end
|
807
|
+
|
808
|
+
end
|
809
|
+
|
810
|
+
class DayDreamAction < Action
|
811
|
+
|
812
|
+
def initialize(h={})
|
813
|
+
super({}.merge h)
|
814
|
+
end
|
815
|
+
|
816
|
+
end
|
817
|
+
|
818
|
+
class SetKeyboardAction < Action
|
819
|
+
|
820
|
+
def initialize(h={})
|
821
|
+
super({}.merge h)
|
822
|
+
end
|
823
|
+
|
824
|
+
end
|
825
|
+
|
826
|
+
class SetKeyguardAction < Action
|
827
|
+
|
828
|
+
def initialize(h={})
|
829
|
+
super({}.merge h)
|
830
|
+
end
|
831
|
+
|
832
|
+
end
|
833
|
+
|
834
|
+
class CarModeAction < Action
|
835
|
+
|
836
|
+
def initialize(h={})
|
837
|
+
super({}.merge h)
|
838
|
+
end
|
839
|
+
|
840
|
+
end
|
841
|
+
|
842
|
+
class ChangeKeyboardAction < Action
|
843
|
+
|
844
|
+
def initialize(h={})
|
845
|
+
super({}.merge h)
|
846
|
+
end
|
847
|
+
|
848
|
+
end
|
849
|
+
|
850
|
+
class SetWallpaperAction < Action
|
851
|
+
|
852
|
+
def initialize(h={})
|
853
|
+
super({}.merge h)
|
854
|
+
end
|
855
|
+
|
856
|
+
end
|
857
|
+
|
858
|
+
class OpenFileAction < Action
|
859
|
+
|
860
|
+
def initialize(h={})
|
861
|
+
super({}.merge h)
|
862
|
+
end
|
863
|
+
|
864
|
+
end
|
865
|
+
|
866
|
+
class ForceLocationUpdateAction < Action
|
867
|
+
|
868
|
+
def initialize(h={})
|
869
|
+
super({}.merge h)
|
870
|
+
end
|
871
|
+
|
872
|
+
end
|
873
|
+
|
874
|
+
class SetLocationUpdateRateAction < Action
|
875
|
+
|
876
|
+
def initialize(h={})
|
877
|
+
super({}.merge h)
|
878
|
+
end
|
879
|
+
|
880
|
+
end
|
881
|
+
|
882
|
+
class AddCalendarEntryAction < Action
|
883
|
+
|
884
|
+
def initialize(h={})
|
885
|
+
super({}.merge h)
|
886
|
+
end
|
887
|
+
|
888
|
+
end
|
889
|
+
|
890
|
+
class LogAction < Action
|
891
|
+
|
892
|
+
def initialize(h={})
|
893
|
+
super({}.merge h)
|
894
|
+
end
|
895
|
+
|
896
|
+
end
|
897
|
+
|
898
|
+
class ClearLogAction < Action
|
899
|
+
|
900
|
+
def initialize(h={})
|
901
|
+
super({}.merge h)
|
902
|
+
end
|
903
|
+
|
904
|
+
end
|
905
|
+
|
906
|
+
class RecordMicrophoneAction < Action
|
907
|
+
|
908
|
+
def initialize(h={})
|
909
|
+
super({}.merge h)
|
910
|
+
end
|
911
|
+
|
912
|
+
end
|
913
|
+
|
914
|
+
class PlaySoundAction < Action
|
915
|
+
|
916
|
+
def initialize(h={})
|
917
|
+
super({}.merge h)
|
918
|
+
end
|
919
|
+
|
920
|
+
end
|
921
|
+
|
922
|
+
class SendEmailAction < Action
|
923
|
+
|
924
|
+
def initialize(h={})
|
925
|
+
super({}.merge h)
|
926
|
+
end
|
927
|
+
|
928
|
+
end
|
929
|
+
|
930
|
+
class SendSMSAction < Action
|
931
|
+
|
932
|
+
def initialize(h={})
|
933
|
+
super({}.merge h)
|
934
|
+
end
|
935
|
+
|
936
|
+
end
|
937
|
+
|
938
|
+
class ClearNotificationsAction < Action
|
939
|
+
|
940
|
+
def initialize(h={})
|
941
|
+
super({}.merge h)
|
942
|
+
end
|
943
|
+
|
944
|
+
end
|
945
|
+
|
946
|
+
class MessageDialogAction < Action
|
947
|
+
|
948
|
+
def initialize(h={})
|
949
|
+
super({}.merge h)
|
950
|
+
end
|
951
|
+
|
952
|
+
end
|
953
|
+
|
954
|
+
class AllowLEDNotificationLightAction < Action
|
955
|
+
|
956
|
+
def initialize(h={})
|
957
|
+
super({}.merge h)
|
958
|
+
end
|
959
|
+
|
960
|
+
end
|
961
|
+
|
962
|
+
class SetNotificationSoundAction < Action
|
963
|
+
|
964
|
+
def initialize(h={})
|
965
|
+
super({}.merge h)
|
966
|
+
end
|
967
|
+
|
968
|
+
end
|
969
|
+
|
970
|
+
class NotificationAction < Action
|
971
|
+
|
972
|
+
def initialize(h={})
|
973
|
+
super({}.merge h)
|
974
|
+
end
|
975
|
+
|
976
|
+
end
|
977
|
+
|
978
|
+
class ToastAction < Action
|
979
|
+
|
980
|
+
def initialize(h={})
|
981
|
+
super({}.merge h)
|
982
|
+
end
|
983
|
+
|
984
|
+
end
|
985
|
+
|
986
|
+
class AnswerCallAction < Action
|
987
|
+
|
988
|
+
def initialize(h={})
|
989
|
+
super({}.merge h)
|
990
|
+
end
|
991
|
+
|
992
|
+
end
|
993
|
+
|
994
|
+
class ClearCallLogAction < Action
|
995
|
+
|
996
|
+
def initialize(h={})
|
997
|
+
super({}.merge h)
|
998
|
+
end
|
999
|
+
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
class OpenCallLogAction < Action
|
1003
|
+
|
1004
|
+
def initialize(h={})
|
1005
|
+
super({}.merge h)
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
end
|
1009
|
+
|
1010
|
+
class RejectCallAction < Action
|
1011
|
+
|
1012
|
+
def initialize(h={})
|
1013
|
+
super({}.merge h)
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
end
|
1017
|
+
|
1018
|
+
class MakeCallAction < Action
|
1019
|
+
|
1020
|
+
def initialize(h={})
|
1021
|
+
super({}.merge h)
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
end
|
1025
|
+
|
1026
|
+
class SetRingtoneAction < Action
|
1027
|
+
|
1028
|
+
def initialize(h={})
|
1029
|
+
super({}.merge h)
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
class SetBrightnessAction < Action
|
1035
|
+
|
1036
|
+
def initialize(h={})
|
1037
|
+
super({}.merge h)
|
1038
|
+
end
|
1039
|
+
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
class ForceScreenRotationAction < Action
|
1043
|
+
|
1044
|
+
def initialize(h={})
|
1045
|
+
super({}.merge h)
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
end
|
1049
|
+
|
1050
|
+
class ScreenOnAction < Action
|
1051
|
+
|
1052
|
+
def initialize(h={})
|
1053
|
+
super({}.merge h)
|
1054
|
+
end
|
1055
|
+
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
class DimScreenAction < Action
|
1059
|
+
|
1060
|
+
def initialize(h={})
|
1061
|
+
super({}.merge h)
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
class KeepAwakeAction < Action
|
1067
|
+
|
1068
|
+
def initialize(h={})
|
1069
|
+
super({}.merge h)
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
end
|
1073
|
+
|
1074
|
+
class SetScreenTimeoutAction < Action
|
1075
|
+
|
1076
|
+
def initialize(h={})
|
1077
|
+
super({}.merge h)
|
1078
|
+
end
|
1079
|
+
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
class SilentModeVibrateOffAction < Action
|
1083
|
+
|
1084
|
+
def initialize(h={})
|
1085
|
+
super({}.merge h)
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
end
|
1089
|
+
|
1090
|
+
class SetVibrateAction < Action
|
1091
|
+
|
1092
|
+
def initialize(h={})
|
1093
|
+
super({}.merge h)
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
class VolumeIncrementDecrementAction < Action
|
1099
|
+
|
1100
|
+
def initialize(h={})
|
1101
|
+
super({}.merge h)
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
end
|
1105
|
+
|
1106
|
+
class SpeakerPhoneAction < Action
|
1107
|
+
|
1108
|
+
def initialize(h={})
|
1109
|
+
super({}.merge h)
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
class SetVolumeAction < Action
|
1115
|
+
|
1116
|
+
def initialize(h={})
|
1117
|
+
super({}.merge h)
|
1118
|
+
end
|
1119
|
+
|
1120
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby-macrodroid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkxMDI3MjEyNDA0WhcN
|
15
|
+
MjAxMDI2MjEyNDA0WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDGFPay
|
17
|
+
XYuML5FESMa8WAbhZyaUhuUMxkOuMAQCEvZoB/aNyVE2Ho1yNLwzmJNO3t5ne7YO
|
18
|
+
Q4kRP6/9r76ghiR43XJGhrMicgxL8QC3GmQtJl9KOSiAibzMcya+4hNjF99nqTKf
|
19
|
+
0IbVLz8omiskIbgMMxnLxx8hr4t1cUBW/PXkjufqtzTob+KQEESQeXkQYAjbnnME
|
20
|
+
0+x0LL8Bi1OiLVAK3b2rMzt8onNmSwvYvfPAXrBcTJczsUrCSgiGHkQYGyK8StnE
|
21
|
+
5NaCGOxXObiiyJ/PVEh+kn7R1y9C3Ugprf81qEWg6fsazlFl+JpyCdWphmo/J2Hd
|
22
|
+
7oXa+MxCrZRCRo3Z2Avz54tyXukyq4W5CWuceuucBG/vnAKSoqm69pWGhjhVFDzF
|
23
|
+
BWxmV2iDrU06g+sWXVHWEGGQURyZBl/2ue0rzeaZYFEuLOTN9JRMMwqTNb9S6A0d
|
24
|
+
nLhZkSiHCe7levTBK9tN1zRdqYXb/hj3iZpkIejYMRQaqxdX1sJcvqzijDcCAwEA
|
25
|
+
AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUYKFwpZGg
|
26
|
+
MIpWf2U87TzYBDvorjMwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
|
+
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAiOFHbXd+U1P/j84TjNssAprjID/iexoPR482NaIg
|
29
|
+
WVC6VldVyC2tOXEniZvtpsECzR7oLicY2+D4p6ZtYkeI6T19moSN8SFK/lPjHhh5
|
30
|
+
ujRQBqFwiwInlkcZO6e36aNDhrEtocrZyE9KFkYb5ZUUOSJpPIm/+F+4u7R1o3TX
|
31
|
+
gMkrwlIwKylTjbvBjqwrQ65JVHkGrzxOoN4GFo2WEMGyVgMtvCFosWg91dJNpkww
|
32
|
+
RH5jzcCEVO3woUSruZQIk7WYAHiO/ucn4JcocSF/1yO5yDzuh6AODA5wr3kMywOY
|
33
|
+
5+DmfHEB/fXuwZtr6kjloq9MmQFSu+8rMSiVmrP9gzcl3zwXFVZjh4oy6QqQAITQ
|
34
|
+
FvR4UThQs3/4aYBWPAwXUKrth1dV39dGFTX4VXOMqp/yEmBCOme8YMNaAu3M3hHL
|
35
|
+
NZ2kdBIUDnAM24e0/wXdVxg4HnsZbdymxyzMQ4P5pKYcpI6oisBxI37p/Xy+wAg3
|
36
|
+
SBHno3GEuuD8ZWj24IMJpfbp
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: rxfhelper
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.9'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.9.4
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.9'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.9.4
|
60
|
+
description:
|
61
|
+
email: james@jamesrobertson.eu
|
62
|
+
executables: []
|
63
|
+
extensions: []
|
64
|
+
extra_rdoc_files: []
|
65
|
+
files:
|
66
|
+
- lib/ruby-macrodroid.rb
|
67
|
+
homepage: https://github.com/jrobertson/ruby-macrodroid
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubygems_version: 3.0.3
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: 'Reads the exported JSON file from MacroDroid. #unofficialgem #experimental'
|
90
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|